var error = 0;
var msg = "";

function validateEmail(email)
{
    var splitted = email.match("^(.+)@(.+)$");
    if(splitted == null) return false;
    if(splitted[1] != null )
    {
      var regexp_user=/^\"?[\w-_\.]*\"?$/;
      if(splitted[1].match(regexp_user) == null) return false;
    }
    if(splitted[2] != null)
    {
      var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/;
      if(splitted[2].match(regexp_domain) == null) 
      {
        var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;
        if(splitted[2].match(regexp_ip) == null) return false;
      }// if
      return true;
    }
    return false;
}


function isExpiryDate(month, year) {
    var today = new Date();
    var expiry = new Date("20"+year, month);
    if (today.getTime() > expiry.getTime())
    return false;
    else
    return true;
}


function validateEmailPass(){
    msg = "";
    var myval = jQuery.trim(jQuery('#email').val());
    var myval1 = jQuery.trim(jQuery('#emailVerify').val());
    var errorimg = 0;
    
    if(requireExistingMember == false){
        jQuery('#email').removeClass('input_error');
        jQuery('#emailVerify').removeClass('input_error');
            
        //-------- email validation -----------//
        if(myval==""){
            jQuery('#email').addClass('input_error');
            msg = ">> You forgot to fill email id.";
        }else{
            if(!validateEmail(myval)){            
                error = 1;
                errorimg = 1;
                jQuery('#email').addClass('input_error');
                msg += "\n>> Invalid email id.";
            }
        }
        
        if(myval1==""){
            error = 1;
            errorimg = 1;
            jQuery('#emailVerify').addClass('input_error');
            msg += "\n>> You forgot to fill verify email id.";
        }
        
        if(myval != myval1){
            error = 1;
            errorimg = 1;
            jQuery('#emailVerify').addClass('input_error');
            msg += "\n>> Email & verify email ids are not equal.";
        }
        
        //-------- password validate -------------//
        myval = jQuery.trim(jQuery('#orbisPassword').val());
        myval1 = jQuery.trim(jQuery('#orbisPasswordVerify').val());
        jQuery('#orbisPassword').removeClass('input_error');
        jQuery('#orbisPasswordVerify').removeClass('input_error');
        
        if(myval == ""){
            error = 1;
            errorimg = 1;
            jQuery('#orbisPassword').addClass('input_error');        
            msg += "\n>> You forgot to fill password.";
        }else{
            if(myval != myval1){
                error = 1;
                errorimg = 1;
                jQuery('#orbisPasswordVerify').addClass('input_error');
                msg += "\n>> Invalid verify password.";
                
                jQuery('#signupverfiypassword').html("<div style='float:left; color:#ff0000'>Invalid password</div><div style='float:left;'>&nbsp;<img src='"+ABS_WP_URL+"wordpress/wp-content/uploads/delete2.png'></div><br clear='all' />");
            }else{
                jQuery('#signupverfiypassword').html("<div style='float:left; color:green'>Valid password</div><div style='float:left;'>&nbsp;<img src='"+ABS_WP_URL+"wordpress/wp-content/uploads/check2.png'></div><br clear='all' />");
            }
        }
        
        if(myval1==""){
            error = 1;
            errorimg = 1;
            jQuery('#orbisPasswordVerify').addClass('input_error');
            msg += "\n>> You forgot to fill verify password.";       
        }else{
            jQuery('#orbisPasswordVerify').removeClass('input_error'); 
        }        
    }
    
    if(errorimg == 1){
        jQuery("#signupStep1").attr("src", ABS_WP_URL+"wordpress/wp-content/uploads/delete2.png");
    }else{
        jQuery("#signupStep1").attr("src", ABS_WP_URL+"wordpress/wp-content/uploads/check2.png");       
    }    
}


function validateCaptacha(){
    var errorimg = 0;
    msg = "";
    var myval = jQuery.trim(jQuery('#captcha_code').val());
    jQuery('#captcha_code').removeClass('input_error'); 
    if(myval == ""){
        error = 1;
        errorimg = 1;
        jQuery('#captcha_code').addClass('input_error');
        msg += "\n>> You forgot to fill verification code.";
    }    

    if(errorimg == 1){
        jQuery("#signupStep2").attr("src", ABS_WP_URL+"wordpress/wp-content/uploads/delete2.png");
    }else{
        jQuery("#signupStep2").attr("src", ABS_WP_URL+"wordpress/wp-content/uploads/check2.png");       
    }    
}


function validateContactinfo(){
    var errorimg = 0;
    msg = "";
    var myval = jQuery.trim(jQuery('#firstName').val());
    jQuery('#firstName').removeClass('input_error'); 
    if(myval == ""){
        error = 1;
        errorimg = 1;
        jQuery('#firstName').addClass('input_error');
        msg += "\n>> You forgot to fill first name of contact info.";
    }

    myval = jQuery.trim(jQuery('#lastName').val());
    jQuery('#lastName').removeClass('input_error'); 
    if(myval == ""){
        error = 1;
        errorimg = 1;
        jQuery('#lastName').addClass('input_error');
        msg += "\n>> You forgot to fill last name of contact info.";
    }
    
    myval = jQuery.trim(jQuery('#address').val());
    jQuery('#address').removeClass('input_error'); 
    if(myval == ""){
        error = 1;
        errorimg = 1;
        jQuery('#address').addClass('input_error');
        msg += "\n>> You forgot to fill address of contact info.";
    }
    
    myval = jQuery.trim(jQuery('#city').val());
    jQuery('#city').removeClass('input_error'); 
    if(myval == ""){
        error = 1;
        errorimg = 1;
        jQuery('#city').addClass('input_error');
        msg += "\n>> You forgot to fill city of contact info.";
    }
    
    myval = jQuery.trim(jQuery('#state').val());
    jQuery('#state').removeClass('input_error'); 
    if(myval == ""){
        error = 1;
        errorimg = 1;
        jQuery('#state').addClass('input_error');
        msg += "\n>> You forgot to fill state of contact info.";
    }

    myval = jQuery.trim(jQuery('#zip').val());
    jQuery('#zip').removeClass('input_error'); 
    if(myval == ""){
        error = 1;
        errorimg = 1;
        jQuery('#zip').addClass('input_error');
        msg += "\n>> You forgot to fill zip of contact info.";
    }

    myval = jQuery.trim(jQuery('#dayPhone').val());
    jQuery('#dayPhone').removeClass('input_error'); 
    if(myval == ""){
        error = 1;
        errorimg = 1;
        jQuery('#dayPhone').addClass('input_error');
        msg += "\n>> You forgot to fill day phone number of contact info.";
    }

    myval = jQuery.trim(jQuery('#nightphone').val());
    jQuery('#nightphone').removeClass('input_error'); 
    if(myval == ""){
        error = 1;
        errorimg = 1;
        jQuery('#nightphone').addClass('input_error');
        msg += "\n>> You forgot to fill night phone number of contact info.";
    }


    if(errorimg == 1){
        jQuery("#signupStep3").attr("src", ABS_WP_URL+"wordpress/wp-content/uploads/delete2.png");
    }else{
        jQuery("#signupStep3").attr("src", ABS_WP_URL+"wordpress/wp-content/uploads/check2.png");       
    }    
}

function validateContactinfo1(){
 var errorimg = 0;
    msg = "";
    var myval = jQuery.trim(jQuery('#firstName').val());
    jQuery('#firstName').removeClass('input_error'); 
    if(myval == ""){
        error = 1;
        errorimg = 1;
        jQuery('#firstName').addClass('input_error');
        msg += "\n>> You forgot to fill first name of contact info.";
    }

    myval = jQuery.trim(jQuery('#lastName').val());
    jQuery('#lastName').removeClass('input_error'); 
    if(myval == ""){
        error = 1;
        errorimg = 1;
        jQuery('#lastName').addClass('input_error');
        msg += "\n>> You forgot to fill last name of contact info.";
    }
	
	 if(errorimg == 1){
		 jQuery("#signupStep3").attr("src", ABS_WP_URL+"wordpress/wp-content/uploads/delete2.png");
    }else{
		
        jQuery("#signupStep3").attr("src", ABS_WP_URL+"wordpress/wp-content/uploads/check2.png");       
    }    
}



function validateBillinginfo(){
    var errorimg = 0;
    msg = "";
    var myval = jQuery.trim(jQuery('#bill_firstName').val());
    jQuery('#bill_firstName').removeClass('input_error'); 
    if(myval == ""){
        error = 1;
        errorimg = 1;
        jQuery('#bill_firstName').addClass('input_error');
        msg += "\n>> You forgot to fill first name of billing info.";
    }

    myval = jQuery.trim(jQuery('#bill_lastName').val());
    jQuery('#bill_lastName').removeClass('input_error'); 
    if(myval == ""){
        error = 1;
        errorimg = 1;
        jQuery('#bill_lastName').addClass('input_error');
        msg += "\n>> You forgot to fill last name of billing info.";
    }
    
    myval = jQuery.trim(jQuery('#cc_address').val());
    jQuery('#cc_address').removeClass('input_error'); 
    if(myval == ""){
        error = 1;
        errorimg = 1;
        jQuery('#cc_address').addClass('input_error');
        msg += "\n>> You forgot to fill address of billing info.";
    }
    
    myval = jQuery.trim(jQuery('#cc_city').val());
    jQuery('#cc_city').removeClass('input_error'); 
    if(myval == ""){
        error = 1;
        errorimg = 1;
        jQuery('#cc_city').addClass('input_error');
        msg += "\n>> You forgot to fill city of billing info.";
    }
    
    myval = jQuery.trim(jQuery('#cc_state').val());
    jQuery('#cc_state').removeClass('input_error'); 
    if(myval == ""){
        error = 1;
        errorimg = 1;
        jQuery('#cc_state').addClass('input_error');
        msg += "\n>> You forgot to fill state of billing info.";
    }

    myval = jQuery.trim(jQuery('#cc_zip').val());
    jQuery('#cc_zip').removeClass('input_error'); 
    if(myval == ""){
        error = 1;
        errorimg = 1;
        jQuery('#cc_zip').addClass('input_error');
        msg += "\n>> You forgot to fill zip of billing info.";
    }

    myval = jQuery.trim(jQuery('#bill_dayPhone').val());
    jQuery('#bill_dayPhone').removeClass('input_error'); 
    if(myval == ""){
        error = 1;
        errorimg = 1;
        jQuery('#bill_dayPhone').addClass('input_error');
        msg += "\n>> You forgot to fill day phone number of billing info.";
    }

    myval = jQuery.trim(jQuery('#bill_nightphone').val());
    jQuery('#bill_nightphone').removeClass('input_error'); 
    if(myval == ""){
        error = 1;
        errorimg = 1;
        jQuery('#bill_nightphone').addClass('input_error');
        msg += "\n>> You forgot to fill night phone number of billing info.";
    }

    if(errorimg == 1){
        jQuery("#signupStep4").attr("src", ABS_WP_URL+"wordpress/wp-content/uploads/delete2.png");
    }else{
        jQuery("#signupStep4").attr("src", ABS_WP_URL+"wordpress/wp-content/uploads/check2.png");       
    }    
}



function validateTACagree(){
    var errorimg = 0; 
    msg = "";
    var myval = jQuery('#termsGroupInput').is(':checked');    
    if(myval){
		error = 0;
        jQuery('#termsGroupInput').removeClass('input_error'); 
        jQuery("#signupStep5").attr("src", ABS_WP_URL+"wordpress/wp-content/uploads/check2.png"); 
        return true;
    }else{
        errorimg = 1;
		error = 1;
        jQuery('#termsGroupInput').addClass('input_error');
        jQuery("#signupStep5").attr("src", ABS_WP_URL+"wordpress/wp-content/uploads/delete2.png");
        if(errorimg == 1){
            alert(">> Please check the checkbox to agree with term & conditions.");
			return false;
        }
        return false;
    }
}


function validateCCform(){
    var myval = "";
    var myval1 = "";
    var errorimg = 0;
    msg = "";
    myval = jQuery.trim(jQuery('#cc_firstName').val());
    jQuery('#cc_firstName').removeClass('input_error'); 
    if(myval == ""){
        error = 1;
        errorimg = 1;
        jQuery('#cc_firstName').addClass('input_error');
        msg += "\n>> You forgot to first name of credit card.";
    }
    
    myval = jQuery.trim(jQuery('#cc_lastName').val());
    jQuery('#cc_lastName').removeClass('input_error'); 
    if(myval == ""){
        error = 1;
        errorimg = 1;
        jQuery('#cc_lastName').addClass('input_error');
        msg += "\n>> You forgot to last name of credit card.";
    }
    
    myval = jQuery.trim(jQuery('#cardNumber').val());
    jQuery('#cardNumber').removeClass('input_error'); 
    if(myval == ""){
        error = 1;
        errorimg = 1;
        jQuery('#cardNumber').addClass('input_error');
        msg += "\n>> You forgot to credit card number.";
    }else{
        if(isValidCreditCardNumber(myval, jQuery('#cardType').val())){
            jQuery("#signupcccardNumber").attr("src", ABS_WP_URL+"wordpress/wp-content/uploads/check2.png");
        }else{
            error = 1;
            errorimg = 1;
            jQuery('#cardNumber').addClass('input_error');
            msg += "\n>> Invalid credit card number.";
            jQuery("#signupcccardNumber").attr("src", ABS_WP_URL+"wordpress/wp-content/uploads/delete2.png");
        }
    }
    
    myval = jQuery.trim(jQuery('#expirationDate').val());
    jQuery('#expirationDate').removeClass('input_error'); 
    if(myval == ""){
        error = 1;
        errorimg = 1;
        jQuery('#expirationDate').addClass('input_error');
        msg += "\n>> You forgot to fill credit card expiry date.";
    }else{
        myval = myval.split("/");
        myval = isExpiryDate(myval[0], myval[1]);
        
        if(myval){
           // jQuery("#signupccexpirationDate").attr("src", ABS_WP_URL+"wordpress/wp-content/uploads/check2.png");
        }else{
            error = 1;
            errorimg = 1;
            jQuery('#expirationDate').addClass('input_error');
           // jQuery("#signupccexpirationDate").attr("src", ABS_WP_URL+"wordpress/wp-content/uploads/delete2.png");
            //alert(">> Credit card has been expired.");
        }
    }
    
    myval = jQuery.trim(jQuery('#CVV2').val());
    jQuery('#CVV2').removeClass('input_error'); 
    if(myval == ""){
        error = 1;
        errorimg = 1;
        jQuery('#CVV2').addClass('input_error');
        msg += "\n>> You forgot to fill CCV2 code.";
    }
    
    if(errorimg == 1){
       // jQuery("#signupStep6").attr("src", ABS_WP_URL+"wordpress/wp-content/uploads/delete2.png");
    }else{
       // jQuery("#signupStep6").attr("src", ABS_WP_URL+"wordpress/wp-content/uploads/check2.png");       
    } 
	 
	
}


function validateSignUp(){
    var myval = "";
    var myval1 = "";
    msg = "";
    error = 0;
    
    validateEmailPass();
    
    //--------- validate captacha ---------//
    validateCaptacha();
    
    //------- credit card infomation ----------------//
   // validateCCform();

    //------- Contact infomation ----------------//
    validateContactinfo();
    
    //------- Billing infomation ----------------//
    validateBillinginfo();

       
	   
	   
      if(document.signUp.email.value=="")
	   {
		 alert("Please enter your email");   
		 document.signUp.email.focus();  
		 return false;  
	   }
	   
	   if(document.signUp.email.value!=document.signUp.emailVerify.value)
	   {
		 alert("Please Verify your email");   
		 document.signUp.emailVerify.focus();  
		 return false;  
	   }
	   
	   if(document.signUp.orbisPassword.value=="")
	   {
		 alert("Password can not be blank");   
		 document.signUp.orbisPassword.focus();  
		 return false;  
	   }
	   if(document.signUp.orbisPassword.value!=document.signUp.orbisPasswordVerify.value)
	   {
		 alert("Password can not be blank");   
		 document.signUp.orbisPasswordVerify.focus();  
		 return false;  
	   }
	  
	  
	   if(document.signUp.captcha_code.value=="")
	   {
		 alert("Captcha Code can not be blank");   
		 document.signUp.captcha_code.focus();  
		 return false;  
	   }
	   
	   if(document.signUp.cc_firstName.value=="")
	   {
		 alert("First Name can not be blank");   
		 document.signUp.cc_firstName.focus();  
		 return false;  
	   }
	   
	   if(document.signUp.cc_lastName.value=="")
	   {
		 alert("Last Name can not be blank");   
		 document.signUp.cc_lastName.focus();  
		 return false;  
	   }
	
	   if(document.signUp.cardNumber.value=="")
	   {
		 alert("Card Number can not be blank");   
		 document.signUp.cardNumber.focus();  
		 return false;  
	   }
	   
	   if(document.signUp.expirationDate.value=="")
	   {
		 alert("Expiration Date can not be blank");   
		 document.signUp.expirationDate.focus();  
		 return false;  
	   }
	   
	   if(document.signUp.CVV2.value=="")
	   {
		 alert("CVV2 can not be blank");   
		 document.signUp.CVV2.focus();  
		 return false;  
	   }
	   
	   if(document.signUp.firstName.value=="")
	   {
		 alert("First Name can not be blank");   
		 document.signUp.firstName.focus();  
		 return false;  
	   }
	   
	   if(document.signUp.lastName.value=="")
	   {
		 alert("Last Name can not be blank");   
		 document.signUp.lastName.focus();  
		 return false;  
	   }
	   
	   if(document.signUp.address.value=="")
	   {
		 alert("Address can not be blank");   
		 document.signUp.address.focus();  
		 return false;  
	   }
	   
	   if(document.signUp.city.value=="")
	   {
		 alert("City can not be blank");   
		 document.signUp.city.focus();  
		 return false;  
	   }
	   
	   if(document.signUp.state.value=="")
	   {
		 alert("State can not be blank");   
		 document.signUp.state.focus();  
		 return false;  
	   }
	   
	   if(document.signUp.zip.value=="")
	   {
		 alert("Zip can not be blank");   
		 document.signUp.zip.focus();  
		 return false;  
	   }
	   
	   if(document.signUp.dayPhone.value=="")
	   {
		 alert("Day Phone can not be blank");   
		 document.signUp.dayPhone.focus();  
		 return false;  
	   }
	   
	   if(document.signUp.nightphone.value=="")
	   {
		 alert("Night Phone can not be blank");   
		 document.signUp.nightphone.focus();  
		 return false;  
	   }
	   
	   if(document.signUp.bill_firstName.value=="")
	   {
		 alert("First Name can not be blank");   
		 document.signUp.bill_firstName.focus();  
		 return false;  
	   }
	   
	   if(document.signUp.bill_lastName.value=="")
	   {
		 alert("Last Name can not be blank");   
		 document.signUp.bill_lastName.focus();  
		 return false;  
	   }
	   
	   if(document.signUp.cc_address.value=="")
	   {
		 alert("Address can not be blank");   
		 document.signUp.cc_address.focus();  
		 return false;  
	   }
	   
	   if(document.signUp.cc_city.value=="")
	   {
		 alert("City can not be blank");   
		 document.signUp.cc_city.focus();  
		 return false;  
	   }
	   
	   if(document.signUp.cc_state.value=="")
	   {
		 alert("State can not be blank");   
		 document.signUp.cc_state.focus();  
		 return false;  
	   }
	   
	   if(document.signUp.cc_zip.value=="")
	   {
		 alert("Zip can not be blank");   
		 document.signUp.cc_zip.focus();  
		 return false;  
	   }
	   
	   if(document.signUp.bill_dayPhone.value=="")
	   {
		 alert("Day Phone can not be blank");   
		 document.signUp.bill_dayPhone.focus();  
		 return false;  
	   }
	   
	   if(document.signUp.bill_nightphone.value=="")
	   {
		 alert("Home Phone can not be blank");   
		 document.signUp.bill_nightphone.focus();  
		 return false;  
	   }
	   
	  
	   if(document.signUp.termsGroup.checked=="")
	   {
		 alert("Check Terms and Condition");   
		 document.signUp.termsGroup.focus();  
		 return false;  
	   }
	   return true;
    if(error == 1){
        alert(">> Please fill proper value in red boxes.");
        //alert(msg);
        return false;
    }
    
    //--------- term & conditions --------------------//
	var myval = jQuery('#termsGroupInput').is(':checked');    
    if(myval==""){
		validateTACagree();
        return false;
    }
    
}


function validateSignUp1(){
    var myval = "";
    var myval1 = "";
    msg = "";
    error = 0;
    
    validateEmailPass();
    
    //--------- validate captacha ---------//
    validateCaptacha();
   			

    //------- Contact infomation ----------------//
    validateContactinfo1();
	
	 if(document.signUp.email.value=="")
	   {
		 alert("Please enter your email");   
		 document.signUp.email.focus();  
		 return false;  
	   }
	   
	   if(document.signUp.email.value!=document.signUp.emailVerify.value)
	   {
		 alert("Please Verify your email");   
		 document.signUp.emailVerify.focus();  
		 return false;  
	   }
	   
	   if(document.signUp.orbisPassword.value=="")
	   {
		 alert("Password can not be blank");   
		 document.signUp.orbisPassword.focus();  
		 return false;  
	   }
	   if(document.signUp.orbisPassword.value!=document.signUp.orbisPasswordVerify.value)
	   {
		 alert("Password can not be blank");   
		 document.signUp.orbisPasswordVerify.focus();  
		 return false;  
	   }
	  
	  
	   if(document.signUp.captcha_code.value=="")
	   {
		 alert("Captcha Code can not be blank");   
		 document.signUp.captcha_code.focus();  
		 return false;  
	   }
       if(document.signUp.firstName.value=="")
	   {
		 alert("First Name can not be blank");   
		 document.signUp.firstName.focus();  
		 return false;  
	   }
	   
	   if(document.signUp.lastName.value=="")
	   {
		 alert("Last Name can not be blank");   
		 document.signUp.lastName.focus();  
		 return false;  
	   }

 if(error == 1){
        alert(">> Please fill proper value in red boxes.");
        //alert(msg);
        return false;
    }
    
    //--------- term & conditions --------------------//
	
    
}





function setValContact(myval){
    var myArr = new Array("firstName", "lastName", "company", "address", "address2", "city", "state", "zip", "cellphone", "dayPhone", "nightphone");
    var myArr1 = new Array("bill_firstName", "bill_lastName", "cc_company", "cc_address", "cc_address2", "cc_city", "cc_state", "cc_zip", "cc_phone", "bill_dayPhone", "bill_nightphone");
    if(myval == "true" || myval == true){
        for(var i=0; i<myArr.length; i++){
            jQuery('#'+myArr1[i]).val(jQuery('#'+myArr[i]).val());
			
        }
			
		
    }else{
        for(var i=0; i<myArr.length; i++){
            jQuery('#'+myArr1[i]).val('');        
        }
    }
}


function validateEmailInFusion(email){
    if(!validateEmail(email)){
        return false;
    }
    jQuery("#emailexistimg").html("&nbsp;<img src='"+ABS_WP_URL+"wordpress/wp-content/uploads/ajax-loader2.gif' />");
    jQuery.ajax({
        type: "POST",
        url: ABS_WP_URL+"?page_id=891",
        data: "email="+email+"&process=chkmailInfusion",
        success: function(msg){
            if(msg==1){
                jQuery('#emailexistsinfusion').show();
                jQuery('#email').addClass('input_error');
                jQuery("#emailexistimg").html("&nbsp;<img src='"+ABS_WP_URL+"wordpress/wp-content/uploads/delete2.png' />");
            }else{
                jQuery('#emailexistsinfusion').hide();
                jQuery('#email').removeClass('input_error');
                jQuery("#emailexistimg").html("&nbsp;<img src='"+ABS_WP_URL+"wordpress/wp-content/uploads/check2.png' />");
            }
        }
    });
}


function validateAjaxCaptacha(myval){    
    jQuery("#verifycaptchatimg").html("&nbsp;<img src='"+ABS_WP_URL+"wordpress/wp-content/uploads/ajax-loader2.gif' />");
    jQuery.ajax({
        type: "POST",
        url: ABS_WP_URL+"?page_id=891",
        data: "code="+myval+"&process=checkSignupCaptcha",
        success: function(msg){
            if(msg==1){
                jQuery('#captcha_code').addClass('input_error');
                jQuery("#verifycaptchatimg").html("&nbsp;<img src='"+ABS_WP_URL+"wordpress/wp-content/uploads/delete2.png' />");
            }else{
                jQuery('#captcha_code').removeClass('input_error');
                jQuery("#verifycaptchatimg").html("&nbsp;<img src='"+ABS_WP_URL+"wordpress/wp-content/uploads/check2.png' />");
            }
        }
    });    
}

function fillToCCname(myval, myval1){
    if(myval1 == 1){
        if(jQuery.trim(jQuery('#cc_firstName').val()) == ""){
            jQuery('#cc_firstName').val(myval);
        }        
    }

    if(myval1 == 2){
        if(jQuery.trim(jQuery('#cc_lastName').val()) == ""){
            jQuery('#cc_lastName').val(myval);
        }                
    }
}
