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);

function centerWindow(whatOption,winWidth,winHeight) {
	window.open(whatOption,'optionWindow','toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width='+winWidth+',height='+winHeight);
}

function centerWindowModel(whatOption,winWidth,winHeight) {
	window.showModalDialog(whatOption,'optionWindow','toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width='+winWidth+',height='+winHeight);
}


function MM_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=MM_findObj(n,d.layers[i].document);
	}
	if (!x && document.getElementById) {
		x=document.getElementById(n);
	}
	return x;
}

function MM_showHideLayers() { //v3.0
	var i,p,v,obj,args=MM_showHideLayers.arguments;
	for (i=0; i<(args.length-2); i+=3) {
		if ((obj=MM_findObj(args[i]))!=null) {
			v=args[i+2];
			if (obj.style) {
				obj=obj.style;
				v=(v=='show')?'visible':(v='hide')?'hidden':v;
			}
			obj.visibility=v;
		}
	}
}

function MM_timelineStop(tmLnName) { //v1.2
	//Copyright 1997 Macromedia, Inc. All rights reserved.
	if (document.MM_Time == null) {
		MM_initTimelines(); //if *very* 1st time
	}
	if (tmLnName == null) { //stop all
		for (var i=0; i<document.MM_Time.length; i++) {
			document.MM_Time[i].ID = null;
		}
	} else {
		document.MM_Time[tmLnName].ID = null; //stop one
	}
}

function MM_timelineGoto(tmLnName, fNew, numGotos) { //v2.0
	//Copyright 1997 Macromedia, Inc. All rights reserved.
	var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,lastKeyFr,propNum,theObj;
	if (document.MM_Time == null) {
		MM_initTimelines(); //if *very* 1st time
	}
	tmLn = document.MM_Time[tmLnName];
	if (numGotos != null) {
		if (tmLn.gotoCount == null) {
			tmLn.gotoCount = 1;
		} else if (tmLn.gotoCount++ >= numGotos) {
			tmLn.gotoCount=0;
			return;
		}
	}
	jmpFwd = (fNew > tmLn.curFrame);
	for (i = 0; i < tmLn.length; i++) {
		sprite = (jmpFwd)? tmLn[i] : tmLn[(tmLn.length-1)-i]; //count bkwds if jumping back
		if (sprite.charAt(0) == "s") {
			numKeyFr = sprite.keyFrames.length;
			firstKeyFr = sprite.keyFrames[0];
			lastKeyFr = sprite.keyFrames[numKeyFr - 1];
			if ((jmpFwd && fNew<firstKeyFr) || (!jmpFwd && lastKeyFr<fNew)) {
				continue; //skip if untouchd
			}
			for (keyFrm=1; keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]; keyFrm++) {};
			for (j=0; j<sprite.values.length; j++) {
				props = sprite.values[j];
				if (numKeyFr == props.length) {
					propNum = keyFrm-1 //keyframes only
				} else {
					propNum = Math.min(Math.max(0,fNew-firstKeyFr),props.length-1); //or keep in legal range
				}
				if (sprite.obj != null) {
					if (props.prop2 == null) {
						sprite.obj[props.prop] = props[propNum];
					} else {
						sprite.obj[props.prop2][props.prop] = props[propNum];
					}
				}
			}
		} else if (sprite.charAt(0)=='b' && fNew == sprite.frame) {
			eval(sprite.value);
		}
	}
	tmLn.curFrame = fNew;
	if (tmLn.ID == 0) {
		eval('MM_timelinePlay(tmLnName)');
	}
}

function MM_timelinePlay(tmLnName, myID) { //v1.2
	//Copyright 1997 Macromedia, Inc. All rights reserved.
	var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,propNum,theObj,firstTime=false;
	if (document.MM_Time == null) {
		MM_initTimelines(); //if *very* 1st time
	}
	tmLn = document.MM_Time[tmLnName];
	if (myID == null) {
		myID = ++tmLn.ID;
		firstTime=true;
	}//if new call, incr ID
	if (myID == tmLn.ID) { //if Im newest
		setTimeout('MM_timelinePlay("'+tmLnName+'",'+myID+')',tmLn.delay);
		fNew = ++tmLn.curFrame;
		for (i=0; i<tmLn.length; i++) {
			sprite = tmLn[i];
			if (sprite.charAt(0) == 's') {
				if (sprite.obj) {
					numKeyFr = sprite.keyFrames.length; firstKeyFr = sprite.keyFrames[0];
					if (fNew >= firstKeyFr && fNew <= sprite.keyFrames[numKeyFr-1]) { //in range
						keyFrm=1;
						for (j=0; j<sprite.values.length; j++) {
							props = sprite.values[j]; 
							if (numKeyFr != props.length) {
								if (props.prop2 == null) {
									sprite.obj[props.prop] = props[fNew-firstKeyFr];
								} else {
									sprite.obj[props.prop2][props.prop] = props[fNew-firstKeyFr];
								}
							} else {
								while (keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]) {
									keyFrm++;
								}
								if (firstTime || fNew==sprite.keyFrames[keyFrm-1]) {
									if (props.prop2 == null) {
										sprite.obj[props.prop] = props[keyFrm-1];
									} else {
										sprite.obj[props.prop2][props.prop] = props[keyFrm-1];
									}
								}
							}
						}
					}
				}
			} else if (sprite.charAt(0)=='b' && fNew == sprite.frame) {
				eval(sprite.value);
			}
			if (fNew > tmLn.lastFrame) {
				tmLn.ID = 0;
			}
		}
	}
}

//This hides everything when the mouse is clicked anywhere on the page.
//do browser detect stuff
var isNS = (navigator.appName == "Netscape");
var isMacIE = ( (navigator.userAgent.indexOf("IE 4")  > -1) && (navigator.userAgent.indexOf("Mac")  > -1) );
var layerRef = (isNS) ? "document" : "document.all";
var styleRef = (isNS) ? "" : ".style";
var isDynamic = ( (document.layers || document.all) && !isMacIE );

var activeMenu = 0;

function killMenu(e) {
	//check if theres a menu active
	if (activeMenu) {
		MM_showHideLayers('pol01','','hide','pol02','','hide','pol03','','hide','pol04','','hide','pol05','','hide','pol06','','hide','pol07','','hide','pol08','','hide','car01','','hide','car02','','hide','car03','','hide','car04','','hide','car05','','hide','claim01','','hide','quote01','','hide','quote02','','hide','quote03','','hide','quote04','','hide','quote05','','hide','abo01','','hide','abo02','','hide','abo03','','hide','abo04','','hide','abo05','','hide','abo06','','hide','abo07','','hide','claim01','','hide','claim02','','hide','claim03','','hide','claim04','','hide','claim05','','hide','claim06','','hide','claim07','','hide','claim08','','hide','claim09','','hide','claim10','','hide','claim11','','hide','claim12','','hide','claim13','','hide');
		MM_timelineGoto('Timeline1','46');	     
	}
}

function init() {
	activeMenu = 1;
	if (isDynamic) {
		if (isNS) {
			document.captureEvents(Event.MOUSEUP);
		}
		document.onmouseup = killMenu;
	}
}

function hideShow(showThisOne){
	// hide'em all
	MM_showHideLayers('pol01','','hide','pol02','','hide','pol03','','hide','pol04','','hide','pol05','','hide','pol06','','hide','pol07','','hide','pol08','','hide','car01','','hide','car02','','hide','car03','','hide','car04','','hide','car05','','hide','claim01','','hide','quote01','','hide','quote02','','hide','quote03','','hide','quote04','','hide','quote05','','hide','abo01','','hide','abo02','','hide','abo03','','hide','abo04','','hide','abo05','','hide','abo06','','hide','abo07','','hide','claim01','','hide','claim02','','hide','claim03','','hide','claim04','','hide','claim05','','hide','claim06','','hide','claim07','','hide','claim08','','hide','claim09','','hide','claim10','','hide','claim11','','hide','claim12','','hide','claim13','','hide');
	// show this one
	MM_showHideLayers(showThisOne,'','show');
}

function hideAll(){
	// hide'em all
	MM_showHideLayers('pol01','','hide','pol02','','hide','pol03','','hide','pol04','','hide','pol05','','hide','pol06','','hide','pol07','','hide','pol08','','hide','car01','','hide','car02','','hide','car03','','hide','car04','','hide','car05','','hide','claim01','','hide','quote01','','hide','quote02','','hide','quote03','','hide','quote04','','hide','quote05','','hide','abo01','','hide','abo02','','hide','abo03','','hide','abo04','','hide','abo05','','hide','abo06','','hide','abo07','','hide','claim01','','hide','claim02','','hide','claim03','','hide','claim04','','hide','claim05','','hide','claim06','','hide','claim07','','hide','claim08','','hide','claim09','','hide','claim10','','hide','claim11','','hide','claim12','','hide','claim13','','hide');
}

var runScript = false;
var browserName = navigator.appName;
var browserVersion = parseInt(navigator.appVersion);
if ((browserName == "Netscape" && browserVersion >=3) || (browserName == "Microsoft Internet Explorer" && browserVersion >= 4)) {
	runScript = true;
} else {
	runScript = false;
}

// the rollover stuff
var Total_Reps = 22;		// number of loops to wait if images hav enot loaded on the onLoad event
var reps_run = 0;			// counter for Total_Reps
var Total_Images = 26;		// Number of rollover images need to be cached
var images_cached = 0;		// Counter for number of rollover images cached (for Net 3.x and IE 4.x)
var cool_to_run = false;

if (runScript) {
	// initialize our new navigation image objects
	var navOnNav01=new Image();
	var navOnNav02=new Image();
	var navOnNav03=new Image();
	var navOnNav04=new Image();
	var navOnNav05=new Image();
	var navOnNav06=new Image();
	var navOnNav07=new Image();
	var navOnNav08=new Image();
	var navOnNav09=new Image();
	var navOnNav10=new Image();
	var navOnNav11=new Image();
	var navOnNav12=new Image();
	var navOnNav13=new Image();
	var navOffNav01=new Image();
	var navOffNav02=new Image();
	var navOffNav03=new Image();
	var navOffNav04=new Image();
	var navOffNav05=new Image();
	var navOffNav06=new Image();
	var navOffNav07=new Image();
	var navOffNav08=new Image();
	var navOffNav09=new Image();
	var navOffNav10=new Image();
	var navOffNav11=new Image();
	var navOffNav12=new Image();
	
	// Pre-load ON ons and assign them to variables.
	images_cached++;
	navOnNav01.src="/imagesCKR/on_claim.gif";
	images_cached++;
	navOnNav02.src="/imagesCKR/on_agent.gif";
	images_cached++;
	navOnNav03.src="/imagesCKR/on_home.gif";
	images_cached++;
	navOnNav04.src="/imagesCKR/on_site.gif";
	images_cached++;
	navOnNav05.src="/imagesCKR/on_about.gif";
	images_cached++;
	navOnNav06.src="/imagesCKR/on_contact.gif";
	images_cached++;
	navOnNav07.src="/imagesCKR/on_policy.gif";
	images_cached++;
	navOnNav08.src="/imagesCKR/on_career.gif";
	images_cached++;
	navOnNav09.src="/imagesCKR/on_quote.gif";
	images_cached++;
	navOnNav10.src="/imagesCKR/on_ins.gif";
	images_cached++;
	navOnNav11.src="/imagesCKR/on_comm.gif";
	images_cached++;
	navOnNav12.src="/imagesCKR/on_edu.gif";
	
	// Pre-load OFF ons and assign them to variables.
	images_cached++;
	navOffNav01.src="/imagesCKR/off_claim.gif";
	images_cached++;
	navOffNav02.src="/imagesCKR/off_agent.gif";
	images_cached++;
	navOffNav03.src="/imagesCKR/off_home.gif";
	images_cached++;
	navOffNav04.src="/imagesCKR/off_site.gif";
	images_cached++;
	navOffNav05.src="/imagesCKR/off_about.gif";
	images_cached++;
	navOffNav06.src="/imagesCKR/off_contact.gif";
	images_cached++;
	navOffNav07.src="/imagesCKR/off_policy.gif";
	images_cached++;
	navOffNav08.src="/imagesCKR/off_career.gif";
	images_cached++;
	navOffNav09.src="/imagesCKR/off_quote.gif";
	images_cached++;
	navOffNav10.src="/imagesCKR/off_ins.gif";
	images_cached++;
	navOffNav11.src="/imagesCKR/off_comm.gif";
	images_cached++;
	navOffNav12.src="/imagesCKR/off_edu.gif";
}

//Change button to ON image
function navOn(layerName,butName) {
	if (document.layers) {
		var fish2 = document[layerName];
		fish2.document.images[butName].src=eval("navOn" + butName + ".src");
	} else {
//'		document.images[butName].src=eval("navOn" + butName + ".src");
	}
}

//Change button to OFF image
function navOff(layerName,butName) {
	if (document.layers) {
		var fish2 = document[layerName];
		fish2.document.images[butName].src=eval("navOff" + butName + ".src");
	} else {
// 		document.images[butName].src=eval("navOff" + butName + ".src");
	}
}


function do_cool() {
	if ((document.images) && (images_cached == Total_Images)) {
		cool_to_run = true;
	} else {
		reps_run++;
		if (reps_run < Total_Reps) {
			timevar = setTimeout("do_cool()", 50);
		}
	}
}

function MM_initTimelines() { //v4.0
    //MM_initTimelines() Copyright 1997 Macromedia, Inc. All rights reserved.
    var ns = navigator.appName == "Netscape";
    var ns4 = (ns && parseInt(navigator.appVersion) == 4);
    var ns5 = (ns && parseInt(navigator.appVersion) > 4);
    document.MM_Time = new Array(1);
    document.MM_Time[0] = new Array(4);
    document.MM_Time["Timeline1"] = document.MM_Time[0];
    document.MM_Time[0].MM_Name = "Timeline1";
    document.MM_Time[0].fps = 15;
    document.MM_Time[0][0] = new String("behavior");
    document.MM_Time[0][0].frame = 45;
    document.MM_Time[0][0].value = "MM_showHideLayers('pol01','','hide','pol02','','hide','pol03','','hide','pol04','','hide','pol05','','hide','pol06','','hide','pol07','','hide','pol08','','hide','car01','','hide','car02','','hide','car03','','hide','car04','','hide','car05','','hide','claim01','','hide','quote01','','hide','quote02','','hide','quote03','','hide','quote04','','hide','quote05','','hide','abo01','','hide','abo02','','hide','abo03','','hide','abo04','','hide','abo05','','hide','abo06','','hide','abo07','','hide','claim01','','hide','claim02','','hide','claim03','','hide','claim04','','hide','claim05','','hide','claim06','','hide','claim07','','hide','claim08','','hide','claim09','','hide','claim10','','hide','claim11','','hide','claim12','','hide','claim13','','hide');MM_timelineStop('Timeline1')";
    document.MM_Time[0][1] = new String("behavior");
    document.MM_Time[0][1].frame = 1;
    document.MM_Time[0][1].value = "MM_timelinePlay('Timeline1')";
    document.MM_Time[0][2] = new String("behavior");
    document.MM_Time[0][2].frame = 46;
    document.MM_Time[0][2].value = "MM_timelineStop('Timeline1')";
    document.MM_Time[0][3] = new String("behavior");
    document.MM_Time[0][3].frame = 10;
    document.MM_Time[0][3].value = "MM_timelineGoto('Timeline1','45')";
    document.MM_Time[0].lastFrame = 46;
    for (i=0; i<document.MM_Time.length; i++) {
        document.MM_Time[i].ID = null;
        document.MM_Time[i].curFrame = 0;
        document.MM_Time[i].delay = 1000/document.MM_Time[i].fps;
    }
}
