// PRODUCT: product.js
// POLICY SELECT
function getPolicy(form) {
var target = form.policySelect.selectedIndex;
if (form.policySelect.options[target].value) {
window.parent.location = form.policySelect.options[target].value;
}
}
// FIND OLD BROWSERS
bName = navigator.appName;
bVer = parseInt(navigator.appVersion);
if ((bName == "Netscape" && bVer >= 3) || 
(bName == "Microsoft Internet Explorer" && bVer >= 4)) br = "n3"; 
else br = "n2";
// CHECK BROWSER TYPE
if (br== "n3") {
// IMAGE ARRAY
if (document.images) {
im = new Array();
imag = new Array();
imag[0] = "/images/sp.gif"
imag[1] = "/images/spbl.gif"
imag[2] = "/images/newer_about.gif"
imag[3] = "/images/newer_about_over.gif"
imag[4] = "/images/newer_contact.gif"
imag[5] = "/images/newer_contact_over.gif"
imag[6] = "/images/newer_terms.gif"
imag[7] = "/images/newer_terms_over.gif"
imag[8] = "/images/profileopen_white.gif"
imag[9] = "/images/profileopen_green.gif"
imag[10] = "/images/profileclose_white.gif"
imag[11] = "/images/profileclose_red.gif"
imag[12] = "/images/newer_fsa.gif"
imag[13] = "/images/newer_fsa_over.gif"
for (var i = 0; i < imag.length; i++) {
im[i] = new Image();
im[i].src = imag[i];
}
}
}
// ROLL FUNCTION
function roll(imgname,num) {
// CHECK BROWSER TYPE
if (br== "n3") {
if (document.images && imgname) {
imgname.src = im[num].src;
}
}
return;
}
// WINDOW FUNCTION 1
function open_window(target) {
var win_width   = 350;
var win_height  = 350;
var offset_left = (screen.width - win_width) / 2;
var offset_top  = (screen.height - win_height) / 2;
var wincfg = "status=1,scrollbars=1,resizable=1,width=" + win_width + ",height=" + win_height + ",left=" + offset_left + ",top=" + offset_top;
// OPEN WIN
target = target;
openwindow = window.open(target,"popupwin",wincfg);
openwindow.opener = self; 
openwindow.focus("popupwin");
}
// WINDOW FUNCTION 2
function no_query_window(target) {
var win_width   = 350;
var win_height  = 350;
var offset_left = (screen.width - win_width) / 2;
var offset_top  = (screen.height - win_height) / 2;
var wincfg = "status=1,scrollbars=1,resizable=1,width=" + win_width + ",height=" + win_height + ",left=" + offset_left + ",top=" + offset_top;
// OPEN WIN
openwindow = window.open(target,"popupwin",wincfg);
openwindow.opener = self; 
openwindow.focus("popupwin");
}
// WINDOW FUNCTION 3
function on_fly_window(title,body) {
var win_width   = 350;
var win_height  = 350;
var offset_left = (screen.width - win_width) / 2;
var offset_top  = (screen.height - win_height) / 2;
var wincfg = "status=1,scrollbars=1,resizable=1,width=" + win_width + ",height=" + win_height + ",left=" + offset_left + ",top=" + offset_top;
// OPEN WIN
onflywin = window.open('',"popupwin",wincfg);
// BUILD OUTPUT
output  = "<html><title>" + title + "</title>\n<link rel=\"stylesheet\" href=\"/misc/insure.css\">\n<body bgcolor=\"#FFFFFF\" background=\"/images/help_tile.gif\" text=\"#5E6666\" link=\"#000000\" vlink=\"#000000\" alink=\"#000000\">\n<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n<tr>\n<td valign=\"top\" height=\"30\"><tt><b>" + title + "</b></tt></td>\n</tr>\n<tr>\n<td valign=\"top\"><tt>";
output += body;
output += "<tt><br><br></tt></td>\n</tr>\n<tr bgcolor=\"#FFFFFF\">\n<td align=\"center\"><form><input type =\"button\" value = \"close window\" onClick = 'window.close(\"_self\");'></form></td>\n</tr>\n</table>\n</body>\n</html>";
// SEND CONTENT TO ON FLY WIN
onflywin.document.write(output);
}
// WINDOW FUNCTION 5
function open_quote_window(target) {
// MAX WIN SIZE
var win_width   = 800;
var win_height  = 600;
if (win_width > screen.width) {
win_width = screen.width;
}
if (win_height > screen.height) {
win_height = screen.height;
}
var offset_left = (screen.width - win_width) / 2;
var offset_top  = (screen.height - win_height) / 2;
// ADJUST WIN HEIGHT
win_height      = win_height - 100;
// CONFIG WIN
var wincfg = "status=1,scrollbars=1,resizable=1,width=" + win_width + ",height=" + win_height + ",left=" + offset_left + ",top=" + offset_top;
// OPEN WIN
openquotewin5 = window.open(target,"quotewin5",wincfg);
openquotewin5.opener = self; 
openquotewin5.focus("quotewin5");
}

function open_pop_under(target) {
// MAX WIN SIZE
var win_width   = 600;
var win_height  = 500;
if (win_width > screen.width) {
win_width = screen.width;
}
if (win_height > screen.height) {
win_height = screen.height;
}
var offset_left = (screen.width - win_width) / 2;
var offset_top  = (screen.height - win_height) / 2;
// ADJUST WIN HEIGHT
win_height      = win_height - 100;
// CONFIG WIN
var wincfg = "status=1,scrollbars=1,resizable=1,width=" + win_width + ",height=" + win_height + ",left=" + offset_left + ",top=" + offset_top;
// OPEN WIN
openpopunder = window.open(target,"popunder",wincfg);
openpopunder.opener = self; 
}

function launch_quote(quote_target,
                      pop_under_target) {
if (quote_target) {
open_quote_window(quote_target);
}
if (pop_under_target) {
open_pop_under(pop_under_target);
}
openquotewin5.focus("quotewin5");
return false;
}



var ns6 = (!document.all && document.getElementById);
var ie4 = (document.all);
function control_menu(id,mode,hide_select) {
if (id) {
if (mode)  value = 'visible';
if (!mode) value = 'hidden';
if (ns6) {
document.getElementById(id).style.visibility = value;
}
else if(ie4) {
document.all[id].style.visibility = value;
}
if (hide_select && mode)  control_menu(hide_select,0);
if (hide_select && !mode) control_menu(hide_select,1);
}
}
// SHOW HIDE
function control_tab(id) {
if (ns6 || ie4) {
// HIDE ALL
control_menu('PROD',0);
control_menu('ESPO',0);
// SHOW "id"
control_menu(id,1);
return false;
}
return true;
}
