function reportError(msg,url,line) {
 par_url = parent.location.href;
 par_url = (par_url == location.href) ? "no parent" : par_url;
 query_string = "/cgi-bin/javascript_onerror_log_write.cgi"
  + "?url=" + escape(location.href)
  + "&parent=" + escape(par_url)
  + "&referrer=" + escape(document.referrer)
  + "&browser=" + escape(navigator.appName + " " + navigator.appVersion)
  + "&msg=" + escape(msg)
  + "&line=" + escape(line)
  + "&count=" + (++jserror_count);
 if (document.images) {
  reporter = new Image();
  reporter.src = query_string;
 }
 return true;
}

// executed whenever a back is requested.
// copes ok with 2 backs in a row.
// can still be confusing.
function ruback() {
	document.history.back();
}


function jumpship(destination) {
	 opener.window.location=destination;
	 window.close();
	}
	
	
function outputPLT() {

	}

// This must be executed as in a script tag in the page.
// Netscape would not execute it in this file if it were inline.
function customstylesheet() {
	if (navigator.userAgent.indexOf('Mac') > 0) {
		if(navigator.userAgent.indexOf('MSIE') > 0 && navigator.appVersion.indexOf(' 5') > 0) {
			document.write("<link rel='stylesheet' href='/rustylemac5.css'>");
		}
		else if(navigator.userAgent.indexOf('Netscape6') > 0) {
			} else {
			document.write("<link rel='stylesheet' href='/rustylemac.css'>");  
		}
	} else if (navigator.userAgent.indexOf('MSIE') > 0) {
		} else {
		if(navigator.userAgent.indexOf('Gecko') > 0) {
			} else {
				document.write("<link rel='stylesheet' href='/rustylens.css'>");
			}
		}
}
                
/* Rollover automation */               
function preload() {
	for(nextImg=1; nextImg < document.images.length; nextImg++) {
	     theImageSrc =  document.images[nextImg].src;
		 if( theImageSrc.indexOf("-o")				== -1 &&	
		 	(theImageSrc.indexOf("button") 			!= -1 || 
		 	 theImageSrc.indexOf("topofpage")  		!= -1 ||
		 	 theImageSrc.indexOf("navrolls") 		!= -1)	) {

		    imgLength =  theImageSrc.length;
		    imgExt = theImageSrc.substring(imgLength-4, imgLength);
	 
	 		newImageSrc = theImageSrc.substring(0, imgLength-4) + "-o" + imgExt ;

			cacheImage = new Image ;
			cacheImage.src = newImageSrc;                                   
	 	} //if
	} //for
} //function




function currentpage(theImage) {
	// The image.alt attribute does not exist in the netscape 3 dom.
	if((navigator.appName.indexOf('Netscape') != -1) && (navigator.appVersion.indexOf('3') != -1)) {
		// If you have netscape and it is 3 do nothing, else.
		} else {
		if (theImage) {
			if (theImage.alt == document.title && theImage.src.indexOf("location") == -1) {
			    imgLength =  theImage.src.length;
			    imgExt = theImage.src.substring(imgLength-4, imgLength);
				overLocation = theImage.src.lastIndexOf("-o.");  // rollover ending on an image.                      
		    if(overLocation == -1) { // image is in normal state
				newImageSrc = theImage.src.substring(0, imgLength-4) + "location" + imgExt;
			} //if
			else {
				newImageSrc = theImage.src.substring(0, imgLength-6) + "location" + imgExt;
			}
	        theImage.src = newImageSrc;                            
			} //if	
		} //if
		else {
			alert("Why are you calling an undefined image in function currentpage() ?");
		}
	}
} //function



/* onMouseOver="imageswap(this)" onMouseOut="imageswap(this)"  */
function imageswap(theImage) {
    if(theImage.src.indexOf("location") == -1){ // Make sure the image doesn't represent the current page position.
		overLocation = theImage.src.lastIndexOf("-o.");  // the defacto rollover ending on an image.                      
	    imgLength =  theImage.src.length;
	    imgExt = theImage.src.substring(imgLength-4, imgLength);
	 
	    if(overLocation == -1) { // image is in normal state
			newImageSrc = theImage.src.substring(0, imgLength-4) + "-o" + imgExt ;
			theImage.src = newImageSrc;                                        
		} //if
		else {
			newImageSrc = theImage.src.substring(0, imgLength-6) + imgExt ;
			theImage.src = newImageSrc;                                        
		} //else
	}//if                                         
} // function


function popup(thislink, windname,  winfeat) {
 
 var linkwontwork = false;
 
if(!window.focus)
	{
	var popupwin = window.open(thislink,'_blank',winfeat); 
	linkwontwork = false;
	}  //if
else {
   	linkwontwork = false;
/*
//Why Does Maplin do this ?
       if (navigator.appName == "Microsoft Internet Explorer")
        {
			counter++;
			newWin = "win" + counter;
			var siteseal_win = window.open(url, newWin, "toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=0,resizable=0,width=645,height=540");
        }
*/

	thislink.target=windname; //for NS3
	
	// winfeat MUST NOT HAVE SPACES IN. Or NS45 ignores the attribute.
	// windname seems ignored in ie4 
	var popupwin = window.open(thislink,windname,winfeat); 
	//popupwin.location.href = thislink.href; //set the window contents to the link
	popupwin.focus();
	}  //else

return linkwontwork;//is true if it wont work
}  //function

  
   

function rulaunchhelp(url) {
 	// if you put spaces into the window attributes. Netscape BREAKS.
 	return (popup(url,"ruhelpwin","toolbar=0,location=1,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=350,height=300"));
}  //function

  
  
  
function rulaunchsupport(url) {
 	// if you put spaces into the window attributes. Netscape BREAKS.
 	return (popup(url,"rusupportwin","toolbar=1,location=1,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=550,height=400"));
}  //function

  
   
    
function rulaunchterms(url) {
 	// if you put spaces into the window attributes. Netscape BREAKS.
 	return (popup(url,"rutermswin","toolbar=1,location=1,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=550,height=400"));
}  //function

  

  
  
function jsDebug(msg) {
	
	var curr_date = new Date(); 
	
	if ((_dConsole == null) || _dConsole.closed) {
		_dConsole = window.open("", 'dConsoleWin', "width=400, height=600, resizable, scrollbars, menubar, top=0, left=0, status");
		//_dConsole.document.open("text/plain"); // saves htmling
		_dConsole.document.open();
		_dConsole.document.writeln("<html><head><style>");
		_dConsole.document.writeln("body		{font-size : 9; font-family : Verdana}");
		_dConsole.document.writeln("text		{font-size : 9; font-family : Verdana}");	
		_dConsole.document.writeln("</style></head><body bgcolor=ffffff>");
		_dConsole.document.writeln("<a href='/javascript/' onclick='self.close();'><img align=right src='/rujs1.gif' border=0></a><br>");
		_dConsole.document.writeln("<B>Debug information for \""+document.title+"\"<BR><BR>");
		_dConsole.document.writeln("Time :" + curr_date.toLocaleString() + "</B>");
		_dConsole.document.writeln("<BR><HR width=250px align=left noshade>");
	}
	else
	_dConsole.focus();
	_dConsole.document.writeln(msg+"<BR>");
}

                                                
function jsError() {
	// Serve a useful page.
	Window.href="/javascript/"; 
	}                                                
                                                
