var flashContentHeight = 0;
function flashEvent(d,b,c){
	var a="flash_setvariables_"+d;
	if(!$(a)){var e=Builder.node("div",{id:a,className:"access"});
		if($("worldwide-flash-content")){$("worldwide-flash-content").appendChild(e)}
	}
	var f="<embed src='"+RESOURCES_PATH+"swf/worldwide/gateway.swf' FlashVars='lc="+d+"&ev="+escape(b)+","+escape(c)+"' width='0' height='0' type='application/x-shockwave-flash'></embed>";
	$(a).innerHTML="";
	$(a).innerHTML=f;
}

function changeFlashHeight(c, d){
	if(d == null){
		var d = true
	}
	var e = Position.getWindowSize().height;
	var a = e - elementsHeight;
	if($("worldwide-flash-content")){
		if(d){
			if(c >= a){
				$("worldwide-flash-content").setStyle({height:parseInt(c)+"px"});
			} else{
				$("worldwide-flash-content").setStyle({height:parseInt(a)+"px"});
			}
			flashContentHeight = c;
		} else {
			if(c >= flashContentHeight){
				$("worldwide-flash-content").setStyle({height:parseInt(c)+"px"});
			} else{
				$("worldwide-flash-content").setStyle({height:parseInt(flashContentHeight)+"px"});
			}
		}
	}
	try{
		if($("siemens_worldwide")){
			flashEvent("worldwide-flash-content","onScaleEnd");
		}
	}
	catch(b){}
}

var WorldwideFlash = Class.create();
var elementsHeight = 0;
WorldwideFlash.prototype = {
	initialize:function(){
		var b=deconcept.SWFObjectUtil.getPlayerVersion()["major"];
		var a = 0;
		if(b >= 8){
			a = 8
		} else {
			if(b >= 7){a = 7}
		}
		if(a != 0) {
			this.flashVersion = a;
			Event.observe(window,"resize",this.resizeFlash);
			this.initWorldwideFlash();
			this.initLayout();
		}
	}
	,initLayout:function(){
		var a=Position.getWindowSize().height;
		if($("header-zone") && $("toolbar-zone") && $("footer-position-placeholder")) {
			elementsHeight = ($("headervisual-zone").getHeight() + $("toolbar-zone").getHeight() + $("footer-position-placeholder").getHeight());			
			changeFlashHeight(a - elementsHeight,false)
		}
		if($("breadcrumb-zone")){
			$("breadcrumb-zone").hide();
		}
		if($("content-zone")){
			$("content-zone").setStyle({"padding-top":"41px"});
		}
	}
	,resizeFlash:function(){var a=Position.getWindowSize().height;
changeFlashHeight(a-elementsHeight,false)}
,initWorldwideFlash:function(){
	var a=new SWFObject(RESOURCES_PATH+"swf/worldwide/worldwide_v"+this.flashVersion+".swf","siemens_worldwide","100%","100%",this.flashVersion,"#ffffff");
	a.addVariable("xmlPath",RESOURCES_PATH+"worldwide/xml");
	a.addVariable("language",WORLDWIDE_LANG);
	a.addVariable("movieid","worldwide-flash-content");
	a.addVariable("regionXmlPath","../../apps/worldwide/nwa/server.php?lang="+WORLDWIDE_LANG);
	a.addVariable("pdfPath","http://www.siemens.com/about/pool/regions");
	a.addParam("wmode","transparent");
	a.write("worldwide-flash-content")}
}
;
Event.onDOMReady(function(){new WorldwideFlash();
$("content-zone").style.backgroundImage="url()";
$("content-zone").style.height="100%"}
);

