 // preload images
 function MM_preloadImages() { //v3.0
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
 }

 function MM_openBrWindow(theURL,winName,features) { //v2.0
    return PopUp(theURL, features);
 }

 function openFlash750(url) {
   popupWin = window.open(url,'FlashDoc','width=600,height=400,top=20,left=20,resize=no,scrollbars=no');
 }


 // popup window script
 // DEPRECATED -- doesn't work quite right on newer browsers. Use PopUp below, instead.
 function PopupWindow(iUrl, iWidth, iHeight) {
	if (!iWidth) { iWidth = 295; }
	if (!iHeight) { iHeight = 200; }

  	popupWindow = window.open(iUrl,"Popup","toolbar=no,width=" + iWidth +",height=" + iHeight + ",directories=no,status=no,scrollbars=no,resize=no,menubar=no");

	if (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) < 4) {} 
	else popupWindow.focus();
 }
 
 // pass this a set of parameters. example:
 // 'width=670,height=580,scrollbars=yes,toolbars=no,resizable=yes'
 function PopUp(url, parameters, no_fileloc_p) {
    if( !no_fileloc_p ) url = url + '?fileloc=' + document.location.href;

    if (parameters == undefined) {
        parameters = 'width=335,height=489,scrollbars,status';
    }

	popupWindow=window.open(url, "Popup", parameters);
         
	if (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) < 4) {} 
	else popupWindow.focus();
    return false;
 }
 
 // close popup window
 function noThanks() {
 	parent.close()
 }


	function getByID (n) {
		var d = window.document;
		if (d.getElementById)
			return d.getElementById(n);
		else if (d.all)
			return d.all[n];
	}

	function toggleByID (c, id) {
		var e = getByID(id);
		if (c.checked) e.style.display = 'block';
		if (!c.checked) e.style.display = 'none';
	}

    function show(elementName) {
        var e = getByID(elementName);
        e.style.display = 'block';
    }

    function hide(elementName) {
        var e = getByID(elementName);
        e.style.display = 'none';
    }

    function swap(elementName) {
        var e = getByID(elementName);
        if (e.style.display == 'none') {
            e.style.display = '';
        } else {
            e.style.display = 'none';
        }
    }

// function to wrap google analytics to avoid going to "false" in anchor tags
function trackEvent(category, action, optional_label, optional_value) {
    if (optional_label == null || optional_label == undefined) {
        optional_label = ga_subpage;
    }
    if (optional_value != null && optional_value != undefined) {
    //    optional_value = parseInt(optional_value);
    }
    pageTracker._trackEvent(category, action, optional_label, optional_value);
}
