
function Publish(s) {
  return(s);
 }

function connector() {
  var s = document.URL;
  if (s.indexOf(".exe") == -1) {
    return ".htm?";
  } else {
    return "&";
  }
}

// popup function 
// expects :
//			url - of the window to be called
//			Title -  for the window, each unique title spawns a new window
//			width - in pixels of the desired window
//			height - in pixels of the desired window
//	hence a legal call would look like:
// <a href="JavaScript:popWindow('myurl.htm','popupwindowname','520','615')" >click here to spawn window</a>
//

oHTMLWin = null;

function centerWindow(url, name, w, h, scroll, menu, resizable)
{
	if (window.screen)
	{
		var chasm = screen.availWidth;
		var mount = screen.availHeight;
		
		winprops = 'width=' + w + ',height=' + h + ',left=' + ((chasm - w - 10) * .5) + ',top=' + ((mount - h) * .5) + ',scrollbars=' + scroll + ',menubar=' + menu + ',resizable=' + resizable;
		
		oHTMLWin = window.open(url, name, winprops);
		oHTMLWin.window.focus();
	}
}

function popWindow(url,title,width,height){
		centerWindow(url, title, width, height, "yes", "no", "no");
		
		/*strProps = "scrollbars=yes,width="+width+",height="+height;
        if(navigator.appName == "Netscape") {//moz
	        popWin = window.open(url,title,strProps);
	        popWin.focus();
        }
        else{  //ie
	       if (navigator.userAgent.indexOf("MSIE 3") >= 0){ 
	           popWin = window.open(url,title,strProps);
	           popWin.location.href = url;
	       }
	       else{
	           var popWin = window.open(url,title,strProps);
	       }
       }  */     
}

function popWindowNoScroll(url,title,width,height){
		centerWindow(url, title, width, height, "no", "no", "no");
		
		/*strProps = "scrollbars=no,width="+width+",height="+height;
        if(navigator.appName == "Netscape") {//moz
	        popWin = window.open(url,title,strProps);
	        popWin.focus();
        }
        else{  //ie
	       if (navigator.userAgent.indexOf("MSIE 3") >= 0){ 
	           popWin = window.open(url,title,strProps);
	           popWin.location.href = url;
	           //if (popWin.opener == null) popWin.opener = window; 
	           //popWin.opener.name = "opener";
	       }
	       else{
	           var popWin = window.open(url,title,strProps);
	       }
       }  */    
}

// old function for backwards support
function openWin(theURL,title,width,height,scrolling){
window.open(theURL,title,'width=' + width + ',height=' + height + ',scrollbars=' + scrolling + ',toolbar=no,titlebar=yes,status=no,menubar=no,resizable=no,location=no');
}

var myimages=new Array();

function preloadimages(){
for (i=0;i<preloadimages.arguments.length;i++){
myimages[i]=new Image()
myimages[i].src=preloadimages.arguments[i]
}
}

// this function to retrieves a cookie.
	function getCookie(name){
	var cname = name + "=";               
	var dc = document.cookie;             
  	  if (dc.length > 0) {              
  	  begin = dc.indexOf(cname);       
  	      if (begin != -1) {           
  	      begin += cname.length;       
   		     end = dc.indexOf(";", begin);
   	         if (end == -1) end = dc.length;
  	          return unescape(dc.substring(begin, end));
  	      } 
  	  }
	return null;
	}

// this function saves a cookie
	function setCookie(name, value) {
		cookieString = name + "=" + escape(value); 
		cookieString = cookieString + "; path=/";
		document.cookie = cookieString;
		}