function correctPositions(){
	var bottom_bar=document.getElementById("bottom_bar");
	var bottom_margin=document.getElementById("bottom_margin");
	//bottom_bar.style.left=(getDocumentWidth()/2)-(960/2);
	//bottom_margin.style.left=(getDocumentWidth()/2)-(960/2);
	correctSubPosition();
	//if(navigator.userAgent.indexOf('Mac') != -1){
	//	macPositionCorrector();
	//}
	var overflowFrame = document.getElementById("overflowFrame");
	overflowFrame.style.left=((getDocumentWidth()-960)/2+80)+"px";
	overflowFrame.style.top="70px";
	if(this.show_submenu.length>0){
		var submenu = document.getElementById("first_"+this.show_submenu).parentNode;
		submenu.style.display="block";
	}
	iniscroll();
}


function macPositionCorrector(){
	var page=document.getElementById("page");
	var middle=document.getElementById("middle");
	var bottom_bar=document.getElementById("bottom_bar");
	var bottom_margin=document.getElementById("bottom_margin");
	
	page.style.height=710;
	middle.style.height=442;
	//bottom_bar.style.top=625;
	//bottom_margin.style.top=660;
}

	this.test = function(){
		var testTxt = document.getElementById("testTxt");
		var tmpStr="";
		var isMac = false;
		if(navigator.userAgent.indexOf('Mac') != -1){
			isMac=true;
		}
		tmpStr +="<br>";
		tmpStr +="JS: Mac detected = <font color='#FF0000'>"+isMac+"</font> // <font color='#0000FF'>"+navigator.userAgent+"</font><br>";
		testTxt.innerHTML +=tmpStr;
	}

	
function insertHomeFlash(forceFrm){
	// flash initialisation
	var swfVersionStr = "8";
	var xiSwfUrlStr = "";
	var flashvars = {};
	var params = {};
	params.quality = "high";
	params.bgcolor = "#ffffff";
	params.play = "true";
	params.loop = "true";
	//params.wmode = "opaque";
	
	params.wmode = "window";	
	params.scale = "showall";
	params.menu = "true";
	params.devicefont = "false";
	params.salign = "";
	params.allowscriptaccess = "sameDomain";
	
	if(forceFrm){
		flashvars.forcedFrame="2";
	}else{
		flashvars.forcedFrame="0";
	}
	
	var attributes = {};
	attributes.id = "home";
	attributes.name = "home";
	attributes.align = "middle";
	swfobject.embedSWF(
		"home.swf", "flashContent",
		"960", "417",
		swfVersionStr, xiSwfUrlStr,
		flashvars, params, attributes);
	// ! flash initialisation
}

function getDocumentWidth() {
  var myWidth = 0;myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
	//Non-IE
	myWidth = window.innerWidth;
	myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	//IE 6+ in 'standards compliant mode'
	myWidth = document.documentElement.clientWidth;
	myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	//IE 4 compatible
	myWidth = document.body.clientWidth;
	myHeight = document.body.clientHeight;
  }
  return myWidth;
}

window.onresize = correctPositions; 
	
