function sakto_mail(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   document.online_app.email.style.backround='#ffff00';
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   document.online_app.email.style.backround='#ffff00';
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		   document.online_app.email.style.backround='#ffff00';
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		   document.online_app.email.style.backround='#ffff00';
		   return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		   document.online_app.email.style.backround='#ffff00';		    
		   return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		   document.online_app.email.style.backround='#ffff00';
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		   document.online_app.email.style.backround='#ffff00';
		    return false
		 }

 		 return true					
	}
	
function validateForm()
{
var chk_app=true;
var numero = "0123456789";
// check first name
if (document.online_app.fname.value == "" || document.online_app.fname.value == null)
{
  document.online_app.fname.style.background='#FFFF00';
  chk_app = false;
}
// check first name
if (document.online_app.mname.value == "" || document.online_app.mname.value == null)
{
  document.online_app.mname.style.background='#FFFF00';
  chk_app = false;
}

// check last name
if (document.online_app.lname.value == "" || document.online_app.lname.value == null)
{
  document.online_app.lname.style.background='#FFFF00';
  chk_app = false;
}
// check address
if (document.online_app.addr.value == "" || document.online_app.addr.value == null)
{
  document.online_app.addr.style.background='#FFFF00';
  chk_app = false;
}
//check Source Strategy
if (document.online_app.source.value == "" || document.online_app.source.value == null)
{
  document.online_app.source.style.background='#FFFF00';
  chk_app = false;
}
    
// check City
if (document.online_app.city.value == "" || document.online_app.city.value == null)
{
  document.online_app.city.style.background='#FFFF00';
  chk_app = false;
}

//check mobile
if (document.online_app.mobile.value == "" || document.online_app.mobile.value == null)
{
  document.online_app.mobile.style.background='#FFFF00';
  chk_app = false;
}
for (var i = 0; i < document.online_app.mobile.value.length; i++)
{
  temp = document.online_app.mobile.value.substring(i, i+1)
  if (numero.indexOf(temp) == -1 && document.ambot.bla.value != "")
  {
    document.online_app.mobile.style.background='#FFFF00';
    chk_app = false;
    break;
  }
}

//check email address
if (document.online_app.email.value == "" || document.online_app.email.value == null)
{   
  document.online_app.email.style.background='#FFFF00';
  chk_app = false;
}
if(sakto_mail(document.online_app.email.value)==false)
{   
  document.online_app.fname.style.background='#FFFF00';
  chk_app = false;
}

// check birth day
if (document.online_app.bdate.value == "" || document.online_app.bdate.value == null)
{
  document.online_app.bdate.style.background='#ffff00';
  chk_app = false;
}
var kkk='0';
for (var i = 0; i < document.online_app.bdate.value.length; i++)
{
    temp = document.online_app.bdate.value.substring(i, i+1)
    if(temp !="-")
     if (numero.indexOf(temp) == -1 && document.online_app.bdate.value != "")
     {
       document.online_app.bdate.style.background='#ffff00';
       chk_app=false;
       break;
     }
    if(temp =="-")
     { if(kkk > '1' )
        { document.online_app.bdate.style.background='#ffff00';
          chk_app=false;
          break;
        }
       kkk ++;
     }
}
if (chk_app == false)
  document.getElementById('notice').style.display='block';
  
return chk_app;
}

