    var xmlHttp;
	function creatXMLHttpRequest() 
	{
		if(window.ActiveXObject) 
		{
			xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');
		} 
		else if(window.XMLHttpRequest) 
		{
			xmlHttp = new XMLHttpRequest();
		}
	}
	
	var online_url="";
	function openOnline(onlineurl, target, param)
	{
		online_url=onlineurl;
		
		var temp=onlineurl.split("?");
		temp=temp[1];
		temp=temp.split("&");
		for(var i=0; i<temp.length; i++)
		{
			temp2=temp[i].split("=");
			if(temp2[0]=="magid")
			{
				var magid=temp2[1];
				break;
			}
	    }
		
	  
		creatXMLHttpRequest();
		xmlHttp.open("GET", "../inc/ajax_online.php?magid="+magid, "true");
		xmlHttp.onreadystatechange = handleStateChange;
		xmlHttp.send(null);
	}
	
	function handleStateChange() 
	{		
		if(xmlHttp.readyState == 4) 
		{
			if(xmlHttp.status == 200) 
			{				
				var res =  xmlHttp.responseText;
				if(res=="0")
				{
					window.open(online_url, '_blank', 'height=675, width=900, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=yes,location=no, status=no');
				}
				else if(res=="1")
				{
					window.open(online_url, '_blank', 'fullscreen=yes');
				}
				
			}
		}
		
	}