// check if parent frames are present
function framesPresent() {
 if (parent.frames.length == 0) return false;
 else {
    //if ((parent.frames[0].name).indexOf("ip-") == 0)
        return true;
 }
 return false;
}//framesPresent

// if trying to load this page directly (bypassing the index page) then set up the frames first:
function setupFrames(bodyURL, targetWindow) {
    var winTitle = 'InfoPlace: Information Management Products and Services';
    targetWindow.document.writeln('<HEAD><TITLE>' + winTitle + '</TITLE></HEAD>');
    targetWindow.document.writeln('<FRAMESET COLS="136,*" FRAMESPACING="0" FRAMEBORDER="NO" BORDER="0">');
    targetWindow.document.writeln('<FRAMESET ROWS="68,*" FRAMESPACING="0" FRAMEBORDER="NO" BORDER="0">');
    targetWindow.document.writeln('<FRAME SRC="/infoplace/ip-corner.html" NAME="ip-squares" SCROLLING="no">');
    targetWindow.document.writeln('<FRAME SRC="/infoplace/ip-left.html" NAME="ip-navigation" SCROLLING="no">');
    targetWindow.document.writeln('</FRAMESET>');
    targetWindow.document.writeln('<FRAMESET ROWS="68,*" FRAMESPACING="0" FRAMEBORDER="NO" BORDER="0">');
    targetWindow.document.writeln('<FRAME SRC="/infoplace/ip-top.html" NAME="ip-topbar" SCROLLING="no">');
    targetWindow.document.writeln('<FRAME SRC="' + bodyURL + '" NAME="ip-main" SCROLLING="auto" MARGINHEIGHT="5">');
    targetWindow.document.writeln('</FRAMESET>');
    targetWindow.document.writeln('</FRAMESET>');
    targetWindow.document.close();
}//setupFrames

function getNavigatorVersion() {
   return parseInt(navigator.userAgent.substring(8,9));
}//getNavigatorVersion

function getBrowserVersion() {
   return parseInt(navigator.userAgent.substring(8,9));
}//getBrowserVersion

function isMSBrowser() {
   return (navigator.appName.substring(0,9) == "Microsoft" );
}//checkIfMSBrowser

function isNetscapeBrowser() {
   return (navigator.appName.substring(0,8) == "Netscape" );
}//checkIfMSBrowser

function browserRolloverCapable() {
    var browserVersion = getBrowserVersion();
    if(isMSBrowser()) {//if Microsoft browser
        if (browserVersion >= 4) return true;
        else return false;
    }
    else if(isNetscapeBrowser()) {
        if (browserVersion >= 3) return true;
        else return false;
    }
    return false; // all other browsers
}//browserRolloverCapable

var imageToHighlight = "";
// onLoad handler for all the pages
function onLoadHandler(imageName) {
	var tBrowserVers4 = (getNavigatorVersion() >= 4);
    var tExplorer = isMSBrowser();//(navigator.appName.substring(0,9) == "Microsoft" );
    if (!framesPresent())  {
    	if(!tExplorer) setupFrames(this.location.pathname, window);
    }
    else if(tBrowserVers4 && (top.frames.length > 2) && imageName) {
    	if ((parent.frames[0].name).indexOf("ip-") == 0) {
    		if(parent.frames['ip-navigation']) {
				//to ensure that the java script gets loaded, we set a timer
				imageToHighlight = imageName;
				setTimeout("realOnLoadHandler()", 2000);
			}
        }
    }
	
}//onLoadHandler

// onLoad handler for all the pages
function realOnLoadHandler(imageName) {
	if ((parent.frames[0].name).indexOf("ip-") == 0) {
		if(parent.frames['ip-navigation']) {
			parent.frames['ip-navigation'].swapHilite(imageToHighlight);
			imageToHighlight = "";
		}
	}
}//onLoadHandler


