function googlesearch(query)
{
window.open('http://www.google.com/search?q='+query+'','_blank','left=30,top=30,width=800,height=650,toolbar=1,scrollbars=1,location=1,resizable=1,menubar=1');
}

function searcher(hol,mit)
{
	//alert(hol);
	if (hol=='google')
	{
	   //document.forms.searchform.action="http://www.google.co.hu";
	   //document.forms.searchform.target="_blank";
	   //document.forms.searchform.task="";
	   window.open('http://www.google.com/search?q='+mit+'','_blank','left=30,top=30,width=800,height=650,toolbar=1,scrollbars=1,location=1,resizable=1,menubar=1');
	   //self.location="index.php";
	}
	else
		if (hol=='ehok')
		{
		//alert(mit);
		window.location="index.php?task=lib/search.php&q="+mit;}

//window.open('http://www.google.com/search?q='+query+'','_blank','left=30,top=30,width=800,height=650,toolbar=1,scrollbars=1,location=1,resizable=1,menubar=1');
}


function felir()
{
	//submitoljuk a form-ot
	document.getElementById("todo").value='fel'
	document.getElementById("hirform").submit()
	}
	
	function leir()
{
	//submitoljuk a form-ot
	document.getElementById("todo").value='le'
	document.getElementById("hirform").submit()
	}
	
function popup(width,height,kep)
{
	izem=document.getElementById("preview_div");
	kiskeppos=findPos(document.getElementById(kep));
	//alert(kiskeppos[0])
	magassag=kiskeppos[1]-height
	//var magassag=30
	izem.width=width;
	//alert(magassag)
	if(magassag<100){
		izem.style.top=100+ "px";
	}
	else{
		izem.style.top=magassag+"px";
	}
	izem.style.left=150+"px";
	izem.height=height;
	izem.style.display="block";
	//izem.style.z-index="15";
	newHtml='<img src="uploaded/pix/termekfoto/'+kep+'" width="'+width+'" height="'+height+'" onClick="izem.style.display=\'none\'">'
	izem.innerHTML=newHtml;

}
function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
		return [curleft,curtop];
	}
}

