function checkcha(){
var cc = document.getElementById('captcha_code').value;
if(cc.length==0){
	document.getElementById('capReq').style.color = "#c40f31";
}
if(window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
	xmlhttp=new XMLHttpRequest();
}else{// code for IE6, IE5
	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function(){
  if(xmlhttp.readyState==4 && xmlhttp.status==200){
    //alert(xmlhttp.responseText);
    switch(xmlhttp.responseText){
    case "True":
    //
    document.getElementById('capReq').style.color = "#000000";
    //document.getElementById('contactForm').submit();
    submitform();
    break;
    case "False":
    document.getElementById('capReq').style.color = "#c40f31";
    document.getElementById('captcha').src = 'securimage/securimage_show.php?' + Math.random();
    break;
    }
    }
  }
xmlhttp.open("POST","checkcaptcha.php?captcha_code="+cc,true);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.send(cc);  
}
function submitform(){
//alert('we submit') // document.contactForm.submit();
document.contactForm.submit();
//document.getElementById('contactForm').submit; 
}
function submitservice(){
var errorcount = 0
if (document.getElementById('from').value == "0"){
document.getElementById('fromReq').style.color = "#c40f31";
errorcount = errorcount + 1;
}else{
document.getElementById('fromReq').style.color = "#000000";
}
if (document.getElementById('emailtxt').value == ""){
document.getElementById('emailReq').style.color = "#c40f31";
errorcount = errorcount + 1;
}else{
document.getElementById('emailReq').style.color = "#000000";
}
if (document.getElementById('subject').value == "0"){
document.getElementById('subjectReq').style.color = "#c40f31";
errorcount = errorcount + 1;
}else{
document.getElementById('subjectReq').style.color = "#000000";
}
if (errorcount == 0){
	checkcha();
}else{
	window.location ='#top_form';
}
}

