function windowWidthMinusScrollBar () {
if (typeof window.innerWidth != "undefined") return window.innerWidth
else if (document.documentElement && typeof document.documentElement.offsetWidth != "undefined" && document.documentElement.offsetWidth != 0) return document.documentElement.offsetWidth
else if (document.body && typeof document.body.offsetWidth != "undefined") return document.body.offsetWidth
}

function windowHeightMinusScrollBar () {
if (typeof window.innerHeight != "undefined") return window.innerHeight
else if (document.documentElement && typeof document.documentElement.offsetHeight != "undefined" && document.documentElement.offsetHeight != 0) return document.documentElement.offsetHeight
else if (document.body && typeof document.body.offsetHeight != "undefined") return document.body.offsetHeight
}

function openPort(thePicURL,thePortText,imgFolder)
{
//
var curLayer = document.getElementById('portpic');
//alert('msss');
curLayer.innerHTML = "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width="+600+" bgcolor=\"white\"><tr><td colspan=\"2\"><img id=\"bigpic\" src=\""+imgFolder+thePicURL+"\"></td></tr><tr><td width=\""+(600-83)+"\"align=\"left\" valign=\"baseline\" nowrap><h3 style=\"margin:0\">"+thePortText+"</h3></td><td align=\"right\" width=\"82\" valign=\"baseline\"><div class=\"cw\"><a href=\"#\" onClick=\"closePort();return false;\"><img src=\""+imgFolder+"spacer.gif\" width=\"82\" height=\"14\" border=\"0\" /></a></div></td></tr></table>";

//setCentre();
document.getElementById('portpic').style.visibility = 'visible';
//document.getElementById('fullwhite').style.visibility = 'visible';
return false;
}
function closePort() {
document.getElementById('portpic').style.visibility = 'hidden';
return false;
//document.getElementById('fullwhite').style.visibility = 'hidden';
}
function setCentre() {
	var picWidth=600;
	var picHeight=400;
var curLayer = document.getElementById('portpic');
var borderLayer = document.getElementById('fullwhite');

var winW = windowWidthMinusScrollBar()/2;
var winH = windowHeightMinusScrollBar()/2;

curLayer.style.left = (winW - picWidth/2)+'px';
curLayer.style.top = (winH - picHeight/2)+'px';
curLayer.style.width = (picWidth)+'px';
curLayer.style.height = (picHeight)+'px';
curLayer.style.visibility = 'visible';
borderLayer.style.left = (winW - (picWidth+40)/2)+'px';
borderLayer.style.top = (winH - (picHeight+40)/2)+'px';
borderLayer.style.width = (picWidth+36)+'px';
borderLayer.style.height = (picHeight+50)+'px';
borderLayer.style.visibility = 'visible';
}