// Browser Detection 
function BrowserCheck() {
	var b = navigator.appName;	
	if (b=="Netscape") this.b = "ns";
	else if (b=="Microsoft Internet Explorer") this.b = "ie";
	else this.b = b;
	this.version = navigator.appVersion;
	//if (this.version.indexOf('Win')>0) this.os = "PC";
	//else if (this.version.indexOf('Mac')>0) this.os = "Mac";	
	this.WinOs = (this.version.indexOf('Win')>0);
	this.v = parseInt(this.version);
	this.ns = (this.b=="ns" && this.v>=4);
	this.ns4 = (this.b=="ns" && this.v==4);
	this.ns5 = (this.b=="ns" && this.v==5);
	this.ie = (this.b=="ie" && this.v>=4);
	this.ie4 = (this.version.indexOf('MSIE 4')>0);
	this.ie5 = (this.version.indexOf('MSIE 5')>0);
	this.ie6 = (this.version.indexOf('MSIE 6')>0);
	this.min = (this.ns||this.ie);
}
var browser = new BrowserCheck();

if ((!browser.WinOs) && (browser.ie)){
	window.onresize = new Function("window.location.href=document.location");
}


function adjustFooter(){	
	var center_row_height
	if (browser.ns){ 
		center_row_height = self.innerHeight-288; 
	}else{
		center_row_height = parseInt(document.body.clientHeight)-288;
	}
	if ((browser.ns || browser.ie) && (typeof center_row_height == "number")){
		document.writeln('<img src="/images/shared/spacer.gif" width="1" height="'+ center_row_height +'" border="0">'); 
	} else { 
		document.writeln('<img src="/images/shared/spacer.gif" width="1" height="'+ center_row_height +'" border="0">'); 
	}
}

function adjustPopUpTitleBar(){	
	var center_width
	if (browser.ns4){ 
		center_width = self.innerWidth-368; 
	}else if (browser.ns5){
		center_width = self.innerWidth-377; 
	}else{
		center_width = parseInt(document.body.clientWidth)-368;
	}
	if ((browser.ns || browser.ie) && (typeof center_width == "number")){
		document.writeln('<td valign="top"><img src="/images/shared/pop_up_top_sliver.gif" width="'+ center_width +'" height="43" border="0"></td>'); 
	} else { 
		document.writeln('<td valign="top"><img src="/images/shared/pop_up_top_sliver.gif" width="'+ center_width +'" height="43" border="0"></td>'); 
	}
}


//Netscape 4.x Resize
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


var oImgPath = new Object();
oImgPath.home = "/images/home/";
oImgPath.shared = "/images/shared/";


//------
//IMAGE ROLLOVERS
function imgOn(imgName) { document[imgName].src = eval(imgName + "_on.src"); }
function imgOff(imgName) { document[imgName].src = eval(imgName + "_off.src"); }

//IMAGE CACHING
function cacheImg(name,src,rollover,type){
	if (!type) var type = "gif";
	if (rollover==true){
		eval(name + "_off =  new Image");
		eval(name + "_off.src = \'" + src + name + "_off." + type + "\'");
		eval(name + "_on =  new Image");
		eval(name + "_on.src = \'" + src + name + "_on." + type + "\'");
	} else {
		eval(name + " = new Image");
		eval(name + ".src = \'"+src+name+"."+type+"\'");
	}
}

function goSolutionsFinder(){
	var officeSelectedIndex = eval('document.solution_finder.solution_finder_dropdown.selectedIndex');
	var officeSelectedValue = eval('document.solution_finder.solution_finder_dropdown.options['+ officeSelectedIndex +'].value');
	
	if (officeSelectedValue != 'null'){
		document.location = officeSelectedValue;
	}
}

function popWindow(url, width, height, name, scrollbars){
	if (!scrollbars) scrollbars = false;
	if (!width) width = 500;
	if (!height) height = 500;
 	var realW = (width)/2;
	var realH = (height)/2;
 	if (document.all){		
        var xMax = screen.width, yMax = screen.height;
    }else if (document.layers){       
        var xMax = screen.width, yMax = screen.height;
    }else if (document.getElementById){
		var xMax = screen.width, yMax = screen.height;
	}else{
		var xMax = 800, yMax=600;
	}
	var xOffset = ((xMax)/2) - realW, yOffset = (((yMax)/2)) - realH; 
	if (yMax==600){
		yOffset = 0;
	}	
	
	if (scrollbars) {
		var options = "directories=no,status=no,location=no,scrollbars=yes,menubar=no,toolbar=no,resizable=no" + ",screenX=" + xOffset + ",screenY=" + yOffset + ",top=" + yOffset + ",left=" + xOffset + ",width=" + width + ",height=" + height;
	}else{
		var options = "directories=no,status=no,location=no,scrollbars=no,menubar=no,toolbar=no,resizable=no" + ",screenX=" + xOffset + ",screenY=" + yOffset + ",top=" + yOffset + ",left=" + xOffset + ",width=" + width + ",height=" + height;
	}
	
	if (!name) name = "default_window";
	
	popup = window.open(url,name,options);
	popup.focus();	
}

function popWindowArticles(url, pdf){
	var width;
	var height;
	var name;
	if (!pdf) pdf = false;
	if (pdf){
		width = 700;
		height = 500;
		name = "pdfPopWindow";
	}else{
		width = 700;
		height = 500;
		name = "OffSitePopWindow";
	}	
 	var realW = (width)/2;
	var realH = (height)/2;
 	if (document.all){		
        var xMax = screen.width, yMax = screen.height;
    }else if (document.layers){       
        var xMax = screen.width, yMax = screen.height;
    }else if (document.getElementById){
		var xMax = screen.width, yMax = screen.height;
	}else{
		var xMax = 800, yMax=600;
	}
	var xOffset = ((xMax)/2) - realW, yOffset = (((yMax)/2)) - realH; 
	if (yMax==600){
		yOffset = 0;
	}	
	
	if (pdf) {
		var options = "directories=no,status=no,location=no,scrollbars=no,menubar=no,toolbar=no,resizable=yes" + ",screenX=" + xOffset + ",screenY=" + yOffset + ",top=" + yOffset + ",left=" + xOffset + ",width=" + width + ",height=" + height;
	}else{
		var options = "directories=yes,status=yes,location=yes,scrollbars=yes,menubar=yes,toolbar=yes,resizable=yes" + ",screenX=" + xOffset + ",screenY=" + yOffset + ",top=" + yOffset + ",left=" + xOffset + ",width=" + width + ",height=" + height;
	}
	
	popup = window.open(url,name,options);
	popup.focus();	
}
//------