// JScript File



userAgent = window.navigator.userAgent;
browserVers = parseInt(userAgent.charAt(userAgent.indexOf("/")+1),10);
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function findElement(n,ly) {
	if (browserVers < 4)		return document[n];
	var curDoc = ly ? ly.document : document;
	var elem = curDoc[n];
	if (!elem) {
		for (var i=0;i<curDoc.layers.length;i++) {
			elem = findElement(n,curDoc.layers[i]);
			if (elem) return elem;
		}
	}
	return elem;
}

function changeImages() {

	if (document.images && (preloadFlag == true)) {
		var img;
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			img = null;
			if (document.layers) {
				img = findElement(changeImages.arguments[i],0);
			}
			else {
				img = document.images[changeImages.arguments[i]];
			}
			if (img) {
				img.src = changeImages.arguments[i+1];
			}
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
	
	}
}


function openAWindow( pageToLoad, winName, width, height, resizeable, scroll) {
	  	  	var popWin;
	  
	  	  	/* Opens a new window on the users desktop.
	  	  		Arguments:
	  	  		 pageToLoad - The URL of a page to load in the browser window.
	  	  						  This can be a relative URL or fully qualified.
	  	  		 winName - 	 Name of the new window.
	  	  		 width - 	 The horizontal size of the new window.
	  	  		 height - 	 The vertical size of the new window.
	  	  		 center -     toggle centering on 4.0 browsers.
	  	  						  1=centered window 0=no centering
	  
	  	  		 Values in the "args" section below can all be toggled in the
	  	  		 same fashion as the center toggle.  Just modify the appropriate
	  	  		 value in the args section to be either 0 or 1.
	  
	  	  	*/
	  
	  	  		 xposition=0; yposition=0;
	  	  		 if ((parseInt(navigator.appVersion) >= 4 ) && (1==1)){
	  	  			  xposition = (screen.width - width) / 2;
	  	  			  yposition = (screen.height - height) / 2;
	  	  		 }
	  	  		 args = "width=" + width + ","
	  	  		 + "height=" + height + ","
	  	  		 + "location=0,"
	  	  		 + "menubar=0,"
	  	  		 + "resizable=" + resizeable + ","
	  	  		 + "scrollbars=" + scroll + ","
	  	  		 + "status=0,"
	  	  		 + "titlebar=1,"
	  	  		 + "toolbar=0,"
	  	  		 + "hotkeys=0,"
	  	  		 + "screenx=" + xposition + ","  //NN Only
	  	  		 + "screeny=" + yposition + ","  //NN Only
	  	  		 + "left=" + xposition + ","     //IE Only
	  	  		 + "top=" + yposition;           //IE Only
	  
	  	  		 popWin=window.open( pageToLoad,winName,args );
	  	  		 popWin.focus();
	  
	  	  	}
	  


//-- USE ON REP / CLIENT ACCESS PAGE TO OPEN PDF FILES in an IFRAME
 
function openIframeWin( pageToLoad, winName) {
	  	  	var popWin;
	    
	  	  		 xposition=5; yposition=5;
	  	  		 var w = (screen.width * 0.7);
	  	  		if ((w < 700) && (screen.width >= 700)) { 
	  	  		        w = 700 
	  	  		        };
	  	  		 args = "width=" + w + ","
	  	  		 + "height=" + (screen.height * 0.95) + ","
	  	  		 + "location=0,"
	  	  		 + "menubar=0,"
	  	  		 + "resizable=0,"
	  	  		 + "scrollbars=1,"
	  	  		 + "status=0,"
	  	  		 + "titlebar=0,"
	  	  		 + "toolbar=0,"
	  	  		 + "hotkeys=0,"
	  	  		 + "screenx=" + xposition + ","  //NN Only
	  	  		 + "screeny=" + yposition + ","  //NN Only
	  	  		 + "left=" + xposition + ","     //IE Only
	  	  		 + "top=" + yposition;           //IE Only
	  
	  pageToLoad = pageToLoad + "&h=" + (screen.height * 0.95) // height variable for the iFrame height
	  	  		 popWin=window.open( pageToLoad ,winName,args );
	  	  		 popWin.focus();
	  
	  	  	}


//-- NO-RIGHT-CLICK SCRIPT --//
/**/
isNN = document.layers ? 1 : 0;
function noContext(){return false;}
function noClick(e){
if(isNN){
 if(e.which > 1) {return false;}
 } else {
  if(event.button > 1){return false;}
 }
}
if(isNN){
 document.captureEvents(Event.MOUSEDOWN);
}
document.oncontextmenu = noContext;
document.onmousedown   = noClick;
document.onmouseup     = noClick;

