//  removes the border and flashing in Internet Explorer when flash swf files are used
function fixflash(containerID)
{
	var flashContainer = document.getElementById(containerID);
	var flashMovie = document.createElement("div");
	flashMovie.innerHTML = flashContainer.innerHTML.replace(/&lt;/g, "<").replace(/&gt;/g, ">");
	flashContainer.parentNode.insertBefore(flashMovie, flashContainer);
	flashContainer.parentNode.removeChild(flashContainer);
	flashMovie.setAttribute("id",containerID);
}

//  compensates for difference between firefox and ie with menu hiding the flash images
function fiximage(strImageID, blnRight)
{
	var strBrowser = navigator.userAgent.toLowerCase();
	if (strBrowser.indexOf("msie") != -1) 
	{
		if (blnRight == true)
		{
			document.getElementById(strImageID).style.marginRight = "13";	
		}
		else
		{
			document.getElementById(strImageID).style.marginLeft = "23";
		}
	}
}

//  opens the google video viewer
function OpenGoogleVideoViewer(strUrl)
{
	var objVideoViewer = window.open(strUrl, "video", "directories=no,channelmode=no,fullscreen=no,height=350,width=450,left=100,top=100,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=yes");
	if (objVideoViewer && objVideoViewer.focus)
	{
		objVideoViewer.focus();
	}
}

//  creates flash for google video viewer
function CreateGoogleVideoViewer()
{
	var intStartIndex = location.search.indexOf("docId=");
	var intEndIndex = location.search.indexOf("&", intStartIndex);
	var strDocId;
	if (intEndIndex > intStartIndex)
	{
		strDocId = location.search.substring(intStartIndex + 6, intEndIndex);
	}
	else
	{
		strDocId = location.search.substring(intStartIndex + 6);
	}
	document.getElementById("cellViewer").innerHTML = 
			'<embed style="width:400px; height:326px;" id="VideoPlayback" ' +
			'align="middle" type="application/x-shockwave-flash" ' + 
			'src="http://video.google.com/googleplayer.swf?docId=' + strDocId + '&hl=en" ' +			
			'quality="best" bgcolor="#ffffff" scale="noScale" salign="TL" ' + 
			'flashvars="playerMode=embedded"> </embed>';
}


//  opens the youtube video viewer
function OpenYouTubeVideoViewer(strUrl)
{
	var objVideoViewer = window.open(strUrl, "video", "directories=no,channelmode=no,fullscreen=no,height=335,width=520,left=100,top=100,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=yes");
	if (objVideoViewer && objVideoViewer.focus)
	{
		objVideoViewer.focus();
	}
}

//  creates flash for youtube video viewer
function CreateYouTubeVideoViewer()
{
	var intStartIndex = location.search.indexOf("docId=");
	var intEndIndex = location.search.indexOf("&", intStartIndex);
	var strDocId;
	if (intEndIndex > intStartIndex)
	{
		strDocId = location.search.substring(intStartIndex + 6, intEndIndex);
	}
	else
	{
		strDocId = location.search.substring(intStartIndex + 6);
	}
	document.getElementById("cellViewer").innerHTML = 
			'<object style="width:480px; height:295px;">' + 
			'<param name="movie" value="http://www.youtube.com/v/' + strDocId + '&hl=en_US&fs=1&rel=0"></param>' +
			'<param name="allowFullScreen" value="true"></param>' + 
			'<param name="allowscriptaccess" value="always"></param>' +
			'<embed src="http://www.youtube.com/v/' + strDocId + '&hl=en_US&fs=1&rel=0" type="application/x-shockwave-flash" ' + 
			'allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed></object>'
}