﻿/*
 * showFlash(url)
 */
function showFlash(url, width, height) {
	document.write
	('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" '+
		'WIDTH='+width+' HEIGHT='+height+' VIEWASTEXT> <PARAM NAME=movie VALUE="'+url+'"> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=best> <PARAM NAME=bgcolor VALUE=#FFFFFF> '+
		'<EMBED src="'+url+'" menu=false quality=best bgcolor=#FFFFFF  WIDTH='+width+' HEIGHT='+height+' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED> </OBJECT>');
}

// Add function to the window.onload event
function addLoadEvent(func)
{
	var oldonload = window.onload;
	if (typeof window.onload != 'function')
	{
		window.onload = func;
	}
	else
	{
		window.onload = function()
		{
			oldonload();
			func();
		}
	}
}

// opens a popup window in the center of the screen
//
function OpenCenteredPopUp(sFile, sWindowName, iWidth, iHeight)
{
	var maxY = screen.availHeight;
	var maxX = screen.availWidth;
	var x = (maxX - iWidth) / 2;
	var y = (maxY - iHeight) / 2;
    var w = window.open(sFile, sWindowName, 'status=no,scrollbars=no,width='+iWidth+',height='+iHeight+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
    if (w != null)
	    w.focus();

	return w;
}