<!-- 


// ------------------------------------------
// function: char control (q)
// ------------------------------------------
function charctrl_q(keycode) {

	if ((keycode == 13) ||
	    (keycode == 32) ||
	    (keycode == 34) ||
	    (keycode == 45) ||		
            (keycode >= 48 && keycode <= 57) ||
            (keycode >= 65 && keycode <= 90) ||
            (keycode >= 97 && keycode <= 122))

           return true;
    else
           return false;
}




// ------------------------------------------
// function: emailcheck (str)
// ------------------------------------------
function CheckEmail(str) {

	var at="@";
	var dot=".";
	var lat=str.indexOf(at);
	var lstr=str.length;
	var ldot=str.indexOf(dot);
	
	
	if (str.indexOf(at)==-1){
	   return false;
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   return false;
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
	   return false;
	}

	 if (str.indexOf(at,(lat+1))!=-1){
	   return false;
	 }

	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
	   return false;
	 }

	 if (str.indexOf(dot,(lat+2))==-1){
	   return false;
	 }
		
	 if (str.indexOf(" ")!=-1){
	   return false;
	 }


     return true;					
}



// ------------------------------------------
// function: ValidateKontaktForm(f)
// ------------------------------------------
function ValidateFormKontakt(f) {

	if ((f.Email.value == null) || (f.Email.value == "")){
		alert("Prosimo, vnestite svoj elektronski naslov!");
		f.Email.focus();		
		return false;
	}

	if (CheckEmail(f.Email.value) == false){
		alert("Prosimo, vnestite svoj VELJAVNI elektronski naslov!");
		f.Email.value = "";
		f.Email.focus();
		return false;
	}
	
	if ((f.Vprasanje.value == null) || (f.Vprasanje.value == "")){
        alert ("Prosimo, vnesite sporocilo!");
		f.Email.focus();
        return false;
	}


	return true;
}

function OpenL(lunchID) {
document.getElementById('lunch_' + lunchID).style.display = "block";
document.getElementById('clasp_' + lunchID).innerHTML="<a href=\"javascript:CloseL('" + lunchID + "');\">- Skrij datume </a>";
}

function CloseL(lunchID) {
document.getElementById('lunch_' + lunchID).style.display = "none";
document.getElementById('clasp_' + lunchID).innerHTML="<a href=\"javascript:OpenL('" + lunchID + "');\">+ Prikaži datume </a>";
} 
// -->
