var ie=document.all
var ns6=document.getElementById&&!document.all

function enlarge(cr,which,e)
{
	document.getElementById("showimage").style.left  = (screen.width - 700) / 2 + "px";
	document.getElementById("showimage").style.top  = window.pageYOffset + 130 + "px";
	//Render image code for IE 4+ and NS6
	if (ie||ns6)
	{
		crossobj=document.getElementById? document.getElementById("showimage") : document.all.showimage
		if (crossobj.style.visibility=="hidden")
		{
		crossobj.style.left=ns6? pageXOffset+e.clientX : document.body.scrollLeft+event.clientX
		crossobj.style.top=ns6? pageYOffset+e.clientY : document.body.scrollTop+event.clientY
		crossobj.innerHTML='<div align="right" id="drag" style="background-color:green;white-space:nowrap;" onClick="closepreview()"><span><font size="2" style="color: white">&copy; '+cr+'</font><font size="5" style="color: white">&nbsp;&nbsp; <b>X</b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></span></div><img src="'+which+'">'
		crossobj.style.visibility="visible"
		}
		else
		crossobj.style.visibility="hidden"
		return false
	}
}

function closepreview(){crossobj.style.visibility="hidden";}

function enlarge_all(id,e)
{
	document.getElementById("showimage").style.left  = "250px";
	document.getElementById("showimage").style.top  = window.pageYOffset + 130 +"px";
	//Render image code for IE 4+ and NS6
	if (ie||ns6)
	{
		crossobj=document.getElementById? document.getElementById("showimage") : document.all.showimage
		if (crossobj.style.visibility=="hidden")
		{
		crossobj.style.left=ns6? pageXOffset+e.clientX : document.body.scrollLeft+event.clientX
		crossobj.style.top=ns6? pageYOffset+e.clientY : document.body.scrollTop+event.clientY		
		crossobj.innerHTML='<div align="right" id="drag" style="background-color:green;white-space:nowrap;" onClick="closepreview()"><span><font size="5" style="color: white">&nbsp;&nbsp; <b>X</b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></span></div><div id=news_content></div>'
		content(id);		
		crossobj.style.visibility="visible"
		}
		else
		crossobj.style.visibility="hidden"
		return false
	}
}

function content(id)
{
			xmlhttp=GetXmlHttpObject();
			if (xmlhttp==null){alert ("Browser does not support HTTP Request");return;}
			var url="press/new.php";
			url=url+"?id="+id;
			url=url+"&sid="+Math.random();
			xmlhttp.onreadystatechange=function()
			{
				if (xmlhttp.readyState==4)
				{
				document.getElementById("news_content").innerHTML=xmlhttp.responseText;
				}
			}
			xmlhttp.open("GET",url,true);
			xmlhttp.send(null);
			}
			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;
}

function next_page(page,brd)
{
			xmlhttp=GetXmlHttpObject();
			if (xmlhttp==null){alert ("Browser does not support HTTP Request");return;}
			var url="press/news.php";
			url=url+"?start="+page;
			url=url+"&board="+brd;
			url=url+"&sid="+Math.random();
			xmlhttp.onreadystatechange=function()
			{
				if (xmlhttp.readyState==4)
				{
				document.getElementById("news_navi").innerHTML=xmlhttp.responseText;
				}
			}
			xmlhttp.open("GET",url,true);
			xmlhttp.send(null);
			}
			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;
}
