var NS  = (document.layers) ? 1 : 0;
var IE  = (document.all) ? 1 : 0;
var DOM = (document.getElementById) ? 1 : 0;

var pX = 0
var pY = 0
var phasen = 10
var counter = 0
var props = 0

function getObj(name) {
	if (DOM && document.getElementById(eval("'"+name+"'"))) {
 		return document.getElementById(name).style;
 	} else if (IE && document.all[name]) {
 		return document.all[name].style;
 	} else if (NS) {
		 return document.layers[name];
 	} else {
		 return 0;
 	}
}

function getPurObj(name) {
	if (DOM && document.getElementById(eval("'"+name+"'"))) {
 		return document.getElementById(name);
 	} else if (IE && document.all[name]) {
 		return document.all[name];
 	} else if (NS) {
		 return document.layers[name].document;
 	} else {
		 return 0;
 	}
}

function animate(aX,aY){
	if(location.href.indexOf("=")!=-1){
		props = location.href.substring(location.href.indexOf("=")+1)
		popUp(props)
	}
	pX = aX
	pY = aY
	setTimeout("doAni()",500);
}

function doAni(){
	counter++
	this.element = getObj("corquer");
	this.element.left = (pX/phasen)*counter;
	this.element = getObj("corhoch");
	this.element.top = (pY/phasen)*counter;
	if (counter < phasen){restartDoAni();}
}

function popUp(what){
	if (what <= 3){
		for (i=0;i<=3;i++){
			this.element = getObj("menu_" + i);
			this.element.left = -200;
		}
		this.element = getObj("menu_" + what);
		
		this.element.left = 30;
	}
	
	if (props==2){
		if (what==1){
			this.element = getObj("corhoch");
			this.element.top = pY+120
		}else{
			this.element = getObj("corhoch");
			this.element.top = pY
		}
	}
	
	if (props==3){
		if (what==1){
			this.element = getObj("corhoch");
			this.element.top = pY+120
		}else if (what==2){
			this.element = getObj("corhoch");
			this.element.top = pY+60
		}else{
			this.element = getObj("corhoch");
			this.element.top = pY
		}
	}
	if (props>3){
		if (what==1){
			this.element = getObj("corhoch");
			this.element.top = pY+120
		}else if (what==2){
			this.element = getObj("corhoch");
			this.element.top = pY+60
		}else if (what==3){
			this.element = getObj("corhoch");
			this.element.top = pY+60
		}else{
			this.element = getObj("corhoch");
			this.element.top = pY
		}
	}
}

function restartDoAni(){setTimeout("doAni()",25);}