/* Javascript functions for Specialty Produce Website */

function clearForm(){
//setting the value:
document.loginForm.username.value = document.loginForm.usernameTemp.value;
document.loginForm.usernameTemp.value = "";
document.loginForm.pw.value = document.loginForm.pwTemp.value;
document.loginForm.pwTemp.value = "";
document.loginForm.submit;
}

/* Open a new window as needed. */
function openNewWin(theURL,winName,features) {
	window.open(theURL,winName,features);
	return false;
}

/* prodSearch.htm */
/* IE uses 'className' in the setAttribute and everyone else uses 'class' and they ignore each other so we call both... */
function updateLink (clickedLink) {
	var aList = document.getElementsByTagName("a");
	for(var i = 0; i < aList.length; i++) {
		aList[i].setAttribute("className","linkList");
		aList[i].setAttribute("class","linkList");
	}
	clickedLink.setAttribute("className","currentList");
	clickedLink.setAttribute("class","currentList");
}

/* Show and Hide CSS popups */
function ShowPop(id)
{
   document.getElementById(id).style.visibility = "visible";
}
function HidePop(id)
{
   document.getElementById(id).style.visibility = "hidden";
}

/* Set the resolution values in the loginForm for use in browser statistics */
function setResValues() {
	document.loginForm.resWidth.value = screen.width;
	document.loginForm.resHeight.value = screen.height;
	return true;
}

var showTabContent = function() {
	$$('.hiddenTab').setStyle('display', 'none');
	var choice = this.get('id');
	$(choice + 'Content').setStyle('display', 'block');
	$$('.menuItem').removeClass('tab-selected');
	$(choice).addClass('tab-selected');
}