function clear(){
    if (document.login_form.username.value != "")
	document.login_form.userpass.focus();
    else
	document.login_form.username.focus();
}


function check_delete(eform){
    if (confirm("Confirmation\nYes delete!!!"))
	eform.submit();
    else
	return false;
}


function ablak(file,scroll,width,height,name) {
    nagyablak =window.open('',name,'top=0,left=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars='+scroll+',resizable=0,width='+width+',height='+height);
    nagyablak.document.open();
    nagyablak.document.write("<html><head><title>Popup</title><LINK rel=\"stylesheet\" href=\"themes/style_common.css\" type=\"text/css\"></head><body bgcolor=#ffffff leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>");
    nagyablak.document.write("<div align=center><a href='javascript:window.close()'><img src='"+file+"' border='0' border-color=\"#000000\" alt='"+name+"' class=\"pic\"></a></div>");
    nagyablak.document.write("</body></html>");
    nagyablak.document.close();
} 

function style_window(file,scroll,width,height,name) {
    var wwidth = width+25;
    var wheight = height+25;
    nagyablak = window.open('','Eurotailors','top=0,left=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=0,width='+wwidth+',height='+wheight+"'");
    nagyablak.document.open();
    nagyablak.document.write('<html><head><title>'+name+'</title></head><body bgcolor="#ffffff" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">');
    nagyablak.document.write('<div align="center"><a href="javascript:window.close()"><img src="'+file+'" width="'+width+'" height="'+height+'" border="0" alt="'+name+'" title="'+name+'"></a></div>');
    nagyablak.document.write("</body></html>");
    nagyablak.document.close();
}

function fabric_window(URL,name) {
		if (URL != '') {
				window.open(URL,name,'scrollbars=0,width=400,height=450,top=0,left=0');
		}
}


function pic_window(url,scroll,width,height){
	if (url != '') {
		window.open(url,'','scrollbars='+scroll+',width='+width+',height='+height+',top=0,left=0');
	}
}

function user_window(url,scroll,width,height){
	if (url != '') {
		window.open(url,'','scrollbars='+scroll+',width='+width+',height='+height+',top=0,left=0');
	}
}


function print_window(url){
	if (url != '') {
		window.open(url,'','scrollbars=1,width=640,height=550,top=0,left=0');
	}
}

function email_window(url){
	if (url != '') {
		window.open(url,'','scrollbars=0,width=480,height=370,top=0,left=0');
	}
}

function check_email_form(eform){
    var hiba = "";
    
    if (eform.to_email.value == "") hiba = hiba + "Kérjük adja meg a címzett E-mail címét!\n";
    if (eform.from_name.value == "") hiba = hiba + "Kérjük adja meg az Ön nevét!\n";
    
    if (hiba != ""){
	alert(hiba);
	return false;
    }
        
    if (eform.to_name.value == "") hiba = hiba + "A címzett neve\n";
    if (eform.from_email.value == "") hiba = hiba + "Az Ön e-mail címe\n";
    if (eform.message.value == "") hiba = hiba + "Üzenet szövege\n";
    if (hiba != ""){
	if (confirm("A következő mezők nem lettek kitöltve:\n\n"+ hiba + "\nBiztos, hogy elküldi?"))
	    eform.submit();
	else{
	    return false;
	}    
    }
    else{
	eform.submit();
    }
}

function check_contact_form(eform){
    var hiba = "";
    
    if (eform.name.value == "")	hiba = hiba + "Kérjük adja meg a nevét!\n";
    if (eform.phone.value == "") hiba = hiba + "Kérjük adja meg a telefonszámát!\n";
    if (eform.email.value == "") hiba = hiba + "Kérjük adja meg az e-mail címét!\n";
    if (eform.comment.value == "") hiba = hiba + "Kérjük adja hozzá megjegyzését!\n";

    if (hiba != ""){
	alert(hiba);
	return false;
    }
    else{
	eform.submit();
    }
}

function after_loading(){
	if(document.getElementById) {
		document.getElementById('loadingdiv').style.visibility="hidden";
		document.getElementById('loadingdiv').style.height="5px";
		document.getElementById('fabricsdiv').style.visibility="visible";
	}
	else {
		document.all.loadingdiv.style.visibility="hidden";
		document.getElementById('loadingdiv').style.height="5px";
		document.all.fabricsdiv.style.visibility="visible";
	}
}
