function checkForm(){
		var inputs = [];
		var wrong=0;
		var checkPos=0;
		var checkArray=new Array(0,1,2,3,4,5,6,7,9,10,11,12);
		var i=0;
		  while(i<20){
			  if($("input:eq("+i+")","#adotube").val()==''){
					  $("#adotube input:eq("+i+")").css({"border":"solid 1px #ff0000","background-color":"#FFEBEB"});
					  wrong++;
			  } else {
				  $("input:eq("+i+")","#adotube").css({"border":"solid 1px #00cc00","background-color":"#EBFFED"});
					 
			  }
			  checkPos++;
			  i=checkArray[checkPos];
		  }
		  if(($("input:eq(2)","#adotube").val()!=$("input:eq(4)","#adotube").val()) ||( $("input:eq(2)","#adotube").val()=='')){
					  $("input:eq(2)","#adotube").css({"border":"solid 1px #ff0000","background-color":"#FFEBEB"});
					  $("input:eq(4)","#adotube").css({"border":"solid 1px #ff0000","background-color":"#FFEBEB"});
					  wrong++;
			  } else {
				  $("input:eq(2)","#adotube").css({"border":"solid 1px #00cc00","background-color":"#EBFFED"});
				  $("input:eq(4)","#adotube").css({"border":"solid 1px #00cc00","background-color":"#EBFFED"});
					 
			  }
			if($("select:eq(0)","#adotube").val()==0){
					  $("select:eq(0)","#adotube").css({"border":"solid 1px #ff0000","background-color":"#FFEBEB"});
					  wrong++;
			  } else {
				  $("select:eq(0)","#adotube").css({"border":"solid 1px #00cc00","background-color":"#EBFFED"});
					 
			  }
			if($("#keystring").val()!="adotube"){
					  $("#keystring").css({"border":"solid 1px #ff0000","background-color":"#FFEBEB"});
					  wrong++;
			  } else {
				  $("#keystring","#adotube").css({"border":"solid 1px #00cc00","background-color":"#EBFFED"});
					 
			  }
		  if(wrong==0){
			  	$("#error").html("Please wait!");
				$("#adotube").submit();
				
			  } else $("#error").html("Please fill all required filds!");
	}
      $(function() { // onload...do
        $('#adotube').submit(function() {
          var inputs = [];
          $(':input', this).each(function() {
            inputs.push(this.name + '=' + (this.value));
          })
		  jQuery.ajax({
            data: inputs.join('&')+'&action=1',
			type: "POST",
            url: "signup_action.php",
			dataType: "json",
            timeout: 10000,
            error: function() {
              $("#contactForm").hide("slow");
			  alert("We are experiencing problems accepting your message. Please try again later.");
            },
            success: function(json) {
				if(json.status==0){
			  		$("#formTable").hide("slow", function(){
														  $("#formTable").html("<center><img src='../images/thankyou.jpg' vspace='80'></center>");
														  $("#formTable").show("slow");
														  });
			 		//$("#output3").html("Thank you!").show();
				} else {
					error=json.status;
					alert (error);
				}
            }
          })
          return false;
        })
      })