function RouteContent(passActionTypeID, passActionParm){
	var cpath = window.location.pathname;
	
	if (passActionTypeID.toString().length == 0){return;}
	if (passActionParm.toString().length == 0){ return;}
	if (passActionTypeID == 90){ 
		return; 
	} // submenu indicator

	// build the querystring for rerouting to this window
	var mMode = document.getElementById("Mode").value;
	var mWebID = document.getElementById("WebID").value;
	var mUID = document.getElementById("UID").value;
	var mOriginPage = document.getElementById("OriginPage").value;
	var mEDate = document.getElementById("EDATE").value;


	var qs = '?Mode=' + mMode;
	qs += '&WebID=' + mWebID;
	qs += '&UID=' + mUID;
	qs += '&MenuActionTypeID=' + passActionTypeID;
	qs += '&MenuActionParm=' + passActionParm;
	qs += '&OriginPage=' + mOriginPage;
	qs += '&EDate=' + mEDate;

	switch (passActionTypeID) {
	case '2':
		// article - refresh the window, calling in the article
		window.location.href = cpath + qs;
		break;
	case '4':
		if (passActionParm.indexOf('?') == -1){
			// append in the querystring
			passActionParm += qs;
		}
		OpenInNewWindow(passActionParm);
		break;
	case '5':
		// open the url in the lower frame
		window.location.href = cpath + qs;
		break;
	case '6':
		window.location.href = cpath + qs;
		break;
	default :
		window.location.href = cpath + qs;
	}
}

// rh 3/26/02
function MainClick(passMainActionTypeID, passMainActionParm){

	var mMode = document.getElementById("Mode").value;
	var mWebID = document.getElementById("WebID").value;
	var mUID = document.getElementById("UID").value;
	var mOriginPage = document.getElementById("OriginPage").value;
	var mEDate = document.getElementById("EDATE").value;

	var qs = '?Mode=' + mMode;
	qs += '&WebID=' + mWebID;
	qs += '&UID=' + mUID;
	qs += '&MenuActionTypeID=' + passMainActionTypeID;
	qs += '&MenuActionParm=' + passMainActionParm;
	qs += '&OriginPage=' + mOriginPage;
	qs += '&EDate=' + mEDate;

	switch (passMainActionTypeID) {
	case '2':
		// article - refresh the window, calling in the article
		RouteContent(passMainActionTypeID, passMainActionParm);
		break;
	case '4':
		if (passMainActionParm.indexOf('?') == -1){
			// append in the querystring
			passMainActionParm += qs;
		}
		OpenInNewWindow(passMainActionParm);
		break;
	case '5':
		// pass the value back to the route content process
		RouteContent(passMainActionTypeID, passMainActionParm);
		break;
	case '6':
		window.location.href = passMainActionParm;
		break;
	case '70' :
		RouteContent(passMainActionTypeID, passMainActionParm);
		break;
	case '71' :
		RouteContent(passMainActionTypeID, passMainActionParm);
		break;
	case '80' :
		RouteContent(passMainActionTypeID, passMainActionParm);
		break;
	case '81' :
		RouteContent(passMainActionTypeID, passMainActionParm);
		break;
	}
}

function OpenInNewWindow(passURL){
	if (passURL.toString().length == 0){
		return;
	}
	// setup the defaults for the new window
	var OpenFeatures = 'top=100,left=100,height=480,width=640,location=no';
	var w = window.open(passURL,'_blank',OpenFeatures);
}

