// JavaScript Document

<!-- Hide script from older browsers
// Jump Window

        function jumpPage(newLoc) {
                newPage = newLoc.options[newLoc.selectedIndex].value
                if (newPage != "") {
                        window.location.href = newPage
                }
        }

//Popup

function popUpAuth(URL, width, height, scrollbars, resizable, fwdURL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL+'?'+fwdURL, '" + id + "', 'toolbar=1, scrollbars="+scrollbars+",location=0,statusbar=1,menubar=1,resizable="+resizable+",width="+width+",height="+height+"');");
}


// Highlight active link
function extractPageName(hrefString)
{
	var arr = hrefString.split('/');
	return  (arr.length < 2) ? hrefString : arr[arr.length-2].toLowerCase() + arr[arr.length-1].toLowerCase();
}
 
function setActiveMenu(arr, crtPage)
{
	for (var i=0; i < arr.length; i++)
	{
		if(extractPageName(arr[i].href) == crtPage)
		{
			if (arr[i].parentNode.tagName != "DIV")
			{
				arr[i].className = "selected";
				arr[i].parentNode.className = "selected";
			}
		}
	}
}
 
function setPage()
{
	hrefString = document.location.href ? document.location.href : document.location;
 
	if (document.getElementById("header") !=null )
	setActiveMenu(document.getElementById("header").getElementsByTagName("a"), extractPageName(hrefString));
}

var enlight = null;
function higlight(){
    var loc = window.location.href;
    if(loc.indexOf('about_us.shtml')!=-1)
    enlight='aboutus';
    else
    if(loc.indexOf('links.shtml')!=-1)
    enlight='links';
    else
    if(loc.indexOf('contact_us.shtml')!=-1)
    enlight='contactus';
    else
    if(loc.indexOf('/forms.shtml#claims')!=-1)
    enlight='submitclaim';
    else
    if(loc.indexOf('com/index.shtml')!=-1)
    enlight='home';
    else
    if(loc.indexOf('products')!=-1)
    enlight='product';
    else
    if(loc.indexOf('risk_mgt')!=-1)
    enlight='risk';
    else
    if(loc.indexOf('practicing')!=-1)
    enlight='practice';
    else
    if(loc.indexOf('grads')!=-1)
    enlight='graduate';
    if(enlight){
          document.getElementById(enlight).style.borderColor="#C41300";
    }

    
 }

	 
function addEvent(obj, evType, fn){ 
 if (obj.addEventListener){ 
   obj.addEventListener(evType, fn, false); 
   return true; 
 } else if (obj.attachEvent){ 
   var r = obj.attachEvent("on"+evType, fn); 
   return r; 
 } else { 
   return false; 
 } 
}
addEvent(window, 'load', higlight);
