function writeYear() {
	var d = new Date()
	document.write(d.getFullYear());
}

function MM_findObj(n, d) {
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

	function trim(input)
	{
		var inputCopy = String(input);
		var outputCopy = "";
		for(var i=0;i<inputCopy.length;i++)
		{
			if(inputCopy.charCodeAt(i) != 32)
			{
				outputCopy = String(input);
				break;
			}
		}
		return outputCopy;
	}

//GetElementByID replacement
// requires mm.js or MM_findObj found in mm.js
function getDOMElementByID(eid){
	var docElem;
	if (typeof eid == "string"){
		docElem =  MM_findObj(eid);
	}
	return docElem;
}

//Generic toggle switch for expanding content in limited screen space 
function toggleDisplay(iItem) { //exit gracefully if empty 
	if(iItem=='') {return(true);} 
		if(getDOMElementByID(iItem).style.display=="none"||getDOMElementByID(iItem).style.display=="") {
		getDOMElementByID(iItem).style.display="block"; 
		//getDOMElementByID('videoButton').src="/box/bcf05_bc_hidevideo.gif"; 
	} else { 
		getDOMElementByID(iItem).style.display="none"; 		
		//getDOMElementByID('videoButton').src="/box/bcf05_bc_showvideo.gif"; 
	} 
}

function simpleToggle(iItem,blnShow) {
	var oItem = getDOMElementByID(iItem);
	if (oItem) {
		if(blnShow) {
			oItem.style.display="block"; 
		} else {
			oItem.style.display="none"; 
		}
	}
}

function blurSearch() {
	var oSearch = getDOMElementByID('NavSearch');
	if(oSearch) {
		if(trim(oSearch.value=='')) {
			oSearch.value='zip code';
		}
	}
}
function focusSearch() {
	var oSearch = getDOMElementByID('NavSearch');
	if(oSearch) {
		if(oSearch.value=='zip code') {
			oSearch.value='';
		}
	}
}