
function numberonly(tb)           // onkeypress='return numberonly(this);'
{
var v=tb.value;
var carCode = event.keyCode;
if (((carCode < 48) || (carCode > 57)) && (carCode != 46))
{
event.cancelBubble = true;
alert('Numbers Only..');
event.returnValue = false;
}
else if((carCode == 46) && v.indexOf(".")!= -1 )
{
event.cancelBubble = true;
alert('Numbers Only..');
event.returnValue = false;
}
else if(v.length - v.indexOf(".")==3 && v.indexOf(".") != -1)
{
event.cancelBubble = true;
alert('Numbers Only..');
event.returnValue = false;
}
}

  function validate()
   {
    var count=0;
     if(document.frm.r1.value=='')
      {
       document.getElementById('a1').innerHTML='<font color="#FF0000">Fill Profile Id !..</font>';
       //document.frm.r1.focus();
       count++;
      }else{document.getElementById('a1').innerHTML='';}

     if(document.frm.r2.value=='')
      {
       document.getElementById('a2').innerHTML='<font color="#FF0000">Fill Email Address !..</font>';
       //document.frm.r2.focus();
       count++;
      }
     else
      {
       var str=document.frm.r2.value ;
       var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
       if (filter.test(str)) {document.getElementById('a2').innerHTML=''; }
       else
       {
        document.getElementById('a2').innerHTML='<font color="#FF0000">Please input a valid email address!..</font>';
        count++;
       }
      }

     if(document.frm.r3.value=='')
      {
       document.getElementById('a3').innerHTML='<font color="#FF0000">Retype Email Address !..</font>';
      // document.frm.r3.focus();
       count++;
      }
      else
      {
       var str=document.frm.r3.value;
       var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
       if (filter.test(str))
       {document.getElementById('a3').innerHTML=''; }
       else
       {
        document.getElementById('a3').innerHTML='<font color="#FF0000">Please input a valid email address!..</font>';
        count++;
       }
      }
      

     if(document.frm.r2.value==document.frm.r3.value) {document.getElementById('a3').innerHTML='';}else
      {
        document.getElementById('a3').innerHTML='<font color="#FF0000">Both Email Address Do Not Mach Try Again !..</font>';
        count++;
      }

     if(document.frm.r4.value=='')
      {
       document.getElementById('a4').innerHTML='<font color="#FF0000">Fill Password !.. </font>';
      // document.frm.r4.focus();
       count++;
      }else{document.getElementById('a4').innerHTML='';}

     if(document.frm.r5.value=='')
      {
       document.getElementById('a5').innerHTML='<font color="#FF0000">Retype Password !..</font>';
       //document.frm.r5.focus();
       count++;
      }else{document.getElementById('a5').innerHTML='';}

     if(document.frm.r4.value==document.frm.r5.value){document.getElementById('a5').innerHTML='';}else
      {
        document.getElementById('a5').innerHTML='<font color="#FF0000">Both Password Do Not Mach Try Again !..</font>';
        count++;
      }

     if(document.frm.r7.value=='')
      {
       document.getElementById('a7').innerHTML='<font color="#FF0000">Fill First Name  !..</font>';
       //document.frm.r7.focus();
       count++;
      }else{document.getElementById('a7').innerHTML='';}

    // if(document.frm.r9.value=='')
//      {
//       document.getElementById('a9').innerHTML='<font color="#FF0000">Fill Last Name  !..</font>';
//       //document.frm.r9.focus();
//       count++;
//      }else{document.getElementById('a9').innerHTML='';}


      if(document.frm.r11.value=='')
      {
       document.getElementById('a11').innerHTML='<font color="#FF0000">Select Date Of Birth  !..</font>';
       //document.frm.r11.focus();
       count++;
      }else{document.getElementById('a11').innerHTML='';}

     if(document.frm.r12.value=='0')
      {
       document.getElementById('a12').innerHTML='<font color="#FF0000">Select Marital Status  !..</font>';
      // document.frm.r12.focus();
       count++;
      }else{document.getElementById('a12').innerHTML='';}


      if(document.frm.r13.value=='0')
      {
       document.getElementById('a13').innerHTML='<font color="#FF0000">Select Height !..</font>';
      // document.frm.r13.focus();
       count++;
      }else{document.getElementById('a13').innerHTML='';}

      if(document.frm.r14.value=='')
      {
       document.getElementById('a14').innerHTML='<font color="#FF0000">Fill Weight !..</font>';
      // document.frm.r14.focus();
       count++;
      }else{document.getElementById('a14').innerHTML='';}
      
      if(document.frm.rage.value=='' || document.frm.rage.value<18)
      {
       document.getElementById('aage').innerHTML='<font color="#FF0000">Fill Your Age correctly!..</font>';
      // document.frm.rage.focus();
       count++;
      }else{document.getElementById('aage').innerHTML='';}

      if(document.frm.r15.value=='0')
      {
       document.getElementById('a15').innerHTML='<font color="#FF0000">Fill Mother Tongue !..</font>';
      // document.frm.r15.focus();
       count++;
      }else{document.getElementById('a15').innerHTML='';}

      if(document.frm.r16.value=='0')
      {
       document.getElementById('a16').innerHTML='<font color="#FF0000">Fill Education Attended  !..</font>';
      // document.frm.r16.focus();
       count++;
      }else{document.getElementById('a16').innerHTML='';}

      if(document.frm.r17.value=='0')
      {
       document.getElementById('a17').innerHTML='<font color="#FF0000">Fill Religion !..</font>';
      // document.frm.r17.focus();
       count++;
      }
      else
      {
       if (document.frm.r17.value==6){document.getElementById('a17').innerHTML='<font color="#0000FF">Any Other</font><BR><textarea name=detail17 id=detail17 class=w186 rows=2>'+document.getElementById('detail17').value+'</textarea>'}
       else{document.getElementById('a17').innerHTML='';}
      }
      
      if(document.frm.r18.value=='0')
      {
       document.getElementById('a18').innerHTML='<font color="#FF0000">Fill Organizational Category !..</font>';
       count++;
      }
      else
       {
       if (document.frm.r18.value==14)
        {
         document.getElementById('a18').innerHTML='<font color="#0000FF">Any Other</font><BR><textarea name=detail18 id=detail18 class=w186 rows=2>'+document.getElementById('detail18').value+'</textarea>'
        }
       else{document.getElementById('a18').innerHTML='';}
      }

      if(document.frm.r19.value=='0')
      {
       document.getElementById('a19').innerHTML='<font color="#FF0000">Fill Subject Area  !..</font>';
      // document.frm.r19.focus();
       count++;
      }
      else
       {
        if (document.frm.r19.value==11){document.getElementById('a19').innerHTML='<font color="#0000FF">Any Other</font><BR><textarea name=detail19 id=detail19 class=w186 rows=2>'+document.getElementById('detail19').value+'</textarea>'}
       else{document.getElementById('a19').innerHTML='';}
       }

      if(document.frm.r20.value=='0')
      {
       document.getElementById('a20').innerHTML='<font color="#FF0000">Fill Emoluments/ year !..</font>';
      // document.frm.r20.focus();
       count++;
      }else{document.getElementById('a20').innerHTML='';}

      if(document.frm.r21.value=='' || document.frm.r21.value>50)
      {
       document.getElementById('a21').innerHTML='<font color="#FF0000">Fill Your Experience Properly  !..</font>';
      // document.frm.r21.focus();
       count++;
      }else{document.getElementById('a21').innerHTML='';}

      if(document.frm.r22.value=='0')
      {
       document.getElementById('a22').innerHTML='<font color="#FF0000">Fill Country living !..</font>';
       //document.frm.r22.focus();
       count++;
      }else{document.getElementById('a22').innerHTML='';}

      if(document.frm.r23.value=='0')
      {
       document.getElementById('a23').innerHTML='<font color="#FF0000">Fill Residing State!..</font>';
      // document.frm.r23.focus();
       count++;
      }else{document.getElementById('a23').innerHTML='';}

      if(document.frm.r24.value=='0')
      {
       document.getElementById('a24').innerHTML='<font color="#FF0000">Fill Nationality!..</font>';
      // document.frm.r24.focus();
       count++;
      }else{document.getElementById('a24').innerHTML='';}

      if(document.frm.r25.value=='')
      {
       document.getElementById('a25').innerHTML='<font color="#FF0000">Fill City/Town/Village Name !..</font>';
      // document.frm.r25.focus();
       count++;
      }else{document.getElementById('a25').innerHTML='';}

      if(document.frm.r26.value=='')
      {
       document.getElementById('a26').innerHTML='<font color="#FF0000">Fill Mobile No.!..</font>';
      // document.frm.r26.focus();
       count++;
      }else{document.getElementById('a26').innerHTML='';}

      //if(document.frm.r27.value=='')
//      {
//       document.getElementById('a27').innerHTML='<font color="#FF0000">Fill Landline No.!..</font>';
//      // document.frm.r27.focus();
//       count++;
//      }else{document.getElementById('a27').innerHTML='';}

      if(document.frm.r28.value=='')
      {
       document.getElementById('a28').innerHTML='<font color="#FF0000">Fill Current Address!..</font>';
      // document.frm.r28.focus();
       count++;
      }else{document.getElementById('a28').innerHTML='';}

      if(document.frm.r29.value=='')
      {
       document.getElementById('a29').innerHTML='<font color="#FF0000">Fill Permanent Address!..</font>';
      // document.frm.r29.focus();
       count++;
      }else{document.getElementById('a29').innerHTML='';}

      //if(document.frm.r30.value=='')
//      {
//       document.getElementById('a30').innerHTML='<font color="#FF0000">Fill Personal Blog/ Website!..</font>';
//      // document.frm.r30.focus();
//       count++;
//      }else{document.getElementById('a30').innerHTML='';}

      if(document.frm.r31.value=='')
      {
       document.getElementById('a31').innerHTML='<font color="#FF0000">Fill Your Keywords !..</font>';
      // document.frm.r31.focus();
       count++;
      }else{document.getElementById('a31').innerHTML='';}

      if(document.frm.r32.value=='')
      {
       document.getElementById('a32').innerHTML='<font color="#FF0000">Fill Few words about yourself !..</font>';
      // document.frm.r32.focus();
       count++;
      }else{document.getElementById('a32').innerHTML='';}

      if(document.frm.r33.value=='')
      {
       document.getElementById('a33').innerHTML='<font color="#FF0000">Fill About my partner!..</font>';
      // document.frm.r33.focus();
       count++;
      }else{document.getElementById('a33').innerHTML='';}

      //if(document.frm.r34.value=='')
//      {
//       document.getElementById('a34').innerHTML='<font color="#FF0000">Fill Your Photograph!..</font>';
//      // document.frm.r34.focus();
//       count++;
//      }else{document.getElementById('a34').innerHTML='';}
//
//      if(document.frm.r35.value=='')
//      {
//       document.getElementById('a35').innerHTML='<font color="#FF0000">Fill Your Resume!..</font>';
//      // document.frm.r35.focus();
//       count++;
//      }else{document.getElementById('a35').innerHTML='';}

      if (count!=0){return false;} else{ return true; }

   }

function help(a,b)
 {
  for (var c=1;c<=35;c++) {document.getElementById('e'+c).innerHTML='';}
  document.getElementById('e'+a).innerHTML='<div class=commentfooter><div class=commentbox>'+b+'</div></div>';
 }
 
function check(a,b,c)
 {
  if (document.getElementById('r'+a).value==b)
   {
    document.getElementById('a'+a).innerHTML='<font color="#FF0000">'+c+'</font>';
   }
  else
   {
    if (a==3 || a==2)           //email check in ajex and mail-address
     {
      var str=document.getElementById('r'+a).value;
       var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
       if (filter.test(str))
        {
         if (document.getElementById('r2').value!='' && document.getElementById('r3').value!='')
          {
           if (document.getElementById('r2').value==document.getElementById('r3').value){document.getElementById('a3').innerHTML='<img src="images/loader.gif" width="16" height="16" border="0">&nbsp;<b> Loading ....</b>'; get_mail(document.getElementById('r3').value); }
           else {document.getElementById('a3').innerHTML='<font color="#FF0000">Both Email Address Do Not Mach Try Again !..</font>';}
          }
         else
          {document.getElementById('a'+a).innerHTML='';}
        }
       else
       {
        document.getElementById('a'+a).innerHTML='<font color="#FF0000">Please input a valid email address!..</font>';
       }
     }
    else if (a==4 || a==5)
     {
     if (document.getElementById('r4').value!='' && document.getElementById('r5').value!='')
      {
       if (document.getElementById('r4').value==document.getElementById('r5').value)
        {
         document.getElementById('a5').innerHTML='<table width=100%><tr><th style="background-color:#2D8B27;  color=#ffffff; font-weight:bold;"><font color=#FFFFFF>This Password is Valid To Register !....</font></th></tr></table>';
        }
       else
        {
         document.getElementById('a5').innerHTML='<font color="#FF0000">Both Password Do Not Mach Try Again !..</font>';
        }
      }
     }
    else if (a==21)
     {
      if (document.getElementById('r21').value>50)
       {document.getElementById('a21').innerHTML='<font color="#FF0000">Check Again your Experience !..</font>';}
      else
       {document.getElementById('a21').innerHTML='';}
     }
   else if (a=='age')
     {
      if (document.getElementById('rage').value<18)
       {document.getElementById('aage').innerHTML='<font color="#FF0000">Check Again your Age its should be 18+ !..</font>';}
      else
       {document.getElementById('aage').innerHTML='';}
     }
   else if (a==1)
     {
      if (document.getElementById('r1').value!='')
       {document.getElementById('a1').innerHTML='<img src="images/loader.gif" width="16" height="16" border="0">&nbsp;<b> Loading ....</b>'; get_profileid(document.getElementById('r1').value);}
      else
       {document.getElementById('a1').innerHTML='<font color="#FF0000">'+c+'</font>';}
     }
    else
     {
      if (document.getElementById('r17').value==6){}
      else if (document.getElementById('r18').value==14){}
      else if (document.getElementById('r19').value==11){}
      else {document.getElementById('a'+a).innerHTML='';}
     }
   }
 }

function check_img(a,c)
 {
  var val=document.getElementById('r'+a).value;
  if (val!='')
   {
    if (a==34)
    {
     var img = val.split(".");
     if (img[1]=='jpg' || img[1]=='gif'){document.getElementById('a'+a).innerHTML='';}else{document.getElementById('a'+a).innerHTML='<font color="#FF0000">'+c+'</font>'; document.getElementById('r'+a).focus();}
    }
   else
    {
     var img = val.split(".");
     if (img[1]=='doc' || img[1]=='docx'){document.getElementById('a'+a).innerHTML='';}else{document.getElementById('a'+a).innerHTML='<font color="#FF0000">'+c+'</font>'; document.getElementById('r'+a).focus();}
    }
   }
 }
function change(a,k)
 {
      if (document.getElementById('r'+a).value==k)
       {document.getElementById('a'+a).innerHTML='<font color="#0000FF">Any Other</font><BR><textarea name=detail'+a+' class=w186 rows=2></textarea>';}
      else
       {document.getElementById('a'+a).innerHTML='';}
 }

//----------------copy paste lock

function whichButton(event)
  {
   if (event.button==2)//RIGHT CLICK
    {
     alert('Sorry, this functionality is disabled.');
    }
  }

function noCTRL(e)
   {
    var code = (document.all) ? event.keyCode:e.which;
        if (parseInt(code)==17) //CTRL
          {
           alert('Sorry, this functionality is disabled.');
           window.event.returnValue = false;
          }
   }

//----------------copy paste lock

