//change size for screen resolution
function sizeit()
{
if (screen.width < 1000)
{
document.getElementById('mainT').style.width="740px";
}
}

function sizeita()
{
if (screen.width > 1000)
{
document.getElementById('mainT').style.width="740px";
document.getElementById('end').style.display="none";
}
}


//Show / hide details
function togglesp(elmnt)
{
if (document.getElementById(elmnt).style.display == "block") 
{document.getElementById(elmnt).style.display="none";}
else
{document.getElementById(elmnt).style.display="block";}
}

//function for to change colour on mouseover
function subMenu(obj,x) 
{
	obj.backgroundColor = (x);
}


//new window
var newwindow;
function Display(url)
{
	newwindow=window.open(url,'name');
	if (window.focus) {newwindow.focus()}
}
//AJAX Functions
var xmlHttp
var pstr = 0;

function showInfo(str)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
if (pstr != 0)
{
document.getElementById("Swapdata"+pstr).innerHTML="";
}
var url="swapdetail.php"
pstr = str
url=url+"?sid="+str
url=url+"&nid="+Math.random()
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("Swapdata"+pstr).innerHTML=xmlHttp.responseText;
} 
else
{ 
document.getElementById("Swapdata"+pstr).innerHTML="Loading Data"; 
} 
} 

function GetXmlHttpObject()
{ 
var objXMLHttp=null
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
}

function clearSwap(cstr)
{ 
document.getElementById("Swapdata"+cstr).innerHTML="";
}

function menuMain(place, col)
{
	document.getElementById(place).style.background = col;
}

function topMenu(place, num)
{
if (num == 1) {	document.getElementById(place).style.background = '#FF9933';}
else { document.getElementById(place).style.background = '#2323FF';}
}

function bottomMenu(place, num)
{
if (num == 1) {	document.getElementById(place).style.background = '#000099';}
else { document.getElementById(place).style.background = '#2323FF';}
}