//Javascript fot VIP+ Weather
function val(form,$viplat,$viplon) {
 
         document.forms["vipwebinput"].lat.value =$viplat;
         document.forms["vipwebinput"].lon.value =$viplon;
         document.getElementById('viplat').innerHTML=$viplat;
	     document.getElementById('viplon').innerHTML=$viplon;

     }
/*End of function*/


function checklockid(form){
// check if numbers field is blank
// only allow numbers to be entered
var checkOK = "0123456789";
var checkStr = form.lockid.value;
var allValid = true;
var allNum = "";
for (i = 0;  i < checkStr.length;  i++)
{
ch = checkStr.charAt(i);
for (j = 0;  j < checkOK.length;  j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
if (ch != ",")
allNum += ch;
}
//String length longer than 4
if ( checkStr.length > 4 )
allValid = false;

if ( checkStr.length < 4 )
allValid = false;

if (!allValid)
{
alert("Lock ID consists of four figures");
return (false);
}

}
/*End of function*/


function checkdescription(form){
		//alert("Place name check");

var alphaExp =  /^[0-9a-zA-Z\-\_]+$/;
var checkStr = form.description.value;
	//if(form.description.value.match(alphaExp)){
	if(checkStr.match(alphaExp)){
		//alert("Place name OK");
		return true;
	}else{
		alert("Place name consists of 0..9 a..Z -_");
		return false;
	} 
 
 }
/*End of function*/


function checkemail(form){
		//alert("Place name check");

var alphaExp = /^[\w\-\.\+]+$/;
var checkStr = form.email.value;
	//if(form.description.value.match(alphaExp)){
	if(checkStr.match(alphaExp)){
		//alert("Place name OK");
		return true;
	}else{
		alert("No correct emailadress without domain name");
		return false;
	} 
 
 }
/*End of function*/


