//-----------------------------------------------------//
//globalFunctions.js
//This file will contain global functions only
//Last updated - 2008.07.07
//-----------------------------------------------------//

function detectBrowser()
{
	var browser=navigator.appName;
	var b_version=navigator.appVersion;
	var version="";
	if(b_version.indexOf("MSIE")>-1){
		var versiontmp = b_version.split("MSIE");
		//alert(versiontmp[1]);
		version=parseInt(versiontmp[1]);
	}else{
		version=parseFloat(b_version);
	}
	//alert(browser + ":"+version);
	if (browser=="Netscape" && version>=4){
		return "nonIE";
	}else if(browser=="Microsoft Internet Explorer" && version==6){
		return "IE6";
	}else if(browser=="Microsoft Internet Explorer" && version>6){
		return "IE";
	}
	
}


function getCenterAlignXIE6(argWidth){
}

function setXPos(){
	addCombo();
}
function addCombo(){
	
	document.getElementById("dropdownCombo").style.position = "absolute";
	document.getElementById("dropdownCombo").style.left = 747+parseInt(document.getElementById("main").offsetLeft)+"px";
	document.getElementById("dropdownCombo").style.top = 22+parseInt(document.getElementById("main").offsetTop)+"px";
}
function initGlobalVars(){
	currentBrowser = detectBrowser();
	addCombo();
	headerImagePreloader();	
}

function render_flash(movie,w,h){

	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="'+ w +'" height="'+ h +'" id="tool2" align="">');
	document.write('	<param name="movie" value="'+ movie +'">');
	document.write('	<param name="quality" value="high">');
	document.write('	<param name="bgcolor" value="#000000">');
	document.write('	<param name="menu" value="false">');
	document.write('	<param name="loop" value="false">');
	document.write('	<param name="wmode" value="transparent">');
	document.write('	<embed wmode="transparent" src="'+ movie +'" quality="high" bgcolor="#000000" menu="false" width="'+ w +'" height="'+ h +'" name="tool2" id="tool2" align="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>');
	//document.write('	<embed src="'+ movie +'" quality="high" bgcolor="#000000" menu="false" width="'+ w +'" height="'+ h +'" name="tool2" id="tool2" align="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>');
	document.write('</object>');
	expandHeight(0)
	//document.getElementById("tool2").focus();
}
function openPopUp(arg_url, arg_name){
	sw=screen.width;
	sh=screen.height;
	w=567;
	h=424;
	l=(sw-w)/2;
	t=(sh-h)/2;
	window.open(arg_url,arg_name,'width='+w+',height='+h+',menubar=0,status=0,location=0,toolbar=0,scrollbars=0,top='+t+',left='+l);
}
/*-----------------------------------------*/
// function for combo dropdown
function expandHeight(argValue)
{	
	document.getElementById("dropdownCombo").style.overflow="hidden";
	//alert(document.getElementById("dropdownCombo").style.height);
	if(argValue!=0){
		if(document.getElementById("dropdownCombo").style.height=="429px")
		{
			document.getElementById("dropdownCombo").style.height=24+"px";
		}
		else
		{
			document.getElementById("dropdownCombo").style.height=429+"px";
		}
	}else{
		document.getElementById("dropdownCombo").style.height=24+"px";
	}
}
/***********************************/
function render_flash_2(movie,w,h,argId){
	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="'+ w +'" height="'+ h +'" id="'+argId+'" align="">');
	document.write('	<param name="movie" value="'+ movie +'">');
	document.write('	<param name="quality" value="high">');
	document.write('	<param name="bgcolor" value="#000000">');
	document.write('	<param name="menu" value="false">');
	document.write('	<param name="loop" value="false">');
	document.write('	<param name="wmode" value="transparent">');
	document.write('	<embed wmode="transparent" src="'+ movie +'" quality="high" bgcolor="#000000" menu="false" width="'+ w +'" height="'+ h +'" name="'+argId+'" id="'+argId+'" align="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>');
	//document.write('	<embed src="'+ movie +'" quality="high" bgcolor="#000000" menu="false" width="'+ w +'" height="'+ h +'" name="tool2" id="tool2" align="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>');
	document.write('</object>');
}