function getFullScreenWindowParams() {
		return 'menubar=no'
		+ ',toolbar=no'
		+ ',width=' + screen.availWidth
		+ ',height=' + screen.availHeight
		+ ',outerWidth=' + screen.availWidth
		+ ',outerHeight=' + screen.availHeight
		+ ',left=0'
		+ ',top=0'
		+ ',status=no,'
		+ ',resizable=yes'
		+ ',scrollbars=0';
}

function goFullscreen(videoPath, time, state) {
		var time = 0;
		var timeRegex = new RegExp('&begin=[0-9]+', 'i');
		var newVideoUrl = videoPath.replace(timeRegex, '&begin=' + Math.floor(time * 1000));
		var w = window.open(
				'http://video.google.com/videopopup?q='
				+ prepareSearchParams(newVideoUrl)
				+ '&windowtitle='
				+ prepareSearchParams(window.document.title + ' - Full Screen'),
				'GoogleVideo', getFullScreenWindowParams());
		w.focus();
}

function pp_openWindow(url){
	var w = window.open('','watchFullScreen', getFullScreenWindowParams());
	url = url.replace('&amp','&');
	w.document.write("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml10-strict.dtd'>\
	<html xmlns='http://www.w3.org/1999/xhtml'><head>\
	<title></title></head>\
	<body style='padding:0px;margin:0px;'>\
	<div style='text-align:center'>\
	<object width='"+ screen.availWidth*.98+"' height='"+screen.availHeight*.95+"' type='application/x-shockwave-flash' data='"+url+"&amp;playNow=1'>\
	<param name='movie' value='"+url+"&amp;playNow=1' />\
	<param name='wmode' value='window'/>\
	<param name='scale' value='noScale'/>\
	<param name='salign' value='TL' />\
	</object></div></body></html>")
		w.document.title = window.document.title +  ' - Full Screen Video';
		w.focus();
}

function wm_openWindow(url){
	var w = window.open('','watchFullScreen', getFullScreenWindowParams());
	url = url.replace('&amp','&');
	w.document.write("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml0-strict.dtd'>\
	<html xmlns='http://www.w3.org/1999/xhtml'><head>\
	<title></title>\
	</head><body style='padding:0px;margin:0px;'>\
	<div style='text-align:center'>\
		<embed src='"+url+"' width='"+ screen.availWidth*.98+"' height='"+screen.availHeight*.95+"' scale='tofit' autoplay='true' type='video/x-mplayer2' controller='true' />\
			</div></body></html>");
w.document.title = window.document.title +  ' - Full Screen Video';
w.focus();
}

function qt_openWindow(url){
	var w = window.open('','watchFullScreen', getFullScreenWindowParams());
	url = url.replace('&amp','&');
	w.document.write("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml0-strict.dtd'>\
	<html xmlns='http://www.w3.org/1999/xhtml'><head>\
	<title></title>\
	</head><body style='padding:0px;margin:0px;'>\
	<div style='text-align:center'>\
		<embed src='"+url+"' width='"+ screen.availWidth*.98+"' height='"+screen.availHeight*.95+"' scale='tofit' autoplay='true' type='video/quicktime' controller='true' />\
	</div></body></html>")
	w.document.title = window.document.title +  ' - Full Screen Video';
	w.focus();
}

function gv_switchOn(turnOn, turnOff){
	document.getElementById(turnOn).style.display = 'block';
	document.getElementById(turnOff).style.display = 'none';
}

function MM_CheckFlashVersion(reqVerStr,msg){
  with(navigator){
    var isIE  = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);
    var isWin = (appVersion.toLowerCase().indexOf("win") != -1);
    if (!isIE || !isWin){  
      var flashVer = -1;
      if (plugins && plugins.length > 0){
        var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";
        desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;
        if (desc == "") flashVer = -1;
        else{
          var descArr = desc.split(" ");
          var tempArrMajor = descArr[2].split(".");
          var verMajor = tempArrMajor[0];
          var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");
          var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;
          flashVer =  parseFloat(verMajor + "." + verMinor);
        }
      }
      // WebTV has Flash Player 4 or lower -- too low for video
      else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;

      var verArr = reqVerStr.split(",");
      var reqVer = parseFloat(verArr[0] + "." + verArr[2]);
  
      if (flashVer < reqVer){
        if (confirm(msg))
          window.location = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
      }
    }
  } 
}