<!--
//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://" + location.href.substr(7);
			}else
			{
				top.location.href = "https://" + 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;
	  };
}

//fix for ipad window
/*
window.onorientationchange = function()
{
	if (window.innerWidth != currentWidth) 
	{
    	currentWidth = window.innerWidth;
    	var orient = (currentWidth == 320) ? "profile" : "landscape";
    	document.body.setAttribute("orient", orient);
    	window.scrollTo(0, 1);
  	}
	
	
	var is_iPhone = false;
	var is_iPad = false;
	var is_iPod = false;
	
	if (navigator.userAgent.indexOf('iPhone') != -1){is_iPhone = true;}
	if (navigator.userAgent.indexOf('iPad') != -1){is_iPad = true;}
	if (navigator.userAgent.indexOf('iPad') != -1){is_iPod = true;}
	
	var mnu = document.getElementById("menu");
	
	if ( window.orientation === 0)// iPad is in Portrait mode.
	{
		if(is_iPad){menu.style.width = 1024;}
	}else if ( window.orientation === 90)// iPad is in Landscape mode. The screen is turned to the left.
	{
		if(is_iPad){menu.style.width = 1024;}
	}else if ( window.orientation === -90)// iPad is in Landscape mode. The screen is turned to the right.
	{
		if(is_iPad){menu.style.width = 1024;}
	}
}
*/

//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 < 30)
	{
		fsize = fsize + 1;
		document.body.style.fontSize = fsize + "px";
	}
	if(size == "Decrease" && fsize > 6)
	{
		fsize = fsize - 1;
		document.body.style.fontSize = fsize + "px";
	}

	if(size == "Default")
	{
		fsize = 12;
		document.body.style.fontSize = fsize + "px";
	}
	//need to resize the window to change the justified text
	window.resizeBy(-1,0);
	window.resizeBy(1,0);
}
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 Video Player";}
	if(type == "mov"){format = "Quicktime Video Player";}
	if(type == "wmv"){format = "Windows Video Player";}
	if(type == "mp4"){format = "HTML5/mp4 Video Player";}
	if(type == "ogv"){format = "HTML5/ogv Video Playe";}
	if(type == "webm"){format = "HTML5/webm Video Playe";}
	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(pageuid)
{
	document.location = "/page/page.php?UID=" + pageuid;
}
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("&nbsp;<img src='/multimedia/gif/browsers/ie.gif' class='os' alt='Your current Browser is Internet Explorer' title='Your current Browser is Internet Explorer' />");
	}else if(navigator.appName == "Opera") 
	{
		document.write("&nbsp;<img src='/multimedia/gif/browsers/opera.gif' class='os' alt='Your current Browser is Opera' title='Your current Browser is Opera' />");
	}else if(navigator.appName == "Netscape")
	{
		var str = navigator.userAgent;
		if(str.indexOf("Firefox") != -1)
		{
			document.write("&nbsp;<img src='/multimedia/gif/browsers/firefox.gif' class='os' alt='Your current browswer is Firefox' title='Your current browswer is Firefox' />");
		}else if(str.indexOf("Chrome") != -1)
		{
			document.write("&nbsp;<img src='/multimedia/gif/browsers/chrome.gif' class='os' alt='Your current browswer is Chrome' title='Your current browswer is Chrome' />");
		}else if(str.indexOf("Safari") != -1)//Safari must follow chrome or it will trigger chrome icon
		{
			document.write("&nbsp;<img src='/multimedia/gif/browsers/safari.gif' class='os' alt='Your current browswer is Safari' title='Your current browswer is Safari' />");
		}
	}
	if (navigator.userAgent.indexOf('iPhone') != -1)
	{
		document.write("&nbsp;<img src='/multimedia/gif/icons/iphone/icon_iphone.gif'  alt=You are using an iPhone' align='absmiddle' title='Your current device is an iPhone' />")
	}
	if (navigator.userAgent.indexOf('iPod') != -1)
	{
		document.write("&nbsp;<img src='/multimedia/gif/icons/ipod/icon_ipod.gif'  alt=You are using an iPod' align='absmiddle' title='Your current device is an iPod' />")
	}
	if (navigator.userAgent.indexOf('iPad') != -1)
	{
		document.write("&nbsp;<img src='/multimedia/gif/icons/ipad/icon_ipad.gif'  alt=You are using an iPad' align='absmiddle' title='Your current device is an iPad' />")
	}
}

function showOSgif()
{
//document.write(navigator.userAgent);
	var str = navigator.userAgent;
	if(str.indexOf("Windows NT 7.0") != -1)
	{
		document.write("&nbsp;<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.1") != -1)
	{
		document.write("&nbsp;<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("&nbsp;<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("&nbsp;<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("&nbsp;<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("&nbsp;<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("&nbsp;<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("&nbsp;<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("&nbsp;<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("&nbsp;<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("&nbsp;<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("&nbsp;<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("&nbsp;<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 inArray(needle, haystack) 
{
    var length = haystack.length;
    for(var i = 0; i < length; i++) {
        if(haystack[i] == needle) return true;
    }
    return false;
}
function updateVideo(mmo,vidobj,fn,size,vwidth,vheight,format,video_description,autoplay,showlinks)
{
	//change the format for incompatible browsers(plugins required for swf, wmv, mov
	//Firefox: ogv, webm
	//Chrome: mp4, webm, ogv
	//Opera: webm, ogv
	//Safari: mp4
	//IE9+: mp4
	
	//must override the format if set to jpg
	if(format != "jpg")
	{
		if(navigator.appName == "Microsoft Internet Explorer") 
		{
			var browser_video_array = new Array("swf","wmv","mov","mp4");
			if(!inArray(format,browser_video_array))
			{
				//default to flash
				format = "swf";	
			}
		}else if(navigator.appName == "Opera") 
		{
			var browser_video_array = new Array("swf","wmv","mov","webm");
			if(!inArray(format,browser_video_array))
			{
				//default to flash
				format = "swf";	
			}
		}else if(navigator.appName == "Netscape")
		{
			var str = navigator.userAgent;
			if(str.indexOf("Firefox") != -1)
			{
				var browser_video_array = new Array("swf","wmv","mov","webm");
				if(!inArray(format,browser_video_array))
				{
					//default to flash
					format = "swf";	
				}
			}else if(str.indexOf("Chrome") != -1)
			{
				var browser_video_array = new Array("swf","wmv","mov","mp4","webm");
				if(!inArray(format,browser_video_array))
				{
					//default to flash
					format = "swf";	
				}
			}else if(str.indexOf("Safari") != -1)
			{
				var browser_video_array = new Array("swf","wmv","mov","mp4");
				if(!inArray(format,browser_video_array))
				{
					//default to flash
					format = "swf";	
				}
			}else
			{
				var browser_video_array = new Array("swf","wmv","mov","mp4","webm");
			}
		}else
		{
			var browser_video_array = new Array("swf","wmv","mov","mp4","webm");
		}
		
		//if an iphone, ipod, or iphone - use mp4
		if ((navigator.userAgent.indexOf('iPhone') != -1) || (navigator.userAgent.indexOf('iPod') != -1) || (navigator.userAgent.indexOf('iPad') != -1))
		{
			browser_video_array = new Array("mp4");
			format = "mp4";
		}
	}
	//if firefox and set to html5 video code will have to use mp4 with windows or quicktime as the player
	
	//set the video file type for the alt and title text
	var video_type = new Array();
	 video_type["swf"] = "Flash";
	 video_type["wmv"] = "Windows Media Video";
	 video_type["mov"] = "Quicktime";
	 video_type["mp4"] = "HTML5 MP4";
	 video_type["ogv"] = "Ogg Theora";
	 video_type["webm"] = "WebM";
	
	//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;//22 with JW player
	  break;    
	case "wmv":
	  cntlr = 46;
	  break;    
	case "mov":
	  cntlr = 16;
	  break;    
	case "mp4":
	  cntlr = 16;
	  break;    
	case "ogv":
	  cntlr = 16;
	  break;    
	case "webm":
	  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 = 200;//180
	  height = 150 + cntlr;//120
	  break;    
	case "2X":
	  width = 400;
	  height = 300 + cntlr;
	  break;    
	case "3X":
	  width = 600;
	  height = 450 + cntlr;
	  break;    
	case "4X":
	  width = 800;
	  height = 600 + cntlr;
	  break;    
	default:
	  width = 400;
	  height = 300 + cntlr;
	}	
	
	if(vwidth != "") { width = parseInt(vwidth) + cntlr; }
	if(vheight != "") { height = parseInt(vheight) + cntlr; }
	switch(format)
	{
	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 = "";}
			//add the size link icons, same format
			obj = obj + "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','1X','','','swf','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 200x150 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 400x300 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 600x450 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 800x600 px Video\">4X</a>&nbsp;";
			//add the icons for non_ie browsers
			for(i=0;i<browser_video_array.length;i++)
			{
				obj = obj + "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','" + size + "','" + vwidth + "','" + vheight + "','" + browser_video_array[i] + "','" + video_description + "','" + autoplay + "','" + showlinks + "')\"><img src=\"/multimedia/gif/icons/" + browser_video_array[i] + "/icon_" + browser_video_array[i] + ".gif\" width=\"18\" height=\"16\" border=\"0\" align=\"absmiddle\" alt=\"View " + video_type[browser_video_array[i]] + " File\" title=\"View " +  video_type[browser_video_array[i]] + " File\"></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 200x150 px Video\">1X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','2X','','','wmv','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 400x300 px Video\">2X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','3X','','','wmv','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 600x450 px Video\">3X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','4X','','','wmv','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 800x600 px Video\">4X</a>&nbsp;";
			//add the other formats
			//add the icons for non_ie browsers
			for(i=0;i<browser_video_array.length;i++)
			{
				obj = obj + "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','" + size + "','" + vwidth + "','" + vheight + "','" + browser_video_array[i] + "','" + video_description + "','" + autoplay + "','" + showlinks + "')\"><img src=\"/multimedia/gif/icons/" + browser_video_array[i] + "/icon_" + browser_video_array[i] + ".gif\" width=\"18\" height=\"16\" border=\"0\" align=\"absmiddle\" alt=\"View " + video_type[browser_video_array[i]] + " File\" title=\"View " +  video_type[browser_video_array[i]] + " File\"></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 200x150 px Video\">1X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','2X','','','mov','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 400x300 px Video\">2X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','3X','','','mov','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 600x450 px Video\">3X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','4X','','','mov','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 800x600 px Video\">4X</a>&nbsp;";
			//add the other formats
			//add the icons for non_ie browsers
			for(i=0;i<browser_video_array.length;i++)
			{
				obj = obj + "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','" + size + "','" + vwidth + "','" + vheight + "','" + browser_video_array[i] + "','" + video_description + "','" + autoplay + "','" + showlinks + "')\"><img src=\"/multimedia/gif/icons/" + browser_video_array[i] + "/icon_" + browser_video_array[i] + ".gif\" width=\"18\" height=\"16\" border=\"0\" align=\"absmiddle\" alt=\"View " + video_type[browser_video_array[i]] + " File\" title=\"View " +  video_type[browser_video_array[i]] + " File\"></a>";
			}
		}else
		{
			obj = obj + "<br>";	
		}
	  break;
	case "mp4": //Safari, IE
		//if firefox will have to use the windows or quicktime player
		
		if(autoplay == "true"){var autoplay1 = "autoplay='autoplay'";}else{var autoplay1 = "";}			
		obj = "<video width='" + width  + "' height='" + height  + "' controls='controls' " + autoplay1 + " loop='loop' preload='auto'>\n";
		obj += "<source src='" + filename + "' type='video/mp4; codecs=\"avc1.4D401E, mp4a.40.2\"'/>\n";
		obj += "</video><br>\n ";
			
		if(showlinks == "Yes" || showlinks == "Only")
		{
			if(showlinks == "Only") {obj = "";}
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','1X','','','" + format + "','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 200x150 px Video\">1X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','2X','','','" + format + "','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 400x300 px Video\">2X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','3X','','','" + format + "','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 600x450 px Video\">3X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','4X','','','" + format + "','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 800x600 px Video\">4X</a>&nbsp;";
			//add the other formats
			//add the icons for non_ie browsers
			for(i=0;i<browser_video_array.length;i++)
			{
				obj = obj + "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','" + size + "','" + vwidth + "','" + vheight + "','" + browser_video_array[i] + "','" + video_description + "','" + autoplay + "','" + showlinks + "')\"><img src=\"/multimedia/gif/icons/" + browser_video_array[i] + "/icon_" + browser_video_array[i] + ".gif\" width=\"18\" height=\"16\" border=\"0\" align=\"absmiddle\" alt=\"View " + video_type[browser_video_array[i]] + " File\" title=\"View " +  video_type[browser_video_array[i]] + " File\"></a>";
			}
			obj = obj + "<br>HTML5 Videos may be missing until they are added.";
		}else
		{
			obj = obj + "<br>";	
		}
		break;
	case "ogv"://Firefox, Chrome, Opera
		if(autoplay == "true"){var autoplay1 = "autoplay='autoplay'";}else{var autoplay1 = "";}				
		obj = "<video width='" + width  + "' height='" + height  + "' controls='controls'" + autoplay1 + " loop='loop' preload='auto'>\n";
		obj += "<source src='" + filename + "' type='video/ogg; codecs=\"theora, vorbis\"'/>\n";
		obj += "</video><br>\n ";
			
		if(showlinks == "Yes" || showlinks == "Only")
		{
			if(showlinks == "Only") {obj = "";}
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','1X','','','" + format + "','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 200x150 px Video\">1X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','2X','','','" + format + "','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 400x300 px Video\">2X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','3X','','','" + format + "','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 600x450 px Video\">3X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','4X','','','" + format + "','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 800x600 px Video\">4X</a>&nbsp;";
			//add the other formats
			//add the icons for non_ie browsers
			for(i=0;i<browser_video_array.length;i++)
			{
				obj = obj + "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','" + size + "','" + vwidth + "','" + vheight + "','" + browser_video_array[i] + "','" + video_description + "','" + autoplay + "','" + showlinks + "')\"><img src=\"/multimedia/gif/icons/" + browser_video_array[i] + "/icon_" + browser_video_array[i] + ".gif\" width=\"18\" height=\"16\" border=\"0\" align=\"absmiddle\" alt=\"View " + video_type[browser_video_array[i]] + " File\" title=\"View " +  video_type[browser_video_array[i]] + " File\"></a>";
			}
			obj = obj + "<br>HTML5 Videos may be missing until they are added.";
		}else
		{
			obj = obj + "<br>";	
		}
		break;
	case "webm"://Firefox, Chrome, Opera, IE9
		if(autoplay == "true"){var autoplay1 = "autoplay='autoplay'";}else{var autoplay1 = "";}			
		obj = "<video width='" + width  + "' height='" + height  + "' controls='controls'" + autoplay1 + " loop='loop' preload='auto'>\n";
		obj += "<source src='" + filename + "' type='video/webm; codecs=\"vp8.0, vorbis\"'/>\n";
		obj += "</video><br>\n ";
			
		if(showlinks == "Yes" || showlinks == "Only")
		{
			if(showlinks == "Only") {obj = "";}
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','1X','','','" + format + "','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 200x150 px Video\">1X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','2X','','','" + format + "','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 400x300 px Video\">2X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','3X','','','" + format + "','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 600x450 px Video\">3X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','4X','','','" + format + "','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 800x600 px Video\">4X</a>&nbsp;";
			//show the other formats
			//add the icons for non_ie browsers
			for(i=0;i<browser_video_array.length;i++)
			{
				obj = obj + "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','" + size + "','" + vwidth + "','" + vheight + "','" + browser_video_array[i] + "','" + video_description + "','" + autoplay + "','" + showlinks + "')\"><img src=\"/multimedia/gif/icons/" + browser_video_array[i] + "/icon_" + browser_video_array[i] + ".gif\" width=\"18\" height=\"16\" border=\"0\" align=\"absmiddle\" alt=\"View " + video_type[browser_video_array[i]] + " File\" title=\"View " +  video_type[browser_video_array[i]] + " File\"></a>";
			}
			obj = obj + "<br>HTML5 Videos may be missing until they are added.";
		}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 200x150 px Image\">1X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','2X','','','jpg','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 400x300 px Image\">2X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','3X','','','jpg','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 600x450 px Image\">3X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','4X','','','jpg','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 800x600 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 200x150 px Image\">1X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','2X','','','gif','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 400x300 px Image\">2X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','3X','','','gif','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 600x450 px Image\">3X</a>&nbsp;";
			obj += "<a href=\"javascript:void(0)\" onclick=\"updateVideo('" + mmo + "','" + vidobj + "','" + fn + "','4X','','','gif','" + video_description + "','" + autoplay + "','" + showlinks + "')\" title=\"View 800x600 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;		

	}
}




-->
