var ie5 = (document.getElementById) ? 1:0
var ns4 = (document.layers) ? 1:0
var ie4 = (document.all) ? 1:0
var ns6 = document.getElementById&&!document.all ? 1:0
var special=0;
var p1_top=80;
var p2_top=80;
var p3_top=80;
var p4_top=80;
var p1_reachdown=0;
var p2_reachdown=0;
var p3_reachdown=0;
var p4_reachdown=0;
var p1_reachup=1;
var p2_reachup=1;
var p3_reachup=1;
var p4_reachup=1;
var active_color='#cceecc';
var inactive_color='';
var over="";
var row;
/*===========================================================*/

function pos (pos0, dif) {
    if (ns6) {
	 posv = pos0+dif;
    }
	else if (ie5) {
	 posv  = dif;
	}
	else if (ns4) {
	posv = dif;
    }
	else if (ie4) {
        posv  = dif;
    } 
document.writeln(posv);    
}


/*===========================================================*/
function p1_move (direction) {
  dir_p1=direction;
  if (dir_p1 == 1) lehuz_p1();
  else if (dir_p1 == 2) {felhuz_p1();}
}

function p1_scroll (akt_top) {
    if (ns6) {
	 xp1 = document.getElementById("xp1").style;
	 xp1.top = akt_top;
    }
	else if (ie5) {
	 xp1.style.top = akt_top + "px";
	}
	else if (ns4) {
	 document.xp1.top=akt_top;
    }
	else if (ie4) {
     xp1.style.pixelTop = akt_top;
    } 
}

function lehuz_p1 () {
  if (dir_p1 == 1 && p1_reachdown == 0){  

	
	if (p1_top<350) {p1_top=p1_top + 15;p1_reachup=0;}
   	if (p1_top>=350) {p1_top=350;p1_reachdown=1;p1_reachup=0;}
   	p1_scroll(p1_top);
	setTimeout("lehuz_p1()",15);
  }		
}

function felhuz_p1 () {
  if (dir_p1 == 2 && p1_reachup == 0){  
    if (p1_top>73) {p1_top=p1_top - 10;p1_reachdown=0;}
    if (p1_top<=73) {p1_top=80;p1_reachup=1;p1_reachdown=0;}
	p1_scroll(p1_top);
	setTimeout("felhuz_p1()",10);
  }
}

/*===========================================================*/

function p2_move (direction) {
  dir_p2=direction;
  if (dir_p2 == 1) lehuz_p2();
  else if (dir_p2 == 2) {felhuz_p2();}
}

function p2_scroll (akt_top) {
    if (ns6) {
	 xp2 = document.getElementById("xp2").style;
	 xp2.top = akt_top;
    }
	else if (ie5) {
	 xp2.style.top = akt_top + "px";
	}
	else if (ns4) {
	 document.xp2.top=akt_top;
    }
	else if (ie4) {
     xp2.style.pixelTop = akt_top;
    } 
}

function lehuz_p2 () {
  if (dir_p2 == 1 && p2_reachdown == 0){  
	if (p2_top<350) {p2_top=p2_top + 15;p2_reachup=0;}
   	if (p2_top>=350) {p2_top=350;p2_reachdown=1;p2_reachup=0;}
   	p2_scroll(p2_top);
	setTimeout("lehuz_p2()",10);
  }		
}

function felhuz_p2 () {
  if (dir_p2 == 2 && p2_reachup == 0){  
    if (p2_top>73) {p2_top=p2_top - 10;p2_reachdown=0;}
    if (p2_top<=73) {p2_top=80;p2_reachup=1;p2_reachdown=0;}
	p2_scroll(p2_top);
	setTimeout("felhuz_p2()",10);
  }
}

/*===========================================================*/

function p3_move (direction) {
  dir_p3=direction;
  if (dir_p3 == 1) lehuz_p3();
  else if (dir_p3 == 2) {felhuz_p3();}
}

function p3_scroll (akt_top) {
    if (ns6) {
	 xp3 = document.getElementById("xp3").style;
	 xp3.top = akt_top;
    }
	else if (ie5) {
	 xp3.style.top = akt_top + "px";
	}
	else if (ns4) {
	 document.xp3.top=akt_top;
    }
	else if (ie4) {
     xp3.style.pixelTop = akt_top;
    } 
}

function lehuz_p3 () {
  if (dir_p3 == 1 && p3_reachdown == 0){  
	if (p3_top<350) {p3_top=p3_top + 15;p3_reachup=0;}
   	if (p3_top>=350) {p3_top=350;p3_reachdown=1;p3_reachup=0;}
   	p3_scroll(p3_top);
	setTimeout("lehuz_p3()",10);
  }		
}

function felhuz_p3 () {
  if (dir_p3 == 2 && p3_reachup == 0){  
    if (p3_top>73) {p3_top=p3_top - 10;p3_reachdown=0;}
    if (p3_top<=73) {p3_top=80;p3_reachup=1;p3_reachdown=0;}
	p3_scroll(p3_top);
	setTimeout("felhuz_p3()",10);
  }
}

/*===========================================================*/

function p4_move (direction) {
  dir_p4=direction;
  if (dir_p4 == 1) lehuz_p4();
  else if (dir_p4 == 2) {felhuz_p4();}
}

function p4_scroll (akt_top) {
    if (ns6) {
	 xp4 = document.getElementById("xp4").style;
	 xp4.top = akt_top;
    }
	else if (ie5) {
	 xp4.style.top = akt_top + "px";
	}
	else if (ns4) {
	 document.xp4.top=akt_top;
    }
	else if (ie4) {
     xp4.style.pixelTop = akt_top;
    } 
}

function lehuz_p4 () {
  if (dir_p4 == 1 && p4_reachdown == 0){  
	if (p4_top<350) {p4_top=p4_top + 15;p4_reachup=0;}
   	if (p4_top>=350) {p4_top=350;p4_reachdown=1;p4_reachup=0;}
   	p4_scroll(p4_top);
	setTimeout("lehuz_p4()",10);
  }		
}

function felhuz_p4 () {
  if (dir_p4 == 2 && p4_reachup == 0){  
    if (p4_top>73) {p4_top=p4_top - 10;p4_reachdown=0;}
    if (p4_top<=73) {p4_top=80;p4_reachup=1;p4_reachdown=0;}
	p4_scroll(p4_top);
	setTimeout("felhuz_p4()",10);
  }
}

function felhuz_all () {

  p1_move('2');
  p2_move('2');
  p3_move('2');
  p4_move('2');
document.getElementById('top').style.top=0;
document.getElementById('top').style.left=0;
document.getElementById('bot').style.top=350;
   
document.getElementById('p1').style.top=80; 
   
document.getElementById('p2').style.left=250;
document.getElementById('p2').style.top=80;
document.getElementById('EMc').style.left=440; 
document.getElementById('EMc').style.top=80;
document.getElementById('Haj').style.left=440; 
document.getElementById('Haj').style.top=100; 
document.getElementById('xPS').style.left=420; 
document.getElementById('xPS').style.top=118;
document.getElementById('dWZ').style.left=480; 
document.getElementById('dWZ').style.top=136; 
document.getElementById('Uts').style.left=250;    
document.getElementById('Uts').style.top=160;     
   
document.getElementById('p3').style.left=500; 
document.getElementById('EUsat').style.left=650; 
document.getElementById('SinOp').style.left=625; 
document.getElementById('Radar').style.left=650; 
document.getElementById('Earth').style.left=650;
document.getElementById('Hun').style.left=720; 
document.getElementById('Boci').style.left=500; 

}


function letol_all () {
 	document.getElementById('top').style.top=-60;
  	document.getElementById('top').style.left=360;
document.getElementById('bot').style.top=800; 
document.getElementById('xp1').style.top=800; 
document.getElementById('xp2').style.top=800;
document.getElementById('xp3').style.top=800;
document.getElementById('xp4').style.top=800;

document.getElementById('p1').style.top=330; 

document.getElementById('p2').style.left=0;
document.getElementById('p2').style.top=0;
document.getElementById('EMc').style.left=190; 
document.getElementById('EMc').style.top=0;
document.getElementById('Haj').style.left=190; 
document.getElementById('Haj').style.top=20; 
document.getElementById('xPS').style.left=170; 
document.getElementById('xPS').style.top=38;
document.getElementById('dWZ').style.left=230; 
document.getElementById('dWZ').style.top=56; 
document.getElementById('Uts').style.left=0;    
document.getElementById('Uts').style.top=600;     

document.getElementById('p3').style.left=0; 
document.getElementById('EUsat').style.left=150; 
document.getElementById('SinOp').style.left=125; 
document.getElementById('Radar').style.left=150; 
document.getElementById('Earth').style.left=150; 
document.getElementById('Hun').style.left=220; 
document.getElementById('Boci').style.left=0; 

}
