Home ·  HTML ·  Javascript ·  CSS ·  PHP ·  MySQL ·  Stripe ·  AuthNet ·  Unix ·  Server ·  Email ·  GIFs ·  PNGs ·  SVGs ·  Video ·  Misc · 
Color Wheel
Structure ·  Pre-<html> ·  Head ·  Meta ·  Charset ·  Favicons ·  CSS ·  Javascript ·  Body ·  Header ·  Content ·  Footer ·  Misc ·  Notes · 
 
<script language="javascript">
//declare some video standards

var default_video_format = "mp4";
var default_video_size = "2X";
var vsize = "2X";
var vext = "mp4";
var use_original_vsize = false;
var vplayer ="mp4";
var showads = false;
var showanchormenu = true;
var showchaermenu = true;
var MMOid = 0;
var MMFid = 0;
//set some window measurements and update it
var w = window.innerWidth || document.body.clientWidth;
var h =  window.innerHeight || document.body.clientHeight;
//update the seesion time (set on first line)
var session_time = 3600;
updateTimeoutTimer(session_time);

function loadPage(session_text)
{
	updateScreenParameters(session_text);
	updateTimeoutTimer(session_time);
}

function setRowColor(obj, bgColor, fgcolor)
{
	obj.style.backgroundColor = bgColor;
	obj.style.color = fgcolor;
}

function setBodyFontSize()
{
	document.body.style.fontSize = 12 + "px";
	window.resizeBy(1,0);
	//need to fix error below, get undefined, use AJAX to get current session text size so can move this to a common javascript file
	//var txtSize = getXMLtxt("secure/adminutils/echo_data.php?Field=TextSize");
	//alert(txtSize);
}

//-->
</script>
</head>
<body onLoad="loadPage(12)" onResize="updateScreenParameters()">
 
function inArray(needle, haystack) 
{
    var length = haystack.length;
    for(var i = 0; i < length; i++) 
    {
    if(haystack[i] == needle) return true;
    }
    return false;
}
 
 
function loadPage(session_text)
{
	txtSize(session_text)
	updateTimeoutTimer(session_time);
}
 
function setRowColor(obj, bgColor, fgcolor)
{
	obj.style.backgroundColor = bgColor;
	obj.style.color = fgcolor;
}
 
 f
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();
}
 
 
function 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 findAnchors()
{
	if(showanchormenu)
	{
		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()
{
	//get the user agent in an array
	var ua = navigator.userAgent;
	var ua_array = ua.split(" ");
	var isFirefox = false;
	var isChrome = false;
	var isSafari = false;
	var isOpera = false;
	var isEdge = false;
	var isIE = false;
	for(i=0;i< ua_array.length;i++)
	{
		if(ua_array[i].match("fxios") || ua_array[i].match("Firefox"))
		{
			 isFirefox = true;
		}
		
		if(ua_array[i].match("CriOS") || ua_array[i].match("Chrome"))
		{
			 isChrome = true;
		} 
		if(ua_array[i].match("Safari"))
		{
			 isSafari = true;
		}
		if(ua_array[i].match("Opera") || ua_array[i].match("OPR") )
		{
			 isOpera = true;
		}
		if(ua_array[i].match("Edge"))
		{
			 isEdge = true;
		}
		if(ua_array[i].match("MSIE") || ua_array[i].match("Trident") || ua_array[i].match("Microsoft Internet Explorer"))
		{
			 isIE = true;
		}
	}
	if(isFirefox)
	{
			document.write(" Your current browser is Firefox");
	}
	
	if(isOpera )
{
		document.write(" Your current browser is Opera");
	}
	if(isChrome && isSafari && !isOpera && !isEdge)
	{
			document.write(" Your current browser is Chrome");
	}
	
	if(isSafari && !isChrome)
	{
			document.write(" Your current browser is Safari");
	}
	
	if(isEdge )
	{
		document.write(" Your current browser is Microsoft Edge");
	}
	if(isIE )
	{
		document.write(" Your current browser is Internet Explorer");
	}
	/*
	if(navigator.userAgent.indexOf('Edge')) 
	{
		document.write(" Your current Browser is Microsoft Edge");
	}else if(navigator.appName == "MSIE") 
	{
		document.write(" Your current Browser is Internet Explorer");
	}else if(navigator.appName == "Microsoft Internet Explorer") 
	{
		document.write(" Your current Browser is Internet Explorer");
	}else if(navigator.appName == 'Netscape' && navigator.userAgent.indexOf("Trident") != -1) 
	{
		document.write(" Your current Browser is Internet Explorer 11");
	}else if(navigator.appName == "Opera") 
	{
		document.write(" Your current Browser is Opera");
	}else if(navigator.appName == "Netscape")
	{
		var str = navigator.userAgent;
		if(str.indexOf("Firefox") != -1)
		{
			document.write(" Your current browswer is Firefox");
		}else if(str.indexOf("Chrome") != -1)
		{
			document.write(" Your current browswer is Chrome");
		}else if(str.indexOf("Safari") != -1)//Safari must follow chrome or it will trigger chrome icon
		{
			document.write(" Your current browswer is Safari");
		}else if(str.indexOf("Safari") != -1)//Safari must follow chrome or it will trigger chrome icon
		{
			document.write(" Your current browswer is Safari");
		}else
		{
			//
		}
	}
	*/
	if (navigator.userAgent.indexOf('iPhone') != -1)
	{
		document.write(" You are using an iPhone")
	}
	if (navigator.userAgent.indexOf('iPod') != -1)
	{
		document.write(" Y'ou")
	}
	if (navigator.userAgent.indexOf('iPad') != -1)
	{
		document.write(" You are using an iPad")
	}
	if (navigator.userAgent.indexOf('Android') != -1)
	{
		if (navigator.userAgent.indexOf('Mobile') != -1)
		{
			document.write(" You are using an iPad")
		}else
		{
			document.write(" You are using an iPad")
		}
	}
}
 
 
function showOSgif()
{
//document.write(navigator.userAgent);
	var str = navigator.userAgent;
	if(str.indexOf("Windows NT 10") != -1 || str.indexOf("Windows Phone 10") != -1)
	{
		document.write(" Your current OS is Windows 10");	
	}
	if(str.indexOf("Windows NT 7.0") != -1)
	{
		document.write(" Your current OS is Windows 7.0");	
	}
	if(str.indexOf("Windows NT 6.2") != -1)
	{
		document.write(" Your current OS is Windows 8");	
	}
	if(str.indexOf("Windows NT 6.1") != -1)
	{
		document.write(" Your current OS is Windows 7.0");	
	}
	if(str.indexOf("Windows NT 6.0") != -1)
	{
		document.write(" Your current OS is Windows Vista");	
	}
	if(str.indexOf("Windows NT 5.2") != -1)
	{
		document.write(" Your current OS is Windows Server or 64x XP");	
	}
	if(str.indexOf("Windows NT 5.1") != -1)
	{
		document.write(" Your current OS is Windows XP");	
	}
	if(str.indexOf("Windows NT 5.0") != -1)
	{
		document.write(" Your current OS is Windows 2000");	
	}
	if(str.indexOf("Windows NT 4.0") != -1)
	{
		document.write(" Your current OS is Windows NT");	
	}
	if(str.indexOf("Windows 9X") != -1)
	{
		document.write(" Your current OS is Windows ME");	
	}
	if(str.indexOf("Windows 98") != -1)
	{
		document.write(" Your current OS is Windows 98");	
	}
	if(str.indexOf("Windows CE") != -1)
	{
		document.write(" Your current OS is Windows CE");	
	}
	if(str.indexOf("OS X") != -1 || str.indexOf("Mac") != -1)
	{
		document.write(" Your current OS is Apple");	
	}
	if(str.indexOf("Linux") != -1)
	{
		document.write(" Your current OS is Linux");	
	}
	if(str.indexOf("X11") != -1)
	{
		document.write(" Your current OS is Unix");	
	}
	if (navigator.userAgent.indexOf('Android') != -1)
	{
		document.write(" Your current OS is Unix");	
	}
}
 
 
function showHTML5gif()
{
	if(document.doctype.name == "html")
	{
		document.write(" Your document is HTML5 compatible");	
	}
}
 
 
function videoFormat(ext)
{
	//set the new base text size and refresh the page
		var loc = "../ajax/sessions.php?VideoFormat=" + ext;
		getAjax(loc, function(data){ console.log(data);});
		var format_array = getVideoFormats();
		
		
		for(i=0;i< format_array.length;i++)
		{
			var format = format_array[i].toUpperCase();
			var imgUpper = "img" + format;
			
			var image = document.getElementById(imgUpper);
			
			if(format_array[i] == ext)
			{
				image.src = "../multimedia/gif/icons/" + format_array[i] + "/default_icon_" + format_array[i] + ".gif";
				
			}else
			{
				image.src = "../multimedia/gif/icons/" + format_array[i] + "/icon_" + format_array[i] + ".gif";
			}
			
		}
}
 
 
function updateAnchorMenu(obj)
{
	for(i=0;i< obj.options.length;i++)
	{
		obj.options[i].setAttribute("class","pagemenu_items");
	}
	obj.options[obj.selectedIndex].setAttribute("class","pagemenu_current");
}
 
 
function txtSize(size)
{
	var textsize = document.getElementById("textsize").innerHTML;
	var fontsize = parseInt(textsize.replace(/\D/g,''));
	
	var defaulttextsize = document.getElementById("defaulttextsize").title;
	var defaultfontsize = parseInt(defaulttextsize.replace(/\D/g,''));

	if(isNaN(size))
	{
		if(size == "Increase") 
		{ 
			fontsize = fontsize + 1;
			//set the new base text size and refresh the page
			var loc = "../ajax/sessions.php?TextSize=" + fontsize;
			getAjax(loc, function(data){ console.log(data);});
			//document.body.style.fontSize = size + "px";
			document.querySelector(":root").style.fontSize = fontsize + "px";
			document.getElementById("textsize").innerHTML = fontsize + "px  ";	
		}
		if(size == "Decrease") 
		{ 
			fontsize = fontsize - 1;
			//set the new base text size and refresh the page
			var loc = "../ajax/sessions.php?TextSize=" + fontsize;
			getAjax(loc, function(data){ console.log(data);});
			//document.body.style.fontSize = size + "px";
			document.querySelector(":root").style.fontSize = fontsize + "px";
			document.getElementById("textsize").innerHTML = fontsize + "px  ";	
		}
		if(size == "Default") 
		{ 
			var loc = "../ajax/sessions.php?TextSize=" + defaultfontsize;
			getAjax(loc, function(data){ console.log(data);});
			//document.body.style.fontSize = size + "px";
			document.querySelector(":root").style.fontSize = defaultfontsize + "px";
			document.getElementById("textsize").innerHTML = defaultfontsize + "px  ";	
		}
		if(size == "SetDefaultTextSize") 
		{ 
			var loc = "../ajax/sessions.php?SetTextSize=" + fontsize;
			document.getElementById("defaulttextsize").title = fontsize;
			divID = document.getElementById("divAjax");
			getAjax(loc, function(data){ console.log(data);});
			//document.body.style.fontSize = size + "px";
			document.querySelector(":root").style.fontSize = fontsize + "px";
			document.getElementById("textsize").innerHTML = fontsize + "px  ";	
			alert("The default text size is now " + fontsize + "px");
		}
	}
}
 
 
function videoSize(vidsize)
{
	var videosize = document.getElementById("videosize");	
	var defaultvideosize = document.getElementById("defaultvideosize");
	videosize.title = vidsize;
	defaultvideosize.title = vidsize;
	
	var loc = "../ajax/sessions.php?VideoSize=" + vidsize;
	getAjax(loc, function(data){ console.log(data);});
	
	var videosizes = document.getElementById("VideoSizes");
	var temp = "";
	
	var video_sizes = new Array("1X","2X","3X","4X");
	for(i=0;i< video_sizes.length;i++)
	{
		if(video_sizes[i] == vidsize)
		{
			temp += "  ";
		}else
		{
			temp += "  ";
		}
	}
	videosizes.innerHTML = temp;
	location.reload();
}

 
 
function updateScreenParameters()
{ 
	var w = window.innerWidth || document.body.clientWidth;
	var h =  window.innerHeight || document.body.clientHeight;
	document.getElementById("ScreenParameters").innerHTML = " " + w + "x" + h + "  ";
	//set the text size
	/*
	var loc = "../scripts/sessions.php?GetResponsive=true";
	var responsive = getXML(loc,"Rtext");
	
	var responsive_img = document.getElementById("ResponsiveTextSizeImage");
	
	if(responsive)
	{
		responsive_img.src = "../multimedia/png/common/ResponsiveTextSize.png";
		responsive_img.onmouseover="MM_swapImage('ResponsiveTextSizeImage','','../multimedia/common/ResponsiveTextSizeHover.png',1)";
	}else
	{
		responsive_img.src = "../multimedia/png/common/UnResponsiveTextSize.png";
		responsive_img.onmouseover="MM_swapImage('ResponsiveTextSizeImage','','../multimedia/common/UnResponsiveTextSizeHover.png',1)";
	}
	
	if(responsive)
	{
		var fsize;
		var w = window.innerWidth || document.body.clientWidth;
		if(w < 321){fsize = 9;}
		else if(w < 642){fsize = 9;}
		else if(w < 701){fsize = 10;}
		else if(w < 841){fsize = 11;}
		else if(w < 1024){fsize = 12;}
		else {fsize = 12;}
		//set the new base text size and refresh the page
		
		var loc = "../scripts/sessions.php?Responsive=" + fsize;
		var fsize = getXML(loc,"textsize");
		//document.body.style.fontSize = size + "px";
		document.querySelector(":root").style.fontSize = fsize + "px";
		document.getElementById("textsize").innerHTML = fsize + "px ";	
	}
	*/
}
 
 
function updateTimeoutTimer(tim)
{	
	var seconds = parseInt(tim);
	var secs = parseInt(seconds) % 60;
	if(secs < 10){ secs = "0" + secs;}
	
	var mins = parseInt(seconds / 60);
	var hrs = parseInt(mins/ 60);
	
	hrs = Math.floor(hrs);
	if(hrs < 10){hrs = "0" + hrs;}
	
	mins = Math.floor(mins) % 60;
	if(mins < 10){mins = "0" + mins;}
	
	if(tim < 900)
	{
		document.getElementById("SessionTimeLeft").style.color = "#F70";
	}
	if(tim < 300)
	{
		document.getElementById("SessionTimeLeft").style.color = "#F00";
	}
	
	
	if(tim == 0)
	{
		document.location = "../login/logout.php";
	}
	
	var txt = "< strong>Session:</strong> " + hrs + ":" + mins + ":" + secs + "  ";
	
	
	//update the timer_text also
	var tmr = document.getElementById("SessionTimeLeft");
	if(tmr != null) { tmr.innerHTML = txt; }
	seconds = parseInt(seconds) - 1;
	if(tim > 0)
	{
		TimeoutTimerID = setTimeout("updateTimeoutTimer(" + seconds + ")",1000);
	}
}
 
 
function getVideoFormats()
{
		if(navigator.appName == "MSIE" || navigator.appName == "Edge") 
		{
			var format = new Array("mp4","swf","wmv","mov");
		}else if(navigator.appName == "Opera") 
		{
			var format = new Array("mp4","webm","ogv","swf","wmv","mov");
		}else if(navigator.appName == "Netscape")
		{
			var str = navigator.userAgent;
			if(str.indexOf("Firefox") != -1)
			{
				var format = new Array("mp4","webm","ogv","swf","wmv","mov");
				
			}else if(str.indexOf("Chrome") != -1)
			{
				var format = new Array("mp4","webm","ogv","swf","wmv","mov");
			}else if(str.indexOf("Safari") != -1)
			{
				var format = new Array("mp4","swf","wmv","mov");
			}else
			{
				var format = new Array("mp4","webm","swf","wmv","mov");
			}
		}else
		{
			var format = new Array("mp4","webm","swf","wmv","mov");
		}
		//if an iphone, ipod, or iphone - use mp4
		if ((navigator.userAgent.indexOf('iPhone') != -1) || (navigator.userAgent.indexOf('iPod') != -1) || (navigator.userAgent.indexOf('iPad') != -1))
		{
			var format = new Array("mp4");
		}
		if (navigator.userAgent.indexOf('Android') != -1)
		{
			var format = new Array("mp4");
		}
		return format;
}
 
 
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 + "\">";
	if(video_title != "")
	{
		txt = txt + "<caption class=\"tabletitle\" align=\"" + title_align + "\">" + video_title + "</caption>";
	}
	txt = txt + "<tr><td width=\"100%\" align=\"center\" id=\"" + div_id + "\">";
	txt = txt + " </td></tr>";
	if(vcaption != "")
	{
		txt = txt + <tr><td class=\"tablecaption\" align=\"" + caption_align + "\">" + vcaption + "</td></tr></table></div>";
	}else
	{
		txt = txt + "</table></div>";
	}
	document.write(txt);
	updateVideo(div_id,mmfn_id,vfilename,vfilesize,vwidth,vheight,vfiletype,video_description,autoplay,showlinks)
}
 
 
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: mp4,,ogv, webm
	//Chrome: mp4, webm, ogv
	//Opera: mp4,,webm, ogv
	//Safari: mp4
	//IE9+: mp4
	
	//must override the format if set to jpg
	if(format != "jpg" && format != "gif")
	{
		if(navigator.appName == "MSIE" || navigator.appName == "Edge") 
		{
			var browser_video_array = new Array("mp4","swf","wmv","mov");
			if(!inArray(format,browser_video_array))
			{
				//default to flash
				format = "swf";	
			}
		}else if(navigator.appName == "Opera") 
		{
			var browser_video_array = new Array("mp4","webm","ogv","swf","wmv","mov");
			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("mp4","webm","ogv","swf","wmv","mov");
				if(!inArray(format,browser_video_array))
				{
					//default to flash
					format = "swf";	
				}
			}else if(str.indexOf("Chrome") != -1)
			{
				var browser_video_array = new Array("mp4","webm","ogv","swf","wmv","mov");
				if(!inArray(format,browser_video_array))
				{
					//default to flash
					format = "swf";	
				}
			}else if(str.indexOf("Safari") != -1)
			{
				var browser_video_array = new Array("mp4","swf","wmv","mov");
				if(!inArray(format,browser_video_array))
				{
					//default to flash
					format = "swf";	
				}
			}else
			{
				var browser_video_array = new Array("mp4","webm","swf","wmv","mov");
			}
		}else
		{
			var browser_video_array = new Array("mp4","webm","swf","wmv","mov");
		}
		
		//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 (navigator.userAgent.indexOf('Android') != -1)
		{
			browser_video_array = new Array("mp4");
			format = "mp4";
		}
	}
	//switch the Session Video Format
	
	//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 = "https://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 = 56;//46
	  break;    
	case "mov":
	  cntlr = 16;
	  break;    
	case "mp4":
	  cntlr = 20;//16
	  break;    
	case "ogv":
	  cntlr = 20;//16
	  break;    
	case "webm":
	  cntlr = 20;//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\"> ";
		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> ";
			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> ";
			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> ";
			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> ";
			//add the icons for non_ie browsers
			for(i=0;i<browser_video_array.length;i++)
			{
				if(browser_video_array[i] != "swf")
				{
					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/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 += "";
		obj += "";
		//obj += "";
		//choices for uimode are invisible,none,mini,full,custom
		obj += "";
		obj += "";
		obj += "";
		//obj += "";
		obj += "";
		obj += "";
		//text += "";
		//text += "";
		obj += "";
		obj += "";
		obj += "";
		obj += "1X ";
			obj += "2X ";
			obj += "3X ";
			obj += "4X ";
			//add the other formats
			//add the icons for non_ie browsers
			for(i=0;i\"View ";
				}
			}
		}else
		{
			obj = obj + "
"; } break; case "mov": obj += "\n"; obj += "\n"; obj += "\n"; obj += "\n"; obj += "\n"; obj += "\n"; obj += "1X "; obj += "2X "; obj += "3X "; obj += "4X "; //add the other formats //add the icons for non_ie browsers for(i=0;i\"View "; } } }else { obj = obj + "
"; } 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 = "
\n "; if(showlinks == "Yes" || showlinks == "Only") { if(showlinks == "Only") {obj = "";} obj += "1X "; obj += "2X "; obj += "3X "; obj += "4X "; //add the other formats //add the icons for non_ie browsers for(i=0;i\"View "; } } obj = obj + "
"; }else { obj = obj + "
"; } break; case "ogv"://Firefox, Chrome, Opera if(autoplay == "true"){var autoplay1 = "autoplay='autoplay'";}else{var autoplay1 = "";} obj = "
\n "; if(showlinks == "Yes" || showlinks == "Only") { if(showlinks == "Only") {obj = "";} obj += "1X "; obj += "2X "; obj += "3X "; obj += "4X "; //add the other formats //add the icons for non_ie browsers for(i=0;i\"View "; } } obj = obj + "
"; }else { obj = obj + "
"; } break; case "webm"://Firefox, Chrome, Opera, IE9 if(autoplay == "true"){var autoplay1 = " autoplay='autoplay'";}else{var autoplay1 = "";} obj = "
\n "; //alert(obj); if(showlinks == "Yes" || showlinks == "Only") { if(showlinks == "Only") {obj = "";} obj += "1X "; obj += "2X "; obj += "3X "; obj += "4X "; //show the other formats //add the icons for non_ie browsers for(i=0;i\"View "; } } obj = obj + "
"; }else { obj = obj + "
"; } break; case "jpg": obj += "\"Image\""; obj += "

"; if(showlinks == "Yes" || showlinks == "Only") { if(showlinks == "Only") {obj = "";} obj += "1X "; obj += "2X "; obj += "3X "; obj += "4X "; }else { obj = obj + "
"; } break; case "gif": obj += "\"Image\""; obj += "

"; if(showlinks == "Yes" || showlinks == "Only") { if(showlinks == "Only") {obj = "";} obj += "1X "; obj += "2X "; obj += "3X "; obj += "4X "; }else { obj = obj + "
"; } break; default: //if jpg or gif, no controller var user_id = -1; if(user_id == "1") { obj = obj + "
" + filename; } } div_mmf.innerHTML = obj; //alert(div_mmf.innerHTML); }
 
 
function updateMMFSize(vid,size)
{
	video = document.getElementById(vid).src;
	video = video.replace(/1X|2X|3X|4X/g,size);
	document.getElementById(vid).src = video;
	if(size == "1X")
	{
		document.getElementById(vid).width = 200;
		document.getElementById(vid).height = 150;
	}
	if(size == "2X")
	{
		document.getElementById(vid).width = 400;
		document.getElementById(vid).height = 300;
	}
	if(size == "3X")
	{
		document.getElementById(vid).width = 600;
		document.getElementById(vid).height = 400;
	}
	if(size == "4X")
	{
		document.getElementById(vid).width = 800;
		document.getElementById(vid).height = 600;
	}
}