speed = 5
step = 2
divOpenPercent = 102

function touch(y){ 
 
	if(y == 'a'){ //Open menu
		i=1
		id=document.getElementById('lev-0')
		opnMnu() 
	}
	if(y == 0){ //Close menu
		j=divOpenPercent
		id2=document.getElementById('lev-0')
		clsMnu() 
	}
	if(y > 0){ // Opens sub menu 
		i=1
		id=document.getElementById('lev-'+y)
		opnMnu() 
		j=divOpenPercent
		id2=document.getElementById('lev-0')
		clsMnu() 
	}
	if(y < 0){ // Closes sub menu
		y *= -1 
		j=divOpenPercent
		id2=document.getElementById('lev-'+y)
		clsMnu() 
		i=1
		id=document.getElementById('lev-0')
		opnMnu() 
	}
}

function opnMnu(){
	i += step
	if(i < divOpenPercent-step){
		id.style.height= i +'%'
		timer1=window.setTimeout('opnMnu()',speed)
	}
	else id.style.height= divOpenPercent +'%'
}

function clsMnu(){
	j -= step
	if(j > step){
		id2.style.height= j +'%'
		timer2=window.setTimeout('clsMnu()',speed)
	}
	else id2.style.height = 0
}

function CooKie() {if(navigator.cookieEnabled==true){
document.cookie='res='+screen.width+'|'+screen.height+'; path=/'}}

//document.cookie='res='+window.innerWidth+'|'+window.innerHeight+'; path=/'}}
//document.cookie='x='+screen.width+'; path=/'
//document.cookie='y='+screen.height+'; path=/'}
//document.cookie='x='+window.innerWidth+'; path=/'
//document.cookie='y='+window.innerHeight+'; path=/'}
