	flag = 1;
	
	// -- functions -- //
	function init(pop) {
		//popup window if on main page
		if (pop){
			thepopup = window.open("", "popupwindow", "left=5000,top=5000;");
			thepopup.opener.name = "main";
			thepopup.blur();
			thepopup.location = "/popup.htm";
			thepopup.resizeTo(460,220);			
			thepopup.moveTo(50,50);			
			thepopup.focus();
		}
		
		var lMainHeight
		var content = document.getElementById("main");
		var sideBar = document.getElementById("leftPanel");
		var footer = document.getElementById("footer");
		//alert(content.offsetTop)
		//alert(content.offsetHeight)
		//alert(content.scrollHeight )
		
		//SBE 06/13/2007:  this will be null for all .aspx pages
		if (content == null) return;
		
		//set footer and left nav to correct locations
		if (document.all){
			lMainHeight = 96 + document.all.main.offsetHeight
			document.all.footer.style.top = lMainHeight
			document.all.footer.style.visibility = "visible"
			document.all.leftPanel.style.height = lMainHeight
			document.all.leftPanel.style.clip = "rect(0 143 " + lMainHeight + " 0)"
			
		} else {
			
			lMainHeight = content.offsetTop + content.offsetHeight
			sideBar.style.height = lMainHeight + "px"
			
			footer.style.top = lMainHeight + "px"
			footer.style.visibility = "visible"
			
			window.document.height = lMainHeight + 100
			//document.layers["navHeader"].zIndex = 1
		}
	}
	

	
	// default is to show up
	function xit(pop) {
		// check to see if internal link
		var expiresDate = new Date((new Date()).getTime() + 43200000); // expire cookie in 12 hrs
		
		document.cookie = "winOpen=" + flag + "; expires=" + expiresDate.toGMTString() + "; path=/;";

	}
	
	function getCookieVal (offset) {
    	var endstr = document.cookie.indexOf (";", offset);
      	if (endstr == -1)
        	endstr = document.cookie.length;
      	return unescape(document.cookie.substring(offset, endstr));
    }

    function GetCookie (name) {
    	var arg = name + "=";
      	var alen = arg.length;
      	var clen = document.cookie.length;
      	var i = 0;
		
      	while (i < clen) {
        	var j = i + alen;
        	if (document.cookie.substring(i, j) == arg)
          		return getCookieVal (j);
        	
			i = document.cookie.indexOf(" ", i) + 1;
        	if (i == 0) break; 
      	}
		
     	return null;
    }

	function submitForm(f){f.submit()}	
	
	
// Cookie handling
var cookieManager = {
	setCookie:	 function (sName, sValue, nDays) {
		var expires = "";
		if (typeof nDays == "number") {
			var d = new Date();
			d.setTime(d.getTime() + nDays * 24 * 60 * 60 * 1000);
			expires = "; expires=" + d.toGMTString();
		}

		document.cookie = sName + "=" + escape(sValue) + expires + "; path=/";
	},

	getCookie:	function (sName) {
		var re = new RegExp("(\;|^)[^;]*(" + sName + ")\=([^;]*)(;|$)");
		var res = re.exec(document.cookie);
		return res != null ? unescape(res[3]) : null;
	},

	removeCookie:	function (name) {
		cookieManager.setCookie(name, "", -1);
	}
};	



