// Javascript Utilities
function bui_leaving_popup( page ) {
  parentDest=page;
  inttemp=window.open( '/jsp/utils/interstit.jsp', 'interstit','height=178,width=420');
  inttemp.focus();
}

function bui_leaving_popup2( page ) {
  parentDest=page;
  inttemp=window.open( '/jsp/utils/interstit_2.jsp', 'interstit2','height=178,width=420');
  inttemp.focus();
}

function interstit( page ) {
  parentDest=page;
  inttemp=window.open( '/jsp/utils/interstit.jsp', 'interstit','height=180,width=420');
  inttemp.focus();
}

function bui_privacy_popup( page ) {
  parentDest=page;
  inttemp=window.open( '/jsp/utils/privacy.jsp', 'privacy','status=yes,resizable=yes,height=280,width=420');
  inttemp.focus();
}

pdfDest='';
function bui_pdfxfer( page ) {
  pdfDest=page;
  pdftemp=window.open( '/jsp/utils/pdfxfer/prepdf.jsp', 'pdfxfer','height=250,width=420');
  pdftemp.focus();
}

pdfDest='';
function bui_pdfxfer2( page ) {
  pdfDest=page;
  pdftemp=window.open( '/jsp/utils/pdfxfer/prepdf2.jsp', 'pdfxfer','height=250,width=420');
  pdftemp.focus();
}



// this assigns the name "BRAND" to the website, so it can be referred to by windows that have been spawned (popups)
window.name='BRAND';

// Assign specific .css file paths to variables
//   Arrays accomidate more than one css file per page

var win_ie_css = new Array();
var win_n6_css = new Array();
var win_n4_css = new Array();
var mac_ie_css = new Array();
var mac_n6_css = new Array();
var mac_n4_css = new Array();
var other_css = new Array();

win_ie_css = [
	"/css/global/" + fontSize + "bui_styles.css",
	"/css/sitespecific/" + fontSize + "brand.css"
];

win_n6_css = [
	"/css/global/" + fontSize + "bui_stylesNS4.css",
	"/css/sitespecific/" + fontSize + "brandNS4.css"
];

win_n4_css = [
	"/css/global/" + fontSize + "bui_stylesNS4.css",
	"/css/sitespecific/" + fontSize + "brandNS4.css"
];

mac_ie_css = [
	"/css/global/" + fontSize + "bui_stylesMAC.css",
	"/css/sitespecific/" + fontSize + "brandMAC.css"
];

mac_n6_css = [
	"/css/global/" + fontSize + "bui_stylesMAC.css",
	"/css/sitespecific/" + fontSize + "brandMAC.css"
];

mac_n4_css = [
	"/css/global/" + fontSize + "bui_stylesMAC.css",
	"/css/sitespecific/" + fontSize + "brandMAC.css"
];

other_css = [
	"/css/global/" + fontSize + "bui_styles.css",
	"/css/sitespecific/" + fontSize + "brand.css"
];

//===================================================

// global vars
var css_call;
var user_client;
var user_platform;

// get platform
if (navigator.appVersion.indexOf("Win") != -1) {
	user_platform = "win";
} else if (navigator.appVersion.indexOf("Mac") != -1) {
	user_platform = "mac";
}

// get browser
if (document.layers) {
	user_client = "n4";
} else if (document.getElementById && !document.all) {
	user_client = "n6";
} else if (document.all) {
	user_client = "ie";
}

// build css call
if (user_platform == "win" || user_platform == "mac") {
	if (user_client == "n4" || user_client == "n6" || user_client == "ie") {
		css_call = user_platform + "_" + user_client + "_css";
	} else {
		css_call = "other_css";
	}
} else {
	css_call = "other_css";
}


// write call tag
var css_ref = eval(css_call);

for (var i = 0; i < css_ref.length; i++) {
	document.write('<link rel="stylesheet" type="text/css" href="' + jsContextPath + css_ref[i] + '">');
}

