function showCompt(id,val)
{
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
  	{
  		alert ("Browser does not support HTTP Request");
  		return;
  	}
	document.getElementById("job_cnt").value = val;
	var url = "../employee/comp_view.php"
	//alert(id);
	url=url+"?id="+id
	//alert(url);
	url=url+"&sid="+Math.random()
	//alert(url);
	xmlHttp.onreadystatechange=stateChangesRating;
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function stateChangesRating() 
{
	 

	var value    = document.getElementById('job_cnt').value;
	if (xmlHttp.readyState != 4 || xmlHttp.readyState != "complete")
	{
		
		document.getElementById("view_count_jobs"+ value).innerHTML = '<img border="0" src="../_images/loading.gif" alt="loading" />';
	}

	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{		
		var location = xmlHttp.responseText;
		//alert(location);
		if(location=="redirect")
		{
			var message = "You have insufficient credits .Please purchase credits";
			document.location.href = "../purchase_credits.php?crd_msg="+message;
			exit();
		}
		else
		{
		 document.getElementById("view_count_jobs"+ value ).innerHTML = xmlHttp.responseText;
		}
	}
}

function GetXmlHttpObject()
{
	if (window.XMLHttpRequest)
  	{
		// code for IE7+, Firefox, Chrome, Opera, Safari
		return new XMLHttpRequest();
	}
	if (window.ActiveXObject)
  	{
		// code for IE6, IE5
		return new ActiveXObject("Microsoft.XMLHTTP");
	}
	return null;
}