var IE5, IE6=false;

function returnInt(name){/*returns the integer equivalent of a passed string of pixel height: eg '20px'*/
	name=name.split('p');
	name=parseInt(name);
	return name;
}

function detectBrowser(){
	if (navigator.appVersion.indexOf("MSIE")!=-1){	
		temp=navigator.appVersion.split("MSIE")
		var version=parseFloat(temp[1])
		if (version>=5.5 && version < 6.0){ //NON IE browser will return 0
			IE5=true;
		}
		else{
			if(version>=6.0){
				IE6=true;
			}
		}
	}
}
	
function detectScreenWidth(){
	myDocument=document;
	/*For IE 6.x in standards mode*/
	if(document.documentElement.clientWidth){
		screenWidth = document.documentElement.clientWidth;
		resizeTable(screenWidth);	
	}
	else{/*for Other browsers*/
		screenWidth = myDocument.body.clientWidth;/*other browsers*/
		resizeTable(screenWidth);
	}
}

function resizeTable(screenWidth){
	var minWidth = 792;
	var maxWidth = 1000;
	var adjust = 0
	if(IE6==true){
		var adjust=20; //adjustment for body left & right padding/margin
	}
	else{
		var adjust=20;
	}
	var containerDiv = document.getElementById('containerDiv');
	if (screenWidth > maxWidth){
	 	containerDiv.style.width=maxWidth-adjust;
	}
	else{
		if (screenWidth < minWidth){
			containerDiv.style.width=minWidth-adjust;
		}
		else{
			containerDiv.style.width=screenWidth-adjust;
		}
	}
}

function resizeDecide(){
	if (IE5==true||IE6==true){
		detectScreenWidth();
	}
}

function startWinResizer(e){
	//if (!e) var e = window.event;//universal event detector for all browsers
	detectBrowser();
	resizeDecide();
}
window.onresize = resizeDecide;