// JavaScript Document
function addSome() {
	
	document.location.href="http://jae.org.ua/add/";
	/*
    addNewVc = document.getElementById("ShowAdd");

	if (addNewVc.style.display=='inline') { k=false; i=1; gopacity("ShowAdd"); }
	else { addNewVc.style.display='inline'; k=true; i=0.01; gopacity("ShowAdd"); }
	
	
	addMenu=document.getElementById("add");
    var x0 = 0, y0 = 0;
    do {
	        x0 += addMenu.offsetLeft;
	        y0  += addMenu.offsetTop;
			} while (addMenu = addMenu.offsetParent);
	y0=y0+25;
	x0=x0-54;

	addNewVc.style.left=x0+"px";
	addNewVc.style.top=y0+"px";
	*/
}

function bodyClick() {
	aSon=document.getElementById("bl_1");
	bSon=document.getElementById("bl_2");
	aParent=document.getElementById("language_1");
	bParent=document.getElementById("language_2");

    var x0 = 0, y0 = 0;
	var x1 = 0, y1 = 0;
	do {
	        x0 += aParent.offsetLeft;
	        y0  += aParent.offsetTop;
			} while (aParent = aParent.offsetParent);
	y0=y0+30;
	
	aSon.style.left=x0+"px";
	aSon.style.top=y0+"px";	
	
	do {
	        x1 += bParent.offsetLeft;
	        y1  += bParent.offsetTop;
			} while (bParent = bParent.offsetParent);
	y1=y1+27;

	bSon.style.left=x1+"px";
	bSon.style.top=y1+"px";	
}

function goClip(id, background) {
idTimeout=id;
bgTimeout=background;
a=document.getElementById(id);

height=a.offsetHeight;
BGheight=height+30;

if (a.style.display=="") { 
	j=j+(height/20);
	bgSize=bgSize+BGheight/20;
	bgHeight=bgSize; 
	layerHeight=j; 
	imitationZero=false;
} else { 
	if (j==0 && imitationZero==false) { j=layerHeight; bgSize=bgHeight; }
	j=j-(height/20); 
	bgSize=bgSize-BGheight/20;
	
	if (bgSize<=0) { bgSize=0; j=0; imitationZero=true; }
}

bodyClick();
a.style.clip="rect(auto, auto, " + j + "px, auto)";
document.getElementById(background).style.height=bgSize+"px";


	timeout=setTimeout("goClip(idTimeout, bgTimeout)",3); 
	if (j>=height || j<=0) {
		clearTimeout(timeout);
		if (j<=0) a.style.display="none";
		if (j>=height) a.style.display="";
	}
	
}


function HeightWeigth(parent, son, background) {
	HighMenu=document.getElementById(parent);
	LowMenu=document.getElementById(son);
    var x0 = 0, y0 = 0;
    do {
	        x0 += HighMenu.offsetLeft;
	        y0  += HighMenu.offsetTop;
			} while (HighMenu = HighMenu.offsetParent);
	if (parent=="language_2") y0=y0+27; else y0=y0+30;
	
	if (LowMenu.style.display=="") LowMenu.style.display="block";
	else LowMenu.style.display="";

	LowMenu.style.left=x0+"px";
	LowMenu.style.top=y0+"px";	

	goClip(son, background);
}

function gopacity(id) {
	idTimeout=id;
    invisibleMenu = document.getElementById(id);
		if (k==true) i=i+0.05; else { i=i-0.05;}
		invisibleMenu.style.filter="alpha(opacity="+ i*100 +")";	
		invisibleMenu.style.opacity = i;
	timeout=setTimeout("gopacity(idTimeout)",30); 
	
	if (i>1 || i<0) { 
		clearTimeout(timeout); 
		if (k==false) invisibleMenu.style.display='none';
		} 

}


function addSome2() {
    cityMenu = document.getElementById("Showcity");
	if (cityMenu.style.display=='inline') { k=false; i=1; gopacity("Showcity"); }
	else { cityMenu.style.display='inline'; k=true; i=0.01; gopacity("Showcity"); }

	addMenu=document.getElementById("city");
    var x0 = 0, y0 = 0;
    do {
	        x0 += addMenu.offsetLeft;
	        y0  += addMenu.offsetTop;
			} while (addMenu = addMenu.offsetParent);
	y0=y0+25;
	x0=x0-98;

	cityMenu.style.left=x0+"px";
	cityMenu.style.top=y0+"px";
}

function addSome3() {
    cityMenu = document.getElementById("ShowTeachingabroad");
	if (cityMenu.style.display=='inline') { k=false; i=1; gopacity("ShowTeachingabroad"); }
	else { cityMenu.style.display='inline'; k=true; i=0.01; gopacity("ShowTeachingabroad"); }

	addMenu=document.getElementById("teachingabroad");
    var x0 = 0, y0 = 0;
    do {
	        x0 += addMenu.offsetLeft;
	        y0  += addMenu.offsetTop;
			} while (addMenu = addMenu.offsetParent);
	y0=y0+23;
	x0=x0-173;

	cityMenu.style.left=x0+"px";
	cityMenu.style.top=y0+"px";
}