
<!--
//prevent no www in address!
if(location.href.indexOf("www") == -1)
{
	if(location.href.indexOf("localhost") == -1)
	{
		if(location.href.indexOf("dev") == -1)
		{
			if(location.href.indexOf("https") == -1)
			{
				top.location.href = "http://www." + location.href.substr(7);
			}else
			{
				top.location.href = "https://www." + location.href.substr(8);
			}
		}
	}
	
}
//prevent phishing!
if(top != self)
{
	//top.location.href = self; 
	window.top.location.href=location;
}
//-->
//need an indexOf function (not in javascript basic implementation
						
if (!Array.prototype.indexOf)
{
	Array.prototype.indexOf = function(elt /*, from*/)
	{
		var len = this.length;
	
		var from = Number(arguments[1]) || 0;
		from = (from < 0)
			 ? Math.ceil(from)
			 : Math.floor(from);
		if (from < 0)
		  from += len;
	
		for (; from < len; from++)
		{
		  if (from in this &&
			  this[from] === elt)
			return from;
		}
		return -1;
	  };
}

//MM Functions
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_popupMsg(msg) { //v1.0
  alert(msg);
}

function newVideo(divnum,vfilenum,video_title,vfilename,vfilesize,vwidth,vheight,vfiletype,vcaption,video_align,title_align,caption_align,video_description,autoplay,showlinks)
{
	//put the video file here with parameters
	var div_id = "videodiv" + divnum;
	var mmfn_id = "videoid" + vfilenum;
	//float:" + video_align + ";
	var txt = ""; 
	txt = txt + "<div id=\"videocntr\" style=\" margin:0.6em; z-index:4;\">";
	txt = txt + "<table width=\"200\" border=\"0\" align=\"" + video_align + "\">";
	txt = txt + "<caption class=\"tabletitle\" align=\"" + title_align + "\">" + video_title + "</caption>";
	txt = txt + "<tr><td width=\"100%\" align=\"center\" id=\"" + div_id + "\">";
	txt = txt + "&nbsp;</td></tr>";
	txt = txt + "<tr><td class=\"tablecaption\" align=\"" + caption_align + "\">" + vcaption + "</td></tr></table></div>";
	document.write(txt);
	updateVideo(div_id,mmfn_id,vfilename,vfilesize,vwidth,vheight,vfiletype,video_description,autoplay,showlinks)
}

function updateRating(UID,PID,Rating)
{
	url = "/phpajax/rate_page.php?UserID=" + UID + "&PageID=" + PID + "&Rating=" + Rating;
	var divID = "Rating";
	getXML(url,divID);
}


//Get cookie routine by Shelley Powers 
//set cookies by:  document.cookie="sitename=JavaScript Kit" 
//get cookie by:  var result=get_cookie("sitename") 
function get_cookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    // if cookie exists
    if (offset != -1) { 
      offset += search.length
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset);
      // set index of end of cookie value
      if (end == -1) end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end))
      }
   }
  return returnvalue;
}
function activateCMESession()
{
	var loc = "/phpajax/cme_session.php";
	getXML(loc,"CMESession");
	var loc2 = "/cme/cme_disclaimer.php";
	window.location.href = loc2;
}
//need a routine to add cookie/set cookie
function txtSize(size)
{
	//alert(size);
	//set the new base text size and refresh the page
	var loc = "/phpajax/sessions.php?NewTextSize=" + size;
	getXML(loc,"textsize");
	var fsize = parseInt(document.body.style.fontSize.substr(0,2));

	if(size == "Increase" && fsize < 24)
	{
		fsize = fsize + 1;
		document.body.style.fontSize = fsize + "px";
	}
	if(size == "Decrease" && fsize > 6)
	{
		fsize = fsize - 1;
		document.body.style.fontSize = fsize + "px";
	}
	
	//var id = document.getElementById("FontLabel");
	//if(id) //must test for the element b/c not on all pages
	//{
	//	id.innerHTML = "Font(" + document.body.style.fontSize + "):";
	//}
	//need to resize the window to change the justified text
	window.resizeBy(1,0);
	//document.body.style.fontSize = pixelsize + "px";
}
function useOriginalVideoSize(val)
{
	var loc = "/phpajax/sessions.php?UseOriginalVideoSize=" + val;
	getXML(loc,"videotype");
	alert("All of the videos sizes have been reset to their original value. ");
	//refresh until code worked out
	document.location.reload();
}

function videoFormat(type)
{
	//alert(type);
	var loc = "/phpajax/sessions.php?NewVideoFormat=" + type;
	getXML(loc,"videosize");
	var format;
	if(type == "swf"){format = "Flash.";}
	if(type == "mov"){format = "Quicktime.";}
	if(type == "wmv"){format = "Windows Video.";}
	if(type == "avi"){format = "Windows Video(old format).";}
	alert("All of the videos formats have been set to " + format);
	//refresh until code worked out
	document.location.reload();
	//alert(document.getElementById("CurrentDefaults").innerHTML);
	//window.location.reload(false);  //false = reloads from the cache, true reloads from the server
	//set the new default video format,find all of the videos, replace them!
	//all videos have the format MMF_Loop#	
	//for each ID that matches then update the video
	//alert(document.getElementById("Layer1"));
	//[object HTMLDivElement]
	//[object HTMLTableCellElement]
	//$i=1;
	//$idpre = "MMF_Loop";
	//$id = $idpre + $i;
	//while(document.getElementById($id) == "[object HTMLTableCellElement]")
	//{
		//updateVideo(mmo,fn,size,format);
		//update($id, , ,type);
		//$i++;
	//}
	//** In order to get this to work without refreshing each page, need to get each innerHTML
	//   from each Element, find the file name and the size and return it to the updateVideo function
	//   Do this code later when have time 
}
function videoSize(size)
{
	//alert(size);
	//set the new video size and refresh the page
	//passing increase or decrease to the sessions page so do the video size change from there
	var loc = "/phpajax/sessions.php?NewVideoSize=" + size;
	
	getXML(loc,"CurrentDefaults");
	//the defaults table is updated, now refresh the page or walk the DOM
	alert("All of the video size has been alter to " + size);
	document.location.reload();
	
	/*
	//the page has a hidden MMFid of the number of videos on this page so reiterate thru each video and change the size.
	
	var NumMMF = parseInt(document.getElementById("MMFid").value);
	
	for(i=0;i<NumMMF;i++)
	{
		//the file name is
		var mmo = "mmovideo" + i;
		var vid = "video" + i;
		//a real problem getting file name from the object
		//IE will deliver movie name with the document.getelementById[obj].movie
		//but others will not becuase they do not use objects, they use embeds
		//opera will display itself as IE but it uses embed also
		//also some vids use src other vids use movie others use filename in the object!!!
		//to get around this, get the file name from the HTML of the video file by looking up the src value from the embeds.

		var html = window.document.video0.innerHTML;
		var embedstart =  html.indexOf("embed",0)
		var moviestart = html.indexOf("src",embedstart) + 5;
		var movieend = html.indexOf("X.",moviestart) + 5;
		var numchars = movieend - moviestart;
		var fn = html.substr(moviestart,numchars);
		alert(fn);
		//filename is in the format loops/####/####_?X.typ
		var start = fn.indexOf("_",0) + 1; 
		var start2 = start + 3;
		var basefn = fn.substr(0,start -1);
		var vidsize = fn.substr(start,2);
		var vidformat = fn.substr(start2,3);
		var newSize;
		alert(vidsize);
		switch(vidsize)
		{
			case "1X":
				if(size == "Increase"){newSize = "2X";}
				if(size == "Decrease"){newSize = "1X";}
				break;
			case "2X":
				if(size == "Increase"){newSize = "3X";}
				if(size == "Decrease"){newSize = "1X";}
				break;
			case "3X":
				if(size == "Increase"){newSize = "4X";}
				if(size == "Decrease"){newSize = "2X";}
				break;
			case "4X":
				if(size == "Increase"){newSize = "4X";}
				if(size == "Decrease"){newSize = "3X";}
				break;
		}
		//got the new size, now update the fn and update the video
		//var newfn = basefn + newSize + "." + vidformat;
		//alert(mmo + ":" + vid + ":" + basefn + ":" + newSize + ":" + vidformat);
		updateVideo(mmo,vid,basefn,newSize,vidformat)
	}*/
	//lost all of my poll questions and eotd stuff so will refresh the page after changing the session vars
}

function bookMark(fn,puid)
{
	//add the bookmark to the users bookmark table,
	//send a popup msg that the bookmark has been added
	var url = "/phpajax/bookmarkpage.php?Page=" + fn + "&&UID=" + puid;
	getXML(url,"bookmarkid");
}
function setOpeningPage(fn,puid)
{
	//add the bookmark to the users bookmark table,
	//send a popup msg that the bookmark has been added
	var url = "/phpajax/setopeningpage.php?Page=" + fn + "&&UID=" + puid;
	getXML(url,"bookmarkid");
}
function getPage(pageid)
{
	document.location = "/page/page.php?UID=" + pageid;
}
function findAnchors()
{
	if(showanchormenu == "Yes")
	{
		if(document.getElementById("AnchorMenu"))
		{
			var AnchorMenu = document.getElementById("AnchorMenu");
			
			//alert(AnchorMenu.length);
			AnchorMenu.options.length = 1;
			//alert(document.anchors.length);
			//alert(document.anchors[0].name);
			var txt = document.URL;
			
			for(i=0;i<document.anchors.length;i++)
			{
				//need to take out the extra anchors if refreshing  the page
				//only works on one so this is a possible bug.
				//if(txt.indexOf("#") != -1)
				//{
				//	txt = txt.substr(0,txt.indexOf("#")
				//}
				var address = txt + "#" + document.anchors[i].name; //can use id it is the same
				var menu0 = "";
				var menu = document.anchors[i].title;
				
				//if the name has a "_" in it then use it instead of the title!! for the text of the link
				if(document.anchors[i].name.indexOf("_") != -1)
				{
					menu0 = document.anchors[i].name.replace(/[_]/g," ")	
				}
				if(menu0 == "")
				{
					if(menu == "")
					{
						var menu0 = document.anchors[i].name;
					}else
					{
						menu0 = menu;	
					}
				}
				
				var j = i + 1;
				AnchorMenu.options[j] = new Option(menu0,address);
			}
			//disable if no anchors available
			
			if(AnchorMenu.options.length == 1)
			{
				//need to hide the anchor menu
				AnchorMenu.options.length = 0;
				AnchorMenu.options.disabled = true;
			}
		}
	}
}

function showBrowsergif()
{
	if(navigator.appName == "Microsoft Internet Explorer") 
	{
		document.write("<img src='/multimedia/gif/browsers/ie.gif' class='os' alt='Your current Browser is Internet Explorer' title='Your current Browser is Internet Explorer' />");
	}
	if(navigator.appName == "Opera") 
	{
		document.write("<img src='/multimedia/gif/browsers/opera.gif' class='os' alt='Your current Browser is Opera' title='Your current Browser is Opera' />");
	}
	if(navigator.appName == "Netscape")
	{
		var str = navigator.userAgent;
		if(str.indexOf("Firefox") != -1)
		{
			document.write("<img src='/multimedia/gif/browsers/firefox.gif' class='os' alt='Your current browswer is Firefox' title='Your current browswer is Firefox' />");
		}
		if(str.indexOf("Chrome") != -1)
		{
			document.write("<img src='/multimedia/gif/browsers/chrome.gif' class='os' alt='Your current browswer is Chrome' title='Your current browswer is Chrome' />");
		}
		//Safari must follow chrome or it will trigger chrome icon
		if(str.indexOf("Safari") != -1)
		{
			document.write("<img src='/multimedia/gif/browsers/safari.gif' class='os' alt='Your current browswer is Safari' title='Your current browswer is Safari' />");
		}
	}
}

function showOSgif()
{
//document.write(navigator.userAgent);
	var str = navigator.userAgent;
	if(str.indexOf("Windows NT 6.1") != -1)
	{
		document.write("<img src='/multimedia/gif/os/windows7.gif'  class='os' alt='Your current OS is Windows Vista' title='Your current OS is Windows 7.0' />");	
	}
	if(str.indexOf("Windows NT 6.0") != -1)
	{
		document.write("<img src='/multimedia/gif/os/win_vista.gif'  class='os' alt='Your current OS is Windows Vista' title='Your current OS is Windows Vista' />");	
	}
	if(str.indexOf("Windows NT 5.2") != -1)
	{
		document.write("<img src='/multimedia/gif/os/winxp.gif' class='os' alt='Your current OS is Windows Server or 64x XP' title='Your current OS is Windows Server or 64x XP' />");	
	}
	if(str.indexOf("Windows NT 5.1") != -1)
	{
		document.write("<img src='/multimedia/gif/os/winxp.gif' class='os' alt='Your current OS is Windows XP' title='Your current OS is Windows XP' />");	
	}
	if(str.indexOf("Windows NT 5.0") != -1)
	{
		document.write("<img src='/multimedia/gif/os/windowsnt.gif' class='os' alt='Your current OS is Windows 2000' title='Your current OS is Windows 2000' />");	
	}
	if(str.indexOf("Windows NT 4.0") != -1)
	{
		document.write("<img src='/multimedia/gif/os/win2k.gif' class='os' alt='Your current OS is Windows NT' title='Your current OS is Windows NT' />");	
	}
	if(str.indexOf("Windows 9X") != -1)
	{
		document.write("<img src='/multimedia/gif/os/windowsme.gif' class='os' alt='Your current OS is Windows ME' title='Your current OS is Windows ME' />");	
	}
	if(str.indexOf("Windows 98") != -1)
	{
		document.write("<img src='/multimedia/gif/os/windows98.gif' class='os' alt='Your current OS is Windows 98' title='Your current OS is Windows 98' />");	
	}
	if(str.indexOf("Windows CE") != -1)
	{
		document.write("<img src='/multimedia/gif/os/windowsce.gif' class='os' alt='Your current OS is Windows CE' title='Your current OS is Windows CE' />");	
	}
	if(str.indexOf("OS X") != -1 || str.indexOf("Mac") != -1)
	{
		document.write("<img src='/multimedia/gif/os/apple.gif' class='os' alt='Your current OS is Apple' title='Your current OS is Apple' />");	
	}
	if(str.indexOf("Linux") != -1)
	{
		document.write("<img src='/multimedia/gif/os/linux.gif' class='os' alt='Your current OS is Linux' title='Your current OS is Linux' />");	
	}
	if(str.indexOf("X11") != -1)
	{
		document.write("<img src='/multimedia/gif/os/linux.gif' class='os' alt='Your current OS is Unix' title='Your current OS is Unix' />");	
	}

}

function setStatusBar(txt)
{
	self.status = txt;
}

function updateHTML(page, args)
{
	var loc = page + args;
	//alert(loc);
	getXML(loc,"HTML");
}

function updateRecord(sqlidx,col,val,refcol,refval)
{
	var url = "/secure/sql_page.php?sqlidx=" + sqlidx + "&col=" + col + "&val=" + val  + "&refcol=" + refcol + "&refval=" + refval;
	getXMLtxt(url);
}

function updateVideo(mmo,vidobj,fn,size,vwidth,vheight,format,video_description,autoplay,showlinks)
{
	//mmo is the multimedia object
	//fn is the base filename (without the prefix or postfix so can build the filename
	//size is the requested object new size
	//format is the format requested
	
	//send a message that loading the new video player,file
	//get the div, set the object to blank, generate the obj txt based upon the format, send the obj text
	var div_mmf = document.getElementById(mmo);
	//alert (div_mmf.innerHTML);
	div_mmf.innerHTML = "Loading video...";
	var obj = "";
	//build the filename requested
	var filename = fn + "_" + size + "." + format;
	//var filename = "http://www.e-echocardiography.com" + fn + "_" + size + "." + format;
	//alert(filename);
	//set the controller height to the video/image
	var cntlr = 0;
	switch(format)
	{
	case "swf":
	  cntlr = 0;
	  break;    
	case "avi":
	  cntlr = 46;
	  break;    
	case "wmv":
	  cntlr = 46;
	  break;    
	case "mov":
	  cntlr = 16;
	  break;    
	default: //if jpg or gif, no controller
	  cntlr = 0;
	}	


	//set the new size parameters
	var width;
	var height;
	switch(size)
	{
	case "1X":
	  width = 180;
	  height = 120 + cntlr;
	  break;    
	case "2X":
	  width = 360;
	  height = 240 + cntlr;
	  break;    
	case "3X":
	  width = 540;
	  height = 360 + cntlr;
	  break;    
	case "4X":
	  width = 720;
	  height = 480 + cntlr;
	  break;    
	default:
	  width = 360;
	  height = 240 + cntlr;
	}	
	
	if(vwidth != "")
	{
		width = parseInt(vwidth) + cntlr;
	}
	if(vheight != "")
	{
		height = parseInt(vheight) + cntlr;
	}
	switch(format)
	{
	case "flv":
		//register the object first
		swfobject.registerObject(vidobj);
		
		obj = obj + "<object id='" + vidobj + "' name='" + vidobj + "' style=\"background-color:#FFFFFF;\" ";
		obj = obj + "classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" title=\"" + video_description + "\" ";
		obj = obj + "codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" ";
		obj = obj + "width=\"" + width + "\" ";
		obj = obj + "height=\"" + height + "\"> ";
		obj = obj + "<param name='movie' value='/loops/FLVPlayer_Progressive.swf' /> ";
		obj = obj + "<param name='quality' value='high' /> ";
		obj = obj + "<param name='wmode' value='transparent' /> ";
		obj = obj + "<param name='scale' value='noscale' /> ";
		obj = obj + "<param name='salign' value='lt' /> ";
		obj = obj + "<param name='FlashVars' value='&MM_ComponentVersion=1&skinName=/loopsClear_Skin_2&streamName=" + filename + "&autoPlay=true&autoRewind=true' /> ";
		obj = obj + "<param name='swfversion' value='8,0,0,0' /> ";
		obj = obj + "<!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->";
		obj = obj + "<param name='expressinstall' value='/loops/expressInstall.swf' /> ";
		obj = obj + "<!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->";
        obj = obj + "<!--[if !IE]>-->";
		obj = obj + "<object type='application/x-shockwave-flash' data='FLVPlayer_Progressive.swf' width='" + width + "' height='" + height + "'>";
		obj = obj + "<!--<![endif]-->";
		obj = obj + "<param name='quality' value='high' /> ";
		obj = obj + "<param name='wmode' value='transparent' /> ";
		obj = obj + "<param name='scale' value='nltoscale' /> ";
		obj = obj + "<param name='salign' value='' /> ";
		obj = obj + "<param name='FlashVars' value='&MM_ComponentVersion=1&skinName=Clear_Skin_2&streamName=" + filename + "&autoPlay=true&autoRewind=true' /> ";
		obj = obj + "<param name='swfversion' value='8,0,0,0' /> ";
		obj = obj + "<param name='expressinstall' value='/loops/expressInstall.swf' /> ";
		obj = obj + "<!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->";
		obj = obj + "<div>";
		obj = obj + "<h4>Page content requires a newer version of Adobe Flash Player.</h4>";
		obj = obj + "<p><a href='http://www.adobe.com/go/getflashplayer'><img src='http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a></p>";
		obj = obj + "</div>";
		obj = obj + " <!--[if !IE]>-->";
		obj = obj + " </object>";
		obj = obj + " <!--<![endif]-->";
		obj = obj + "</object>";
		obj = obj + "<br><br>";
		if(showlinks == "Yes" || showlinks == "Only")
		{
			if(showlinks == "Only") {obj = "";}
			obj = obj + "<a href=\"javascript:void(0)\" onclick=\"void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','1X','','','flv','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 180x120 px Video\">1X</a>&nbsp;";
			obj = obj + "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','2X','','','flv','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 360x240 px Video\">2X</a>&nbsp;";
			obj = obj + "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','3X','','','flv','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 540x360 px Video\">3X</a>&nbsp;";
			obj = obj + "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','4X','','','flv','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 720x480 px Video\">4X</a>&nbsp;";
			obj = obj + "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','" + size + "','" + vwidth + "','" + vheight + "','flv','" + video_description + "','" + autoplay + "','" + showlinks + "')\"><img src=\"/multimedia/gif/icons/swf/icon_flash32.gif\" width=\"18\" height=\"16\" border=\"0\" align=\"absmiddle\" alt=\"View FLV Flash File\" title=\"View FLV Flash File\"></a>";
			obj = obj + "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','" + size + "','" + vwidth + "','" + vheight + "','swf','" + video_description + "','" + autoplay + "','" + showlinks + "')\"><img src=\"/multimedia/gif/icons/swf/icon_swf.gif\" width=\"18\" height=\"16\" border=\"0\" align=\"absmiddle\" alt=\"View Flash File\" title=\"View Flash File\"></a>";
			obj = obj + "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','" + size + "','" + vwidth + "','" + vheight + "','mov','" + video_description + "','" + autoplay + "','" + showlinks + "')\"><img src=\"/multimedia/gif/icons/mov/icon_mov.gif\" width=\"18\" height=\"16\" border=\"0\" align=\"absmiddle\" alt=\"View Quicktime File\" title=\"View Quicktime File\"></a> ";
			if(navigator.appName == "Microsoft Internet Explorer") 
			{
			obj = obj + "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','" + size + "','" + vwidth + "','" + vheight + "','wmv','" + video_description + "','" + autoplay + "','" + showlinks + "')\"><img src=\"/multimedia/gif/icons/wmv/icon_wmv.gif\" width=\"16\" height=\"16\" border=\"0\" align=\"absmiddle\" alt=\"View Windows Media Video File\" title=\"View Windows Media Video File\"></a> "; 
			obj = obj + "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','" + size + "','" + vwidth + "','" + vheight + "','avi','" + video_description + "','" + autoplay + "','" + showlinks + "')\"><img src=\"/multimedia/gif/icons/avi/icon_avi.gif\" width=\"18\" height=\"16\" border=\"0\" align=\"absmiddle\" alt=\"View Windows AVI File (Old PCs Only)\" title=\"View Windows AVI Video File (Old PCs Only(Ligos Pluging Required))\"></a>";
			}
		}else
		{
			obj = obj + "<br>";	
		}
	  break;    
	case "swf":
		obj = obj + "<object id='" + vidobj + "' name='" + vidobj + "' style=\"background-color:#FFFFFF;\" ";
		obj = obj + "classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" title=\"" + video_description + "\" ";
		obj = obj + "codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" ";
		obj = obj + "width=\"" + width + "\" ";
		obj = obj + "height=\"" + height + "\"> ";
		obj = obj + "<param name=\"allowScriptAccess\" value=\"always\"> ";
		obj = obj + "<param name=\"movie\" value=\"" + filename + "\" /> ";
		obj = obj + "<param name=\"quality\" value=\"best\" /> ";
		obj = obj + "<param name='bgcolor' value='#FFFFFF' /> ";
		obj = obj + "<param name=\"wmode\" value=\"transparent\">";
		obj = obj + "<embed src=\"" + filename + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"" + width + "\" height=\"" + height + "\" wmode=\"transparent\"></embed> ";
		obj = obj + "</object>";
		obj = obj + "<br><br>";
		if(showlinks == "Yes" || showlinks == "Only")
		{
			if(showlinks == "Only") {obj = "";}
			//obj = obj + "<a href=\"javascript:updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','1X','','','swf','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 180x120 px Video\">1X</a>&nbsp;";
			obj = obj + "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','1X','','','swf','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 180x120 px Video\">1X</a>&nbsp;";
			obj = obj + "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','2X','','','swf','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 360x240 px Video\">2X</a>&nbsp;";
			obj = obj + "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','3X','','','swf','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 540x360 px Video\">3X</a>&nbsp;";
			obj = obj + "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','4X','','','swf','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 720x480 px Video\">4X</a>&nbsp;";
			obj = obj + "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','" + size + "','" + vwidth + "','" + vheight + "','swf','" + video_description + "','" + autoplay + "','" + showlinks + "')\"><img src=\"/multimedia/gif/icons/swf/icon_swf.gif\" width=\"18\" height=\"16\" border=\"0\" align=\"absmiddle\" alt=\"View Flash File\" title=\"View Flash File\"></a>";
			obj = obj + "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','" + size + "','" + vwidth + "','" + vheight + "','mov','" + video_description + "','" + autoplay + "','" + showlinks + "')\"><img src=\"/multimedia/gif/icons/mov/icon_mov.gif\" width=\"18\" height=\"16\" border=\"0\" align=\"absmiddle\" alt=\"View Quicktime File\" title=\"View Quicktime File\"></a> ";
			if(navigator.appName == "Microsoft Internet Explorer") 
			{
			obj = obj + "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','" + size + "','" + vwidth + "','" + vheight + "','wmv','" + video_description + "','" + autoplay + "','" + showlinks + "')\"><img src=\"/multimedia/gif/icons/wmv/icon_wmv.gif\" width=\"16\" height=\"16\" border=\"0\" align=\"absmiddle\" alt=\"View Windows Media Video File\" title=\"View Windows Media Video File\"></a> "; 
			obj = obj + "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','" + size + "','" + vwidth + "','" + vheight + "','avi','" + video_description + "','" + autoplay + "','" + showlinks + "')\"><img src=\"/multimedia/gif/icons/avi/icon_avi.gif\" width=\"18\" height=\"16\" border=\"0\" align=\"absmiddle\" alt=\"View Windows AVI File (Old PCs Only)\" title=\"View Windows AVI Video File (Old PCs Only(Ligos Pluging Required))\"></a>";
			}
		}else
		{
			obj = obj + "<br>";	
		}
	  break;    
	case "avi":
		obj += "<object id='" + vidobj + "' name='" + vidobj + "' classid='clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95' title=\"" + video_description + "\" ";
		//obj += "<object id='video' classid='clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6'" ;
		obj += " width='" + width + "'"; 
		obj += " height='" + height + "'";   
		obj += " type='application/x-oleobject'";   
		//obj += " standby='Loading Windows Media Player components...'"; 
		//obj += " codebase='http://www.microsoft.com/windows/windowsmedia/mp10/default.aspx'";
		obj += " boarder='0'>";   
		obj += "<param name='ShowDisplay' value='0'>";
		obj += "<param name='ShowControls' value='true'>";
		obj += "<param name='AutoStart' value='" + autoplay + "'>";
		obj += "<param name='AutoRewind' value='true'>";
		//obj += "<param name='PlayCount' value='0'>";
		obj += "<param name='Loop' value='true'>";
		//obj += "<param name='Appearance' value='0'>";
		//obj += "<param name='BorderStyle' value='0'>";
		obj += "<param name='MovieWindowHeight' value='" + height + "'>";
		obj += "<param name='MovieWindowWidth' value='" + width + "'>";
		obj += "<param name='FileName' value='" + filename + "'>";
		obj += "<embed src='" + filename + "'";
		obj += " type='video/x-msvideo'";
		obj += " width='" + width  + "'";
		obj += " height='" + height + "'";                
		obj += " loop ='true'";               
		obj += " autostart='" + autoplay + "'";          
		obj += " controls='true'";
		obj += " bgcolor='#FFFFFF'>";
		obj += "</embed>"; 	      
		obj += "</object><br><br>";		   
		if(showlinks == "Yes" || showlinks == "Only")
		{
			if(showlinks == "Only") {obj = "";}
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','1X','','','avi','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 180x120 px Video\">1X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','2X','','','avi','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 360x240 px Video\">2X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','3X','','','avi','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 540x360 px Video\">3X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','4X','','','avi','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 720x480 px Video\">4X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','" + size + "','" + vwidth + "','" + vheight + "','swf','" + video_description + "','" + autoplay + "','" + showlinks + "')\"><img src=\"/multimedia/gif/icons/swf/icon_swf.gif\" width=\"18\" height=\"16\" border=\"0\" align=\"absmiddle\" alt=\"View Flash File\" title=\"View Flash File\"></a>";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','" + size + "','" + vwidth + "','" + vheight + "','mov','" + video_description + "','" + autoplay + "','" + showlinks + "')\"><img src=\"/multimedia/gif/icons/mov/icon_mov.gif\" width=\"18\" height=\"16\" border=\"0\" align=\"absmiddle\" alt=\"View Quicktime File\" title=\"View Quicktime File\"></a> ";
			if(navigator.appName == "Microsoft Internet Explorer") 
			{
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','" + size + "','" + vwidth + "','" + vheight + "','wmv','" + video_description + "','" + autoplay + "','" + showlinks + "')\"><img src=\"/multimedia/gif/icons/wmv/icon_wmv.gif\" width=\"16\" height=\"16\" border=\"0\" align=\"absmiddle\" alt=\"View Windows Media Video File\" title=\"View Windows Media Video File\"></a> "; 
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','" + size + "','" + vwidth + "','" + vheight + "','avi','" + video_description + "','" + autoplay + "','" + showlinks + "')\"><img src=\"/multimedia/gif/icons/avi/icon_avi.gif\" width=\"18\" height=\"16\" border=\"0\" align=\"absmiddle\" alt=\"View Windows AVI File (Old PCs Only)\" title=\"View Windows AVI File (Old PCs Only(Ligos Pulgin Required))\"></a>";
			}
		}else
		{
			obj = obj + "<br>";	
		}
	  break;    
	case "wmv":
		obj += "<object id='" + vidobj + "' name='" + vidobj + "' classid='6BF52A52-394A-11d3-B153-00C04F79FAA6'  title=\"" + video_description + "\"";
		obj += " width='" + width + "'"; 
		obj += " height='" + height + "'";   
		obj += " type='application/x-oleobject'";   
		//text += " standby='Loading Windows Media Player components...'";   
		//text += " codebase='http://www.microsoft.com/windows/windowsmedia/mp10/default.aspx'";
		obj += " border='0'>";   
		obj += "<PARAM NAME='ShowDisplay' value='True'>";
		obj += "<PARAM NAME='uiMode' value='full'>";
		//obj += "<PARAM NAME='ShowStatusbar' value='True'>";
		//choices for uimode are invisible,none,mini,full,custom
		obj += "<PARAM NAME='ShowControls' value='True'>";
		obj += "<PARAM NAME='AutoStart' value='" + autoplay + "'>";
		obj += "<PARAM NAME='AutoRewind' value='True'>";
		//obj += "<PARAM NAME='PlayCount' value='100'>";
		obj += "<PARAM NAME='Loop' value='True'>";
		//text += "<param name='Appearance' value='0'>";
		//text += "<param name='BorderStyle' value='0'>";
		obj += "<PARAM NAME='MovieWindowHeight' value='" + height + "'>";
		obj += "<PARAM NAME='MovieWindowWidth' value='" + width + "'>";
		obj += "<PARAM NAME='FileName' value='" + filename + "'>";
		obj += "<embed src='" + filename + "'";
		obj += " type='video/x-msvideo'";
		obj += " width='" + width  + "'";
		obj += " height='" + height + "'";                
		obj += " loop ='true'";               
		obj += " autostart='" + autoplay + "'";          
		obj += " autorewind='true'";          
		obj += " controls='true'";
		obj += " bgcolor='#FFFFFF'>";
		obj += "</embed>"; 	      
		obj += "</object>";		   
		obj += "<br><br>";
		if(showlinks == "Yes" || showlinks == "Only")
		{
			if(showlinks == "Only") {obj = "";}
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','1X','','','wmv','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 180x120 px Video\">1X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','2X','','','wmv','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 360x240 px Video\">2X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','3X','','','wmv','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 540x360 px Video\">3X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','4X','','','wmv','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 720x480 px Video\">4X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','" + size + "','" + vwidth + "','" + vheight + "','swf','" + video_description + "','" + autoplay + "','" + showlinks + "')\"><img src=\"/multimedia/gif/icons/swf/icon_swf.gif\" width=\"18\" height=\"16\" border=\"0\" align=\"absmiddle\" alt=\"View Flash File\" title=\"View Flash File\"></a>";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','" + size + "','" + vwidth + "','" + vheight + "','mov','" + video_description + "','" + autoplay + "','" + showlinks + "')\"><img src=\"/multimedia/gif/icons/mov/icon_mov.gif\" width=\"18\" height=\"16\" border=\"0\" align=\"absmiddle\" alt=\"View Quicktime File\" title=\"View Quicktime File\"></a> ";
			if(navigator.appName == "Microsoft Internet Explorer") 
			{
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','" + size + "','" + vwidth + "','" + vheight + "','wmv','" + video_description + "','" + autoplay + "','" + showlinks + "')\"><img src=\"/multimedia/gif/icons/wmv/icon_wmv.gif\" width=\"16\" height=\"16\" border=\"0\" align=\"absmiddle\" alt=\"View Windows Media Video File\" title=\"View Windows Media Video File\"></a> "; 
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','" + size + "','" + vwidth + "','" + vheight + "','avi','" + video_description + "','" + autoplay + "','" + showlinks + "')\"><img src=\"/multimedia/gif/icons/avi/icon_avi.gif\" width=\"18\" height=\"16\" border=\"0\" align=\"absmiddle\" alt=\"View Windows AVI File (Old PCs Only)\" title=\"View Windows AVI File (Old PCs Only(Ligos Plugin Required))\"></a>";
			}
		}else
		{
			obj = obj + "<br>";	
		}
	  break;    
	case "mov":
		obj += "<OBJECT id='" + vidobj + "' name='" + vidobj + "' CLASSID='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' NOEXTERNALDATA='TRUE' title=\"" + video_description + "\" \n" ;
		obj += "WIDTH='" + width  + "'\n";
		obj += "HEIGHT='" + height + "'\n";   
		obj += "CODEBASE='http://www.apple.com/qtactivex/qtplugin.cab'>\n";
		obj += "<PARAM NAME='controller' VALUE='TRUE'>\n";
		obj += "<PARAM NAME='type' VALUE='video/quicktime'>\n";
		obj += "<PARAM NAME='autoplay' VALUE='" + autoplay + "'>\n";
		obj += "<PARAM NAME='target' VALUE='myself'>\n";
		obj += "<PARAM NAME='SRC' VALUE='" + filename + "'>\n";
		obj += "<PARAM NAME='LOOP' VALUE='TRUE'>\n";
		obj += "<PARAM NAME='pluginspage' VALUE='http://www.apple.com/quicktime/download/indext.html'>\n";
		obj += "<EMBED WIDTH='" + width  + "' ";
		obj += "HEIGHT='" + height + "' ";                
		obj += "CONTROLLER='TRUE' ";
		obj += "TYPE='" + 'video/quicktime' + "' ";
		obj += "SRC='" + filename + "' ";
		obj += "TYPE='video/quicktime' ";
		obj += "AUTOPLAY='" + autoplay + "' ";          
		obj += "LOOP ='TRUE' ";               
		obj += "BGCOLOR='#FFFFFF' ";
		obj += "SCALE='TOFIT' ";
		obj += "CACHE='true' ";
		obj += "KIOSKMODE='true' ";
		obj += "PLAYEVERYFRAME='true' ";                       
		obj += "PLUGINSPAGE='http://www.apple.com/quicktime/download/' >";                        
		obj += "</EMBED>"; 	      
		obj += "</OBJECT>\n";		   
		obj += "<br><br>";
		if(showlinks == "Yes" || showlinks == "Only")
		{
			if(showlinks == "Only") {obj = "";}
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','1X','','','mov','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 180x120 px Video\">1X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','2X','','','mov','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 360x240 px Video\">2X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','3X','','','mov','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 540x360 px Video\">3X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','4X','','','mov','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 720x480 px Video\">4X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','" + size + "','" + vwidth + "','" + vheight + "','swf','" + video_description + "','" + autoplay + "','" + showlinks + "')\"><img src=\"/multimedia/gif/icons/swf/icon_swf.gif\" width=\"18\" height=\"16\" border=\"0\" align=\"absmiddle\" alt=\"View Flash File\" title=\"View Flash File\"></a>";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','" + size + "','" + vwidth + "','" + vheight + "','mov','" + video_description + "','" + autoplay + "','" + showlinks + "')\"><img src=\"/multimedia/gif/icons/mov/icon_mov.gif\" width=\"18\" height=\"16\" border=\"0\" align=\"absmiddle\" alt=\"View Quicktime File\" title=\"View Quicktime File\"></a> ";
			if(navigator.appName == "Microsoft Internet Explorer") 
			{
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','" + size + "','" + vwidth + "','" + vheight + "','wmv','" + video_description + "','" + autoplay + "','" + showlinks + "')\"><img src=\"/multimedia/gif/icons/wmv/icon_wmv.gif\" width=\"16\" height=\"16\" border=\"0\" align=\"absmiddle\" alt=\"View Windows Media Video File\" title=\"View Windows Media Video File\"></a> "; 
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','" + size + "','" + vwidth + "','" + vheight + "','avi','" + video_description + "','" + autoplay + "','" + showlinks + "')\"><img src=\"/multimedia/gif/icons/avi/icon_avi.gif\" width=\"18\" height=\"16\" border=\"0\" align=\"absmiddle\" alt=\"View Windows AVI File (Old PCs Only)\" title=\"View Windows AVI File (Old PCs Only(Ligos Plugin Required)\"></a>";
			}
		}else
		{
			obj = obj + "<br>";	
		}
	  break;    
	case "jpg":
			obj += "<img id='" + vidobj + "' name='" + vidobj + "' src=\"" + filename + "\" alt=\"Image\" border=\"0\" width=\"" + width  + "\" height=\"" + height + "\" align=\"absmiddle\" style=\"padding-right:0.5em \" title=\"" + video_description + "\" >";
			obj += "<br><br>";
		if(showlinks == "Yes" || showlinks == "Only")
		{
			if(showlinks == "Only") {obj = "";}
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','1X','','','jpg','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 180x120 px Image\">1X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','2X','','','jpg','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 360x240 px Image\">2X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','3X','','','jpg','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 540x360 px Image\">3X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','4X','','','jpg','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 720x480 px Image\">4X</a>&nbsp;";
		}else
		{
			obj = obj + "<br>";	
		}
		break;
	case "gif":
			obj += "<img id='" + vidobj + "' name='" + vidobj + "' src=\"" + filename + "\" alt=\"Image\" border=\"0\" width=\"" + width  + "\" height=\"" + height + "\" align=\"absmiddle\" style=\"padding-right:0.5em \" title=\"" + video_description + "\" >";
			obj += "<br><br>";
		if(showlinks == "Yes" || showlinks == "Only")
		{
			if(showlinks == "Only") {obj = "";}
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','1X','','','gif','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 180x120 px Image\">1X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','2X','','','gif','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 360x240 px Image\">2X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','3X','','','gif','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 540x360 px Image\">3X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','4X','','','gif','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 720x480 px Image\">4X</a>&nbsp;";
		}else
		{
			obj = obj + "<br>";	
		}
		break;
	
	default: //if jpg or gif, no controller
	  
	}	
	
	div_mmf.innerHTML = obj;
	//alert(div_mmf.innerHTML);
}

function setRowColor(rownum, thePointerColor, theNormalBgColor)
{
	var theRow = document.getElementById(rownum);
	var currentColor = theRow.bgColor;
    var newColor = (currentColor.toLowerCase() == thePointerColor.toLowerCase())
                     ? theNormalBgColor
                     : thePointerColor;
	theRow.bgColor = newColor;
}

function getRecord(id)
{
	//use this to get the record, the record is referred to a page that pulls the record id
	//then finds the template and loads the template
	//and anchor may accompany this id
	document.location = "/pgage/page.php?" + id;
}


function updateTimeoutTimer(tim)
{
	var seconds = parseInt(tim);
	if(seconds == 0){window.location = "/logout/logout.php?AutoLogout=Yes";}
	if(seconds > -1)
	{
		var secs = parseInt(seconds) % 60;
		if(secs < 10){ secs = "0" + secs;}
		var mins = parseInt(seconds) / 60;
		mins = Math.floor(mins);
		if(mins < 10){mins = "0" + mins;}
		
		window.status = "Your session will timeout in " + mins + ":" + secs;
		var txt = "<strong>Inactivity Time Left:</strong> " + mins + ":" + secs;
		//update the timer_text also
		var tmr = document.getElementById("TimerText");
		tmr.innerHTML = txt;

		seconds = parseInt(seconds) - 1;
		TimeoutTimerID = setTimeout("updateTimeoutTimer(" + seconds + ")",1000);
	}
}

function updateTimer2(vSecs)
{
	//the end time is entered in seconds from now
	//alert(vSecs);
	parseInt(vSecs);
	if(vSecs > -1)
	{
		
		if (vSecs > 0)
		{
			vSecs = vSecs - 1;
		} else
		{
			vSecs = 0;
		}
				
		var TimeLeft = vSecs;
		parseInt(TimeLeft);
	
		//add the seconds to the current time
		var SecsLeft = (TimeLeft % 60);
		var TotalMinsLeft = ((TimeLeft - SecsLeft) / 60);
		var MinsLeft = (TotalMinsLeft % 60);
		var HoursLeft = ((TotalMinsLeft - MinsLeft) / 60);
		
		var vSecsLeft;
		var vMinsLeft;
		var vHoursLeft;
		
		vSecsLeft = ((SecsLeft < 10) ? "0" : "") + SecsLeft;
		vMinsLeft = ((MinsLeft < 1) ? "00" : MinsLeft);
		vMinsLeft = ((MinsLeft < 10) ? "0" : "") + MinsLeft;
		vHoursLeft = ((HoursLeft < 1) ? "00" : HoursLeft);
		vHoursLeft = ((HoursLeft < 10) ? "0" : "") + HoursLeft;
		////if(SecsLeft < 10){vSecsLeft = "0" + SecsLeft;} else {vSecsLeft = "" + SecsLeft;}
		////if(MinsLeft < 1){vMinsLeft = "00";} elseif (MinsLeft < 10){vMinsLeft = "0" + MinsLeft;} else {vMinsLeft = "" + MinsLeft;}
		//if(HoursLeft < 1){vHoursLeft = "00";} elseif (HoursLeft < 10){vHoursLeft = "0" + HoursLeft;} else {vHoursLeft = "" + HoursLeft;}
		
		var theTimeLeft = vHoursLeft + ":" + vMinsLeft + ":" + vSecsLeft;
	
		window.status = "Time Left:  " + theTimeLeft;
		
		if (vSecs > 0)
		{
			TimerID = setTimeout("updateTimeoutTimer(" + vSecs + ")", 1000);
		} else
		{
			var URL = "/login/logout.php?AutoLogout=Yes";
			window.location.href = URL;		
		}
		
	} else
	{
		window.status = "Inactivity Timeout";
		var URL = "/logout/logout.php?AutoLogout=Yes";
		window.location.href = URL;		

	}
}




-->