/* 
    Copyright Notice ========================================================

    This file contains proprietary information of Alpine Internet Solutions. 
    Copying or reproduction without prior written approval is prohibited. 

    Copyright (c) 2000-2005 =================================================

	Purpose: Javascript support functions

    $Id: rolllib.js,v 2.3 2005/03/24 18:39:28 bcash Exp $
    $Author: bcash $
    $Revision: 2.3 $
    $Date: 2005/03/24 18:39:28 $

*/

<!-- 
function fetch(url) {
    opener.location = url;
} 

function swapImgRestore() { //v3.0 
  var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; 
} 
 
function js_back_button()
{
    document.writeln('&nbsp;<a href="javascript:history.go(-1);" class="textlink">&lt;BACK</a>');
}
 
function preloadImages() { //v3.0 
  var d=document; if(d.images){ if(!d.p) d.p=new Array(); 
    var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++) 
    if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}} 
} 
 
function findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { 
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} 
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; 
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
} 
 
function swapImage() { //v3.0 
  var i,j=0,x,a=swapImage.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3) 
   if ((x=findObj(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} 
} 
 
function swapImage2() { //v3.0 
  var i,j=0,x,a=swapImage2.arguments; document.sr2=new Array; for(i=0;i<(a.length-2);i+=3) 
   if ((x=findObj(a[i]))!=null){document.sr2[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} 
} 
function swapImgRestore2() { //v3.0 
  var i,x,a=document.sr2; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; 
} 

function setTextOfLayer(objName,x,newText) { //v3.0
  if ((obj=findObj(objName))!=null) with (obj)
    if (navigator.appName=='Netscape') {document.write(unescape(newText)); document.close();}
    else innerHTML = unescape(newText);
}
 
function changeProp(objName,x,theProp,theValue) { //v3.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)) eval("obj."+theProp+"='"+theValue+"'");
}
 
var lastMouseX;
var lastMouseY;
var curPopupWindow = null;
var helpWindow = null;

function openBrWindow(theURL,winName,features) { //v2.0
  var newWin = window.open(theURL,winName,features);
  if (newWin.opener == null) newWin.opener = self; 
  newWin.focus();
  
}
 
function openWindow(url, winName, width, height, center) { 
	 
   var xposition = 50; // Postions the window vertically in px 
   var yposition = 50; // Postions the window horizontally in px 
 
 
   if ((parseInt(navigator.appVersion) >= 4 ) && (center)){ 
       xposition = (screen.width - 800) / 2; 
       yposition = (screen.height - 600) / 2; 
   }  
 

   // Features to specify for a new window 
   args = "width=" + width + "," 
   + "height=" + height + "," 
   + "location=0," 
   + "menubar=0," 
   + "resizable=1," 
   + "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 
 
   // Performs the opening of the window. 
   if (curPopupWindow != null) { 
	    
		if (!curPopupWindow.closed) { 
			curPopupWindow.close(); 
		} 
		curPopupWindow = null; 
	} 
	curPopupWindow = window.open(url, winName, args, false); 
	if (curPopupWindow.opener == null) curPopupWindow.opener = self; 
	curPopupWindow.focus(); 
 
} 

function setLastMousePosition(e) {
	if (navigator.appName.indexOf("Microsoft") != -1) e = window.event;
	lastMouseX = e.screenX;
	lastMouseY = e.screenY;
}

function openClickout(url) {
		// Taken out due to inconsistent escape results between java and javascript
        //window.open('/sales/linkout.jsp?url='+escape(url), "_blank", 'width=640,height=480,dependent=no,resizable=yes,toolbar=yes,status=yes,directories=yes,menubar=yes,scrollbars=1', false);
	window.open(url, "_blank", 'width=640,height=480,dependent=no,resizable=yes,toolbar=yes,status=yes,directories=yes,menubar=yes,scrollbars=1', false);
}
function Add_A_Favorite() 
{ 
if (window.external) 
// if the browser is IE open the add favorite window
{
external.AddFavorite(location.href, document.title)
// Add the document location and title to the AddFavorite window
}
else 
// Display and alert box for any other browser.
{
alert("Sorry, your browser doesn't support this feature." + 
"\nPlease use the bookmark feature of your browser to save the location of this page.");
}

}
//--> 
