self.name = "theMain";
/*****************************************
* Dissolving Image Rollover- By Roy Whittle (http://www.javascript-fx.com/)
* Featured on/available at http://www.dynamicdrive.com/
* This notice must stay intact for use
*****************************************/
//Generate transition CSS (transition=0 to 23)
document.write('<STYLE TYPE="text/css">.imgTrans{ filter:revealTrans(duration=0.4,transition=12) }</STYLE>');
//Uncomment the next line for fading rollovers instead of dissolving:
//document.write('<STYLE TYPE="text/css">.imgTrans{ filter:blendTrans(duration=0.4) }</STYLE>');
//
//
var onImages=new Array();
var lastOn="";

function Rollover(imgName, imgSrc)
{
	onImages[imgName] = new Image();
	onImages[imgName].src = imgSrc;
}

function turnOn(imgName){ 
	turnOff();
	
	if(document.images[imgName].filters != null) {
//		document.images[imgName].filters[0].apply();  // not working in IE right now...
	}
	document.images[imgName].offSrc = document.images[imgName].src;
	document.images[imgName].src    = onImages[imgName].src;
	if(document.images[imgName].filters != null) {
//		document.images[imgName].filters[0].play();  // not working in IE right now...
	}
	lastOn=imgName;
}

function turnOff(){
	if(lastOn!=""){ 
		if(document.images[lastOn].filters != null) {
//			document.images[lastOn].filters[0].stop();  // not working in IE right now...
		}
		document.images[lastOn].src = document.images[lastOn].offSrc;
	}
}

//Specify name of participating images, plus paths to their onMouseover replacements:
//The serverBase variable is used so that external servers can use this mouseover file (discussions)

var serverBase = "./images/";
//
// debug / develop
//var serverBase = "./images/";
// end debug / develop
//
//Navigation Buttons
Rollover( "index", serverBase + "index_down.gif" );
Rollover( "ppa", serverBase + "ppa_down.gif" );
Rollover( "ie", serverBase + "ie_down.gif" );
Rollover( "attorneys", serverBase + "attorneys_down.gif" );
Rollover( "pub", serverBase + "pub_down.gif" );
Rollover( "pres", serverBase + "pres_down.gif" );
Rollover( "contact", serverBase + "contact_down.gif" );
//
//C&E Disputes Left Nav Buttons
Rollover( "cd_ov", serverBase + "overview_over.gif" );
Rollover( "cd_ac", serverBase + "aci_over.gif" );
Rollover( "cd_ci", serverBase + "cii_over.gif" );
Rollover( "cd_rd", serverBase + "rd_over.gif" );
Rollover( "cd_mrs", serverBase + "mrs_over.gif" );
//
//C&E Programs Left Nav Buttons
Rollover( "cp_ov", serverBase + "overview_over.gif" );
Rollover( "cp_co", serverBase + "co_over.gif" );
Rollover( "cp_ra", serverBase + "ra_over.gif" );
Rollover( "cp_of", serverBase + "of_over.gif" );
Rollover( "cp_cm", serverBase + "cm_over.gif" );
Rollover( "cp_bo", serverBase + "bo_over.gif" );
Rollover( "cp_cc", serverBase + "cc_over.gif" );
Rollover( "cp_tc", serverBase + "tc_over.gif" );
Rollover( "cp_rs", serverBase + "rs_over.gif" );
Rollover( "cp_id", serverBase + "id_over.gif" );
Rollover( "cp_ps", serverBase + "ps_over.gif" );
Rollover( "cp_as", serverBase + "as_over.gif" );
Rollover( "cp_ea", serverBase + "ea_over.gif" );
Rollover( "cp_tp", serverBase + "tp_over.gif" );
Rollover( "cp_ii", serverBase + "ii_over.gif" );
Rollover( "cp_cu", serverBase + "cu_over.gif" );
Rollover( "cp_do", serverBase + "do_over.gif" );
/**
	NOTE: Files on this site must adhere to the following convention for navigation to work
	      properly:
				- .gif must be used for all nav button images
				- page names and nav button names must be associated in the following manner:
				- [pageName].htm, [pageName].gif, [pageName]_down.gif
**/

// Initialize nav on each page load
function initNav()
{
	// Attach an 'onclick', 'onmouseover' and 'onmouseout' event to the div containing 
	// the nav button images.  Event propagation then allows the parent div to catch 
	// any of the child buttons' 'onclick' events.
	// By simply adding an img tag to the 'nav' div, image swapping and url redirection is 
	// automatically implemented.
	document.getElementById( "nav" ).onclick = btnClicked;
	document.getElementById( "nav" ).onmouseover = btnOver;
	document.getElementById( "nav" ).onmouseout = btnOut;
	
	// Determine the file name of the current page and set the nav button images accordingly
	var curFile = location.pathname.substring( location.pathname.lastIndexOf( "/" ) + 1 );
	setBtnImg( curFile.substring( 0, curFile.indexOf( "." ) ) );
	
/*	Code that may be useful later:

// Change Class of any element based on browser sniff!

	var bName = navigator.appName;
	var bVer = parseFloat(navigator.appVersion);
	var browser = "";
	if ( bName == "Netscape" ) {
		browser = "Netscape Navigator"
	} else {
		browser = bName;
	}
	
	// unless modified, will do all images on page...
	
	if( document.getElementsByTagName ) { 
		var imgs = document.getElementsByTagName("img");
		for(i = 0; i < imgs.length; i++){
			if ( browser == "Microsoft Internet Explorer" ) {
				imgs[i].className = "navBtn";
			} else {
				imgs[i].className = "navBtnFF";
			}
		} 
	} 
*/
}

// Set a button to its active state
function setBtnImg( btnId )
{
	IMG_DIR = "./images/";
	DOWN_IMG_EXTENSION = "_down.gif";
	if ( btnId == "ce_programs" || btnId == "ce_disputes" ) {
		BTN_ID = "ppa";
	} else {
		BTN_ID = ( btnId ) ? btnId : "index";	// if null, default to "index" page
	}
	
	// Get button object from the supplied id and set its src
	var btn = document.getElementById( BTN_ID );
	btn.src = IMG_DIR + BTN_ID + DOWN_IMG_EXTENSION;
}

// Function called when the nav receives an 'onclick' event
function btnClicked( evt )
{	
	// Get element that originated the 'onclick' event
	var clickedElem = getElem( evt );
	
	// Since we are using the nav buttons' parent div to catch the buttons' 'onclick' events,
	// we must first verify that the div's 'onclick' was propagated from a "navBtn" image and
	// not some other possible (albeit unlikely in this particular case) source.
	if ( clickedElem.className == "navBtn" ) {
		if ( clickedElem.id == "ppa" ) {
			MM_showMenu( window.mm_menu_01_0,0,20,null,'ppa' ); 
			turnOn( 'ppa' );
			//setPage( 'ce_programs' );
		} else if ( clickedElem.id == "attorneys" ) {
			MM_showMenu( window.mm_menu_01_1,0,20,null,'attorneys' ); 
			turnOn( 'attorneys' );
			//setPage( 'attorneys' );
		} else {
			setPage( clickedElem.id );
		}
	}
}

// Function called when the nav receives an 'onmouseover' event
function btnOver( evt )
{	
	// Get element that originated the 'onmouseover' event
	var overElem = getElem( evt );
	
	// Since we are using the nav buttons' parent div to catch the buttons' 'onmouseover' events,
	// we must first verify that the div's 'onmouseover' was propagated from a "navBtn" image and
	// not some other possible (albeit unlikely in this particular case) source.
	if ( overElem.className == "navBtn" ) {
		switch ( overElem.id ) {
			case "index":
				MM_showMenu(window.mm_menu_01_2,0,0,null,'index');
				turnOn('index');
				break;
			case "ppa":
				MM_showMenu(window.mm_menu_01_0,0,20,null,'ppa'); 
				turnOn('ppa');
				break;
			case "ie":
				MM_showMenu(window.mm_menu_01_2,0,0,null,'ie'); 
				turnOn('ie');
				break;
			case "attorneys":
				MM_showMenu(window.mm_menu_01_1,0,20,null,'attorneys'); 
				turnOn('attorneys');
				break;
			case "pub":
				MM_showMenu(window.mm_menu_01_2,0,0,null,'pub');
				turnOn('pub');
				break;
			case "pres":
				MM_showMenu(window.mm_menu_01_2,0,0,null,'pres');
				turnOn('pres');
				break;
			case "contact":
				MM_showMenu(window.mm_menu_01_2,0,0,null,'contact');
				turnOn('contact');
				break;
			default:
				// Do Nothing;
		}
	}
}

// Function called when the nav receives an 'onmouseout' event
function btnOut( evt )
{	
	// Get element that originated the 'onmouseout' event
	var outElem = getElem( evt );
	
	// Since we are using the nav buttons' parent div to catch the buttons' 'onmouseout' events,
	// we must first verify that the div's 'onmouseout' was propagated from a "navBtn" image and
	// not some other possible (albeit unlikely in this particular case) source.
	if ( outElem.className == "navBtn" ) {
		MM_startTimeout();
	}
}

function setPage( pageName )
{
	PAGE_EXTENSION = ".htm";
	location.href = pageName + PAGE_EXTENSION;
}

// Return the element associated with the supplied event.
// IE and Netscape handle this differently, so this function is essentially just a cross-browser
// branch of the srcElement(IE) and the target(NS) properties.
function getElem( evt ) 
{
	evt = ( evt ) ? evt : (( event ) ? event : null );
	
	if ( evt ) {
		var elem = ( evt.target ) ? evt.target : (( evt.srcElement ) ? evt.srcElement : null );
		return ( elem ) ? elem : null;
	}
}
