var bIsIE = (navigator.appName == "Microsoft Internet Explorer");
var bIsNtsp = (navigator.appName == "Netscape");

//figures out where the files are
if (root_level > 1)
	for (loop = 1; loop < root_level; loop++) root_path += "../";

// checks for valid version 4 or higher
if (navigator.appVersion.substring(0,1) < 4) {
	whynot = "browser_version";
	browser_valid = false;
	}

// assigns values for IE
else if (bIsIE) {
	}

// assigns values for Netscape
else if (bIsNtsp) {
	}

// alerts for invalid browser
else {
	whynot = "browser_name";
	browser_valid = false;
	}

//if the page that is requested is to be in a frame (if the name of the page isn't home.htm) then the page is flushed into a frame.
//otherwise it's just displayed in the current frame is a simple HTML page.

//the following attributes are optional because every secondary page shares the same top menu and has a content.htm
if ((frame_menu_top == null) && (section_type == "home" )) frame_menu_top = "../home/home_top.htm";
	else if ((frame_menu_top == null) && (section_type == "secondary" )) frame_menu_top = "../../top_menu.htm";
		else if ((frame_menu_top == null) && (section_type == "tertiary" )) frame_menu_top = "../../../top_menu.htm";


// making the frame
if (	(frame_menu_left == null) ||
	(frame_content_url == null)) {
		document.write ("<html><head><title>ERROR on page</title></head><body><font face=arial size=2>");
		document.write ("This web page has not been configured properly, please email the webmaster and notify them of this error. Thank you.");
		document.write ("</body></html>");
		}

//else if (!browser_valid) {
//	document.write ("<html><head><title>ERROR on page</title></head><body><font face=arial size=2>");
//	if (whynot == "browser_name") document.write ("You are using a browser that is neither Internet Explorer nor Netscape.<br>Please change to another browser or download the new version of Internet Explorer. <p>Click here >>> <a href=http://www.microsoft.com/msdownload/iebuild/msnie5/en/unavmsn.htm>http://www.microsoft.com/msdownload/iebuild/msnie5/en/unavmsn.htm</a>");
//	else if (whynot == "browser_version") document.write ("Your version of " + navigator.appName + " (" + navigator.appVersion.substring(0,3) + ") is too old to view this site.<br>Please update... <p>Click here >>> <a href=http://www.microsoft.com/msdownload/iebuild/msnie5/en/unavmsn.htm>http://www.microsoft.com/msdownload/iebuild/msnie5/en/unavmsn.htm</a>");
//	document.write ("</body></html>");
//	}

else {

//window.name = "content";

is_2frame = ((parent.window.location.href == window.location.href) && (window.name != "content"));
if (is_2frame) {

	// sets value for the frames according to browser
	frame_cols_home = new Array;
	frame_cols_secondary = new Array;
	frame_cols_tertiary = new Array;

	frame_rows_home = new Array;
	frame_rows_secondary = new Array;
	frame_rows_tertiary = new Array;

  // convert all characters to lowercase to simplify testing
    var agt=navigator.userAgent.toLowerCase();

    // *** BROWSER VERSION ***
    // Note: On IE5, these return 4, so use is_ie5up to detect IE5.
    var is_major = parseInt(navigator.appVersion);
    var is_minor = parseFloat(navigator.appVersion);

    // Note: Opera and WebTV spoof Navigator.  We do strict client detection.
    // If you want to allow spoofing, take out the tests for opera and webtv.
    var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
    var is_nav2 = (is_nav && (is_major == 2));
    var is_nav3 = (is_nav && (is_major == 3));
    var is_nav4 = (is_nav && (is_major == 4));
    var is_nav4up = (is_nav && (is_major >= 4));
    var is_navonly      = (is_nav && ((agt.indexOf(";nav") != -1) ||
                          (agt.indexOf("; nav") != -1)) );
    var is_nav6 = (is_nav && (is_major == 5));
    var is_nav6up = (is_nav && (is_major >= 5));
    var is_gecko = (agt.indexOf('gecko') != -1);


    var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    var is_ie3    = (is_ie && (is_major < 4));
    var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
    var is_ie4up  = (is_ie && (is_major >= 4));
    var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
    var is_ie5_5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
    var is_ie5up  = (is_ie && !is_ie3 && !is_ie4);
    var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5);
    var is_ie6    = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) );
    var is_ie6up  = (is_ie && !is_ie3 && !is_ie4 && !is_ie5 && !is_ie5_5);
	var is_opera = (agt.indexOf("opera") != -1);
    var is_opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1);
    var is_opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1);
    var is_opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1);
    var is_opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1);
    var is_opera5up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4);

// If Netscape 6 or Internet Explorer 4+ then

  if ( is_gecko || is_ie5up)
  {
		frame_cols_home[0] = "292";
		frame_cols_home[1] = "*";
		frame_cols_secondary[0] = "203";
		frame_cols_secondary[1] = "*";
		frame_cols_tertiary[0] = "172";
		frame_cols_tertiary[1] = "*";

		frame_rows_home[0] = "128";
		frame_rows_home[1] = "*";
		frame_rows_secondary[0] = "111";
		frame_rows_secondary[1] = "35";
		frame_rows_secondary[2] = "*";
		frame_rows_tertiary[0] = "111";
		frame_rows_tertiary[1] = "*";

		}
		
// if Netscape 4 then
		
  else if (is_nav4)
  {
		frame_cols_home[0] = "292";
		frame_cols_home[1] = "*";
		frame_cols_secondary[0] = "209";
		frame_cols_secondary[1] = "*";
		frame_cols_tertiary[0] = "182";
		frame_cols_tertiary[1] = "*";

		frame_rows_home[0] = "128";
		frame_rows_home[1] = "*";
		frame_rows_secondary[0] = "115";
		frame_rows_secondary[1] = "40";
		frame_rows_secondary[2] = "*";
		frame_rows_tertiary[0] = "111";
		frame_rows_tertiary[1] = "*";
		}

  else
  
  {
		frame_cols_home[0] = "292";
		frame_cols_home[1] = "*";
		frame_cols_secondary[0] = "203";
		frame_cols_secondary[1] = "*";
		frame_cols_tertiary[0] = "172";
		frame_cols_tertiary[1] = "*";

		frame_rows_home[0] = "128";
		frame_rows_home[1] = "*";
		frame_rows_secondary[0] = "111";
		frame_rows_secondary[1] = "35";
		frame_rows_secondary[2] = "*";
		frame_rows_tertiary[0] = "111";
		frame_rows_tertiary[1] = "*";

		
  }
  
  
  
	if (section_type == "home") {
		document.write ("<frameset cols=\"" + frame_cols_home[0] + "," + frame_cols_home[1] + "\" frameborder=\"no\" framespacing=\"0\" border=\"0\">");
			document.write ("<frame src=\"" + root_path + "" + frame_menu_left + "\" scrolling=\"no\" name=\"menu_left\">");
			document.write ("<frameset rows=\"" + frame_rows_home[0] + "," + frame_rows_home[1] + "\" frameborder=\"no\" framespacing=\"0\" border=\"0\">");
				document.write ("<frame src=\"" + root_path + "" + frame_menu_top + "\" norsize scrolling=\"no\" name=\"menu_top\">");
				document.write ("<frame src=\"" + frame_content_url + "?inframe\" norsize scrolling=\"auto\" name=\"content\">");
			document.write ("</frameset>");
		}

	else if (section_type == "secondary") {
		document.write ("<frameset cols=\"" + frame_cols_secondary[0] + "," + frame_cols_secondary[1] + "\" frameborder=\"no\" framespacing=\"0\" border=\"0\">");
			document.write ("<frame src=\"" + root_path + "" + frame_menu_left + "\" scrolling=\"no\" name=\"menu_left\">");
			document.write ("<frameset rows=\"" + frame_rows_secondary[0] + "," + frame_rows_secondary[1] + "," + frame_rows_secondary[2] + "\" frameborder=\"no\" framespacing=\"0\" border=\"0\">");
				document.write ("<frame src=\"" + root_path + "" + frame_menu_top + "\" norsize scrolling=\"no\" name=\"menu_top\">");
				document.write ("<frame src=\"" + root_path + "" + frame_section_name + "\" norsize scrolling=\"no\" name=\"section_name\">");
				document.write ("<frame src=\"" + frame_content_url + "?inframe\" norsize scrolling=\"auto\" name=\"content\">");
			document.write ("</frameset>");

		}
	else {
		document.write ("<frameset cols=\"" + frame_cols_tertiary[0] + "," + frame_cols_tertiary[1] + "\" frameborder=\"no\" framespacing=\"0\" border=\"0\">");
			document.write ("<frame src=\"" + root_path + "" + frame_menu_left + "\" scrolling=\"no\" name=\"menu_left\">");
			document.write ("<frameset rows=\"" + frame_rows_tertiary[0] + "," + frame_rows_tertiary[1] + "\" frameborder=\"no\" framespacing=\"0\" border=\"0\">");
				document.write ("<frame src=\"" + root_path + "" + frame_menu_top + "\" norsize scrolling=\"no\" name=\"menu_top\">");
				document.write ("<frame src=\"" + frame_content_url + "?inframe\" norsize scrolling=\"auto\" name=\"content\">");
			document.write ("</frameset>");

		}
	document.write ("</frameset>");

	document.write ("<noframes>Sorry, you need to have a browser that supports frames in order to view this site. <br>Please update... <p>Click here >>> <a href=http://www.microsoft.com/msdownload/iebuild/msnie5/en/unavmsn.htm>http://www.microsoft.com/msdownload/iebuild/msnie5/en/unavmsn.htm</a><p></noframes>");


	}

else {

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);

	//default css
	//commented out May 2009. Instead, "default_08.css" was added to individual section type "if" statements below.
	document.write ("<link rel='stylesheet' href='../" + root_path + "css/defaults_08.css' TYPE='text/css'>");


	//if it's a secondary page but not home (about, careers, etc) then a new css is imported
	if ((section_type == "home") && (section_name != "home")){
		//if (section_name != null) document.write ("<link rel='stylesheet' href='../" + root_path + "css/defaults_08.css' TYPE='text/css'>");
		if (section_name != null) document.write ("<link rel='stylesheet' href='../" + root_path + "css/secondary/" + section_name + "_08.css' TYPE='text/css'>");
		if (subsection_name != null) document.write ("<link rel='stylesheet' href='../" + root_path + "css/tertiary/" + subsection_name + ".css' TYPE='text/css'>");
		}

	//secondary css
	else if (section_type == "secondary") {
		if (section_name != null) document.write ("<link rel='stylesheet' href='../../" + root_path + "css/defaults_08.css' TYPE='text/css'>");
		if (section_name != null) document.write ("<link rel='stylesheet' href='../../" + root_path + "css/secondary/" + section_name + "_08.css' TYPE='text/css'>");
		}

	// styles for tertiary pages are loaded if section_type == "tertiary"
	// however, the secondary css is also used.
	else if (section_type == "tertiary") {
		if (section_name != null) document.write ("<link rel='stylesheet' href='../" + root_path + "css/secondary/" + section_name + ".css' TYPE='text/css'>");
		if (subsection_name != null) document.write ("<link rel='stylesheet' href='../" + root_path + "css/tertiary/" + subsection_name + ".css' TYPE='text/css'>");
		}

	document.write ("</head>");
	document.write ("<body marginwidth='12' leftmargin='12'><div id='container'>");
	}

}
	
