var obj="";
function rotate(val)
{
	obj=getobject();
	if(obj==null)
	{
		alert('Your browser does not support AJAX.');
		return false;
	}
	var url="rotate.php?total="+val
	obj.onreadystatechange=call;
	obj.open("POST",url,true);
	obj.send(null);
}

function call()
{	
	if(obj.readyState==1)
	{
		document.getElementById('imsg').src="";
	}else if(obj.readyState==4)
	{
		document.getElementById('imsg').innerHTML=obj.responseText;
	}
}

function getobject()
{

	var xmlhttp1=null;

	try

	{

		xmlhttp1=new XMLHttpRequest();

	}catch (e)

	{

		try

		{

			xmlhttp1=new ActiveXObject("Msxml2.XMLHTTP");

		}catch (e)

		{

			xmlhttp1=new ActiveXObject("Microsoft.XMLHTTP");			

		}

	}

	return xmlhttp1;

}