

function checkmail()
{
  if(trimAll(document.getElementById("body").value) == "")
  {
    alert("Insert email body");
    return false;
  }
  else if(trimAll(document.getElementById("subject").value) == "")
  {
    if(confirm("Subject is empty.Do you want to continue ?"))
        return true;
    else
        return false;
  }
  else
  {
    return true;
  }

}

function generate_pay_option()
{

        xmlHttp=GetXmlHttpObject();
        if (xmlHttp==null)
        {
          alert ("Your browser does not support AJAX!");
          return;
        }
        var url="ajax_pay_option.php";
        url=url+"?memtypeid="+document.getElementById("membership_type").value+"&sid="+Math.random();
        xmlHttp.onreadystatechange=stateChanged;
        xmlHttp.open("GET",url,true);
        xmlHttp.send(null);
}

function stateChanged()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="completed")
{
//alert(xmlHttp.responseText);
//alert(document.getElementById("img").innerHTML);
document.getElementById("div_pay_option").innerHTML="";
document.getElementById("div_pay_option").innerHTML=xmlHttp.responseText;
}
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}

//  =========    START   SEARCH   BOX  VALIDATION     ============================================

function chk_srch()
{
  //if(document.getElementById("sex1").value=="")
  //{
    if((document.getElementById("sex1").value=="") && (document.getElementById("key").value=='') && (document.getElementById("agefrom").value=='') && (document.getElementById("ageto").value=='') && (document.getElementById("zip").value=='')&& (document.getElementById("is_picture").checked == false) && (document.getElementById("is_online").checked == false) )
    {


      alert("Insert atleast one search criteria");
      return false;
    }
  //}
  else
  {
        
      return true;
  }

}

function chk_srch_inner()
{
   //alert(document.getElementById("mile").value);
   //alert(document.getElementById("zip").value);
   if(document.getElementById("sex_1").value=="" && document.getElementById("country").value=="" && document.getElementById("key").value=='' && document.getElementById("agefrom_1").value=='' && document.getElementById("ageto_1").value=='' && document.getElementById("zip").value=='')
    {
      //alert("Insert atleast one search criteria");
     // return false;
    }
  else
  {
      return true;
  }

}





//  =========    START   SEARCH   BOX  VALIDATION     ============================================


//  =========    START   CONTACT  US  FROM   VALIDATION     ============================================

function contact_form_chk()
{
  if(trimAll(document.getElementById("name").value)=="")
  {
      alert("Insert name");
      return false;
  }
  else if(trimAll(document.getElementById("email").value)=="")
  {
      alert("Insert email");
      return false;
  }
  else if( !echeck(document.getElementById("email").value) )
  {
      return false;
  }
  else if(trimAll(document.getElementById("msg").value)=="")
  {
      alert("Insert message");
      return false;
  }
  else
      return true;
}

function echeck(str) {

    var at="@"
    var dot="."
    var lat=str.indexOf(at)
    var lstr=str.length
    var ldot=str.indexOf(dot)

    if(str.substr(str.indexOf(".")+1,str.length-str.indexOf("."))=="")
    {
        alert("Invalid E-mail ID");
        return false;
    }
    if (str.indexOf(at)==-1){
       alert("Invalid E-mail ID");
       return false;
    }

    if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
       alert("Invalid E-mail ID");
       return false;
    }

    if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
        alert("Invalid E-mail ID");
        return false;
    }

     if (str.indexOf(at,(lat+1))!=-1){
        alert("Invalid E-mail ID");
        return false;
     }

     if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
        alert("Invalid E-mail ID");
        return false;
     }

     if (str.indexOf(dot,(lat+2))==-1){
        alert("Invalid E-mail ID");
        return false;
     }

     if (str.indexOf(" ")!=-1){
        alert("Invalid E-mail ID");
        return false;
     }

      return true
  }

function trimAll(sString)
{
while (sString.substring(0,1) == ' ')
{
sString = sString.substring(1, sString.length);
}
while (sString.substring(sString.length-1, sString.length) == ' ')
{
sString = sString.substring(0,sString.length-1);
}
return sString;
}

//  =========    END   CONTACT  US  FROM   VALIDATION     ============================================

//Registration Page Verification
function checkpage1()
 {
   if(document.regis_frm1.user.value=="")
    {
      alert("Please Enter Username.");
      document.regis_frm1.user.focus();
      return false;
    }
   if(document.regis_frm1.pass.value=="")
    {
      alert("Please Enter Password.");
      document.regis_frm1.pass.focus();
      return false;
    }
   if(document.regis_frm1.pass1.value=="")
    {
      alert("Please Retype Password.");
      document.regis_frm1.pass1.focus();
      return false;
    }
   if(document.regis_frm1.f_name1.value=="")
    {
      alert("Please Enter First Name.");
      document.regis_frm1.f_name1.focus();
      return false;
    }
   if(document.regis_frm1.l_name1.value=="")
    {
      alert("Please Enter Last Name.");
      document.regis_frm1.l_name1.focus();
      return false;
    }
   if(document.regis_frm1.email.value=="")
    {
      alert("Please Enter Email Address.");
      document.regis_frm1.email.focus();
      return false;
    }
   if(document.regis_frm1.country_id.value=="")
    {
      alert("Please Select Country.");
      document.regis_frm1.country_id.focus();
      return false;
    }
   if(document.regis_frm1.sex1.value=="")
    {
      alert("Please Select Gender.");
      document.regis_frm1.sex1.focus();
      return false;
    }
   if(document.regis_frm1.year1.value=="" || document.regis_frm1.mon1.value=="" || document.regis_frm1.day1.value=="")
    {
      alert("Please Select Date of Birth.");
      //document.regis_frm1.sex1.focus();
      return false;
    }
   if(document.regis_frm1.mtype.value=="")
    {
      alert("Please Select Membership Type.");
      document.regis_frm1.mtype.focus();
      return false;
    }
   if(document.regis_frm1.pass.value != document.regis_frm1.pass1.value)
    {
      alert("Password Not Match !");
      document.regis_frm1.pass1.value="";
      document.regis_frm1.pass.select();
      return false;
    }
   if(document.regis_frm1.agree.checked == false)
    {
      alert("Please Check The Terms & Conditions.");
      return false;
    }
   if(document.regis_frm1.sec_code.value == "")
    {
      alert("Please Insert Security Code.");
      return false;
    }

   return true;
 }


 function op_msg_win_box(m_id)
 {
   //alert(screen.availHeight);
   var height=100;
   var width= screen.availWidth-380;

   window.open("msg_box.php?m_id="+m_id ,"pid"+m_id,"location=0,scrollbars=yes,height=500,width=350,left="+ width+",top=" + height);
 }

 function open_chat_box(m_id,box_id)
 {
   window.open("chat_box.php?action=loadin&r_id="+box_id ,m_id+"pid"+box_id,"location=0,scrollbars=no,height=500,width=750,left=10,top=20");
 }

function close_chat_box(r_id,m_id)
{
var ajaxRequest;  // The variable that makes Ajax possible!
try{
    // Opera 8.0+, Firefox, Safari
    ajaxRequest = new XMLHttpRequest();
  } catch (e){
    // Internet Explorer Browsers
    try{
      ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try{
        ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e){
        // Something went wrong
        alert("Your Browser broke!");
        return false;
      }
    }
  }
  // Create a function that will receive data sent from the server
  ajaxRequest.onreadystatechange = function()
   {
    if(ajaxRequest.readyState == 4)
     {
      window.opener.document.location.reload();
      var mystat = ajaxRequest.responseText;
     }
   }
  var queryString = "?m_id=" + m_id + "&r_id=" + r_id;
  ajaxRequest.open("GET", "close_room.php" + queryString, true);
  ajaxRequest.send(null);
}

 function op_win()
 {
   window.open("view_condition.php" ,"pid1","location=0,scrollbars=yes,height=420,width=780,left=10,top=20");
 }

function loginverify()
 {
   if(document.login.user.value=="")
    {
      alert("Please Enter Username.");
      document.login.user.focus();
      return false;
    }
   if(document.login.pass.value=="")
    {
      alert("Please Enter Password.");
      document.login.pass.focus();
      return false;
    }
   else
    return true;
 }


function checkpaytype()
 {
   if(document.addon.payment_type.value=="")
    {
      alert("Please select payment type.");
      document.addon.payment_type.focus();
      return false;
    }
   else
    return true;
 }

function getregion()
{
document.getElementById('div_state').style.position="absolute";
document.getElementById('div_state').style.visibility="hidden";
document.getElementById('div_city').style.position="absolute";
document.getElementById('div_city').style.visibility="hidden";
var ajaxRequest;  // The variable that makes Ajax possible!
var country_id = document.getElementById('country_id').value;
try{
    // Opera 8.0+, Firefox, Safari
    ajaxRequest = new XMLHttpRequest();
  } catch (e){
    // Internet Explorer Browsers
    try{
      ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try{
        ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e){
        // Something went wrong
        alert("Your Browser broke!");
        return false;
      }
    }
  }
  // Create a function that will receive data sent from the server
  ajaxRequest.onreadystatechange = function()
   {
    if(ajaxRequest.readyState == 4)
     {
      document.getElementById('div_state').style.position="relative";
      document.getElementById('div_state').style.visibility="visible";
      var ajaxDisplay = document.getElementById("div_state");
      ajaxDisplay.innerHTML = ajaxRequest.responseText;
     }
   }
  var country_id = document.getElementById('country_id').value;
  var queryString = "?action=region&country_id=" + country_id;
//  alert(country_id+queryString);
  //ajaxRequest.open("GET", "bank_rup.php", true);
  ajaxRequest.open("GET", "checkvalue.php" + queryString, true);
  ajaxRequest.send(null);
}

function getcity4()
{
document.getElementById('div_city').style.position="absolute";
document.getElementById('div_city').style.visibility="hidden";
var ajaxRequest;  // The variable that makes Ajax possible!
var country_id = document.getElementById('country_id').value;
try{
    // Opera 8.0+, Firefox, Safari
    ajaxRequest = new XMLHttpRequest();
  } catch (e){
    // Internet Explorer Browsers
    try{
      ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try{
        ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e){
        // Something went wrong
        alert("Your Browser broke!");
        return false;
      }
    }
  }
  // Create a function that will receive data sent from the server
  ajaxRequest.onreadystatechange = function()
   {
    if(ajaxRequest.readyState == 4)
     {
      document.getElementById('div_city').style.position="relative";
      document.getElementById('div_city').style.visibility="visible";
      var ajaxDisplay = document.getElementById("div_city");
      ajaxDisplay.innerHTML = ajaxRequest.responseText;
     }
   }
  var region_id = document.getElementById('region_id').value;
  var country_id = document.getElementById('country_id').value;
  var queryString = "?action=city&region_id=" + region_id+"&country_id=" + country_id;
  //ajaxRequest.open("GET", "bank_rup.php", true);
  ajaxRequest.open("GET", "checkvalue.php" + queryString, true);
  ajaxRequest.send(null);
}

function getname()
{
document.getElementById('div_name').style.position="absolute";
document.getElementById('div_name').style.visibility="hidden";
var ajaxRequest;  // The variable that makes Ajax possible!
var country_id = document.getElementById('country_id').value;
if(country_id==254)
 {
   document.getElementById('div_cityname').style.position="absolute";
   document.getElementById('div_cityname').style.visibility="hidden";
 }
else
 {
  document.getElementById('div_cityname').style.position="relative";
  document.getElementById('div_cityname').style.visibility="visible";
 }
try{
    // Opera 8.0+, Firefox, Safari
    ajaxRequest = new XMLHttpRequest();
  } catch (e){
    // Internet Explorer Browsers
    try{
      ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try{
        ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e){
        // Something went wrong
        alert("Your Browser broke!");
        return false;
      }
    }
  }
  // Create a function that will receive data sent from the server
  ajaxRequest.onreadystatechange = function()
   {
    if(ajaxRequest.readyState == 4)
     {
      document.getElementById('div_name').style.position="relative";
      document.getElementById('div_name').style.visibility="visible";
      var ajaxDisplay = document.getElementById("div_name");
      ajaxDisplay.innerHTML = ajaxRequest.responseText;
     }
   }
  var country_id = document.getElementById('country_id').value;
  var queryString = "?action=name&country_id=" + country_id;
  //ajaxRequest.open("GET", "bank_rup.php", true);
  ajaxRequest.open("GET", "checkvalue.php" + queryString, true);
  ajaxRequest.send(null);
}


function deflt(img_id,m_id)
 {
  isconform=confirm("Do you really want to Change Default Picture?");
  if(isconform)
   window.location="profile_picture.php?action=def&img_id=" + img_id + "&m_id="+m_id;
 }


function del(img_id)
 {
  isconform=confirm("Do you really want to Delete Picture?");
  if(isconform)
   window.location="profile_picture.php?action=delete&img_id=" + img_id;
 }


 function search_lt()
 {
   document.page_limit_form.submit();
 }

   //var limt = document.getElementById('page_lt').value;
   //window.location="search.php?action=search&action1=page&" + str + "&limt=" +limt;
   //window.location="search.php?action=search&action1=page&" + str + "&limt=" +limt;

function galleryname()
 {
   if(document.pic_gal.gal_name.value=="")
    {
      alert("Please insert gallery name.");
      document.pic_gal.gal_name.focus();
      return false;
    }
   if(document.pic_gal.is_public.checked==true)
   {
     if(document.pic_gal.pass.value=="")
      {
        alert("Please Enter Password.");
        document.pic_gal.pass.focus();
        return false;
      }
    }
    if(document.pic_gal.pic_name.value=="")
    {
      alert("Please select picture.");
      document.pic_gal.pic_name.focus();
      return false;
    }
   else
    return true;
 }


function del_gallery(gal_id)
 {
  isconform=confirm("Do you really want to Delete Gallery?");
  if(isconform)
   window.location="picture_gallery.php?action=delete&gal_id=" + gal_id ;
 }



function del_gal_pic(gpic_id,id)
 {
  isconform=confirm("Do you really want to Delete Picture?");
  if(isconform)
   window.location="gallery_pictures.php?action=delete&gpic_id=" + gpic_id +"&id="+id;
 }


 function del_friend(id)
 {
  isconform=confirm("Do you really want to remove your friend from friendlist?");
  if(isconform)
   window.location="myfriends.php?action=delete&id=" + id;
 }


 function deflt_gal_pic(gpic_id,gal_id)
 {
  isconform=confirm("Do you really want to Change Default Picture?");
  if(isconform)
   window.location="gallery_pictures.php?action=def_gal_pic&gpic_id=" + gpic_id + "&gal_id="+gal_id;
 }

function checkimage()
 {
   if(document.picture.pic_name.value=="")
    {
      alert("Please select picture.");
      document.picture.pic_name.focus();
      return false;
    }
   else
    return true;
 }

function checkaudio()
 {
   if(document.audio.audio_name.value=="")
    {
      alert("Please select your audio file.");
      document.audio.audio_name.focus();
      return false;
    }
   else
    return true;
 }

 function del_audio(audio_id)
 {
  isconform=confirm("Do you really want to delete audio file?");
  if(isconform)
   window.location="profile_audio.php?action=delete_audio&audio_id=" + audio_id ;
 }

function checkvideo()
 {
   if(document.video.video_name.value=="")
    {
      alert("Please select you video file.");
      document.video.video_name.focus();
      return false;
    }
   else
    return true;
 }

 function del_video(video_id)
 {
  isconform=confirm("Do you really want to delete video file?");
  if(isconform)
   window.location="profile_video.php?action=delete_video&video_id=" + video_id ;
 }

function checkblog()
 {
   if(document.blog.blog_head.value=="")
    {
      alert("Please insert story heading.");
      document.blog.blog_head.focus();
      return false;
    }
   if(document.blog.blog_desc.value=="")
    {
      alert("Please insert story description.");
      document.blog.blog_desc.focus();
      return false;
    }
   else
    return true;
 }

 function del_blog(blog_id)
 {
  isconform=confirm("Do you really want to delete Story?");
  if(isconform)
   window.location="myblog.php?action=delete_blog&story_id=" + blog_id ;
 }


 function op_image_win(path)
 {
   window.open("view_image.php?path="+ path ,"pid2","location=0,scrollbars=yes,height=620,width=780,left=10,top=20");
 }
 
 function op_gallery_img(path)
 {
   window.open("view_gallery_image.php?path="+ path ,"pid2","location=0,scrollbars=yes,height=620,width=780,left=10,top=20");
 }
 
 

//------cnoverted to ajax-----
//function send_invitation(to_id)
// {
//   window.open("invitation.php?action=invite&to_id="+ to_id ,"pid3","location=0,scrollbars=no,height=420,width=780,left=10,top=20");
// }
//function send_wink(to_id)
// {
//   window.open("sendwink.php?action=sendwink&to_id="+ to_id ,"pid4","location=0,scrollbars=no,height=420,width=780,left=10,top=20");
// }
//function send_mail(to_id)
//{
//   window.open("sendmail.php?action=sendmail&to_id="+ to_id,"pid20","location=0,scrollbars=no,height=420,width=780,left=10,top=20");
//
//}
//function send_hotlist(to_id)
// {
//   window.open("sendhotlist.php?action=sendhot_list&to_id="+ to_id ,"pid5","location=0,scrollbars=no,height=420,width=780,left=10,top=20");
// }
//
//function block_user(to_id)
// {
//   window.open("blockuser.php?action=block&to_id="+ to_id ,"pid6","location=0,scrollbars=no,height=420,width=780,left=10,top=20");
// }

function unblock_user(id)
 {
   window.open("blockuser.php?action=unblock&id="+ id ,"pid7","location=0,scrollbars=no,height=420,width=780,left=10,top=20");
 }


 function invite_accept(from_id,id)
 {
   window.open("invitation_accept.php?action=accept&from_id="+ from_id +"&id="+id ,"pid8","location=0,scrollbars=no,height=420,width=780,left=10,top=20");
 }

 function invite_reject(from_id,id)
 {
   window.open("invitation_accept.php?action=reject&from_id="+ from_id +"&id="+id ,"pid9","location=0,scrollbars=no,height=420,width=780,left=10,top=20");
 }

 function open_profile_pic(id)
 {
   window.open("view_profile_picture.php?id="+id ,"pid10","location=0,scrollbars=yes,height=620,width=780,left=10,top=20");
 }


function checkusername()
{
var ajaxRequest;  // The variable that makes Ajax possible!
var mail_to = document.getElementById('mail_to').value;
//alert(mail_to);
try{
    // Opera 8.0+, Firefox, Safari
    ajaxRequest = new XMLHttpRequest();
  } catch (e){
    // Internet Explorer Browsers
    try{
      ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try{
        ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e){
        // Something went wrong
        alert("Your Browser broke!");
        return false;
      }
    }
  }
  // Create a function that will receive data sent from the server
  ajaxRequest.onreadystatechange = function()
   {
    if(ajaxRequest.readyState == 4)
     {
      //document.getElementById('div_username').style.position="relative";
      //document.getElementById('div_username').style.visibility="visible";
      var ajaxDisplay = document.getElementById("div_username");
      ajaxDisplay.innerHTML = ajaxRequest.responseText;
     }
   }
  var mail_to = document.getElementById('mail_to').value;
  var queryString = "?mail_to=" + mail_to;
  ajaxRequest.open("GET", "checkusername.php" + queryString, true);
  ajaxRequest.send(null);
}


function checkcompose()
 {
   if(document.send_msg.mail_to.value=="")
    {
      alert("Please insert username of your friends only.");
      document.send_msg.mail_to.focus();
      return false;
    }
   else
    document.send_msg.mail_to1.value=document.send_msg.mail_to.value;

   if(trimAll(document.send_msg.mail_sub.value)=="")
    {
      alert("Please insert subject.");
      document.send_msg.mail_sub.value="";
      document.send_msg.mail_sub.focus();
      return false;
    }
   if(trimAll(document.send_msg.mail_body.value)=="")
    {
      alert("Please write your message.");
      document.send_msg.mail_body.focus();
      return false;
    }
   else
    return true;
 }



function check_all()
 {
   var tol_no=document.getElementById('tot_no').value;
   var i;
   for(i=1;i<tol_no;i++)
     document.getElementById('chek'+i).checked=true;
 }

function delete_all()
 {
   var tol_no=document.getElementById('tot_no').value;
   var i;
   var count=0;
   for(i=1; i<tol_no; i++)
    {
     var path=eval ("document.delete_mail.chek"+i);
     if(path.checked==true)
       count=count+1;
    }
   if(count==0)
    {
     alert("Please select mail which you want to delete.");
    }
   else
    {
     isconform=confirm( "Do you really want to delete all items?" );
     if(isconform)
       document.delete_mail.submit();
    }
 }


function rating_verify()
 {
   if(document.getElementById("rate_pt").value=="")
    {
      alert("Please select rate point.");
      document.rating.rate_pt.focus();
      return false;
    }
   if(document.getElementById("rate_comment").value=="")
    {
      alert("Please insert comments.");
      document.rating.rate_comment.focus();
      return false;
    }
   else
    return true;
 }


function chk_article()
 {
    if(trimAll(document.getElementById("post_head").value)=="")
    {
    alert("Please Enter an Article Title");
    document.getElementById("post_head").focus();
    return false;
    }
    if(trimAll(document.getElementById("post_desc").value)=="")
    {
    alert("Please Enter an Article");
    document.getElementById("post_desc").focus();
    return false;
    }
 }



function trimAll(sString)
 {
  while (sString.substring(0,1) == ' ')
  {
   sString = sString.substring(1, sString.length);
  }
  while (sString.substring(sString.length-1, sString.length) == ' ')
  {
   sString = sString.substring(0,sString.length-1);
  }
  return sString;
 }


function validate()
{
  if(trimAll(document.getElementById("user_1").value)=="")
  {
    alert("Please Enter Username.");
    return false;
  }
  else
  return true;
}

function validate1()
{
  if(trimAll(document.getElementById("email").value)=="")
  {
    alert("Please Enter Email Id.");
    return false;
  }
  return true;
}

function chk_mand_fld()
{
if(trimAll(document.getElementById("pro_head").value)=="")
  {
    alert("Please Enter Profile Heading.");
    document.getElementById("pro_head").focus();
    return false;
  }
else if(document.getElementById("country_id").value=="")
  {
    alert("Please Select Country.");
    document.getElementById("country_id").focus();
    return false;
  }
else if(trimAll(document.getElementById("street").value)=="")
  {
    alert("Please Enter Street.");
    document.getElementById("street").focus();
    return false;
  }
else if(trimAll(document.getElementById("city").value)=="")
  {
    alert("Please Enter City.");
    document.getElementById("city").focus();
    return false;
  }
else if(trimAll(document.getElementById("fname1").value)=="")
  {
    alert("Please Enter First Name.");
    document.getElementById("fname1").focus();
    return false;
  }
else if(trimAll(document.getElementById("lname1").value)=="")
  {
    alert("Please Enter Last Name.");
    document.getElementById("lname1").focus();
    return false;
  }
else if(document.getElementById("sex1_p").value=="")
  {
    alert("Please Select Gender.");
    document.getElementById("sex1_p").focus();
    return false;
  }
else if(document.getElementById("day1").value=="")
  {
    alert("Please Select Date of Birth.");
    document.getElementById("day1").focus();
    return false;
  }
else if(document.getElementById("mon1").value=="")
  {
    alert("Please Select Date of Birth.");
    document.getElementById("mon1").focus();
    return false;
  }
else if(document.getElementById("year1").value=="")
  {
    alert("Please Select Date of Birth.");
    document.getElementById("year1").focus();
    return false;
  }
else if(trimAll(document.getElementById("about_me").value)=="")
  {
    alert("Please Enter - About Me.");
    document.getElementById("about_me").focus();
    return false;
  }
else if(trimAll(document.getElementById("about_partner").value)=="")
  {
    alert("Please Enter About Partner.");
    document.getElementById("about_partner").focus();
    return false;
  }
else if(document.getElementById("country_id").value=="254" )
  {

    if(document.getElementById("state_code").value=="")
    {
    alert("Please Select State.");
    document.getElementById("state_code").focus();
    return false;
    }

  }
else if(document.getElementById("country_id").value!="254" )
  {
    if( document.getElementById("region_id").value=="")
    {
    alert("Please Select Region.");
    document.getElementById("region_id").focus();
    return false;
    }

  }

}