<!--
function popUpWindow(page, width, height){
	window.open(page, "HelpPages", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=" + width + ",height=" + height);
}

function popUpSelectionWindow(page, width, height){
	window.open(page, "HelpPages", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=" + width + ",height=" + height);
}

function ExportLink(ALink){
	//alert("PRE:ALink:"+ALink);
	var re = /\+/g;        //Create regular expression pattern.	
	ALink = ALink.replace(re,"\%2b");
	//alert("POST:ALink:"+ALink);
	if (ALink ){
		if (window.opener) {
			window.opener.location = ALink;
		}else{
			window.open(ALink);
		}
		window.close();
	}
}

function submitDropdown(Inform,dropdown){
	if (dropdown.selectedIndex != -1){
		if (dropdown.options[dropdown.selectedIndex].value != "") {
			Inform.submit();
		}else{
			alert("Please Select an Entry from the Selection Box");
		}
	}else{
		alert("Please Select an Entry from the Selection Box");
	}
}

function URLEncode(el){
	el.value = escape(el.value);
}

function goRiskSummary(ID, session){
	popUpPage = '/cgi-bin/request.pl?riskpopup=' + ID + '&SessionID=' + session;
	window.open(popUpPage, "RiskSummary", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=500,height=350");
	
}

function Validate(ALink){
	ALink = escape(ALink);
	LoginPage = "/cgi-bin/request.pl?error=1&page=" + ALink;
	window.open(LoginPage, "Login", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=200,height=410");
}

function GetHTTPVar(s,v){
	var vlen=v.length; var ucs = new String (s.toUpperCase()); 
	var ucv = new String (v.toUpperCase());
	var off1 = ucs.indexOf(ucv +'='); var off2=0; 
	if (off1 > -1 ) { 
		off1 = off1+vlen; off2 = s.indexOf('&',off1)-off1;
		if (off2 > -1 )	return(s.substring(off1+1,off1+off2)); 	else return(s.substring(off1+1));
	} else return("");
}

function MaintainState() {
	var d = this.document;
	var asearch = new String (d.location.search.substring(1));
	var aseparator = new String;
	var aSID=GetHTTPVar(asearch,"SESSIONID");
	if (aSID != ""){
		if (document.all.TrialCell){
			document.all.TrialCell[0].style.display = 'none';
			document.all.TrialCell[1].style.display = 'none';
		}
		for (thislink in d.links) {
			aseparator = d.links[thislink].search=="" ? "?" : "&";
			
			if (aSID.indexOf("_") == -1) {
				if (d.links[thislink].hash == "#login"){
					d.links[thislink].href = "/cgi-bin/request.pl?logout=true";
				}
				if (d.links[thislink].hash == "#pdf"){
					d.links[thislink].href = "/cgi-bin/request.pl?pdf=yes";
					d.links[thislink].onclick = "";
				}
				if (d.links[thislink].hash == "#MyEMO"){
					d.links[thislink].href = "/cgi-bin/request.pl?MyEMO=true";
					d.links[thislink].onclick = "";
				}
			}
			
			if (d.links[thislink].protocol != "mailto:"){
				if (!d.links[thislink].hash){
						d.links[thislink].search = d.links[thislink].search + aseparator + "SessionID=" + aSID;
				}
			}
		}
	}
	return true;
}




function ClearForms(what){
	for (var i=0, j=what.elements.length; i<j; i++) {
		myName = what.elements[i].type;
        if (myName.indexOf('checkbox') > -1 || myName.indexOf('radio') > -1)
            what.elements[i].checked = false;
        if (myName.indexOf('text') > -1){
			if (what.elements[i].name.indexOf('CompanyName') != -1){
				DefaultText = "Search for Company Name";
			}else if (what.elements[i].name.indexOf('CompanyAddress') != -1){
				DefaultText = "Search for Company Address";
			}else{
				DefaultText = "";
			}
            what.elements[i].value = DefaultText;
	    }
		if (myName.indexOf('select') > -1)
            for (var k=0, l=what.elements[i].options.length; k<l; k++)
                what.elements[i].options[k].selected = false;
    }
	if (what.FSReported){
		what.FSReported[2].checked = true;
	}
}

function addDropDownValuesToForm(){
		
	var lenCountries = document.ExportWizard.exportgeography.options.length;
	
	
	for(i =0; i < lenCountries; i++) {
		if(document.ExportWizard.exportgeography.options[i].selected == true) {
			document.ExportWizard.exportcountryvalues.value = document.ExportWizard.exportcountryvalues.value  + "," +	document.ExportWizard.exportgeography.options[i].value;			
		}
		
	}
	var lenIndicators = document.ExportWizard.exportindicator.options.length;
	for(i =0; i < lenIndicators; i++) {
		if(document.ExportWizard.exportindicator.options[i].selected == true){			
			document.ExportWizard.exportindicatorvalues.value = document.ExportWizard.exportindicatorvalues.value  + "," +	document.ExportWizard.exportindicator.options[i].value;
		}
	}
}


function clearExportWizard(){
	document.ExportWizard.clearexportwizard.value="1";
}
	
function SaveSearchPopup(action){
	if (document.frmsavesearch.savetitle.value == ""){
		alert("A Title must be provided for this search to be saved.");
		return false;	
	}
	
	if (action ==0){//save
		document.frmsavesearch.closewindow.value = 1;//do alert for this ?	
		document.frmsavesearch.update.value = 0;
		document.frmsavesearch.del.value = 0;
		document.frmsavesearch.savesearch.value = 1;	
	}
	if (action ==1){//update
		document.frmsavesearch.closewindow.value = 1;//do alert for this ?	
		document.frmsavesearch.update.value = 1;
		document.frmsavesearch.del.value = 0;
		document.frmsavesearch.savesearch.value = 1;	
	}
	if (action ==2){//delete
		document.frmsavesearch.closewindow.value = 1;//do alert for this ?	
		document.frmsavesearch.update.value = 0;
		document.frmsavesearch.del.value = 1;
		document.frmsavesearch.savesearch.value = 0;
	}
	
	document.frmsavesearch.submit();
	return true;
}

function SubmitSearchServiceForm(){
	var selecttext = document.searchnav.searchservice.options[document.searchnav.searchservice.selectedIndex].text;
	var selectval = document.searchnav.searchservice.options[document.searchnav.searchservice.selectedIndex].value;	
	
	if((selectval.indexOf("document.searchnav") != -1) || (selecttext.indexOf("BMI Reports & Publications") != -1)){
		eval(selectval);
		document.searchnav.submit();
	}	
	if((selecttext.indexOf("Data & Forecasts") != -1)){
		//document.searchnav.ndbexportwizard.value = 1;
		eval(document.searchnav.searchservice.options[document.searchnav.searchservice.selectedIndex].value);
	}	
	
}

function display(in_box, out){
	maxi = in_box.length - 1;
	x = 0;
	out.value = "";
	count = 0;
	while (x <= maxi){
		if (in_box[x].selected){
			if (count == 0){
				out.value = out.value  + in_box[x].value;
				count = 1;
			}else{
				out.value = out.value + "," + in_box[x].value;
			}
		}
		x++;
	}
}
function updateprefs(){
	document.prefsupdate.update.value=1;
	document.prefsupdate.submit();
	return(true);
}	

function setfocus(){
	        document.loginform.uid.focus();
	}
function closeup() {
	window.close()
} 
function redirect() {
	opener.location="/online/trial.html";
	window.close()
}

function validateSubmitGeog(stype){
  $('input[name=pdf_iso]').val('');
	if (document.frmpdfGeog.pdfiso.selectedIndex == -1 && document.frmpdfSector.industryID.value == ""){
		alert("Please select a Geography or Service to Submit.");
		return false;
	}
	if(document.frmpdfGeog.pdfiso.options[document.frmpdfGeog.pdfiso.selectedIndex].value == ''){/*geog test*/
		alert("Please select a Geography to Submit.");
		return false;
	}else{
    document.frmpdfGeog.pdf_iso.value = document.frmpdfGeog.pdfiso.value;
			var selected = "";
      $('select[name=pdfiso] option:selected').each(function() {
        selected += ","+$(this).val();
      })
      $('input[name=pdf_iso]').val(selected.substr(1));
		return true;
	}
}
function validateSubmitSector(stype){
	if (document.frmpdfGeog.pdfiso.selectedIndex == -1 && document.frmpdfSector.industryID.value == ""){
		alert("Please select a Geography or Service to Submit.");
		return false;
	}
	if(document.frmpdfSector.industryID.value == ""){//service test
		alert("Please select a Service to Submit.");
		return false;
	}else{
		return true;
	}
}
function popup(page){
	var widthX = ((screen.width-640)/2);
	var heightY = ((screen.height-480)/3);

	urltogoto = "/home/Risk/help.html#" + page;
	settings="left="+widthX+",top="+heightY+",location=0,directories=0,resizable=0,scrollbars=1,status=0,height=480,width=640";
	MyNewWin = window.open(urltogoto,'Win1',settings);
	MyNewWin.focus();


}

function popup2(page){
	var widthX = ((screen.width-640)/2);
	var heightY = ((screen.height-480)/3);

	urltogoto = "/home/Risk/methodological.html#" + page;
	settings="left="+widthX+",top="+heightY+",location=0,directories=0,resizable=0,scrollbars=1,status=0,height=480,width=640";
	MyNewWin = window.open(urltogoto,'Win1',settings);
	MyNewWin.focus();
}

/*
validateCCvalues()
ensure cost code values are present if user is set to have is mandatory values
*/
function validateCCvalues(){
	var countblankfields =0;
	var countccfields=0;
	var Nodes = document.getElementsByTagName('input');
	var max = Nodes.length;
	for(var i = 0;i < max;i++) {
		var nodeObj = Nodes.item(i);
		var idname = nodeObj.id;	        
		if((idname.indexOf("CostCode") == 0) ){// only ccheck costcode value fields
			countccfields++;
			if(nodeObj.value == ''){
				countblankfields++;
			}
		}
	}
	if(countblankfields == countccfields){/*all CostCode fields are blank so throw warning */
		alert("Please complete at least one cost code field");
		return(false);
	}else{/*at least one field is not blank*/
		return(true);	
	}
}

function checkvalidterm(fromfrm){
	var strSearchTerm = document.hdrsearchcriteria.keyword.value;
	
	if (_validateSearchTerm(strSearchTerm)==true){
		if (strSearchTerm == "Keyword Search"){
			//document.hdrsearchcriteria.keyword.value = ""; //allow blank search
			return false;
		}
		document.hdrsearchcriteria.savesearch.value = 1;
		if(fromfrm !=1){
			document.hdrsearchcriteria.submit();
		}
		return true;
	}
	else{
		alert("Please enter a valid keyword before starting a search.\n (Valid keywords have at least 2 characters and must not be 'Keyword Search').");
		return false;
	}
	
}

function frmcheckvalidterm(){
	//differentiate call from form submit and not href onclick
	checkvalidterm(1);
}

/*
04/02/2008 17:02:21 JC advanced search term validatin
check keyword ONLY if ISO AND META are not selected 
if meta =="" AND iso = "" and (keyword = "" or keyword = "Enter Keyword" orkeyword < 3 chars) then
throw warning
else carry on
*/	
function advSearchValidate(){
	var doc_iso = document.searchcriteria.searchiso;//was searchiso JC 09/01/2009 10:57:33
	var doc_meta = document.searchcriteria.meta;
	var strSearchTerm = document.searchcriteria.keyword.value;

	if ( ( (doc_iso.selectedIndex == -1	
		    && doc_meta.selectedIndex == -1)
		  ||( (doc_iso.selectedIndex > -1 
		  	   && doc_iso.options[doc_iso.selectedIndex].value =='')
			  || (doc_meta.selectedIndex > -1 
			  	  && doc_meta.options[doc_meta.selectedIndex].value =='')
			)
		 )
		&& (_validateSearchTerm(strSearchTerm)==false)
	   )
	{
		alert("Please enter a valid keyword before starting a search.\n (Valid keywords have at least 2 characters and must not be 'Enter Keyword').");
		return false;
	}
	else{
		/*
		if(document.searchcriteria.daterangeon.value ==1){
			var sdate = formatDateForScreen(document.getElementById("sdate").text);
			var edate = formatDateForScreen(document.getElementById("edate").text);
		
			document.searchcriteria.startdate.value = sdate;//hidden form field
			document.searchcriteria.enddate.value = edate;//hidden form field
		}
		*/
		document.searchcriteria.savesearch.value = 1;
		document.searchcriteria.submit();	
		advSearchValidate = blockIt; // prevents user submitting form more than once in as a page request ie. stops "double clicking"
		//return true;
		return false;
	}
}//end function

/*
 prevents user submitting form more than once in as a page request ie. stops "double clicking"
 */
function blockIt(){
	return false;	
}
/*------------------------------------------------------------
	_validateSearchTerm
	helper function for checkvalidterm() and advSearchValidate()
*/
function _validateSearchTerm(term){
	term = trim(term);
	term = term.toLowerCase() ;
	var slen = term.length;
	
	if(slen > 128 || term == ''){// JC change - do not allow blank searches 27/01/2009 11:22:39
		//alert("Keyword Search is too long.");
		return false;
	}
	
/*JC 13/03/2008 11:27:19 logic changed now allowed to submit "enter keyword" as the backend handles this
	if	( 	( (term.indexOf('keyword') >-1   && term.indexOf('search') >-1) ) 
			|| (term == "")
			|| (slen < 2)
			|| (has_consecutivespaces(term) ==true)
		){
		return false;
	}
	else{
		return true;
	}
	*/
	if	( has_consecutivespaces(term) ==true){
		return false;
	}
	else{
		return true;
	}
}//end function

/*-----------------------------------------------------------------
	test string for 2 consecutive spaces
*/
function has_consecutivespaces(str){
	var arr = str.match("\\s{2}");
	if (arr == null){
		return false;
	}
	var test = arr[0];
	if (test.length == 2){
		//alert("FOUND 2 spaces>"+test+"<");
		return true;
	}else{
		return false;
	}
}//end function

/*-----------------------------------------------------------------
	trim string
	this takes 0.5ms in ALL browsers
	
	alternate function :
	trim: return str.replace(/^\s\s* /, '').replace(/\s\s*$/, '');
                                    ^space in line above to not break the comment block, remove space if intent to use 
	takes 15ms in FF and < 0.5ms in IE	
*/
function trim (str) {
	str = str.replace(/^\s+/, '');
	for (var i = str.length - 1; i >= 0; i--) {
		if (/\S/.test(str.charAt(i))) {
			str = str.substring(0, i + 1);
			break;
		}
	}
	return str;
}

/*------------------------------------------
	validateDates
	IMPORTANT NOTE: DATE MUST BE IN THE FORMAT mm-dd-yyyy
	var startdate = document.searchcriteria.startdatemonth.value+"-"+document.searchcriteria.startdateday.value+"-"+document.searchcriteria.startdateyear.value
	var enddate = document.searchcriteria.enddatemonth.value+"-"+document.searchcriteria.enddateday.value+"-"+document.searchcriteria.enddateyear.value
    
*/
function validateDate(thisdate) {
	
    var RegExPattern = /^(?=\d)(?:(?:(?:(?:(?:0?[13578]|1[02])(\/|-|\.)31)\1|(?:(?:0?[1,3-9]|1[0-2])(\/|-|\.)(?:29|30)\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})|(?:0?2(\/|-|\.)29\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))|(?:(?:0?[1-9])|(?:1[0-2]))(\/|-|\.)(?:0?[1-9]|1\d|2[0-8])\4(?:(?:1[6-9]|[2-9]\d)?\d{2}))($|\ (?=\d)))?(((0?[1-9]|1[012])(:[0-5]\d){0,2}(\ [AP]M))|([01]\d|2[0-3])(:[0-5]\d){1,2})?$/;
    
    if ( (thisdate.match(RegExPattern)) && (thisdate !='')) {
    	//remove for production:
        //alert('Date is OK'); 
       return true;
    } else {
    	var errorMessage = "Please enter valid 'real' date. \n "+thisdate+" would not be accepted.";
        alert(errorMessage);
        return false; 
    } 
    
}//end func
/*------------------------------------------*/
function HandleKeywordSearch(disableIt)
{
	document.searchcriteria.daterangeon.value = disableIt ? 1 : 0;
	document.getElementById("sdate").disabled = !disableIt ;
	document.getElementById("edate").disabled = !disableIt ;
	
	/*
	if(document.searchcriteria.daterangeon.value ==0){
		document.getElementById("sdate").style.color="gray";
		document.getElementById("edate").style.color="gray";
	}else{
		document.getElementById("sdate").style.color="blue";
		document.getElementById("edate").style.color="blue";
	}
	
	document.getElementById("startdate_Month_ID").disabled	= !disableIt;
	document.getElementById("startdate_Day_ID").disabled   	= !disableIt;
	document.getElementById("startdate_Year_ID").disabled	= !disableIt;
	document.getElementById("enddate_Month_ID").disabled	= !disableIt;
	document.getElementById("enddate_Day_ID").disabled		= !disableIt;
	document.getElementById("enddate_Year_ID").disabled		= !disableIt;
	*/
	document.searchcriteria.keyword.disabled        = !disableIt;
	if (document.searchcriteria.keyword.disabled) {
		document.searchcriteria.keyword.value = 'Enter Keyword'
	}
	
	/* remove this for production
	alert ('daterangeon : ' + document.searchcriteria.daterangeon.value );
	*/
}//end func

/*
	checkDates uses simple calendar widget (scw) from 
	http://www.garrett.nildram.co.uk/calendar/scw.htm#FirefoxBug
*/
function checkDates(scwEle){
	var sdate = document.getElementById("sdate").innerHTML;
	var edate = document.getElementById("edate").innerHTML;
	
	//alert("checkDates sdate:"+sdate+"\n,edate:"+edate);
	
	capdates(sdate,edate);
	checkSwapDates(sdate,edate);
}

/*
	JC 25/03/2008 12:33:34
	formatDate
	warning : specific format input/output not generic function 
	used with checkDates and advSearchValidate functions
*/
function formatDateWithDigitMonth(thisdate){
	var myHash = new Hash('jan', 1, 'feb', 2, 'mar', 3,'apr', 4,'may', 5,'jun', 6,'jul', 7,'aug', 8,'sep', 9,'oct', 10,'nov', 11,'dec', 12);
	//myHash.setItems('jan', 1)
	//var test = myHash.getItem('jan');	
	
	var arrd= thisdate.split("-");
	var d 	= arrd[0];
	var mon = arrd[1].toLowerCase();//month	name eg/ Apr
	var m 	= myHash.getItem(mon);	//convert to digit
	if(m < 10){
		m = "0"+m;
	}
	var y 	= arrd[2];
	
	var ret = d+"-"+m+"-"+y;
	
	//alert("formatDate month digit :"+d+"-"+m+"-"+y);
	
	return(ret);
}

function formatDateForScreen(thisdate){
	var myHash = new Hash('01','jan', '02','feb', '03', 'mar', '04','apr', '05','may', '06','jun', '07','jul', '08','aug','09','sep', 10,'oct', 11,'nov', 12,'dec');
	//myHash.setItems('jan', 1)
	//var test = myHash.getItem(9);	
	var test = myHash.getItem('09');	
	alert("thisdate:"+thisdate+",test:"+test);
	
	var arrd= thisdate.split("-");
	var d 	= arrd[0];
	var mon = arrd[1];//month number
	var m 	= myHash.getItem(mon);	//convert to digit
	var y 	= arrd[2];
	
	var ret = d+"-"+m+"-"+y;
	
	//alert("formatDate month digit :"+d+"-"+m+"-"+y);
	
	return(ret);
}

/*

if start date is great than end date then
 swap the dates over

*/

function checkSwapDates(datestart,dateend){
	var diffdays = getDateDiffDays(datestart, dateend);
	//alert("checkSwapDates getDateDiffDays: \ndiffdays:"+ diffdays + ",\ndatestart:"+datestart+",\ndateend:"+ dateend);
	//if(diffdays > 365){
	if (diffdays ==1){ //cap the end date
		datestart = formatDateWithDigitMonth(datestart);
		dateend = formatDateWithDigitMonth(dateend);
		document.getElementById("sdate").innerHTML = formatDateForScreen(dateend);
		document.getElementById("edate").innerHTML = formatDateForScreen(datestart);
		document.getElementById("startdate").value = dateend;
		document.getElementById("enddate").value = datestart;
   	}
}

function getDateDiffDays(date1, date2){
	var swap = 0;
	var myHash = new Hash('jan', 1, 'feb', 2, 'mar', 3,'apr', 4,'may', 5,'jun', 6,'jul', 7,'aug', 8,'sep', 9,'oct', 10,'nov', 11,'dec', 12);
	
	//var christmas=new Date(today.getFullYear(), 11, 25) 
	var arrd= date1.split("-");
	var d 	= arrd[0];
	var mon = arrd[1].toLowerCase();//month	
	var m 	= myHash.getItem(mon);		
	var y 	= arrd[2];	
	
	var arrd2= date2.split("-");
	var d2 	= arrd2[0];
	var mon2 = arrd2[1].toLowerCase();//month	
	var m2 	= myHash.getItem(mon);		
	var y2 	= arrd2[2];	
	
	date1 = new Date(y,m,d); //Month is 0-11 in JavaScript
	date2 = new Date(y2,m2,d2);
	
	//alert("dates:d1:"+date1 +",d2:"+date2);
	var diffdays = 0;
	//Get 1 day in milliseconds
	var one_day=1000*60*60*24;

	//Calculate difference btw the two dates, and convert to days
	/*
	if( date2 > date1 ){
		diffdays = Math.ceil( (date2.getTime()-date1.getTime())/(one_day) ) ;	
	}else if ( date1 > date2 ){
		diffdays = Math.ceil( (date1.getTime()-date2.getTime())/(one_day) ) ;	
	}
	return(diffdays);
	*/
	if ( date1 > date2 ){
		swap = 1;
	}
	return(swap);
}
/*
check to see if the date range is too big - apply rules
#unrestricted meta search without date limitation 
if ( ($daterangon ==0) #date must be capped to one year regardless of use selection or less than one year eg if user selects 6 months
elsif ($daterangeon 
and ($keyword ne "")
and (lc($keyword) ne "enter keyword") 
){
 */ 	
function capdates(datestart,dateend){
	var daterangeon = document.getElementById('daterangeon').value;
	var keyword = document.getElementById('keyword').value;
	
	if  (daterangeon ==0){//unrestricted meta search without date limitation 
		//don't need to do anything as the backend will handle this case by not using the dates
		
	}else if(daterangeon ==1 && keyword != '' && keyword.toLowerCase() != 'enter keyword' ){
		
		//date must be capped to one year regardless of user selection or less than one year eg if user selects 6 months	
		//Set the two dates
		var diffdays = getDateDiffDays(datestart, dateend);	
		//if (diffdays > 365){ //cap the end date
		if (diffdays ==1){ //cap the end date
			newdate = datestart;
			newdate.setDate(newdate.getDate()+365);//add a year to start date for end date
			document.getElementById("enddate").value = formatDateWithDigitMonth(newdate);
			document.getElementById("edate").innerHTML = formatDateForScreen(newdate);
		}
	}
}
/*
	http://www.mojavelinux.com/articles/javascript_hashes.html
 	javascript implementation of a hash 
 	usage:
 	alert(myHash.setItem('foobar', 'hey'));
 	for (var i in myHash.items) {
		alert('key is: ' + i + ', value is: ' + myHash.items[i]);
	}
	or 
	for (var i = 0; i < myHash.length; i++) {
		alert('key is: ' + i + ', value is: ' + myHash.items[i]);
	}
			
	
	if you made a method for 'getItem()', you could also do:
	
	for (var i = 0; i < myHash.length; i++) {
		alert('key is: ' + i + ', value is: ' + myHash.getItem(i));
	}
		
   
*/
function Hash(){
	this.length = 0;
	this.items = new Array();
	for (var i = 0; i < arguments.length; i += 2) {
		if (typeof(arguments[i + 1]) != 'undefined') {
			this.items[arguments[i]] = arguments[i + 1];
			this.length++;
		}
	}
   
	this.removeItem = function(in_key)
	{
		var tmp_value;
		if (typeof(this.items[in_key]) != 'undefined') {
			this.length--;
			var tmp_value = this.items[in_key];
			delete this.items[in_key];
		}
	   
		return tmp_value;
	}

	this.getItem = function(in_key) {
		return this.items[in_key];
	}

	this.setItem = function(in_key, in_value)
	{
		if (typeof(in_value) != 'undefined') {
			if (typeof(this.items[in_key]) == 'undefined') {
				this.length++;
			}

			this.items[in_key] = in_value;
		}
	   
		return in_value;
	}

	this.hasItem = function(in_key)
	{
		return typeof(this.items[in_key]) != 'undefined';
	}
}//end function 
		
/*
onLoadPage
used as a generic caller for onload events
*/
function onLoadPage(highlight){
	highlightChannel(highlight);
}

/*
	highlightChannel 
	changes channel highlight to red for sidenav
	called by body onload event
*/
function highlightChannel(metaid){
	if($('#'+metaid).length) $('#'+metaid).addClass('subnavon');//'#ff0000';
}//end function 















//end file-->



