// JavaScript Document
$(document).ready(function(){
	$(function() {  
   $('.error').hide();  
   $(".call").click(function() {  
     // validate and process form here   
     $('.error').hide(); 
       var phone = $("input#number").val();  
       if (phone == "") {  
       $("label#phone_error").show();  
       $("input#number").focus();  
       return false;  
     }  
		var ext = $("input#ext").val();
		var cmp = $("input#cmp").val();
		var submit_btn = $("input#submit_btn").val();
		$('#message').html("<strong>Submitting Form. Please Wait.</strong>");
		var dataString = 'number='+ phone + '&ext=' + ext + '&cmp=' + cmp;
		
		//alert (dataString);return false;

		$.ajax({
			type: "POST",
			//url: "http://login.localconnex.com/euinc/ctc/call/index.php",
			url: "postcall/postcall.php",
			//url: "http://127.0.0.1:8081/localconnex/testpost.php",
			data: dataString,
			cache: false,
			timeout:10000,
			success: function(html) {
				$('#message').html("<strong>"+html+"</strong>")
				.append("<br />")
			},
			error: function(){
				$('#message').html("<strong>There was an error!</strong>")
				.append("<br />")				
			}
		});
		
		//$('#message').load('http://login.localconnex.com/euinc/ctc/call/index.php?'+dataString);

		return false;
       
   });  
});
});