function popIm(id){
	window.open("Showimage.php?id="+id,"popIm","top=10,left=20,resizable=no,width=200,height=200,status=no,location=no,menubar=no,scrollbars=yes")
}

function popSpecialIm(id,module){
	window.open("Showimage.php?id="+id+"&module="+module,"popIm","top=10,left=20, resizable=no,width=200,height=200,status=no,location=no,menubar=no,scrollbars=yes")
}

function popUserRegForm(addValues){
	window.open("Register.php?"+addValues,"popUp","top=10,left=20,resizable=no,width=700,height=500,status=no,location=no,menubar=no,scrollbars=yes")
}

function checkInt(field, minInt, maxInt){
	var value=parseInt(field.value);
	field.value=value
	if((value<minInt) || (!value))
		field.value=minInt;
	else if(value>maxInt)
		field.value=maxInt;
}

function popCompare(){
	window.open("comparing.php?","popUp","top=10,left=20,resizable=yes,width=800,height=600,status=no,location=no,menubar=no,scrollbars=yes")
}

function popWin(url,he,wi){
	if(he<=0)he = '300';
	if(wi<=0)wi = '300';
	
	var kyssa=window.open(url,'','scrollbars=yes,width='+wi+',height='+he+',resizable=yes,top=10,left=10');	
}

function writeFormElements(kere_tahis, text) {
    if (document.getElementById) {
        if (document.getElementById("search_kere_tahis")) document.getElementById("search_kere_tahis").value = kere_tahis + ':';
        if (document.getElementById("search_text")) document.getElementById("search_text").value = text + ':';
    }
    if (document.all) {
        if (document.all["search_kere_tahis"]) document.all["search_kere_tahis"].value = kere_tahis + ':';
        if (document.all["search_text"]) document.all["search_text"].value = text + ':';
    }
}

function loadButtons() {
    if (document.getElementById) {
        if (document.getElementById("searchTbl")) document.getElementById("searchTbl").style.display = "block";
        if (document.getElementById("loginTbl")) document.getElementById("loginTbl").style.display = "block";
    }
    if (document.all) {
        if (document.all["searchTbl"]) document.all["searchTbl"].style.display = "block";
        if (document.all["loginTbl"]) document.all["loginTbl"].style.display = "block";
    }
}
