function checkGLogin()
{
 var valid=false;
 if(lForm._hash.value=="")
 {
  alert("Login Id Field Can't be left blank");
 lForm._hash.focus();
 }
 else if(lForm._key.value=="")
 {
  alert("Password Field Can't be left blank");
  lForm._key.focus();
 }
 else
 {
  valid=true;
 }
 return valid;
}

function tellaFriend()
{
 var valid=false;
 if(tafForm.fe.value=="")
 {
  alert("Friend's Email Address field can't be left blank");
  tafForm.fe.focus();
 }
 else if(tafForm.fe.value.indexOf('@')<1)
 {
  alert("Invalid Friend's Email Address !! Try Again");
  tafForm.fe.focus();
 }
else if(tafForm.fe.value.indexOf('.')<2)
 {
  alert("Invalid Friend's Email Address !! Try Again");
  tafForm.fe.focus();
 }
 else
 {
  valid=true;
  var fe=tafForm.fe.value
  window.open("tell-a-friend.asp?fe="+fe+" ","QuickQueryWin","marginleft=0, marginright=0,toolbar=no,status=no, menubar=no, location=no, width=550, height=580, top=200, right=200");
 }
}

function checkRegisterForm()
{
 var valid=false;
 if(rForm._hash.value=="")
 {
  alert("Login Id Field Can't be left blank");
  rForm._hash.focus();
 }
 else if(rForm._key1.value=="")
 {
  alert("Password Field Can't be left blank");
  rForm._key1.focus();
 }
 else if(rForm._key2.value=="")
 {
  alert("Confirm Password Field Can't be left blank");
  rForm._key2.focus();
 }
 else if(rForm._key1.value != rForm._key2.value)
 {
  alert("Password Not Matched !! Try Again");
  rForm._key2.focus();
 }
 else if(rForm.fname.value=="")
 {
  alert("First Name Field Can't be left blank");
  rForm.fname.focus();
 }
 else if(rForm.lname.value=="")
 {
  alert("Last Name Field Can't be left blank");
  rForm.lname.focus();
 }
 else if(rForm.email.value=="")
 {
  alert("Email Field Can't be left blank");
  rForm.email.focus();
 }
 else if(rForm.email.value.indexOf('@')<1)
 {
  alert("Invalid Email Address, Try Again");
  rForm.email.focus();
 }
 else if(rForm.email.value.indexOf('.')<2)
 {
  alert("Invalid Email Address, Try Again");
  rForm.email.focus();
 }
 else if(document.rForm.m_day.options[document.rForm.m_day.selectedIndex].value=="-1")
 {
  alert("Please Select Date Of Birth");
  rForm.m_day.focus();
 }
 else if(document.rForm.m_month.options[document.rForm.m_month.selectedIndex].value=="-1")
 {
  alert("Please Select Month Of Birth");
  rForm.m_month.focus();
 }
 else if(document.rForm.m_year.options[document.rForm.m_year.selectedIndex].value=="-1")
 {
  alert("Please Select Year Of Birth");
  rForm.m_year.focus();
 }
 else if(document.rForm.m_hour.options[document.rForm.m_hour.selectedIndex].value=="-1")
 {
  alert("Please Select Hour Of Birth");
  rForm.m_hour.focus();
 }
 else if(document.rForm.m_minute.options[document.rForm.m_minute.selectedIndex].value=="-1")
 {
  alert("Please Select Minutes Of Birth");
  rForm.m_minute.focus();
 }
 else if(document.rForm.m_second.options[document.rForm.m_second.selectedIndex].value=="-1")
 {
  alert("Please Select Second's Of Birth");
  rForm.m_second.focus();
 }
 else if(rForm.addr1.value=="")
 {
  alert("Address Field Can't be left blank");
  rForm.addr1.focus();
 }
 else if(document.rForm.country.options[document.rForm.country.selectedIndex].value=="0")
 {
  alert("Please Select Country");
  rForm.country.focus();
 } 
 else
 { 
  valid=true;
 }
 return valid;
}

function checkIncompleteRegForm()
{
 var valid=false;
 if(rForm2._hash.value=="")
 {
  alert("Login Id Field Can't be left blank");
  rForm2._hash.focus();
 }
 else if(rForm2._key1.value=="")
 {
  alert("Password Field Can't be left blank");
  rForm2._key1.focus();
 }
 else if(rForm2._key2.value=="")
 {
  alert("Confirm Password Field Can't be left blank");
  rForm2._key2.focus();
 }
 else
 {
  valid=true;
 }
 return valid;
}

function checkLoginForm()
{
 var valid=false;
 if(lForm2._hash.value=="")
 {
  alert("Login Id field can't be left blank");
  lForm2._hash.focus();
 }
 else if(lForm2._key.value=="")
 {
  alert("Password field can't be left blank");
  lForm2._key.focus();
 }
 else
 {
  valid=true;
 }
 return valid;
}

function checkUserRole()
{
 var role=document.rForm.role.options[document.rForm.role.selectedIndex].value;
 if(role=="1")
 {
  document.getElementById('astro_service').style.visibility="visible";
  document.getElementById('astro_service2').style.visibility="visible";
 }
 else
 {
  document.getElementById('astro_service').style.visibility="hidden";
  document.getElementById('astro_service2').style.visibility="hidden";
 }
}

function checkForgotPassForm()
{
 var valid=false;
 if(fpForm.pemail.value=="")
 {
  alert("Email Field Can't be left blank");
  fpForm.pemail.focus();
 }
 else if(fpForm.pemail.value.indexOf('@')<1)
 {
   alert("Invalid Email Try Again");
   fpForm.pemail.focus();
 }
 else if(fpForm.pemail.value.indexOf('.')<2)
 {
   alert("Invalid Email Try Again");
   fpForm.pemail.focus();
 }
 else
 {
  valid=true;
 }
 return valid;
}


function checkAdminLogin()
{
 var valid=false;
 if(lForm._hash.value=="")
 {
  alert("Login Id Field Can't be left blank")
  lForm._hash.focus();
}
 else if(lForm._key.value=="")
 {
  alert("Password Field Can't be left blank");
  lForm._key.focus();
 }
 else
 {
  valid=true;
 }
 return valid;
}

function checkAddNewProdForm()
{
 var valid=false;
 if(apForm.pid.value=="")
 {
  alert("Product Id Field Can't be left blank");
  apForm.pid.focus();
 }
 else if(apForm.pname.value=="")
 {
  alert("Product Name Field Can't be left blank");
  apForm.pname.focus();
 }
 else if(document.apForm.cate.options[document.apForm.cate.selectedIndex].value=="Other" && apForm.ocate.value=="")
  {
   alert("Enter New Category Name");
   apForm.ocate.focus();
  }
  else if(document.apForm.scate.options[document.apForm.scate.selectedIndex].value=="Other" && apForm.oscate.value=="")
  {
   alert("Enter New Sub-Category Name");
   apForm.oscate.focus();
  }
  else if(apForm.price_inr.value=="")
 {
  alert("Price in INR Field Can't be left blank");
  apForm.price_inr.focus();
 }
 else if(isNaN(apForm.price_inr.value))
 { 
  alert("User Number only");
  apForm.price_inr.focus();
 }
  else if(apForm.price_us.value=="")
 {
  alert("Price in USD Field Can't be left blank");
  apForm.price_us.focus();
 }
 else if(isNaN(apForm.price_us.value))
 { 
  alert("User Number only");
  apForm.price_us.focus();
 }
 else if(apForm.psale.value=="")
 {
  alert("Sale Field Can't be left blank, Put 0 if this product has no discount");
  apForm.psale.focus();
 }
 else if(apForm.abprod.value=="")
 {
  alert("About Product Field Can't be left blank");
  apForm.abprod.focus();
 }
  else
  {
   valid=true;
 }
 return valid;
}

function checkBlackListedAstrologerForm()
{
 var valid=false;
 if(blaForm.name.value=="")
 {
  alert("Name Field Can't be left blank");
  blaForm.name.focus();
 }
 else if(blaForm.email.value=="")
 {
  alert("Email Field Can't be left blank");
  blaForm.email.focus();
 }
 else if(blaForm.email.value.indexOf('@')<1)
 {
  alert("Invalid Email address, Try Agaian");
  blaForm.email.focus();
 }
 else if(blaForm.email.value.indexOf('.')<2)
 {
  alert("Invalid Email address, Try Agaian");
  blaForm.email.focus();
 }
 else if(blaForm.tp.value=="")
 {
  alert("Telephone Number Field Can't be left blank");
  blaForm.tp.focus();
 }
 else if(blaForm.mb.value=="")
 {
  alert("Mobile Number Field Can't be left blank");
  blaForm.mb.focus();
 }
 else if(blaForm.addr1.value=="")
 {
  alert("Address Field Can't be left blank");
  blaForm.addr1.focus();
 }
 else if(blaForm.city.value=="")
 {
  alert("City Field Can't be left blank");
  blaForm.city.focus();
 }
 else if(blaForm.state.value=="")
 {
  alert("State Field Can't be left blank");
  blaForm.state.focus();
 }
 else if(blaForm.country.value=="")
 {
  alert("Country Field Can't be left blank");
  blaForm.country.focus();
 }
 else if(blaForm.msg.value=="")
 {
  alert("Message Field Can't be left blank");
  blaForm.msg.focus();
 }
 else
 {
  valid=true;
 }
 return valid;
}

function checkUpdatePasswordForm()
{
 var valid=false;
 if(cpForm.opass.value=="")
 {
  alert("Old Password Field Can't be left blank");
  cpForm.opass.focus();
 }
 else if(cpForm.npass.value=="")
 {
  alert("New Password Field Can't be left blank");
  cpForm.npass.focus();
 }
 else if(cpForm.cpass.value=="")
 {
  alert("Confirm Password Field Can't be left blank");
  cpForm.cpass.focus();
 }
 else if(cpForm.npass.value != cpForm.cpass.value)
 {
  alert("Password not match please Try Again !!");
  cpForm.cpass.focus();
 }
 else
 {
  valid=true;
 }
 return valid;
}

function checkTestimonialForm()
{
  var valid=false;
 if(tForm.fname.value=="")
 {
   alert("Name Field Can't be left blank");
   tForm.fname.focus();
 }
 else if(tForm.email.value=="")
 {
  alert("Email Field Can't be left blank");
  tForm.email.focus();
 }
 else if(tForm.email.value.indexOf('@')<1)
 {
  alert("Invalid Email !! Try Again");
  tForm.email.focus();
 }
 else if(tForm.email.value.indexOf('.')<2)
 {
  alert("Invalid Email !! Try Again");
  tForm.email.focus();
 }
 else if(tForm.desc.value=="")
 {
  alert("Message/Feedback Field can't be left blank");
  tForm.desc.focus(); 
 }
 else
 {
  valid=true;
 }
 return valid;
}

function checkAddNewServiceForm()
{
 var valid=false;
 if(asForm.sTitle.value=="")
 {
  alert("Service Title Field Can't be left blank");
  asForm.sTitle.focus();
 }
 else if(asForm.sReq.value=="")
 {
  alert("Service Requirement Field Can't be left blank");
  asForm.sReq.focus();
 }
 else if(asForm.sReq.value=="Any Document, Birth Information etc.. that you need from client")
 {
  alert("Service Requirement Field Can't be left blank");
  asForm.sReq.focus();
 }
else if(asForm.sDesc.value=="")
 {
  alert("Service Description Field Can't be left blank");
  asForm.sDesc.focus();
 }
 else if(asForm.sDesc.value=="About Service")
 {
  alert("Service Description Field Can't be left blank");
  asForm.sDesc.focus();
 }
 else if(asForm.sPrice.value=="")
 {
  alert("Service Price Field Can't be left blank");
  asForm.sPrice.focus();
 }
 else if(isNaN(asForm.sPrice.value))
 {
  alert("Invalid Price Field Value !! Use Number");
  asForm.sPrice.focus();
 }
 else
 {
  valid=true;
 }
 return valid;
}

function checkReportQueryForm()
 {
   var valid=false;
  if(rqForm.nm.value=="")
  {
   alert("Name Field Can't be left blank");
   rqForm.nm.focus();
  }
  else if(rqForm.em.value=="")
  {
   alert("Email Field can't be left blank");
   rqForm.em.focus();
  }
  else if(rqForm.em.value.indexOf('@')<1)
  {
   alert("Invalid Email Try Again");
   rqForm.em.focus();
  }
  else if(rqForm.em.value.indexOf('.')<2)
  {
   alert("Invalid Email Try Again");
   rqForm.em.focus();
  }
  else if(document.rqForm.m_hour.options[document.rqForm.m_hour.selectIndex].value=="-1")
  {
   alert("Please Select Time Of Birth [Birth Hour]");
   rqForm.m_hour.focus();
  }
  else if(document.rqForm.m_minute.options[document.rqForm.m_minute.selectIndex].value=="-1")
  {
   alert("Please Select Time Of Birth [Minutes of Birth]");
   rqForm.m_minute.focus();
  }
  else if(document.rqForm.m_second.options[document.rqForm.m_second.selectIndex].value=="-1")
  {
   alert("Please Select Time Of Birth [Seconds of Birth]");
   rqForm.m_second.focus();
  }
  else if(document.rqForm.m_day.options[document.rqForm.m_day.selectIndex].value=="-1")
  {
   alert("Please Select Date Of Birth");
   rqForm.m_day.focus();
  }
  else if(document.rqForm.m_month.options[document.rqForm.m_month.selectIndex].value=="-1")
  {
   alert("Please Select Date Of Birth [Birth Month]");
   rqForm.m_month.focus();
  }
  else if(document.rqForm.m_year.options[document.rqForm.m_year.selectIndex].value=="-1")
  {
   alert("Please Select Date Of Birth [Birth year]");
   rqForm.m_year.focus();
  }
  else if(rqForm.co.value=="")
  { 
   alert("Birth Country Field Can't be left blank");
   rqForm.co.focus();
  }
  else if(rqForm.ct.value=="")
  { 
   alert("Birth City Field Can't be left blank");
   rqForm.ct.focus();
  }
  else if(rqForm.st.value=="")
  { 
   alert("Birth State Field Can't be left blank");
   rqForm.st.focus();
  }
  else
  { 
   valid=true;
  }
   return valid;
 }

function checkTellFriendFormComplete()
{
 var valid=false;
 if(tafForm.yn.value=="")
 {
  alert("Your Name Field Can't beleft blank");
  tafForm.yn.focus();
 }
 else if(tafForm.ye.value=="")
 {
  alert("Your Email Field Can't be left blank");
  tafForm.ye.focus();
 }
 else if(tafForm.ye.value.indexOf('@')<1)
 {
  alert("Invalid Your Email Field !! Try Again");
  tafForm.ye.focus();
 }
 else if(tafForm.ye.value.indexOf('.')<2)
 {
  alert("Invalid Your Email Field !! Try Again");
  tafForm.ye.focus();
 }
 else if(tafForm.fn.value=="")
 {
  alert("Friend's Name Field Can't beleft blank");
  tafForm.fn.focus();
 }
 else if(tafForm.fe.value=="")
 {
  alert("Friend's Email Field Can't be left blank");
  tafForm.fe.focus();
 }
 else if(tafForm.fe.value.indexOf('@')<1)
 {
  alert("Invalid Friend's Email Field !! Try Again");
  tafForm.fe.focus();
 }
 else if(tafForm.fe.value.indexOf('.')<2)
 {
  alert("Invalid Friend's Email Field !! Try Again");
  tafForm.fe.focus();
 }
 else
 {
  valid=true;
 }
 return valid;
}
