function newsletter_check()
{
	var regBlank = /[^\s]/;
	if(!regBlank.test(document.frm_news.fullname.value))
	 {
	 alert('Please write your fullname');
	 document.frm_news.fullname.focus();
	 return false;
	 }
	if(!isNaN(document.frm_news.fullname.value))
	 {
	 alert('Your fullname must be in numeric');
	 document.frm_news.fullname.focus();
	 return false;
	 } 
	 if(document.frm_news.email.value=='')
	 {
	 alert('Please write your email address');
	 document.frm_news.email.focus();
	 return false;
	 } 
	 else
	 {
	   if(echeck(document.frm_news.email.value)==false)
	   {
		 document.frm_news.email.focus();
		 return false;   
	   }
	 }
	return true; 
}

function contact_validation()
{
	if(document.contact_form.name.value=='')
	{
	  alert('Please write in your name.');
	  document.contact_form.name.focus();
	  return false;
	}

	if(!isNaN(document.contact_form.name.value))
	 {
	 alert('Your name must be in alphabetic');
	 document.contact_form.name.focus();
	 return false;
	 } 
	if(document.contact_form.email.value=='')
	{
	  alert('Please include an email address');
	  document.contact_form.email.focus();
	  return false;
	}
	else
	{
		 if(echeck(document.contact_form.email.value)==false)
		   {
			 document.contact_form.email.focus();
			 return false;   
		   }
	}	
	if(document.contact_form.phone_no.value=='')
	{
	  alert('Please write in your phone number');
	  document.contact_form.phone_no.focus();
	  return false;
	}

	if(isNaN(document.contact_form.phone_no.value))
	 {
	 alert('Your phone number must be numeric');
	 document.contact_form.phone_no.focus();
	 return false;
	 }	
}

function echeck(str){
   var at="@"
   var dot="."
   var lat=str.indexOf(at)
   var lstr=str.length
   var ldot=str.indexOf(dot)
   if (str.indexOf(at)==-1){
	  alert("Invalid E-mail address")
	  return false
   }

   if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	  alert("Invalid E-mail address")
	  return false
   }

   if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
	   alert("Invalid E-mail address")
	   return false
   }

	if (str.indexOf(at,(lat+1))!=-1){
	   alert("Invalid E-mail address")
	   return false
	}

	if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
	   alert("Invalid E-mail address")
	   return false
	}

	if (str.indexOf(dot,(lat+2))==-1){
	   alert("Invalid E-mail address")
	   return false
	}

	if (str.indexOf(" ")!=-1){
	   alert("Invalid E-mail address")
	   return false
	}

	 return true
}


 function ImageUpdate(sUrl, sLink, bPdf, sImage)
    {
        if(bPdf==1)
        {
            document.aspnetForm.imageBigGallery.src = sUrl;
            imageBigLink.href = sImage;
        }
        else
        {        
            document.aspnetForm.imageBigGallery.src = sUrl;
            imageBigLink.href = 'VenuePhotoGalleryDetail.aspx?' + sLink;
        }        
    }
	
