	function showContactTimer2 () {
    	document.getElementById("msg_trnsctn").innerHTML="";
		var loader = document.getElementById('loadBar_comment');
		loader.style.display = "inline";
		document.getElementById("comment").disabled=true;
		sentTimer = setTimeout("hideContactTimer2()",2000);
	}
	
	function hideContactTimer2 () {
		ajaxFunction();		
		var loader = document.getElementById('loadBar_comment');
		loader.style.display = "none";
		document.getElementById("comment").disabled=false;
	}
	
	function ajaxFunction()
	{
		var xmlHttp;
		var str_vars = "det_id="+document.getElementById("det_id").value+"&cat_id="+document.getElementById("cat_id").value+"&comm="+document.getElementById("comment").value+"&uname="+document.getElementById("usrname").value;
		if (window.XMLHttpRequest) {
	    	//alert('Entra a XMLHttpRequest');
	        xmlHttp = new XMLHttpRequest();
	        
	    // branch for IE/Windows ActiveX version
	    } else if (window.ActiveXObject) {
	    	//alert('Entra a activeX');
	        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
				        
	    }
		xmlHttp.onreadystatechange=function(){
			if (xmlHttp.readyState == 4) {
				if (xmlHttp.status != 200) {
					alert('Error : Status '+xmlHttp.status+' returned.');
				} 
			}			
		}
		
		xmlHttp.open("POST","comments/scripts/cmt_response.php?"+str_vars,false);
		xmlHttp.setRequestHeader("Content-Type", "text/plain");
		xmlHttp.send(str_vars); 
		document.getElementById("cmt1").innerHTML=xmlHttp.responseText;	
		/*if(document.getElementById("msg_res")!=undefined){
						alert('hay');
			if(document.getElementById("msg_res").value == 1){
				document.getElementById("msg_trnsctn").innerHTML="<font color=\"green\">Comment successfully posted</font>";
			}else{
				document.getElementById("msg_trnsctn").innerHTML="<font color=\"red\">Comment already exists for this item</font>";
			}
		}else{
			alert('no hay');
		}*/
		
	}

	function validar_comment(thisform){
		with (thisform){
			var submit_ok = false;
			campos = document.getElementsByTagName('input');
			areas = document.getElementsByTagName('textarea');	
			var captcha=campos['cpt'].value;			
			if(campos['usrname']!=undefined && campos['usrname'].value == ''){
				alert('Enter your name');
				campos['usrname'].focus();
			}else if(areas['comment'].value == ''){
				alert("Enter your opinion");
				areas['comment'].focus();			
			}else if(captcha != campos['valcomm'].value){
				alert('Enter validation code');
				campos['valcomm'].focus();
			}else{				
				showContactTimer2();	
			}
			return false;
		}
	}