//<Script language="javascript">

var lastButton = null;
var lastButtonClass = null;
var isMac;
var ua = navigator.userAgent;
var bName = navigator.appName;
var bVer = parseFloat(navigator.appVersion);
var n = document.layers
var ie = document.all
var br
if(bName == "Microsoft Internet Explorer" && bVer >= 4){
	br="ie4"
}else{
	br="n4"
}

if ((ua.indexOf("Mac") != -1) || (ua.indexOf("Windows 3") != -1)) isMac = true;

function admBtnMover(item){
	if ( !item.disabled ) item.className = 'adminButtonMo';
}
function admBtnMout(item){
	if ( !item.disabled ) item.className = 'adminButton';
}


function setBackLast(){
		if (lastButton.className == "lmChosenNavbar"){
		}else{
			if ( lastButton.className == "lmNavbarMouseover" ){
				lastButton.className = lastButtonClass;
				lastButton.children[0].className = "navLink";
				lastButton = null;
			}else{
				lastButton.className = lastButtonClass;
				lastButton.children[0].className = "lmLink";
				lastButton = null;
			}
		}
}

function callSetBackLast(){
	if(lastButton != null && !ButtonTable.contains(window.event.toElement)){
		setBackLast();
	}
}

function Menu_mo(elem){
//	if (document.readyState != "complete" || isMac) return;
	var child, bold, div, A;
	if(lastButton != null){				
		setBackLast();
	}
	if (elem.children.length == 0) return;
	div = elem.children[0];
	if (div.className == "tmChosen" || div.className == "lmChosen" || div.className == "lmChosenNavbar" || elem.children.length == 0) {
		cancelBubble;
		return;
	}
	A = elem.children[0].children[0];
	lastButton = elem.children[0];
	lastButtonClass = elem.children[0].className;
	if(LeftMenutable.contains(elem) || LeftMenutable2.contains(elem)){
	  if(div.className == "lmNormalNavbar"){
		div.className = "lmNavbarMouseover";
		bold = A.style.fontWeight;
		A.className = "navLinkMo";
		A.style.fontWeight = bold;
	  }else{
		div.className = "lmMouseover";
		bold = A.style.fontWeight;
		A.className = "lmLinkMo";
		A.style.fontWeight = bold;
	  }
	}
	cancelBubble;
}

function cancelBubble(){
	if ( window && window.event ){
		window.event.cancelBubble = true;
	}
}

function hideIt(){
	if(ie || n){
		if(n){
			if (document.divLoadCont ) { document.divLoadCont.style.display='none'  }
		}else{
			if ( divLoadCont ) { divLoadCont.style.display='none' }
		}
	}
}

function hiddenTable(x){
	if(x == ""){
		if(ie || n) document.write('<div id="divLoadCont"><table width="100%" height="100%"><tr><td width="100%" height="100%">&nbsp;</td></tr></table></div>')
	}
	if(x == "Loading"){
		if(ie || n) document.write('<div id="divLoadCont"><table width="100%" height="100%" align="center" valign="middle"><tr><td width="100%" height="100%" align="center" valign="middle"><H3 class="loading">Loading...</H3></td></tr></table></div>')
	}
}

function makeSpacer(){
	if(document.all){
		document.write('<td class="spacer" width="16">&nbsp;&nbsp;&nbsp;</td>');
	}else{
		document.write('');
	}
}

function reloadNetscape(){
	if( br == "n4" && bVer >= 4.6 ){
		window.history.go(0)
	}else{}
}

function drawTable(x){
	if ( br == "ie4" ){
		document.write ('<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">')
	}else{
		var winHt = window.innerHeight
		var winWd = window.innerWidth
		document.write ('<table border="0" cellpadding="0" cellspacing="0" height="');
		document.write (winHt-x);
		document.write ('" width="100%">');
	}
}
function drawAdminTable(x){
	if ( br == "ie4" ){
		document.write ('<table id="ButtonTable" border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">')
	}else{
		var winHt = window.innerHeight
		var winWd = window.innerWidth
		document.write ('<table id="ButtonTable" border="0" cellpadding="0" cellspacing="0" height="');
		document.write (winHt-x);
		document.write ('" width="100%">');
	}
}
function drawMacSpacer(x){
	if(isMac){
		document.write('<tr><td valign=bottom height=')
		document.write(screen.availHeight - x)
		document.write('>&nbsp\;</td></tr>')
	}
}

///////////////////////////////////////////////////////////////////////////////
function onClickcancel(elem){
//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// This function cancels the mouseover effects (Menu_mo) when a button is clicked

	var child, div, A;
	if(elem.children.length == 0) return;
	div = elem.children[0];
	A = elem.children[0].children[0];
	if(LeftMenutable.contains(elem) || LeftMenutable2.contains(elem)){
	resetMenu();
	div.className = "lmChosenNavbar";
	A.className = "navLinkChosen";
	}
	lastButton = null;
	cancelBubble;
}


/////////////////////////////////////////////////////////////////////////////
function resetMenu(){
//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// This function resets all the styles on the Menu frame to the defaults

if(bName == "Microsoft Internet Explorer" && bVer >= 4){
	br="ie4"
}else{
	br="n4"
}

  if(br == "n4"){			// netscape currently can't change styles dynamically...
  return false;
  }else{
		if( top && top.frames && top.frames.InScopeLowerLeft ){
			if(top.frames.InScopeLowerLeft.document.all.mypolicies){		// Checking to see if button exists.
				top.frames.InScopeLowerLeft.document.all.mypolicies.className='lmNormalNavbar';
				top.frames.InScopeLowerLeft.document.all.A_mypolicies.className='navLink';
			}		
			if(top.frames.InScopeLowerLeft.document.all.accountactivity){
				top.frames.InScopeLowerLeft.document.all.accountactivity.className='lmNormalNavbar';
				top.frames.InScopeLowerLeft.document.all.A_accountactivity.className='navLink';
			}
			if(top.frames.InScopeLowerLeft.document.all.coveragesummary){
				top.frames.InScopeLowerLeft.document.all.coveragesummary.className='lmNormalNavbar';
				top.frames.InScopeLowerLeft.document.all.A_coveragesummary.className='navLink';
			}
			if(top.frames.InScopeLowerLeft.document.all.billinginfo){
				top.frames.InScopeLowerLeft.document.all.billinginfo.className='lmNormalNavbar';
				top.frames.InScopeLowerLeft.document.all.A_billinginfo.className='navLink';
			}
			if(top.frames.InScopeLowerLeft.document.all.claims){
				top.frames.InScopeLowerLeft.document.all.claims.className='lmNormalNavbar';
				top.frames.InScopeLowerLeft.document.all.A_claims.className='navLink';
			}
			if(top.frames.InScopeLowerLeft.document.all.faxcertificate){
				top.frames.InScopeLowerLeft.document.all.faxcertificate.className='lmNormalNavbar';
				top.frames.InScopeLowerLeft.document.all.A_faxcertificate.className='navLink';
			}
			if(top.frames.InScopeLowerLeft.document.all.printautoidcard){
				top.frames.InScopeLowerLeft.document.all.printautoidcard.className='lmNormalNavbar';
				top.frames.InScopeLowerLeft.document.all.A_printautoidcard.className='navLink';
			}
			if(top.frames.InScopeLowerLeft.document.all.ratevehicle){
				top.frames.InScopeLowerLeft.document.all.ratevehicle.className='lmNormalNavbar';
				top.frames.InScopeLowerLeft.document.all.A_ratevehicle.className='navLink';
			}
			if(top.frames.InScopeLowerLeft.document.all.agentsinfo){
				top.frames.InScopeLowerLeft.document.all.agentsinfo.className='lmNormalNavbar';
				top.frames.InScopeLowerLeft.document.all.A_agentsinfo.className='navLink';
			}
		}
  }
}


/////////////////////////////////////////////////////////////////////////////
function menuChoice(x){
//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// Reset the menu styles and set the proper Chosen button style
if(bName == "Microsoft Internet Explorer" && bVer >= 4){
	br="ie4"
}else{
	br="n4"
}

	if(br == "n4"){			// netscape currently can't change styles dynamically...
	}else{
	resetMenu();
	if( eval("top.frames && top.frames.InScopeLowerLeft && top.frames.InScopeLowerLeft.document.all." + x + "")){   // This checks to see if this object is there, workaround if you refresh the whole page and the right frame loads before the menu frame.
		eval("top.frames.InScopeLowerLeft.document.all." + x + ".className='lmChosenNavbar'");
		eval("top.frames.InScopeLowerLeft.document.all.A_" + x + ".className='navLinkChosen'");
	}
 }
}


/////////////////////////////////////////////////////////////////////////////
function admResetMenu(){
//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// This function resets all the styles on the Admin Menu frame to the defaults
	if(parent.frames && parent.frames.InScopeAdminLowerLeft){
		if(parent.frames.InScopeAdminLowerLeft.document.all.adminhome){		// Checking to see if button exists.
			parent.frames.InScopeAdminLowerLeft.document.all.adminhome.className='lmNormalNavbar';
			parent.frames.InScopeAdminLowerLeft.document.all.A_adminhome.className='navLink';
		}		
		if(parent.frames.InScopeAdminLowerLeft.document.all.securitysetup){
			parent.frames.InScopeAdminLowerLeft.document.all.securitysetup.className='lmNormalNavbar';
			parent.frames.InScopeAdminLowerLeft.document.all.A_securitysetup.className='navLink';
		}
		if(parent.frames.InScopeAdminLowerLeft.document.all.clientsetup){
			parent.frames.InScopeAdminLowerLeft.document.all.clientsetup.className='lmNormalNavbar';
			parent.frames.InScopeAdminLowerLeft.document.all.A_clientsetup.className='navLink';
		}
		if(parent.frames.InScopeAdminLowerLeft.document.all.globalsettings){
			parent.frames.InScopeAdminLowerLeft.document.all.globalsettings.className='lmNormalNavbar';
			parent.frames.InScopeAdminLowerLeft.document.all.A_globalsettings.className='navLink';
	    }
		if(parent.frames.InScopeAdminLowerLeft.document.all.navigationbarsetting){
			parent.frames.InScopeAdminLowerLeft.document.all.navigationbarsetting.className='lmNormalNavbar';
			parent.frames.InScopeAdminLowerLeft.document.all.A_navigationbarsetting.className='navLink';
		}
		if(parent.frames.InScopeAdminLowerLeft.document.all.activityfilter){
			parent.frames.InScopeAdminLowerLeft.document.all.activityfilter.className='lmNormalNavbar';
			parent.frames.InScopeAdminLowerLeft.document.all.A_activityfilter.className='navLink';
		}
		if(parent.frames.InScopeAdminLowerLeft.document.all.transactionfilter){
			parent.frames.InScopeAdminLowerLeft.document.all.transactionfilter.className='lmNormalNavbar';
			parent.frames.InScopeAdminLowerLeft.document.all.A_transactionfilter.className='navLink';
		}
		if(parent.frames.InScopeAdminLowerLeft.document.all.certificatesetting){
			parent.frames.InScopeAdminLowerLeft.document.all.certificatesetting.className='lmNormalNavbar';
			parent.frames.InScopeAdminLowerLeft.document.all.A_certificatesetting.className='navLink';
		}
		if(parent.frames.InScopeAdminLowerLeft.document.all.advancedoptionssetting){
			parent.frames.InScopeAdminLowerLeft.document.all.advancedoptionssetting.className='lmNormalNavbar';
			parent.frames.InScopeAdminLowerLeft.document.all.A_advancedoptionssetting.className='navLink';
		}
		if(parent.frames.InScopeAdminLowerLeft.document.all.autoidsetting){
			parent.frames.InScopeAdminLowerLeft.document.all.autoidsetting.className='lmNormalNavbar';
			parent.frames.InScopeAdminLowerLeft.document.all.A_autoidsetting.className='navLink';
		}
		if(parent.frames.InScopeAdminLowerLeft.document.all.pswdsetting){
			parent.frames.InScopeAdminLowerLeft.document.all.pswdsetting.className='lmNormalNavbar';
			parent.frames.InScopeAdminLowerLeft.document.all.A_pswdsetting.className='navLink';
		}
		if(parent.frames.InScopeAdminLowerLeft.document.all.customizesetting){
			parent.frames.InScopeAdminLowerLeft.document.all.customizesetting.className='lmNormalNavbar';
			parent.frames.InScopeAdminLowerLeft.document.all.A_customizesetting.className='navLink';
		}
		if(parent.frames.InScopeAdminLowerLeft.document.all.customformsetting){
			parent.frames.InScopeAdminLowerLeft.document.all.customformsetting.className='lmNormalNavbar';
			parent.frames.InScopeAdminLowerLeft.document.all.A_customformsetting.className='navLink';
		}
		if(parent.frames.InScopeAdminLowerLeft.document.all.hitssummary){
			parent.frames.InScopeAdminLowerLeft.document.all.hitssummary.className='lmNormalNavbar';
			parent.frames.InScopeAdminLowerLeft.document.all.A_hitssummary.className='navLink';
		}
	}
}


/////////////////////////////////////////////////////////////////////////////
function admMenuChoice(x){
//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// Reset the menu styles and set the proper Chosen button style

	if(br == "n4"){			// netscape currently can't change styles dynamically...
	}else{
	if(eval("parent.frames.InScopeAdminLowerLeft.document.all.startagain")){
	parent.frames.InScopeAdminLowerLeft.document.all.startagain.focus();
	}
	admResetMenu();
	if(eval("parent.frames.InScopeAdminLowerLeft.document.all." + x)){   // This checks to see if this frame is there, workaround if you refresh the whole page and the right frame loads before the menu frame.
		eval("parent.frames.InScopeAdminLowerLeft.document.all." + x + ".className='lmChosenNavbar'");
		eval("parent.frames.InScopeAdminLowerLeft.document.all.A_" + x + ".className='navLinkChosen'");
	}
  }
}


///////////////////////////////////////////////////////////////////////////////
function admOnClickcancel(elem){
//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// This function cancels the mouseover effects (Menu_mo) when a button is clicked

	var child, div, A;
	if(elem.children.length == 0) return;
	div = elem.children[0];
	A = elem.children[0].children[0];
	if(LeftMenutable.contains(elem) || LeftMenutable2.contains(elem)){
	admResetMenu();
	div.className = "lmChosenNavbar";
	A.className = "navLinkChosen";
	}
	lastButton = null;
	cancelBubble;
}


function fixHelp(){
	if(document.all && document.all.help){
		document.all.help.children[0].className='lmHelpMouseover'
		document.all.help.children[0].className='lmHelpButton'
	}
}

function fixCellWidths(){

	if(document.all) window.status=top.fs1.children[1].width;


}

//////////////////////////////////////////////////////////////////////////////////////////////
// ======= End of changes =============================================================     <
//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

function InScopePrint(btnName,btnValue,alertMsg){

  var printbr ;


//brTest = ua.search('MSIE 5');

	if(bName == "Microsoft Internet Explorer" && ua.search('MSIE 5') == "-1")
	{
		
		printbr="ie";
	}
	else
	{
		printbr="other"
	}

	if (printbr == "other")
	{
		
		if ( btnName == "" ) btnName = "Print";
		if ( btnValue == "" ) btnValue = "Print";
		if ( btnValue == "" ) btnValue = "Printing Complete!";
		
		document.write('<input class="adminButton" type="button" name="' + btnName + '" id="' + btnName + '" value="' + btnValue + '" onClick="window.print()">');
	}
	else
	{
    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
		document.write(WebBrowser);
		//document.body.insertAdjacentHTML('beforeEnd', WebBrowser);

		document.write('<input class="adminButton" type="button" name="' + btnName + '" id="' + btnName + '" value="' + btnValue + '" onClick="WebBrowser1.ExecWB(6, 2);alert(\'' + alertMsg + '\')">');

    //WebBrowser1.ExecWB(6, 2); //Use a 1 vs. a 2 for a prompting dialog box			
															//This option only seems to work for IE4, as IE5 always brings up the dialog.

    //WebBrowser1.outerHTML = "";  
	}
}

function setSpacer(){
	if ( navigator.appName == 'Microsoft Internet Explorer' && navigator.appVersion.search('MSIE 5.5') > 0 ){
		if ( document.all && document.all.sTable ){
			if ( sTable.childNodes[0] && sTable.childNodes[0].childNodes[0] && sTable.childNodes[0].childNodes[0].childNodes ){
				iCol = sTable.childNodes[0].childNodes[0].childNodes.length + 1
				if ( sTable.style.pixelHeight >= sTable.scrollHeight ){
					spacer.style.display = 'none';
					eval("hCOL" + iCol + ".style.display = 'none'");
				}else{
					spacer.style.display = 'inline';
					eval("hCOL" + iCol + ".style.display = 'inline'");
				}
			}
		}
	}
}

//sets the focus to the first text input of a form
function SetFormFocus() {
	if (document.forms[0]) {
		for (count = 0; count < document.forms[0].length; count++) {
			if (document.forms[0].elements[count].type == "Text" || document.forms[0].elements[count].type == "text") {
				document.forms[0].elements[count].focus();
				break;
			}
		}
	}
}

function setSpacer(iLastColID)
{
	if ( document.all && document.all.sTable && sTable.style && sTable.style.pixelHeight && sTable.scrollHeight ){
		if ( (sTable.style.pixelHeight >= sTable.scrollHeight) ){
			spacer.style.display = 'none';
			eval("hCOL" + iLastColID + ".style.display = 'none'");
		}else{
			spacer.style.display = 'inline';
			eval("hCOL" + iLastColID + ".style.display = 'inline'");
		}
	}
}

function setSpacerBorder(iLastColID)
{
	if ( document.all && document.all.sTable && sTable.style && sTable.style.pixelHeight && sTable.scrollHeight ){
		if ( (sTable.style.pixelHeight >= (sTable.scrollHeight + 8)) ){
			spacer.style.display = 'none';
			eval("hCOL" + iLastColID + ".style.display = 'none'");
		}else{
			spacer.style.display = 'inline';
			eval("hCOL" + iLastColID + ".style.display = 'inline'");
		}
	}
}

//</script>

