//functions being invoked by the SWF
function expand(){
	if (window.navigator.userAgent.indexOf("MSIE ") > -1){
		document.getElementById("rightContainer").getElementsByTagName("object")[0].style.width = "996px";
	}else{
		document.getElementById("rightContainer").getElementsByTagName("embed")[0].style.width = "996px";
	}
	document.getElementById("rightContainer").style.width = "996px";
	document.getElementById("rightContainer").style.left = "-20px";
	document.getElementById("rightContainer").style.zIndex = "80";
}
function collapse(){
	if (window.navigator.userAgent.indexOf("MSIE ") > -1){
		document.getElementById("rightContainer").getElementsByTagName("object")[0].style.width = "180px";
	}else{
		document.getElementById("rightContainer").getElementsByTagName("embed")[0].style.width = "180px";
	}
	document.getElementById("rightContainer").style.width = "182px";
	document.getElementById("rightContainer").style.left = "794px";
	document.getElementById("rightContainer").style.zIndex = "80";
}

function movestack(evt){
	if (window.navigator.userAgent.indexOf("MSIE ") > -1){
		if(document.documentElement.scrollTop > 130){
			document.getElementById("rightContainer").style.top=(document.documentElement.scrollTop)+"px";
		} else {
			document.getElementById("rightContainer").style.top="130px";
		}
	} else {
		if(window.pageYOffset > 130){
			document.getElementById("rightContainer").style.top=(window.pageYOffset)+"px";
		} else {
			document.getElementById("rightContainer").style.top="130px";
		}
	}
}

// Google Analytics Tracking

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

try {
	var pageTracker = _gat._getTracker("UA-9498490-1");
	pageTracker._trackPageview();
} catch(err) {
}

// CSS Drop Down

function setmenu(source, target){
	document.getElementById(target).innerHTML = document.getElementById(source).options[document.getElementById(source).options.selectedIndex].innerHTML;
}


// Headline Font adjustment

function adjusthead(){
var currentloc = window.location.toString();

	if (document.location.href.indexOf("/en/")>-1){
		var lang = "en";
	} else if (document.location.href.indexOf("/de/")>-1){
		var lang = "de";
		
	} else if (document.location.href.indexOf("/fr/")>-1){
		var lang = "fr";
	} else if (document.location.href.indexOf("/es/")>-1){
		var lang = "es";
	} else if (document.location.href.indexOf("/pt/")>-1){
		var lang = "pt";
	} else if (document.location.href.indexOf("/cn/")>-1){
		var lang = "cn";
		
	} else if (document.location.href.indexOf("/ko/")>-1){
		var lang = "ko";
	} else if (document.location.href.indexOf("/ja/")>-1){
		var lang = "ja";
	} else if (document.location.href.indexOf("/hk/")>-1){
		var lang = "hk";
	}
if(currentloc.indexOf("language=") != -1){
var currentlanguage = currentloc.substring(currentloc.indexOf("language") + 9 ,currentloc.indexOf("language") + 11);
var lang=currentlanguage ;
}
     



    var text = document.getElementsByTagName("h1")[0].firstChild.data;
    var height = document.getElementsByTagName("h1")[0].offsetHeight;
    var width = document.getElementsByTagName("h1")[0].offsetWidth;
    
	var adjustHeight = 0;
	var adjustWidth = 0;
	
	//---BEGIN FONT FIX
	
	//if(height > 90){
	//	adjustHeight = 59;
	//}
	//else if(height >= 70){
	//	adjustHeight = 47;
	//}
	//else if(height > 60){
	//	adjustHeight = 50;
	//}
	//else{
	//	adjustHeight = height;
	//}
	//if(height>110){
	//	adjustHeight = height;
	//}
	
	adjustHeight = height*0.90;
	
	if(width == 585){
		adjustWidth = 500;
	}
	else{
		adjustWidth = width;		
	}
	
	
	var style="float:none;background:none;";
	//---END FONT FIX
	text = encodeURIComponent(text);
	text = text.split("'").join("&lsquo;");

    var flashURL = "/assets/swf/font.swf?txtC="+text;

    var flashURL = "/assets/swf/font.swf?txtC="+text+"&language="+lang;


    // var H1ObjStr = "<object class='ctaLayer' type='application/x-shockwave-flash' data='"+flashURL+"' width='"+adjustWidth+"' id='pageTitleFont' height='"+adjustHeight+"'>"

    // var H1ObjStr = "<object type='application/x-shockwave-flash' data='"+flashURL+"' width='"+width+"' id='pageTitleFont' height='"+adjustHeight+"'>"


    // var H1ObjStr = "<object type='application/x-shockwave-flash' data='"+flashURL+"' width='"+width+"' id='pageTitleFont' height='"+adjustHeight+"'>"

    var H1ObjStr = "<object type='application/x-shockwave-flash' data='"+flashURL+"' style='"+style+"' width='"+width+"' id='pageTitleFont' height='"+adjustHeight+"'>"


        + "<param name='allowScriptAccess' value='sameDomain' />"
        + "<param name='movie' value='"+flashURL+"' />"
        + "<param name='quality' value='high' />"
        + "<param name='valign' value='top' />"
        + "<param name='wmode' value='transparent' />"
        + "</object>";   
    document.write(H1ObjStr);
    document.getElementsByTagName("h1")[0].style.visibility = "hidden";
    document.getElementsByTagName("h1")[0].style.position = "absolute";
    document.getElementsByTagName("h1")[0].style.top="165px";
	document.getElementsByTagName("h1")[0].style.width="390px";
	if(height > 110){
		document.getElementsByTagName("h1")[0].style.width="375px";	
	}
	else if(height > 90){
		document.getElementsByTagName("h1")[0].style.width="325px";	
	}

}

// small headline exchange
function adjustsmallhead(path){
	if (document.location.href.indexOf("/en/")>-1){
		var lang = "en";
	} else if (document.location.href.indexOf("/de/")>-1){
		var lang = "de";
	} else if (document.location.href.indexOf("/fr/")>-1){
		var lang = "fr";
	} else if (document.location.href.indexOf("/es/")>-1){
		var lang = "es";
	} else if (document.location.href.indexOf("/pt/")>-1){
		var lang = "pt";
	} else if (document.location.href.indexOf("/cn/")>-1){
		var lang = "cn";
	} else if (document.location.href.indexOf("/ko/")>-1){
		var lang = "ko";
	} else if (document.location.href.indexOf("/ja/")>-1){
		var lang = "ja";
	} else if (document.location.href.indexOf("/hk/")>-1){
		var lang = "hk";
	}
    var text = document.getElementsByTagName("h1")[0].firstChild.data;
    var height = document.getElementsByTagName("h1")[0].offsetHeight;
    var width = document.getElementsByTagName("h1")[0].offsetWidth;
    
	var adjustHeight = 0;
	var adjustWidth = 0;
	
	adjustHeight = height*0.90;
	
	if(width == 585){
		adjustWidth = 500;
	}else{
		adjustWidth = width;		
	}
	
	
	var style="float:none;background:none;";
	if(!path){
		path="/assets/swf/";
	}
	text = encodeURIComponent(text);
	text = text.split("'").join("&lsquo;");
	
    var flashURL = path+"font_small.swf?txtC="+text+"&language="+lang;
	var H1ObjStr = "<object type='application/x-shockwave-flash' data='"+flashURL+"' style='"+style+"' width='"+width+"' id='pageTitleFont' height='"+adjustHeight+"'>"
        + "<param name='allowScriptAccess' value='sameDomain' />"
        + "<param name='movie' value='"+flashURL+"' />"
        + "<param name='quality' value='high' />"
        + "<param name='valign' value='top' />"
        + "<param name='wmode' value='transparent' />"
        + "</object>";   
    document.write(H1ObjStr);
    document.getElementsByTagName("h1")[0].style.visibility = "hidden";
    document.getElementsByTagName("h1")[0].style.position = "absolute";
    document.getElementsByTagName("h1")[0].style.top="165px";
	document.getElementsByTagName("h1")[0].style.width="390px";
	if(height > 110){
		document.getElementsByTagName("h1")[0].style.width="375px";	
	}
	else if(height > 90){
		document.getElementsByTagName("h1")[0].style.width="325px";	
	}
}


