
		var waitDialog;
		var linkDialog;

		function highlightLink(lnk) {
			//alert('hello');
			var arr = document.body.getElementsByTagName('A');
			//alert(arr.length);
			
			for (var i = 0; i < arr.length;i++) {
				//alert(lnk + '::' + arr[i].href);
				if (arr[i].href == lnk && arr[i].className == 'leftnav') {
					arr[i].className = 'leftnav_highlight';
				}
			}

		}

		function popWindow(href,wnm,w,h,sb,tb,mb,dp,rs,st) {
			 
			 if (! window.focus) return true;
			 
			 var url = href;

			 try {
				if (href.tagName == 'A') {
					url = href.href;
				}				
			 }
			 catch (e) {}


			 var proparr = new Array();
			 proparr.push('width=' + w);
			 proparr.push('height=' + h);
			 proparr.push(sb ? 'scrollbars=yes' : 'scrollbars=no');
			 proparr.push(tb ? 'toolbar=yes' : 'toolbar=no');
			 proparr.push(mb ? 'menubar=yes' : 'menubar=no');
			 proparr.push(dp ? 'dependent=yes' : 'dependent=no');
			 proparr.push(rs ? 'resizable=yes' : 'resizable=no');
			 proparr.push(st ? 'status=yes' : 'status=no');
			 var prop = proparr.join(',');
			 var myWin = window.open(url,wnm,prop);
			 myWin.focus();
			 return false;

		}

		function popWithReturn(href,wnm,w,h,sb,tb,mb,dp,rs,st) {
			 
			 if (! window.focus) return true;
			 
			 var url = href;

			 try {
				if (href.tagName == 'A') {
					url = href.href;
				}				
			 }
			 catch (e) {}


			 var proparr = new Array();
			 proparr.push('width=' + w);
			 proparr.push('height=' + h);
			 proparr.push(sb ? 'scrollbars=yes' : 'scrollbars=no');
			 proparr.push(tb ? 'toolbar=yes' : 'toolbar=no');
			 proparr.push(mb ? 'menubar=yes' : 'menubar=no');
			 proparr.push(dp ? 'dependent=yes' : 'dependent=no');
			 proparr.push(rs ? 'resizable=yes' : 'resizable=no');
			 proparr.push(st ? 'status=yes' : 'status=no');
			 var prop = proparr.join(',');
			 //alert(prop);
			 var myWin = window.open(url,wnm,prop);
			 myWin.focus();
			 return myWin;

		}

        function helpPop(mylink) {
                if (! window.focus) return true;
                myWin = window.open(mylink,"help", 'width=600,height=350,scrollbars=yes,toolbar=yes,menubar=no,dependent=yes,resizable=yes,status=yes');
                myWin.focus();
                return false;
        }
        function doPopup(atag,wnm,x,y) {
                if (! window.focus) return true;
                myWin = window.open(atag.href,wnm, 'width=' + x + ',height=' + y + ',scrollbars=yes,toolbar=no,menubar=no,dependent=yes,resizable=yes,status=no');
                myWin.focus();
                return false;
        }
        function popWiz(href,wnm,x,y) {
                if (! window.focus) return true;
                myWin = window.open(href,wnm, 'width=' + x + ',height=' + y + ',scrollbars=no,toolbar=no,menubar=no,dependent=yes,resizable=no,status=no');
                myWin.focus();
                return false;
        }

		function popUserInfo(usrid) {
                if (! window.focus) return true;
                myWin = window.open('/cgi/master?sks=full&page=pitr&cmd=getusr&uid=' + usrid,"usrinfo", 'width=300,height=175,scrollbars=no,toolbar=no,menubar=no,dependent=yes,resizable=yes,status=no');
                myWin.focus();
                return false;
		}
		function popWin(href,wnm,x,y) {
                if (! window.focus) return true;
                myWin = window.open(href,wnm, 'width=' + x + ',height=' + y + ',scrollbars=no,toolbar=no,menubar=yes,dependent=yes,resizable=yes,status=yes');
	            myWin.focus();
                return false;
        }
        function doPopupUnadorned(atag,wnm,x,y) {
                if (! window.focus) return true;
                myWin = window.open(atag.href,wnm, 'width=' + x + ',height=' + y + ',scrollbars=no,toolbar=no,menubar=no,dependent=yes,resizable=no,status=no');
                myWin.focus();
                return false;
        }
	function refresh(win) {
		
		try	{

			var loc = win.document.location.href;
			win.document.location = "/content/blank.html";
			try
			{ // for pop-ups and such that don't have save services
				window.top.saveService.setAllChanged(false);
			}
			catch (e) {}

			win.document.location = loc;
		} catch (e) {}
	}

	function targetPop(myLink,target) {
                if (! window.focus) return true;
                var myWin = window.open(cacheBreaker(myLink),target);
                myWin.focus();
                return false;
		
	}
	
	function deleteConfirm(intxt) {
		return confirm("Click OK to delete this " + intxt + " or Cancel to abort.");
	}

	function hc() {
		var mst = getMenuState();
		if (mst != null) {
			setCookie('mst',mst);
		}	
		return true;
	}

	function getMenuState() {

		try { // in case menuState is null

			if (menuState != null) {
            	var sts = ''; 
       		   		for (var i = 0; i < menuState.length; i++) {
       	         		if (menuState[i]) {
       	         			sts = sts + '1';
		               	} else {
       				        sts = sts + '0';
                		}
               		}
                	return sts;
			}	
		} catch (e) { }
                return '';
	}

        function sms(lnk) {
		if (menuState != null) {
	                var href = lnk.href;
        	        var sts = '&mst=';
                	for (var i = 0; i < menuState.length; i++) {
                		if (menuState[i]) {
                			sts = sts + '1';
	               		} else {
       				        sts = sts + '0';
                		}
               		}
                	href = href + sts;
                	lnk.href = href;
		}
                return true;
        }

        function gms() {

		if (menuState != null) {
        	        var sts = '&mst=';
                	for (var i = 0; i < menuState.length; i++) {
                		if (menuState[i]) {
                			sts = sts + '1';
	               		} else {
       				        sts = sts + '0';
                		}
               		}
                	return sts;
		}
                return '';
        }

        function gmst() {

		if (menuState != null) {
        	        var sts = ''; 
                	for (var i = 0; i < menuState.length; i++) {
                		if (menuState[i]) {
                			sts = sts + '1';
	               		} else {
       				        sts = sts + '0';
                		}
               		}
                	return sts;
		}
                return '';
        }

	function setCookie (name, value) {  
		var argv = setCookie.arguments;  
		var argc = setCookie.arguments.length;  
		var expires = (argc > 2) ? argv[2] : null;  
		var path = (argc > 3) ? argv[3] : null;  
		var domain = (argc > 4) ? argv[4] : null;  
		var secure = (argc > 5) ? argv[5] : false;  
		document.cookie = name + "=" + escape (value) + 
		((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
		((path == null) ? "" : ("; path=" + path)) +  
		((domain == null) ? "" : ("; domain=" + domain)) +    
		((secure == true) ? "; secure" : "");
	}

	function setUserCookie (value) {		
		document.cookie = 'uuid=' + value + '; expires=Tue, 01-Oct-2030 12:00:00 GMT; path=/';
	}

	function resCookie() {
		var res = screen.width + "x" + screen.height;
		setCookie('res',res);
	}

	function setLocation(href) {
		//document.location = 'about:blank';
		document.location = href;
	}

	function openWaitDialog(title,text) {
		var dialog = showModelessDialog('/content/blank.html',window,'dialogHeight:100px;dialogWidth:200px;center:yes;help:no;resizable:no;scroll:no;status:no');

		var html = '<head><title>' + title + '</title><style type="text/css"><!--' +
				   '.dialog {font-family:sans serif,Arial;font-size:12px;font-weight:bold;}' +
				   '--></style></head><body bgcolor=#D4D0C8><center><table width=100% border=0><tr><td width=60 align=right>' +
				   '<img src="/img/tworking_anm_gbg.gif" height=50 width=50 hspace=5 vspace=10></td><td valign=middle align=left>' +
				   '<span class="dialog">' + text + '</span></td></tr></table><br></center></body>';

		dialog.document.write(html);

		//setTimeout('dialog.close()',4000);
		waitDialog = dialog;
		return dialog;
	}

	function cacheBreaker(url) {

		var d = new Date();

		var ret = d.getYear() + "" + d.getMonth() + "" + d.getDate() + "" +d.getHours() + "" +
			      d.getMinutes() + "" + d.getSeconds() + "" + Math.random();

		return url + "&cbr=" + ret;

	}

    function getAbsoluteTop(el) {

		//alert(el.tagName);
        var h = 0;
        if (el.parentElement != null) {
            h = h + getAbsoluteTop(el.parentElement)
        }
        return h + el.clientTop + el.offsetTop;
    }
    function getAbsoluteLeft(el) {

        var h = 0;
        if (el.parentElement != null) {
            h = h + getAbsoluteLeft(el.parentElement)
        }
        return h + el.clientLeft + el.offsetLeft;
    }

	function promptDialog(title,question,x,y) {
		var arr = new Array();
		arr[0] = title;
		arr[1] = question;

		var fstr = 'dialogHeight: 140px; dialogWidth: 250px; unadorned:yes; status: no;';

		if (x != null) {
			fstr = fstr + 'dialogLeft: ' + x + 'px' + ';';
		}
		if (y != null) {
			fstr = fstr + 'dialogTop: ' + y + 'px' + ';';
		}
		return showModalDialog('/content/webforms/promptdialog.html',arr,fstr);
	}

	function cancelEvent() {
		event.returnValue = false;
	}

