var pathname = window.location.pathname.toLowerCase();filename = pathname.substring(0,(pathname.lastIndexOf('nsf')+4)) ;filenameR = pathname.substring(0,(pathname.lastIndexOf('nsf')+3)) ;theDomain =  window.location.protocol + '//' + window.location.hostname;function LogoClick(){	if(event.altKey) {		var URL = theDomain + filename + 'admin';		//var newWindow = window.open( URL,'secondary_window','toolbar=yes,location=yes,scrollbars=auto,resizable:yes,directories=no');		//newWindow.focus();				window.location = URL;		};} function imageLink(URL){//alert('Future functionality ');var newWindow = window.open( URL,'secondary_window','toolbar=yes,location=yes,resizable=yes,scrollbars=yes,directories=yes');newWindow.focus();}function openMenu ( UNID) {	var winTitle = 'DynamicNav';	var url = theDomain + filename + 'lu.menu/' + UNID + '?openDocument';		var newWindow =  window.open(url,winTitle,'status=no,toolbar=no,location=no,scrollbars=auto,resizable:yes,directories=no,height=200,width=450');    	newWindow.focus();}function openMenuModal ( UNID) {	var winTitle = 'DynamicNav';	var url = theDomain + filename + 'lu.menu/' + UNID + '?editDocument';		window.showModalDialog(url,'dialogHeight:210px; dialogWidth:550px;dialogLeft:10;dialogTop:10;help:no; resizable:yes; scroll:yes');  	}function copy_clip(xtext){ if (window.clipboardData)    {      // the IE-manier   window.clipboardData.setData("Text", xtext);    }   else if (window.netscape)    {          netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');       var clip = Components.classes['@mozilla.org/widget/clipboard;1']                 .createInstance(Components.interfaces.nsIClipboard);   if (!clip) return;     var trans = Components.classes['@mozilla.org/widget/transferable;1']                  .createInstance(Components.interfaces.nsITransferable);   if (!trans) return;         trans.addDataFlavor('text/unicode');         var str = new Object();   var len = new Object();      var str = Components.classes["@mozilla.org/supports-string;1"]                .createInstance(Components.interfaces.nsISupportsString);      var copytext=xtext;      str.data=copytext;      trans.setTransferData("text/unicode",str,copytext.length*2);      var clipid=Components.interfaces.nsIClipboard;      if (!clip) return false;      clip.setData(trans,null,clipid.kGlobalClipboard);      }   alert("the following info was copied to your clipboard:\n\n" + xtext);   return false;}function startList() {	if (document.all&&document.getElementById) {		navRoot = document.getElementById("dmenu");		for (i=0; i<navRoot.childNodes.length; i++) {			node = navRoot.childNodes[i];			if (node.nodeName=="LI") {				node.onmouseover=function() {					this.className+=" over";				}				node.onmouseout=function() {					this.className=this.className.replace(" over", "");				}			}		}	}}function logoutDrop() {if (confirm("Are you really sure you want to erase the auto login information?. \n\n select  'OK' to erase it. \n select 'Cancel'  to keep the information and logout"))	{     deleteCookie('usr',"/","");          location.href = filenameR + "?logout&redirectTo="	} else {			location.href = filenameR + "?logout&redirectTo="			}	}function ValidatePhone(pObj){//alert(pObj.name + 4)p=p1.valueif(p.length==3){	//d10=p.indexOf('(')	pp=p;	d4=p.indexOf('(')	d5=p.indexOf(')')	if(d4==-1){		pp="("+pp;	}	if(d5==-1){		pp=pp+")";	}	//pp="("+pp+")";	p1.value="";	p1.value=pp;}if(p.length>3){	d1=p.indexOf('(')	d2=p.indexOf(')')	if (d2==-1){		l30=p.length;		p30=p.substring(0,4);		//alert(p30);		p30=p30+")"		p31=p.substring(4,l30);		pp=p30+p31;		//alert(p31);		p1.value="";		p1.value=pp;	}	}if(p.length>5){	p11=p.substring(d1+1,d2);	if(p11.length>3){	p12=p11;	l12=p12.length;	l15=p.length	//l12=l12-3	p13=p11.substring(0,3);	p14=p11.substring(3,l12);	p15=p.substring(d2+1,l15);	m.value="";	pp="("+p13+")"+p14+p15;	pObj.value=pp;		}	l16=p.length;	p16=p.substring(d2+1,l16);	l17=p16.length;	if(l17>3&&p16.indexOf('-')==-1){		p17=p.substring(d2+1,d2+4);		p18=p.substring(d2+4,l16);		p19=p.substring(0,d2+1);		//alert(p19);	pp=p19+p17+"-"+p18;	p1.value="";	p1.value=pp;		}}//}setTimeout(ValidatePhone,100)}function formatNum(pObj) {n=pObj.name;//alert(pObj)p1=pObjValidatePhone(pObj)}function testphone(obj1){p=obj1.value//alert(p)p=p.replace("","")p=p.replace("-","")p=p.replace("-","")p=p.replace("-","")//alert(isNaN(p))if (isNaN(p)==true){alert("Check phone");return false;}}//Cookie functionfunction getCookieVal (offset) {  var endstr = document.cookie.indexOf (";", offset);  if (endstr == -1)    endstr = document.cookie.length;  return unescape(document.cookie.substring(offset, endstr));}function SetCookie ( name, value, expires, path, domain, secure ) {	document.cookie = name + "=" + (value) +	((expires) ? "; expires=" + expires.toGMTString() : "") +	((path) ? "; path=" + path : "") +	((domain) ? "; domain=" + domain : "") +	((secure) ? "; secure" : "");}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 deleteCookie (name,path,domain) {  if (getCookie(name)) {    document.cookie = name + "=" +      ((path) ? "; path=" + path : "") +      ((domain) ? "; domain=" + domain : "") +	"; expires=Thu, 01-Jan-70 00:00:01 GMT";  }}//end cookie functionsfunction logout() {	if (confirm("You are being Logged Out!!\n\nDo you with to continue?")) {	top.document.location.href = filenameR + "?logout&RedirectTo=" + filenameR;	return true;	} else {	return false;	}}
