// JavaScript Document
<!--
//open pop up window for gallery

function openwindow(url,w,h)
{

  var winwidth = screen.availWidth;
  var winheight = screen.availHeight;
  var leftt=Math.floor((winwidth/2)-(w/2));
  var topt=Math.floor((winheight/2)-(h/2));
  window.open(url,'popup','left='+leftt+',top='+topt+',width='+w+', height='+h+', toolbar=0,  location=0, directories=0,status=0, titlebar=0, menubar=0, resizable=1, scrollbars=0')
};


var newwindow = ''
function popitup(url) {
if (newwindow.location && !newwindow.closed) {
    newwindow.location.href = url;
    newwindow.focus(); }
else {
    newwindow=window.open(url,'htmlname','width=404,height=316,resizable=1');}
}

function tidy() {
if (newwindow.location && !newwindow.closed) {
   newwindow.close(); }
}


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";
      }
    }
  } 
}
//source name, width , height, container div id, (for flv)stream_name,skin name
function show_video(source_name,my_width,my_height,container,stream_name,skinName)
{
	var my_video = document.createElement("embed");
	var my_parent=document.getElementById(container);
	while (my_parent.firstChild) {//clear all
	  my_parent.removeChild(my_parent.firstChild);
	}
	if (stream_name) stream_name="&streamName="+stream_name;
	if (skinName) skinName="&skinName="+skinName;
	my_video.setAttribute("type","application/x-shockwave-flash");
	my_video.setAttribute("FlashVars","&MM_ComponentVersion=1"+skinName+stream_name+"&autoPlay=true&autoRewind=false");
	my_video.setAttribute("scale","noscale");
	my_video.setAttribute("width",my_width);
	my_video.setAttribute("height",my_height);
	my_video.setAttribute("name","FLVPlayer");
	my_video.setAttribute("salign","LT");
	my_video.setAttribute("pluginspage","http://www.macromedia.com/go/getflashplayer");
	my_video.setAttribute("src",source_name);
	my_video.setAttribute("wmode",'transparent');
	my_parent.appendChild(my_video);
}
//-->