// sizes and sets a standard popup window
function popupWindow(filename, type) {
		
	var w;
	var h;
	
	switch(type)
	{
		case "raterecipe":
			w = "500";
            h = "295";
			break;
		
		case "emailrecipe":
			w = "490";
			h = "490";
			break;
	    
	    case "prodlocator":
			w = "575";
			h = "480";
			break;
		
		case "shopinfo":
			w = "538";
			h = "400";
			break;
		
		case "printrecipe46":
			w = "475";
			break;
		
		case "printrecipe57":
			w = "475";
			h = "475";
			break;
			
		case "printrecipe810":
			w = "475";
			h = "700";
			break;
	}
	
	popup_window = window.open( filename, "popup_window", "left=20,top=20,width=" + w + ",height=" + h + ",resizable=yes,scrollbars=1,toolbar=0,status=0,location=0,directories=0,menubar=0");
	popup_window.focus();
}

function getSelectedButton(buttonGroup){
	for (var i = 0; i < buttonGroup.length; i++) {
		if (buttonGroup[i].checked) {
			return i
		}
	}
	return 0
}

function hideselect(element) { }
function showselect (element) { }

function choose_select_list(element){
	var value = element.options[element.selectedIndex].value;
	parent.location = value;
}
	
function make_blank() {
	document.freetext_search_box.keywords.value ="";
}

function make_blank2() {
	document.email_submit.email_address.value ="";
}

function ShowHide(elementId, showhide) {
	var element = document.getElementById(elementId);
	if (showhide == "show") {
		element.style.display = "block";
	} else {
		element.style.display = "none";
	}
}

function openPopupWindow(url, width, height) {
	newWindow = window.open(url,'_popup','width='+width+',height='+height+',scrollbars=yes,resizable=no,menubar=no,toolbar=no,directories=no,location=no,status=yes');
	newWindow.focus();
}
	

startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("topNav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
window.onload=startList;

$(document).ready( function() {
	if( $("#leftnav").size() > 0 ) {
		$("#leftnav").height( $("#leftnav").parent().height() );
	}
});

