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("Figyelem!\nBiztos törli ezt az adatlapot?\nAz összes kapcsolódó adat törlésre kerül!!!"))
	eform.submit();
    else
	return false;
}

function check_delete_answer(eform){
    if (confirm("Figyelem!\nBiztos törli ezt a választ?\nAz összes kapcsolódó adat törlésre kerül!!!"))
	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=\"/rexinfo/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='1' alt='"+name+"' class=\"pic\"></a></div>");
    nagyablak.document.write("</body></html>");
    nagyablak.document.close();
} 


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 cikk_ablak(url){
	if (url != '') {
		window.open(url,'','width=480,height=370,top=0,left=0');
	}
}

function flash_window(url){
	if (url != '') {
		window.open(url,'','scrollbars=0,width=410,height=470,top=0,left=0');
	}
}

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

function flash2_window(url){
	if (url != '') {
		window.open(url,'','scrollbars=0,width=700,height=470,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 StyleActivate(value){
    if (value == '') {return;}
    var i, lnk;
    for(i=0;(lnk=document.getElementsByTagName("link")[i]);i++){
	if (lnk.getAttribute('rel').indexOf('style') != -1 && lnk.getAttribute('title')){
	    lnk.disabled = true;
	    if (lnk.getAttribute('title') == value){
		lnk.disabled = false;
	    }
	}
    }
    return;
}

