/* Get Page dimensions */
function findLivePageWidth() {
	if (window.innerWidth)
		return window.innerWidth;
	if (document.body.clientWidth)
		return document.body.clientWidth;
	return (null);
}

/* initialize */

objectSlide=document.getElementById('slide');
objectCover=document.getElementById('cover');


/* Hides expanded window */
function hideLightbox() {
	objectSlide.style.display = 'none';	
	objectCover.style.display = 'none';
	document.getElementById('mediaContent').innerHTML = '';
}


/* Pop a new window */
function showLightbox(evt) {

// show the layer
	objectSlide.style.display = 'block';
	objectCover.style.display = 'block';

	document.getElementById('mediaPlayer').style.display = 'none';
	document.getElementById('mediaContent').style.display = '';

	var contenthtml = '';

	if (browser_supports_html5_h264())
		contenthtml += '<video controls src="http://mobile.twistage.com/videos/' + evt +'/formats/ipod-compatible-h264/file" poster="http://service.twistage.com/videos/'+ evt+ '/screenshots/417w.jpg" width="417px" height="251px"> Your browser does not support HTML5. </video>';
	else
		contenthtml += '<object data="http://service.twistage.com/plugins/player.swf?v=' + evt + '&p=production&a=810736" type="application/x-shockwave-flash" width="417" name="embedded_player" height="251" id="embedded_player"><param name="base" value="http://service.twistage.com"/><param name="allowscriptaccess" value="always"/><param name="movie" value="http://service.twistage.com/plugins/player.swf?v=' + evt + '&p=production&a=810736"/><param name="wmode" value="opaque"/><param name="allowfullscreen" value="true"/><param name="bgcolor" value="#000000"/><param name="flashvars" value="autoplay=true"/> </object>';

	document.getElementById('mediaContent').innerHTML = contenthtml;
	swfobject.removeSWF("mediaPlayerSWF");

	contenthtml = '<div class="expMediaPodWrapperOverlay"><p style="margin-left:30px;">View more testimonials from Eloqua customers <a href="/customers/explore_customers/" style="color:#555555">here</a>.</p></div>';
	document.getElementById('mediaExploreMoreBottom').innerHTML = contenthtml

	livePageWidth = findLivePageWidth();
	newLeft = (livePageWidth/2) - (202);
	objectSlide.style.left = newLeft + 'px';
}

