/*  /////////ex coutomer/////////////////////////////////////////////////////////////*/

$(function() {
  $('.error').hide();
  $('input.commontxtbox').css({backgroundColor:"#FFFFFF"});

  $('input.commontxtbox').blur(function(){
    $(this).css({backgroundColor:"#FFFFFF"});
	$('.error').hide();
  });
  
  
    $(".exreqbutton").click(function() {
    $('.error').hide();
	
		
	  var customid = $("input#customid").val();
		if (customid == "") {
      $("label#customid_error").show();
      $("input#customid").focus();
	  $('input.commontxtbox').css({backgroundColor:"#FFB0B0"});
      return false;
    }
		
	var cname = $("input#cname").val();
		if (cname == "") {
      $("label#cname_error").show();
      $("input#cname").focus();
	   $('input.commontxtbox').css({backgroundColor:"#FFB0B0"});
      return false;
    }
	var lname = $("input#lname").val();
		if (lname == "") {
      $("label#lname_error").show();
      $("input#lname").focus();
	   $('input.commontxtbox').css({backgroundColor:"#FFB0B0"});
      return false;
    }
	
	var cphone = $("input#cphone").val();
		if (cphone == "") {
      $("label#cphone_error").show();
      $("input#cphone").focus();
	   $('input.commontxtbox').css({backgroundColor:"#FFB0B0"});
      return false;
    }
	
	var cemail = $("input#cemail").val();
		if (cemail == "") {
      $("label#cemail_error").show();
      $("input#cemail").focus();
	   $('input.commontxtbox').css({backgroundColor:"#FFB0B0"});
      return false;
    }
	
		var cnotes = $("textarea#cnotes").val();
				
		var dataString = 'customid='+ customid + '&cname=' + cname  + '&lname=' + lname + '&cphone=' + cphone + '&cemail=' + cemail + '&cnotes=' + cnotes;
		//alert (dataString);return false;
		
		$.ajax({
      type: "POST",
      url: "requestpro.php",
      data: dataString,
      success: function() {
        $('#request_form').html("<div id='conmessage'></div>");
        $('#conmessage').html("<h4>Your Request Submitted!</h2>")
        .append("<p>We will be in touch soon.</p>")
        .hide()
        .fadeIn(1500, function() {
          $('#conmessage').append("<img id='checkmark' src='check.png' /><br><br><a href='create_account.php'>Back</a>");
        });
      }
     });
    return false;
	});
  
});



/*  ///////////////////////////new custor///////////////////////////////////////////*/

$(function() {
  $('.error').hide();
  $('input.commontxtbox').css({backgroundColor:"#FFFFFF"});

  $('input.commontxtbox').blur(function(){
    $(this).css({backgroundColor:"#FFFFFF"});
	$('.error').hide();
  });
  
 
 $(".newreqbutton").click(function() {
    $('.error').hide();
	
	var ccompany2 = $("input#ccompany2").val();
		if (ccompany2 == "") {
      $("label#ccompany2_error").show();
      $("input#ccompany2").focus();
	   $('input.commontxtbox').css({backgroundColor:"#FFB0B0"});
      return false;
    }
	
	var btype = $("select#btype").val();
		if ((btype == "")||(btype == "-Select-")) {
      $("label#btype_error").show();
      $("select#btype").focus();
	   $('select.commontxtbox').css({backgroundColor:"#FFB0B0"});
      return false;
    }

	var cname2 = $("input#cname2").val();
		if (cname2 == "") {
      $("label#cname2_error").show();
      $("input#cname2").focus();
	   $('input.commontxtbox').css({backgroundColor:"#FFB0B0"});
      return false;
    }
	var lname2 = $("input#lname2").val();
		if (lname2 == "") {
      $("label#lname2_error").show();
      $("input#lname2").focus();
	   $('input.commontxtbox').css({backgroundColor:"#FFB0B0"});
      return false;
    }
	
	var caddress2 = $("input#caddress2").val();
		if (caddress2 == "") {
      $("label#caddress2_error").show();
      $("input#caddress2").focus();
	   $('input.commontxtbox').css({backgroundColor:"#FFB0B0"});
      return false;
    }
	
		var ccity2 = $("input#ccity2").val();
		if (ccity2 == "") {
      $("label#ccity2_error").show();
      $("input#ccity2").focus();
	   $('input.commontxtbox').css({backgroundColor:"#FFB0B0"});
      return false;
    }
				
	var cstate2 = $("input#cstate2").val();
		if (cstate2 == "") {
      $("label#cstate2_error").show();
      $("input#cstate2").focus();
	   $('input.commontxtbox').css({backgroundColor:"#FFB0B0"});
      return false;
    }				
	
	var czip2 = $("input#czip2").val();
		if (czip2 == "") {
      $("label#czip2_error").show();
      $("input#czip2").focus();
	   $('input.commontxtbox').css({backgroundColor:"#FFB0B0"});
      return false;
    }
	
	var ccountry2 = $("select#ccountry2").val();
		if (ccountry2 == "") {
      $("label#ccountry2_error").show();
      $("select#ccountry2").focus();
	   $('select.commontxtbox').css({backgroundColor:"#FFB0B0"});
      return false;
    }
	
	
	
	var cphone2 = $("input#cphone2").val();
		if (cphone2 == "") {
      $("label#cphone2_error").show();
      $("input#cphone2").focus();
	   $('input.commontxtbox').css({backgroundColor:"#FFB0B0"});
      return false;
    }
	
	var cfax2 = $("input#cfax2").val();
	
	var cemail2 = $("input#cemail2").val();
		if (cemail2 == "") {
      $("label#cemail2_error").show();
      $("input#cemail2").focus();
	   $('input.commontxtbox').css({backgroundColor:"#FFB0B0"});
      return false;
    }
	
	var cweb2 = $("input#cweb2").val();
	var cnotes2 = $("textarea#cnotes2").val();
		
		
		var dataString = 'ccompany2=' + ccompany2 +'&btype='+ btype +'&cname2='+ cname2 + '&lname2='+ lname2 +'&caddress2=' + caddress2 + '&ccity2=' + ccity2 + '&cstate2=' + cstate2 + '&czip2=' + czip2 + '&ccountry2=' + ccountry2 + '&cphone2=' + cphone2 + '&cfax2=' + cfax2 + '&cemail2=' + cemail2 + '&cweb2=' + cweb2 + '&cnotes2=' + cnotes2;
		//alert (dataString);return false;
 		
		$.ajax({
      type: "POST",
      url: "requestpronew.php",
      data: dataString,
      success: function() {
        $('#request_form').html("<div id='conmessage'></div>");
        $('#conmessage').html("<h4>Your Request Submitted!</h2>")
        .append("<p>We will be in touch soon.</p>")
        .hide()
        .fadeIn(1500, function() {
          $('#conmessage').append("<img id='checkmark' src='check.png' /><br><br><a href='create_account.php'>Back</a>");
        });
      }
     });
    return false;
	});
  
});