﻿//////////////////////////////Body Onload COODING START HERE////////////////////////////
$(document).ready(function() {
//////////////////////////////Body Onload COODING START HERE////////////////////////////
 
    HideExtraProfessional();
 
	$('#lkProf').click(function() {
	  return lkProf_click($(this));
	});//$('#lkProf').click(function() {
 

//////////////////////////////Body Onload COODING END HERE////////////////////////////
});//$(document).ready(function() {
//////////////////////////////Body Onload COODING END HERE////////////////////////////




//================================================================
function HideExtraProfessional(){

	$('#Prof1').addClass("WHidden");
	$('#Prof2').addClass("WHidden");

}//function HideExtraEducation{

//================================================================
function lkProf_click(lkProf){

  var Prof1 = $('#Prof1');
  var Prof2 = $('#Prof2');
  
    
  if ( Prof1.css('display')== 'none'){
        Prof1.removeClass("WHidden")
        return false
  }//// if ( Prof2.css('display')== 'none'){
  
  if ( Prof2.css('display')== 'none'){
        Prof2.removeClass("WHidden")
        lkProf.addClass("WHidden")
        return false
  }// if ( Prof2.css('display')== 'none'){
  
  
  return false
}//function lkProf_click(){



function Validate_Professional(){

    //START:====================================Professional Experiences 1st panel Validation
    if (WIsEmptyValue('cmbEmp1')== false && WIsOtherSelected('cmbEmp1')== false ){

	   

        if(WIsEmptyValue('cmbProfCntry1')){
          LogError("Please select Country Information in Professional Experiences Section.");
        }
         

        if(WIsEmptyValue('cmbProfCty1')){
          LogError("Please select City Information in Professional Experiences Section.");
        }
        
        if(WIsEmptyValue('cmbInd1')){
          LogError("Please select Industry Information in Professional Experiences Section.");
        }       
        
        if(WIsEmptyValue('dtPickerFrm1')){
          LogError("You must define your working period 'From Date' in Professional Experiences Section.");
        }else if  (!WvalidateDate('dtPickerFrm1')){
          LogError("Invalid 'From Date' format in Professional Experiences Section.");
        }else if  (!WvalidateIsPastDate('dtPickerFrm1')){
          LogError("Working period 'From Date' in Professional Experiences Section cannot be greater than or equal to Current Date.");
        }// if(WIsEmptyValue('dtPickerFrm1')){
        

        
        if(!WIsEmptyValue('dtPickerTo1')){

            if  (!WvalidateDate('dtPickerTo1')){
              LogError("Invalid 'To Date' format in Professional Experiences Section.");
            }else if  (!WvalidateIsPastDate('dtPickerTo1')){
              LogError("Working period 'To Date' in Professional Experiences Section cannot be greater than or equal to Current Date.");
            }else if  (!WvalidateFromToDates('dtPickerFrm1', 'dtPickerTo1')){
              LogError("Working period 'To Date' in Professional Experiences Section must be greater than 'From Date'.");
            }//if  (!WvalidateDate('dtPickerTo1')){        
            
        }//if(!WIsEmptyValue('dtPickerTo1')){

        if (WIsEmptyValue('txtEmp1')  == false && WvalidateInteger('txtLastSal1') == false){
            LogError("Last Drawn Salary must be given in whole numbers and should be in Valid format in Professional Experiences Section.");
        }

        
       
    }else if (WIsOtherSelected('cmbEmp1') == true  && WIsEmptyValue('txtEmp1')  == true ){
      LogError("Please specify employer information.");
    }else if (WIsEmptyValue('cmbEmp1') == true && WIsEmptyValue('cmbProfCntry1') == false ){
      LogError("Please select employer information.");
    }else if (WIsEmptyValue('cmbEmp1') == true && WIsEmptyValue('cmbProfCty1') == false ){
      LogError("Please select employer information.");
    }else if (WIsEmptyValue('cmbEmp1') == true && WIsEmptyValue('cmbInd1') == false ){
      LogError("Please select employer information.");
    }else if (WIsEmptyValue('cmbEmp1') == true && WIsEmptyValue('txtPos1') == false ){
      LogError("Please select employer information.");
    }else if (WIsEmptyValue('cmbEmp1') == true && WIsEmptyValue('dtPickerFrm1') == false ){
      LogError("Please select employer information.");
    }else if (WIsEmptyValue('cmbEmp1') == true && WIsEmptyValue('dtPickerTo1') == false ){
      LogError("Please select employer information.");
    }else if (WIsEmptyValue('cmbEmp1') == true && WIsEmptyValue('txtLastSal1') == false ){
      LogError("Please select employer information.");
    }else if (WIsEmptyValue('cmbEmp1') == true && WIsEmptyValue('txtDet1') == false ){
      LogError("Please select employer information.");
    }//if (!WIsEmptyValue('cmbEmp1')){

    //END:======================================Professional Experiences 1st panel Validation


    //START:====================================Professional Experiences 2nd panel Validation
    if (WIsEmptyValue('cmbEmp2')== false && WIsOtherSelected('cmbEmp2')== false ){

       

        if(WIsEmptyValue('cmbProfCntry2')){
          LogError("Please select Country Information in Professional Experiences Section.");
        }
         

        if(WIsEmptyValue('cmbProfCty2')){
          LogError("Please select City Information in Professional Experiences Section.");
        }
        
        if(WIsEmptyValue('cmbInd2')){
          LogError("Please select Industry Information in Professional Experiences Section.");
        }       
        
        if(WIsEmptyValue('dtPickerFrm2')){
          LogError("You must define your working period 'From Date' in Professional Experiences Section.");
        }else if  (!WvalidateDate('dtPickerFrm2')){
          LogError("Invalid 'From Date' format in Professional Experiences Section.");
        }else if  (!WvalidateIsPastDate('dtPickerFrm2')){
          LogError("Working period 'From Date' in Professional Experiences Section cannot be greater than or equal to Current Date.");
        }// if(WIsEmptyValue('dtPickerFrm2')){
        
        

        if  (WIsEmptyValue('dtPickerTo2')){
          LogError("You must define your working period 'To Date' in Professional Experiences Section.");
        }else if  (!WvalidateDate('dtPickerTo2')){
          LogError("Invalid 'To Date' format in Professional Experiences Section.");
        }else if  (!WvalidateIsPastDate('dtPickerTo2')){
          LogError("Working period 'To Date' in Professional Experiences Section cannot be greater than or equal to Current Date.");
        }else if  (!WvalidateFromToDates('dtPickerFrm2', 'dtPickerTo2')){
          LogError("Working period 'To Date' in Professional Experiences Section must be greater than 'From Date'.");
        }//if  (!WvalidateDate('dtPickerTo2')){        
        

        if (WIsEmptyValue('txtEmp2')  == false && WvalidateInteger('txtLastSal2') == false){
            LogError("Last Drawn Salary must be given in whole numbers and should be in Valid format in Professional Experiences Section.");
        }

        
       
    }else if (WIsOtherSelected('cmbEmp2') == true  && WIsEmptyValue('txtEmp2')  == true ){
      LogError("Please specify employer information.");
    }else if (WIsEmptyValue('cmbEmp2') == true && WIsEmptyValue('cmbProfCntry2') == false ){
      LogError("Please select employer information.");
    }else if (WIsEmptyValue('cmbEmp2') == true && WIsEmptyValue('cmbProfCty2') == false ){
      LogError("Please select employer information.");
    }else if (WIsEmptyValue('cmbEmp2') == true && WIsEmptyValue('cmbInd2') == false ){
      LogError("Please select employer information.");
    }else if (WIsEmptyValue('cmbEmp2') == true && WIsEmptyValue('txtPos2') == false ){
      LogError("Please select employer information.");
    }else if (WIsEmptyValue('cmbEmp2') == true && WIsEmptyValue('dtPickerFrm2') == false ){
      LogError("Please select employer information.");
    }else if (WIsEmptyValue('cmbEmp2') == true && WIsEmptyValue('dtPickerTo2') == false ){
      LogError("Please select employer information.");
    }else if (WIsEmptyValue('cmbEmp2') == true && WIsEmptyValue('txtLastSal2') == false ){
      LogError("Please select employer information.");
    }else if (WIsEmptyValue('cmbEmp2') == true && WIsEmptyValue('txtDet2') == false ){
      LogError("Please select employer information.");
    }//if (!WIsEmptyValue('cmbEmp2')){

    //END:======================================Professional Experiences 2nd panel Validation


    //START:====================================Professional Experiences 3rd panel Validation
    if (WIsEmptyValue('cmbEmp3')== false && WIsOtherSelected('cmbEmp3')== false ){

       

        if(WIsEmptyValue('cmbProfCntry3')){
          LogError("Please select Country Information in Professional Experiences Section.");
        }
         

        if(WIsEmptyValue('cmbProfCty3')){
          LogError("Please select City Information in Professional Experiences Section.");
        }
        
        if(WIsEmptyValue('cmbInd3')){
          LogError("Please select Industry Information in Professional Experiences Section.");
        }       
        
        if(WIsEmptyValue('dtPickerFrm3')){
          LogError("You must define your working period 'From Date' in Professional Experiences Section.");
        }else if  (!WvalidateDate('dtPickerFrm3')){
          LogError("Invalid 'From Date' format in Professional Experiences Section.");
        }else if  (!WvalidateIsPastDate('dtPickerFrm3')){
          LogError("Working period 'From Date' in Professional Experiences Section cannot be greater than or equal to Current Date.");
        }// if(WIsEmptyValue('dtPickerFrm3')){
        
        

        if  (WIsEmptyValue('dtPickerTo3')){
          LogError("You must define your working period 'To Date' in Professional Experiences Section.");
        }else if  (!WvalidateDate('dtPickerTo3')){
          LogError("Invalid 'To Date' format in Professional Experiences Section.");
        }else if  (!WvalidateIsPastDate('dtPickerTo3')){
          LogError("Working period 'To Date' in Professional Experiences Section cannot be greater than or equal to Current Date.");
        }else if  (!WvalidateFromToDates('dtPickerFrm3', 'dtPickerTo3')){
          LogError("Working period 'To Date' in Professional Experiences Section must be greater than 'From Date'.");
        }//if  (!WvalidateDate('dtPickerTo3')){        
        

        if (WIsEmptyValue('txtEmp3')  == false && WvalidateInteger('txtLastSal3') == false){
            LogError("Last Drawn Salary must be given in whole numbers and should be in Valid format in Professional Experiences Section.");
        }

        
       
    }else if (WIsOtherSelected('cmbEmp3') == true  && WIsEmptyValue('txtEmp3')  == true ){
      LogError("Please specify employer information.");
    }else if (WIsEmptyValue('cmbEmp3') == true && WIsEmptyValue('cmbProfCntry3') == false ){
      LogError("Please select employer information.");
    }else if (WIsEmptyValue('cmbEmp3') == true && WIsEmptyValue('cmbProfCty3') == false ){
      LogError("Please select employer information.");
    }else if (WIsEmptyValue('cmbEmp3') == true && WIsEmptyValue('cmbInd3') == false ){
      LogError("Please select employer information.");
    }else if (WIsEmptyValue('cmbEmp3') == true && WIsEmptyValue('txtPos3') == false ){
      LogError("Please select employer information.");
    }else if (WIsEmptyValue('cmbEmp3') == true && WIsEmptyValue('dtPickerFrm3') == false ){
      LogError("Please select employer information.");
    }else if (WIsEmptyValue('cmbEmp3') == true && WIsEmptyValue('dtPickerTo3') == false ){
      LogError("Please select employer information.");
    }else if (WIsEmptyValue('cmbEmp3') == true && WIsEmptyValue('txtLastSal3') == false ){
      LogError("Please select employer information.");
    }else if (WIsEmptyValue('cmbEmp3') == true && WIsEmptyValue('txtDet3') == false ){
      LogError("Please select employer information.");
    }//if (!WIsEmptyValue('cmbEmp3')){

    //END:======================================Professional Experiences 3rd panel Validation


 

}//function Validate_Professional(){
