function popUpPF(link){
   var mWidth=630;
   var mHeight=600;
   var mLeft=(screen.width - (mWidth)-10);
   var mTop=5;
   window.open(link, "winPop","scrollbars=yes,toolbar=no,menubar=yes,resizable=1,width="+mWidth+"px,height="+mHeight+"px,top="+mTop+"px,left="+mLeft+"px");
}

function menuInitialize(){
   //do nothing
}

/**
 * function to show the footer .... should be called when onResize and onLoad
 */
var okToResize = 0;
function js_drawFooter(){
	if (navigator.appName == 'Netscape'){
		//do_js_drawFooter();
		jsMoveFooter();
	}
	else{
		if (navigator.appVersion.indexOf('MSIE 5.0') != -1){
			if (okToResize == 0){ //0 = not locked
				okToResize = 1;//set lock
				window.resizeBy('1', '1');
				window.resizeBy('-1', '-1');
				//do_js_drawFooter();
				jsMoveFooter();
				okToResize = 0;//unlock
			}
		}
		if (navigator.appVersion.indexOf('MSIE 6.0') != -1){
			//do_js_drawFooter();
			jsMoveFooter();
		}
	}

}

function jsMoveFooter(){
	var myTop = 0;
	var footerHeight = 21;
	var topHeight = 102;
	var winHeight = document.body.clientHeight;
		
	//window.status = navigator.appName;
	
	if (navigator.appName == 'Netscape'){
		myTop = document.height;
	}
	if (navigator.appName.indexOf("Microsoft")!= -1){
		myTop = document.body.scrollHeight;
	}
	
	//window.status += " cH- "+myTop;
	//window.status += " wH- " + winHeight;
	
	
	var superTable = document.getElementById("supertable");
	//superTable.style.borderWidth = "1px";
	//superTable.style.backgroundColor = "silver";
	
	
	if (superTable){
		superTable.style.height=winHeight -footerHeight - topHeight;
		/*
		if (myTop < winHeight){
			//resize down
			//window.status += " down"+(winHeight -footerHeight - topHeight)+"px";
			superTable.style.height=winHeight -footerHeight - topHeight;
		}
		else if (myTop == winHeight){
			//do nothing
			//window.status += "do nth";
		}
		else{
			//resize back
			//window.status += " up"+(winHeight -footerHeight - topHeight)+"px";
			superTable.style.height=winHeight -footerHeight - topHeight;
		}
		*/
		//window.status += " ->" + document.body.scrollHeight;
		document.body.style.height = winHeight -footerHeight - topHeight;
		
		//window.status += " done";
	}
}

var safeTop = 0;
function do_js_drawFooter(){

		//alert(navigator.appVersion);
		var hwFooter = document.getElementById("divFooter");
		var conHeight = 0;
		var winHeight = 0;
		var conWidth = 0;
		var winWidth = 0;
		var footerHeight = 88;
		var haveScrollH = false;
		var scrollBarH = 17;
		var tempH = 0;
		
		var hwFooterTop = hwFooter.style.top;
		//trim away the 'px' at the end
		if (hwFooterTop == ""){
			hwFooterTop = 0;
		}else{
			//hwFooterTop = hwFooterTop.substr(0, hwFooterTop.length-2);
			hwFooterTop = hwFooterTop.replace('px', '');
		}
		
		
		hwFooter.style.display = "none";
		
		if (navigator.appName == 'Netscape'){
			//window.status = "NS-"+document.body.scrollHeight + "-"+document.height +" " +screen.availHeight + '-' +screen.height+' '+ window.innerHeight + ' '+window.outerHeight +' ' + document.body.clientHeight + ' '+document.body.clientWidth;
			
			//conHeight = document.height;
			
			
			conHeight = document.body.scrollHeight;
			
			
			winHeight = document.body.clientHeight;
			conWidth = document.width;
			winWidth = document.body.clientWidth;
			
			
			window.status = 'NS conHeight:'+ document.body.scrollHeight+
			' winHeight:'+document.body.clientHeight+
			' conWidth:'+document.width+
			' winWidth:'+document.body.clientWidth;
			
			//window.status = "NS-"+document.body.scrollHeight + "-" + document.height + "-" + document.body.clientHeight;
		}
		else if (navigator.appName.indexOf("Microsoft")!= -1){
			window.status = "MS-"+document.body.scrollHeight +"-"+document.body.style.height+"-" + screen.availHeight + '-' +screen.height+' '+ document.body.offsetWidth + ' '+document.body.offsetHeight +' ' + document.body.clientHeight + ' '+document.body.clientWidth;
			
			conHeight = document.body.scrollHeight;
			winHeight = document.body.clientHeight;
			conWidth = document.body.scrollWidth;
			winWidth = document.body.clientWidth;
			//window.status = "MS:-"+document.body.scrollHeight + "-" +document.body.clientHeight;
			//alert(window.status);
		}
		
		
		//for Opera, use document.body.style.pixelHeight
		//check if have horizontal scrollbar
		
		//if (conWidth > winWidth){
		//	haveScrollH = true;
		//	tempH = scrollBarH;
		//}
	
	
	if ((navigator.appName == 'Netscape') || (navigator.appVersion.indexOf('MSIE 5.0') != -1)){
	//window.status = window.status + " |" + document.height + "| ";
	
		if (conHeight > winHeight){
			safeTop = conHeight;			
			hwFooter.style.top = conHeight;
			hwFooter.style.display = "block";
			window.status = window.status + "-N1";
			//alert(conHeight + '-1');
		}else{
			if ( (hwFooterTop == (conHeight - footerHeight)) ||(hwFooterTop == (winHeight - footerHeight)) ){
				window.status = window.status + "-N2 "+hwFooterTop;
				hwFooter.style.display = "block";
				//alert(conHeight + '-2');
			}else{
				if ((safeTop != 0) && (winHeight-footerHeight <= safeTop)){
					hwFooter.style.top = safeTop;
				}else{
					hwFooter.style.top = winHeight-footerHeight;
				}
				
				hwFooter.style.display = "block";
				window.status = window.status + "-N3";
				//alert(conHeight + '-3');
			}
		}
	}	
	else if (navigator.appName.indexOf("Microsoft")!= -1){
	
		//if have space to simply footer in current window's bottom
		if (conHeight + footerHeight < winHeight){
			hwFooter.style.top = winHeight - footerHeight - tempH;
			hwFooter.style.display = "block";
			//window.status = window.status + "-1";
		}
		else{
			if (hwFooterTop == (conHeight - footerHeight)){
				//alert('no need to change');
			}
			else{
				//append to end that's all
				hwFooter.style.top = conHeight;
				hwFooter.style.display = "block";
				//window.status = window.status + "-2";
				//alert('change');
			}
			
		}
	}	
	//alert(window.status);
	//alert("st" + safeTop);
}


function moveFooter(distance){
	var hwFooter = document.getElementById("divFooter");
	if (hwFooter){
		var topStr = hwFooter.style.top;
		var topInt = topStr.substring(0, topStr.length -2);
		
		hwFooter.style.top = (topInt * 1) + distance;
	}
	
}