// JavaScript Document
function mainmenu(state) {
	//- main menu state-
	var mm=document.getElementById('mainmenu');
	var bm=document.getElementById('backmenu');
	var im=document.getElementById('hideselects_idbug');
	if (state==1) {
		mm.style.display='block';
		bm.style.display='block';
		im.style.display='block';
	} else if (state==2) {
		//setTimeout('hidemenu()',500);
		mm.style.display='none';
		bm.style.display='none';
		im.style.display='none';
	}/* else {
		mm.style.display='none';
	}*/
}
function ronoff(i,p)
	//- roll over -
	{ document.getElementById(i).src='images/'+p; }
function csubf(id) {
	//- tabs homepage -
	for (i=1;i<7;i++) {
		var ic='sub'+i;
		var acid='a'+ic;
		var sf=document.getElementById(ic);
		var asf=document.getElementById(acid);
		 if (ic==id) {
			sf.style.display='block';
			asf.firstChild.style.color='#000000';
			if (ic=='sub6') {
			  asf.style.backgroundColor='#cc2829';
			} else {  
			  asf.style.backgroundColor='#ffffff';
			}
		 } else {
	   		sf.style.display='none';
           	asf.firstChild.style.color='#ffffff';
           	asf.firstChild.fontWeight='bold';
           if (ic=='sub6') {
              asf.style.backgroundColor='#cc2829';
           } else {  
              asf.style.backgroundColor='#000000';
           }
		}
    }
}
function ClearSearch() {
	if (document.SearchForm.sSearchString.value=="Search") {
		document.SearchForm.sSearchString.value="";
	}
}	
function onFocusDeleteText(control) {
	if(control.value != "" && control.value == control.getAttribute("startvalue")) {
		control.value = "";
		if (has(control,"dataclass")) {
			if (control.className) {
				control.className = control.getAttribute("dataclass");
			} else {
				control.setAttribute("class", control.getAttribute("dataclass"));
			}
		}
	}	
}
//This will set it back to the start value, if the person didn't enter any data (happens when user leaves textbox)
function onBlurTextReplace(control) {
	if(control.value == "") {
		control.value = control.getAttribute("startvalue");
		if (has(control,"emptyclass")){
			if (control.className)
				control.className = control.getAttribute("emptyclass");
			else
				control.setAttribute("class", control.getAttribute("emptyclass"));
		}
	}
}
//Firefox vs. IE --> checking to see if you actually want there to be styles.
function has(control,child) {
  return ((control.hasAttribute && control.hasAttribute(child) ) || control.getAttribute(child));
}
window.onload = function() {
//- function on load -
	var subtd1 = document.getElementById('sub1');
	var subtd5 = document.getElementById('sub5');
	var subtd6 = document.getElementById('sub6');
	if (subtd1) {
		rtd(subtd1);
	}
	if (subtd5) {
		rtd(subtd5);
	}
	if (subtd6) {
		rtd(subtd6);
	}
	function rtd(subtd) {
		for(var i = 0; i < 4; i++) {
			var td = subtd.getElementsByTagName('tr')[0].getElementsByTagName('td')[i];
			td.onmouseover = function() {
				this.style.backgroundColor = '#eeeeee';
			};
			td.onmouseout = function() {
				this.style.backgroundColor = '#ffffff';
			};
		}
	}
};
/*--Show the Stock Graphics List*/
function GfxList(lnk) { 
	var nlnk = lnk; //"http://www.andersonsspirit.com/images/RibbonDesigns.htm", ///images/MascotDesigns.htm
  showList=window.open(nlnk, "SpiritRibbonDesigns", "width=750,height=650,toolbar=no,menubar=no,status=no,resizable=no,scrollbars=yes,screenX=10,screenY=10,left=10,top=10");
  showList.focus();
  return false;
}