/* The infamous breadcrumb function 
mSource = 3rd button id
mItem = 4th tier nav unordered list
mSubItem = 4th tier link within the unordered list

All it does is set the passed id to bold.
*/


var openSource = '';
var openItem = '';
var openSubItem = '';

function breadcrumb(mSource, mItem, mSubItem){
	if((mSource == openSource) && ((openItem != '') && (openItem != null))){
		document.getElementById(mSource).style.fontWeight = "normal";
		document.getElementById(mItem).style.display = "none";
		openSource = '';
		openItem = '';
		if((openSubItem != '') && (openSubItem != null)){
			document.getElementById(mSubItem).style.fontWeight = "normal";
			openSubItem = '';
		}
	}else{
		if((mSource != '') && (mSource != null)){
			if((openSource != '') && (openSource != null)){
				document.getElementById(openSource).style.fontWeight = "normal";
			}else{
				document.getElementById(mSource).style.fontWeight = "bold";
				openSource = mSource;
			}
			if((openItem != '') & (openItem != null)){
				document.getElementById(openItem).style.display = "none";
			}
			if((mItem != '') && (mItem != null)){
				document.getElementById(mSource).style.fontWeight = "bold";
				openSource = mSource;
				document.getElementById(mItem).style.display = "block";
				openItem = mItem;
			}
			if((mSubItem != '') && (mSubItem != null)){
				document.getElementById(mSubItem).style.fontWeight = "bold";
				openSubItem = mSubItem;
			}
			
		}
		
	}
}


function jumpTo(mTarget,mObject,restore){ 
	eval(mTarget+".location='"+mObject.options[mObject.selectedIndex].value+"'");  
	if (restore) selObj.selectedIndex=0;
}

/* Creates the URL for the 'printer friendly' page */

function printLink(){
	var pageURL = location.href;
	var question = pageURL.split("?");
	
	myWindow = window.open();
	
	if (question.length < 2){
		myWindow.location = pageURL + "?print=1";
	}else{
		myWindow.location = pageURL + "&print=1";
	}
}	
	

/* Cookie functionality, just in case you need it */

function getCookie(name) {
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1) {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    } else {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1) {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}

function setCookie(name, value, expires, path, domain, secure) {
    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}