function getBwidth(){if(document.all){return document.body.offsetWidth;}else if(document.layers){return window.innerWidth;}}

function alignAll(inside){
	bWidth  = getBwidth();
	if(bWidth<=760) {
		if (document.all){
			Layer2.style.left = 190;
			Layer3.style.left = 229;
			Layer16.style.left = 268;
			Layer4.style.left = 307;
			Layer5.style.left = 346;
			Layer17.style.left = 385;
			Layer18.style.left = 424;
			
			if (inside==0){
				Layer20.style.left = 100;
				Layer21.style.left = 100;
				Layer23.style.left = (bEnglish == 1? 90 : 70);
				Layer24.style.left = (bEnglish == 1? 50 : 75);
				Layer26.style.left = (bEnglish == 1? 120 : 158);
				Layer25.style.left = (bEnglish == 1? 90 : 105);
				
				Layer20.style.top = 127;
				Layer21.style.left = 100;				
				Layer23.style.top = 185;
				Layer24.style.top = 205;
				Layer26.style.top = 224;
				Layer25.style.top = (bEnglish == 1? 260 : 240);
			}
		}
		else if (document.layers) {
			document.Layer2.left = 190;
			document.Layer3.left = 229;
			document.Layer16.left = 268;
			document.Layer4.left = 307;
			document.Layer5.left = 346;
			document.Layer17.left = 385;
			document.Layer18.left = 424;
			
			if (inside==0) {
				document.Layer20.left = 100;
				document.Layer23.left = (bEnglish == 1? 90 : 70);
				document.Layer24.left = (bEnglish == 1? 50 : 75);
				document.Layer26.left = (bEnglish == 1? 120 : 158);
				document.Layer25.left = (bEnglish == 1? 90 : 105);
				
				document.Layer20.top = 127;
				document.Layer23.top = 185;
				document.Layer24.top = 205;
				document.Layer26.top = 224;
				document.Layer25.top = (bEnglish == 1? 260 : 240);
			}
		}
	}
	else {
		bCenter = bWidth/2;
		if (document.all){
			Layer2.style.left = bCenter - 199;
			Layer3.style.left = bCenter - 160;
			Layer16.style.left = bCenter - 121;
			Layer4.style.left = bCenter - 82;
			Layer5.style.left = bCenter - 43;
			Layer17.style.left = bCenter - 4;
			Layer18.style.left = bCenter + 35;
			
			if (inside==0){

				Layer20.style.left = bCenter - 285;
				Layer21.style.left = bCenter - 275;				
				Layer23.style.left = bCenter - (bEnglish == 1? 297 : 317);
				Layer24.style.left = bCenter - (bEnglish == 1? 332 : 307);
				Layer26.style.left = bCenter - (bEnglish == 1? 268 : 230);
				Layer25.style.left = bCenter - (bEnglish == 1? 295 : 280);
				
				Layer20.style.top = 127;
				Layer21.style.top = 147;			
				Layer23.style.top = 185;
				Layer24.style.top = 205;
				Layer26.style.top = 224;
				Layer25.style.top = (bEnglish == 1? 260 : 240);
			}
		}
		else if (document.layers) {
			document.Layer2.left = bCenter - 199;
			document.Layer3.left = bCenter - 160;
			document.Layer16.left = bCenter - 121;
			document.Layer4.left = bCenter - 82;
			document.Layer5.left = bCenter - 43;
			document.Layer17.left = bCenter - 4;
			document.Layer18.left = bCenter + 35;
			
			if (inside==0) {
				document.Layer20.left = bCenter - 285;
				document.Layer21.left = bCenter - 275;				
				document.Layer23.left = bCenter - (bEnglish == 1? 297 : 317);
				document.Layer24.left = bCenter - (bEnglish == 1? 340 : 307);
				document.Layer26.left = bCenter - (bEnglish == 1? 260 : 230);
				document.Layer25.left = bCenter - (bEnglish == 1? 295 : 280);
				
				document.Layer20.top = 128;
				document.Layer21.top = 148;				
				document.Layer23.top = 186;
				document.Layer24.top = 206;
				document.Layer26.top = 223;
				document.Layer25.top = (bEnglish == 1? 260 : 240);
			}
		}
	}
}

function mik(e) {
	if (document.layers){checkMouseNS(e);}
	if (mouseOverLayer==false || isInFade == true) return;
	clearTheTimeOut()
	j = checkVisible();
	if (typeof(j) == "undefined"){return;}
	var minX, maxX, minY, maxY;
	var clX, clY;
	if (document.all){
		minX = parseInt(allDIVs[j].style.left);
		minY = parseInt(allDIVs[j].style.top);
		maxX = parseInt(allDIVs[j].style.left) + parseInt(allDIVs[j].offsetWidth);
		maxY = parseInt(allDIVs[j].style.top) + parseInt(allDIVs[j].offsetHeight);
		clX  = window.event.clientX;
		clY  = window.event.clientY+document.body.scrollTop
	}
	else if (document.layers){
		minX = allDIVs[j].left;
		minY = allDIVs[j].top;
		maxX = allDIVs[j].clip.right + minX;
		maxY = allDIVs[j].clip.bottom + minY;
		clX  = e.pageX;
		clY  = e.pageY
	}
	if (clX<minX || clX>maxX || clY<minY-29 || clY>maxY) {
		if (document.all){
			myOpacity = 100;
			allDIVs[j].style.filter = "alpha(opacity=100)";
			isInFade = true;
			timerID1 = window.setInterval('doFadeOut()',60);
		}
		else if (document.layers){
			allDIVs[j].visibility = "hide";
			mouseOverLayer = false;
		}
	}
}

function checkVisible() {
	if (document.all) {
		allDIVs = document.all.tags("DIV");
		allDIVsLength = allDIVs.length;
		for (i=0; i<allDIVsLength; i++){
			if (allDIVs[i].style.visibility == "visible")
			return i;
		}
	}
	else if (document.layers){
		allDIVs = document.layers;
		allDIVsLength = allDIVs.length;
		for (i=0; i<allDIVsLength; i++){
			if (allDIVs[i].visibility != "hide")
			return i;
		}
	}
}

function doFadeOut(){
	myOpacity = myOpacity - 25
	allDIVs[j].style.filter = "alpha(opacity="+myOpacity+")";
	if (myOpacity <= 0) {
		window.clearInterval(timerID1);
		allDIVs[j].style.visibility = "hidden"
		allDIVs[j].style.filter = "alpha(opacity=100)"
		mouseOverLayer = false
		isInFade = false;
	}
}

function checkMouseNS(e) {
	j = checkVisible();
	if (typeof(j) == "undefined"){return;}
	var minX = allDIVs[j].left;
	var minY = allDIVs[j].top;
	var maxX = allDIVs[j].clip.right + minX;
	var maxY = allDIVs[j].clip.bottom + minY;
	var clX  = e.pageX;
	var clY  = e.pageY;
	if (clX>minX && clX<maxX && clY>minY && clY<maxY)
	mouseOverLayer=true;
}

function setTim(i) {
//var i;
var no1;
if(i!=1) {
no1=i-1;
         }
else  {
no1=7
      }
if (no1==1) {
window.document.one.src="Images/button.gif";
          }
if (no1==2) {
window.document.two.src="Images/button.gif";
          }
if (no1==3) {
window.document.three.src="Images/button.gif";
          }
if (no1==4) {
window.document.four.src="Images/button.gif";
          }
if (no1==5) {
window.document.five.src="Images/button.gif";
          }
if (no1==6) {
window.document.six.src="Images/button.gif";
          }
if (no1==7) {
window.document.seven.src="Images/button.gif";
          }
if (i==1) {
window.document.one.src="Images/logoanimation.gif";
setTimeout("setTim(2)",1000)
          }
if (i==2) {
window.document.two.src="Images/ani/logoanimation.gif";
setTimeout("setTim(3)",1000)
          }
if (i==3) {
window.document.three.src="Images/ani/logoanimation.gif";
setTimeout("setTim(4)",1000)
          }
if (i==4) {
window.document.four.src="Images/ani/logoanimation.gif";
setTimeout("setTim(5)",1000)
          }
if (i==5) {
window.document.five.src="Images/ani/logoanimation.gif";
setTimeout("setTim(6)",1000)
          }
if (i==6) {
window.document.six.src="Images/ani/logoanimation.gif";
setTimeout("setTim(7)",1000)
          }
if (i==7) {
window.document.seven.src="Images/ani/logoanimation.gif";
setTimeout("setTim(1)",1000)
          }
}

function initall(mod,inside) {
	if (mod==1) 
		alignAll(inside);
// 31/10/2001 - Three lines commented
//	else 
//		if(document.layers)
//			location.reload();
	if (typeof(myHilightImage) != "undefined") document[myHilightImage].src = 'Images/bcon.gif'; 
// 31/10/2001 - Condition changed
//	if (inside == 0 && mod != 2) setTim(1);
	setTim(1)
}

function MM_openBrWindow(theURL,winName,features) {
	window.open(theURL,winName,features);
}

function goSpecialMenu1(myForm, myName){
var x = myForm[myName].selectedIndex;
myForm[myName].selectedIndex = 0;
var myPage = myForm[myName][x].value;
if (myPage!='')
parent.location.href = myPage;
}
