window.onload=resize;
window.onresize=resize;

function popup(theURL) {
	winName='project';
	W=680;
	H=500;
	//var left=Math.round((screen.width-W)/2)+"px";
	//var top=Math.round((screen.height-H)/2)+"px";
	var left="0px";
	var top="0px";
	window.open(theURL,winName,"width="+W+", top="+top+", left="+left);
}

function resize(){
	if(browser!='Internet Explorer'){
		return;
	}
	var min_width=780;
	var current_width=getWindowWidth();
	var resize=(current_width>min_width)?true:false;

	var target=document.getElementById("thetable");
	target.style.width=(resize)?"100%":min_width+"px";
	var target=document.getElementById("footer");
	target.style.width=(resize)?"100%":min_width+"px";
}

function getWindowWidth() {
    var windowWidth=0;
    if (typeof(window.innerWidth)=='number') {
        windowWidth=window.innerWidth;
    } else {
        if (document.documentElement && document.documentElement.clientWidth) {
            windowWidth = document.documentElement.clientWidth;
        } else {
            if (document.body && document.body.clientWidth) {
                windowWidth = document.body.clientWidth;
            }
        }
    }
    return parseInt ( windowWidth );
}


var detect = navigator.userAgent.toLowerCase();
var OS,browser,version,total,thestring;

if (checkIt('konqueror'))
{
	browser = "Konqueror";
	OS = "Linux";
}
else if (checkIt('safari')) browser = "Safari"
else if (checkIt('omniweb')) browser = "OmniWeb"
else if (checkIt('opera')) browser = "Opera"
else if (checkIt('webtv')) browser = "WebTV";
else if (checkIt('icab')) browser = "iCab"
else if (checkIt('msie')) browser = "Internet Explorer"
else if (!checkIt('compatible'))
{
	browser = "Netscape Navigator"
	version = detect.charAt(8);
}
else browser = "An unknown browser";

if (!version) version = detect.charAt(place + thestring.length);

if (!OS)
{
	if (checkIt('linux')) OS = "Linux";
	else if (checkIt('x11')) OS = "Unix";
	else if (checkIt('mac')) OS = "Mac"
	else if (checkIt('win')) OS = "Windows"
	else OS = "an unknown operating system";
}
function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}


