Fx.FadeHoverLink = Fx.Style.extend({
    initialize: function(el, options) {
		options.wait = false;
        this.parent(el, 'opacity', options);
        this.set(0.01);
        this.element.addEvent('mouseover', function() { this.custom(0.01,1); }.bind(this) );
        this.element.addEvent('mouseout', function() { this.custom(1,0.01); }.bind(this) );
    }
});

Fx.FadeHoverImageMapLink = Fx.Style.extend({
    initialize: function(el, options) {
		options.wait = false;
        this.parent(el, 'opacity', options);
        this.set(0.01);
		$$('.'+el.id+'_target').addEvent('mouseover', function() { this.custom(0.01,1); }.bind(this) );
        $$('.'+el.id+'_target').addEvent('mouseout', function() { this.custom(1,0.01); }.bind(this) );
    }
});

window.addEvent('domready', function() {
	//-- for IE6 but not IE7, Moz, Safari, Opera...
	if (typeof document.body.style.maxHeight == "undefined") {
		try {
		  document.execCommand('BackgroundImageCache', false, true);
		} catch(e) { /* unless it's not IE6... */ }
	} // if

	$$('.bvFadeLink').each(
		function(el) {
			el.fl = new Fx.FadeHoverLink(el,{duration:500});
		}
	);

	$$('.bvFadeImageMapLink').each(
		function(el) {
			el.fl = new Fx.FadeHoverImageMapLink(el,{duration:500});
		}
	);
}); // addEvent..onload

// Universal Rollover Script
function imghighlight(whichimg) {
	var imgsrc = new String(whichimg.src);
	imgsrc = imgsrc.replace(new RegExp('_off\.','g'),'_on\.');
	whichimg.src = imgsrc;
}

function imgnohighlight(whichimg) {
	var imgsrc = new String(whichimg.src);
	imgsrc = imgsrc.replace(new RegExp('_on\.','g'),'_off\.');
	whichimg.src = imgsrc;
}


//SHOW/HIDE DIV
function hidediv(pass) {
	var divs = document.getElementsByTagName('div');
	for(i=0;i<divs.length;i++){
		if(divs[i].id.match(pass)){//if they are 'see' divs
			if (document.getElementById) // DOM3 = IE5, NS6
				divs[i].style.display="none";// show/hide
			else
			if (document.layers) // Netscape 4
				document.layers[divs[i]].display = 'none';
			else // IE 4
				document.all.hideshow.divs[i].display = 'none';
			}
	}
}

function showdiv(pass) {
	var divs = document.getElementsByTagName('div');
		for(i=0;i<divs.length;i++){
			if(divs[i].id.match(pass)){
				if (document.getElementById)
					divs[i].style.display="block";
				else
				if (document.layers) // Netscape 4
					document.layers[divs[i]].display = 'block';
				else // IE 4
					document.all.hideshow.divs[i].display = 'block';
			}
	}
}

//Pop-up Functions
function popwin(loc,winname,w,h,scroll,resize) {
	eval('var newwin = window.open("' + loc + '","' + winname + '","width=' + w + ',height=' + h + ',top=100,left=200,location=no,scrollbars=' + scroll + ',menubar=no,toolbar=no,resizable=' + resize + '")');
}


function pulldownGoTo(thePulldown)
{

var theUrl = thePulldown.options[thePulldown.selectedIndex].value;

	if(theUrl != '@')
	{
		window.location = theUrl;
	}
	else
	{
	
	}
}


//	This javascript tags file downloads and external links in Google Analytics.
//	You need to be using the Google Analytics New Tracking Code (ga.js) 
//	for this script to work.
//	To use, place this file on all pages just above the Google Analytics tracking code.
//	All outbound links and links to non-html files should now be automatically tracked.
//
//	This script has been provided by Goodwebpractices.com
//	Thanks to ShoreTel, MerryMan and Colm McBarron
//
//	www.goodwebpractices.com
//

if (document.getElementsByTagName) {
        // Initialize external link handlers
        var hrefs = document.getElementsByTagName("a");
        for (var l = 0; l < hrefs.length; l++) {
                //protocol, host, hostname, port, pathname, search, hash
                if (hrefs[l].protocol == "mailto:") {
                        startListening(hrefs[l],"click",trackMailto);
                } else if (hrefs[l].hostname == location.host) {
                        var path = hrefs[l].pathname + hrefs[l].search;
                        var isDoc = path.match(/(?:doc|eps|jpg|png|svg|xls|ppt|pdf|xls|zip|txt|vsd|vxd|js|css|rar|exe|wma|mov|avi|wmv|mp3)($|\&)/);
                        if (isDoc) {
                                startListening(hrefs[l],"click",trackExternalLinks);
                        }
                } else {
                        startListening(hrefs[l],"click",trackExternalLinks);
                }
        }
}

function startListening (obj,evnt,func) {
        if (obj.addEventListener) {
                obj.addEventListener(evnt,func,false);
        } else if (obj.attachEvent) {
                obj.attachEvent("on" + evnt,func);
        }

}

function trackMailto (evnt) {
        var href = (evnt.srcElement) ? evnt.srcElement.href : this.href;
        var mailto = "/mailto/" + href.substring(7);
        if (typeof(pageTracker) == "object") pageTracker._trackPageview(mailto);

}

function trackExternalLinks (evnt) {
        var e = (evnt.srcElement) ? evnt.srcElement : this;
        while (e.tagName != "A") {
                e = e.parentNode;
        }
        var lnk = (e.pathname.charAt(0) == "/") ? e.pathname : "/" +
e.pathname;
        if (e.search && e.pathname.indexOf(e.search) == -1) lnk += e.search;
        if (e.hostname != location.host) lnk = "/external/" + e.hostname +
lnk;
        if (typeof(pageTracker) == "object") pageTracker._trackPageview(lnk); 

} 


