// JavaScript Document
var layerPopup;
function drawLayerPopup (url,w,h) {
	//document.body.innerHTML;
	
	document.write('<div id="layerPopup" style="z-index:5;position:absolute;width:'+(w+22)+'px;height:'+h+'px;display:block;"><div style="float:left;width:'+w+'px"><iframe src="'+url+'" width="'+w+'" height="'+h+'" scrolling="no" frameborder="0" style="overflow:hidden"></iframe></div><div style="float:right;width:22px;height:22px;display:block;color:#FFCC00"><a href="javascript:closeLayerPopup();"><img src="../corporate/images/closepopup.gif" border="0"/></a></div></div>');
	layerPopup = document.getElementById("layerPopup");
	window.onresize = onResize;
	onResize();
}
function onResize () {
	
	if(layerPopup != null){
		//alert(layerPopup);
		var cw = document.body.clientWidth;
		var ch = 600; 
		var x = Math.round((cw-layerPopup.style.width.split("px")[0])*0.5);		
		var y = Math.round((ch-layerPopup.style.height.split("px")[0])*0.5);
		//alert(layerPopup.style.height);
		layerPopup.style.top = y;
		layerPopup.style.left = x;
	}
}
function closeLayerPopup () {
	if(layerPopup != null) layerPopup.style.display = "none";
}
function drawFlash (drawTo, name, w,h, wmode, vars) {
	var drawTo = document.getElementById(drawTo);
   	var mode = (wmode) ? wmode : "opaque";
	mode = "opaque";
	var fv = (vars) ? vars : "";
	var fname = name.split("/")[name.split("/").length-1];
	var str = AC_FL_GetContent( 'id',fname,'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0','width',w,'height',h,'id',fname,'align','middle','src',fname,'quality','high','bgcolor','#FFFFFF','name',fname,'allowscriptaccess','sameDomain','allowfullscreen','true','scale', 'noscale','pluginspage','http://www.macromedia.com/go/getflashplayer','menu','false','wmode',mode,'movie',name,'FlashVars', fv ); 

	drawTo.innerHTML = str;	
}

function popup (url, name, w, h, scrollBars) {
	window.open(url,name,'scrollbars='+((scrollBars) ? "yes" : "no")+',width='+w+',height='+h);
}
/* Facebook share link */
function fbshare(url) {
	u=url;
	t=document.title;
	window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
	return false;
}
function shareThisPage () {
	fbshare(document.URL);
}
function o (e) {
	return document.getElementById(e);
	
}
function swf(movieName) {
		if (navigator.appName.indexOf("Microsoft") != -1) {
			return window[movieName];
		} else {
			return document[movieName];
		}
}