﻿$(document).ready(function(){
    $("li.answer").hide();
    $("li.question").click(function(){
        var currentFAQ = $(this).next().html();
		$("div#faqtext").html(currentFAQ);
	});
	
	$("#tooltip").easyTooltip({ 
        useElement: "footnote"
    });
});

function addToLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			if (oldonload) {
				oldonload();
			}
			func();
		}
	}
}


function productredirect()
{
    productSearch = window.open("http://productlocator.infores.com/productlocator/servlet/ProductLocator?zip="+document.forms[0].elements.zip.value+"&searchradius=10&productid="+document.forms[0].elements.product.value+"&productfamilyid=WASA&producttype=upc&template=xsltemplate.xsl&clientid=91&stores=1&storespagenum=1&storesperpage=15&etailers=1&etailerspagenum=1&etailersperpage=15","productSearch","fullscreen=no,toolbar=np,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=no,width=600,height=400");

//    productSearch = window.open("http://productlocator.infores.com/productlocator/keg/keg.pli?client_id=91&productfamilyid=WASA&"+document.forms[0].elements.product.value+"&"+document.forms[0].elements.zip.value,"productSearch","fullscreen=no,toolbar=np,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=no,width=600,height=400");
//	if(document.forms[0].elements.product.value=="")
//		{
//			document.getElementById("searchproductformerror").innerHTML = "Please make a selection.";
//			document.getElementById("searchproductformerror").style.visibility = "visible";

//		}
//		else
//		{
//			
//			if (document.forms[0].elements.zip.value=="" || !validateInteger(document.forms[0].elements.zip.value)  )
//				
//			{
//				document.getElementById("searchproductformerror").innerHTML = "Please enter a valid zip code.";
//				document.getElementById("searchproductformerror").style.visibility = "visible";

//			}
//			else
//			{
//				
//				//document.getElementById("searchproductformerror").style.visibility = "hidden";
//				//productSearch = window.open("http://apps.barillaus.com/productsearch.aspx?"+document.forms[0].elements.product.value+"&"+document.forms[0].elements.zip.value,"productSearch","fullscreen=no,toolbar=np,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=no,width=600,height=400");
//				
//			}
//		}		
}

