function resizeCurrentWindow()
{
  if (window.screen) {
    window.moveTo(0, 0);
    window.resizeTo(screen.availWidth, screen.availHeight);
  }
}

function open_media(quality, width, height) {
	var re = new RegExp ('&', 'gi') ;
	vids = window.open("presentation.php?quality=" + quality, "_blank", "width=" + width + ",height=" + height + ",resizable=yes,scrollbars=no,toolbar=no,titlebar=no,location=no,locationbar=no,directories=no,status=no,menubar=no,personalbar=no,width=640,height=480,left=20,top=20")		
}

function resize(elementID)
{
	myElement = document.getElementById(elementID);
	theWidth = Number(myElement.offsetWidth);
	theHeight = Number(myElement.offsetHeight);
	window.resizeTo(340, theHeight);
}

function resize_window(width, height)
{
	var nn = (navigator.appName == "Netscape" || document.layers) ? true : false
	var ie = document.all ? true : false
	var ieMac = (navigator.platform.indexOf("Mac") != -1 && document.all) ? true : false
	var aol = (navigator.userAgent.indexOf("AOL ") != -1) ? true : false;
	var xp = (navigator.userAgent.indexOf("NT 5.1") != -1) ? true : false;
	var vista = (navigator.userAgent.indexOf("NT 6.") != -1) ? true : false;
	var ie7 = (navigator.userAgent.indexOf("MSIE 7.") != -1) ? true : false;
	var firefox = (navigator.userAgent.indexOf("Firefox") != -1) ? true : false;
	
	window.resizeTo(width, height);
	
	if(ieMac) {
		newHeight = Number(height);
		newHeight -= Number(document.body.clientHeight);
		newHeight += Number(height);
		
		newWidth = Number(width);
		newWidth -= Number(document.body.clientWidth);
		newWidth += Number(width);
	}
	else if(aol) {
		newHeight = Number(height);
		newWidth = Number(width);

		newHeight += 4;
	}
	else if(xp && firefox) {
		newHeight = Number(height);
		newWidth = Number(width);

		newHeight += 54;
		newWidth += 7;
	}
	else if(ie7) {
		newHeight = Number(height);
		newWidth = Number(width);

		newHeight += 84;
		newWidth += 7;
	}
	else if(xp) {
		newHeight = Number(height);
		newWidth = Number(width);

		newHeight += 65;
		newWidth += 12;
	}
	else if(ie)	{
		newHeight = Number(height);
		newWidth = Number(width);

		newHeight += 35;
		newWidth += 12;
	}
	else {
		newHeight = Number(height);
		newHeight -= Number(window.innerHeight);
		newHeight += Number(height);
		
		newWidth = Number(width);
		newWidth -= Number(window.innerWidth);
		newWidth += Number(width);

	}

	if(firefox)
		newHeight += 8;
	
	window.resizeTo(newWidth, newHeight);
	moveWindow();
}

function moveWindow()
{
	var nn = (navigator.appName == "Netscape" || document.layers) ? true : false
	var ie = document.all ? true : false

  if (window.screen) 
  {
	if(ie)
	{
		moveToW = (Number(window.opener.document.body.clientWidth) - Number(document.body.clientWidth)) / 2
		moveToH = (Number(window.opener.document.body.clientHeight) - Number(document.body.clientHeight)) / 2
	}
	else
	{
		moveToW = (Number(window.opener.outerWidth) - Number(window.outerWidth)) / 2
		moveToH = (Number(window.opener.outerHeight) - Number(window.outerHeight)) / 2
	}
    window.moveTo(moveToW, moveToH);
  }
}

function embedMovie(f_path, f_name, f_width, f_height, f_color, f_vars) {
	document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="' + f_width + '" HEIGHT="' + f_height +'" id="' + f_name + '">\n');
	document.write('<PARAM NAME="movie" VALUE="' + f_path + '">\n');
	document.write('<PARAM NAME="quality" VALUE="high">\n');
	document.write('<PARAM NAME="quality" VALUE="high">\n');
	if(f_color != "") {
		document.write('<PARAM NAME="bgcolor" VALUE="#' + f_color + '">\n');
	}
	document.write('<EMBED src="' + f_path + '" ' + (f_color != "" ? ('bgcolor="#' + f_color):'') + '" quality="high" WIDTH="' + f_width + '" HEIGHT="' + f_height +'" NAME="' + f_name + '" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">\n');
	document.write('</EMBED>\n');
	document.write('</OBJECT>\n');
}
