var t='';

function indul() {
		
	lenyito=document.getElementById('termekek');
	//ternyi=document.getElementById('termekle');
	//alert(lenyito.firstChild.nodeName);
	//lenyito.firstChild.onmouseover=resettimer;
	fomenu1=document.getElementById('fomenu');
	
	for (i=0;i<10;i++) {
		aktlink='menu'+i;
		thelink=document.getElementById(aktlink);
		thelink.onmouseover=over;
	}
	
	for (i=1;i<7;i++) {
		aktlink_alemnu='almenu'+i;
		almenu=document.getElementById(aktlink_alemnu);
		almenu.onmouseover=over;
	}
	
	lenyito.onmouseover=over;
	//ternyi.onmouseover=over;
	
	if(document.getElementById('csab')) {
			document.getElementById('csab').style.visibility="hidden";
		}
	
}

function over(e) {
	if (t) resettimer();
	if (!e) var e=window.event;
	thislink = (e.target) ? e.target: e.srcElement;

	
	if (thislink.id.substring(0,4)=='menu') {
		for (i=1;i<7;i++) {
			document.getElementById('almenu'+i).style.display="none";
	}
		
		var szam=thislink.id.substring(4);
		lenyit(document.getElementById('almenu'+szam));
	}

   // if (thislink.id=='termekek') lenyit(fomenu1);
	//if (thislink.id=='termekle') lenyit(fomenu1);
}


function lenyit(id) {
	if (t) resettimer();
	id.style.display="block";
}
function overthe() {
	resettimer();
	document.getElementById('fomenu').style.display="block";
	document.getElementById('termekek').style.backgroundColor='#990000';
}

/*function csuk() {
	for (i=1;i<7;i++) {
		document.getElementById('almenu'+i).style.display="none";
	}
	//id.style.display="none";

}*/

function resettimer() {
	window.clearTimeout(t);
}

/*function out(e) {
	if (!e) var e=window.event;
	outlink = (e.target) ? e.target: e.srcElement;
	//setTimeout("csuk('szia');",2000);
	//alert(outlink.className);
	//if (outlink.className!="") {
	var z=outlink.id;
	if (z.substring(0,4)=='fome') return false;
	else if (z.substring(0,4)=='menu') return false;
	else if (z.substring(0,4)=='alme') return false;
	else if (z.substring(0,4)=='alal') return false;
	else if (z!='') return false;
	//alert('torlok');
	//else if (outlink.className=='fomenutart') return false;
		//if (!checkclose(outlink.id,outlink.className)) {
			t=window.setTimeout("csuk(document.getElementById('fomenu'));",500);
		//}
	//}
}



function checkclose(atribut,atribut2) {
	if (atribut2=='fomenutart' || atribut.substring(0,4)=='fome' || atribut.substring(0,4)=='menu' || atribut.substring(0,4)=='alme' || atribut.substring(0,4)=='alal') return true;
	else return false;
	/*if (atribut.substring(0,4)=='fome') alert('fome')
		if (atribut.substring(0,4)=='menu') alert('menu')
			if (atribut.substring(0,4)=='alme') alert('alme')
				if (atribut.substring(0,4)=='alal') alert('alal');// return true;


}*/




function le() {
	for (i=1;i<7;i++) {
		document.getElementById('almenu'+i).style.display="none";
	}
	t=window.setTimeout("document.getElementById('fomenu').style.display='none';",500);
}


function menu(id) {
	if (id==1 || id==3) document.getElementById('fomenu').style.display="none";
	//if (id==2) overthe(); 
	menupont = new Array ('bemutatkozas','ujdonsagok','termekek','partnerek','referencia','letoltes','email','fooldal');
	document.getElementById(menupont[id]).style.backgroundColor='#990000';
}
function torol(ell) {
	if (ell==1) {document.getElementById('kereso').value=''; }
	if (ell==2) {
		if (document.getElementById('kereso').value=='') {
			document.getElementById('kereso').value=" keres...";
		}
	}
}
function mezo(param,color) {
	document.getElementById(param).style.backgroundColor=color;
}

function megtekint(id) {
 url="megtekint.php?termekosztaly="+id;
 window.open(url,"user"+id,"width=1000,height=450,top=28,left=8,scrollbars=1,resizable=1");
}
function fajlfel() {
 url="fajlfeltolt.php";
 window.open(url,"user","width=1000,height=450,top=28,left=8,scrollbars=1,resizable=1");
}
function showpic(id,x,y) {
 url="kep.php?kepid="+id;
 window.open(url,"kep"+id,"width="+x+",height="+y+",top=228,left=408,scrollbars=0,resizable=1");

}