var ns4=document.layers?1:0
var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1
var ns6=document.getElementById&&!document.all?1:0
var speed = 1					// aeg millisekundites kui kiiresti menüüd avatakse, sammude vahe ms
var open_close_step = 5       // kui mitu pixlit menüüd iga sammuga avatakse
var menu_heights = new Array('60','60');
var menu_height = 10          // kui mitu pixlit menüüd iga sammuga avatakse
var algus; 
var themenu;

function regenerate(){
	//return true;
	window.location.reload()
}

function pullDraw(el_id) {
      themenu = document.getElementById(el_id);
      menu_height = 21 * slidemenus[el_id];
      menu_height += 5;
      if (themenu.style.height=='1px') {
     	 pull(el_id);
      }
      else {
    	 draw(el_id);
      }
}

function pull(el_id){	
	themenu = document.getElementById(el_id)
	if (window.drawit)
		clearInterval(drawit)
	pullit=setInterval("pullengine()",speed)
}

function draw(el_id){
	themenu = document.getElementById(el_id)
	clearInterval(pullit)		  	
	drawit=setInterval("drawengine()",speed)
}

function pullengine(){
	if (parseInt(themenu.style.height)<menu_height) {
		themenu.style.height=parseInt(themenu.style.height)+open_close_step
	}
	else if (window.pullit){
		clearInterval(pullit)
	}
}

function drawengine(){
	if (parseInt(themenu.style.height)>1) {
		themenu.style.height=parseInt(themenu.style.height)-open_close_step
	}
	else if (window.drawit){
		clearInterval(drawit)
	}
}