var is=new Object(); var display_menus=true; is.version = new Number(navigator.appVersion.substr(0,1)); is.netscape = (navigator.appName == "Netscape"); is.netscape6 = (is.netscape && is.version >= 5); is.ie = (navigator.appVersion.toLowerCase().indexOf("msie") >= 0); is.opera = (navigator.appName == "Opera"); var get_menus = WM_readCookie("GracoMenus"); if (get_menus == false) { display_menus = true; } else if (get_menus == "off") { display_menus = false; } function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } function eventDate() { var form = document.GetEvents; form.action = '/products/M_Pages.nsf/EventsShowdate?OpenAgent&'+escape('Query='+form.Dates.options[form.Dates.selectedIndex].value); form.submit(); } var WM_acceptsCookies = false; if(document.cookie == '') { document.cookie = 'WM_acceptsCookies=yes'; // Try to set a cookie. if(document.cookie.indexOf('WM_acceptsCookies=yes') != -1) { WM_acceptsCookies = true; }// If it succeeds, set variable } else { // there was already a cookie WM_acceptsCookies = true; } function WM_setCookie (name, value, hours, path, domain, secure) { if (WM_acceptsCookies) { var not_NN2 = (navigator && navigator.appName && (navigator.appName == 'Netscape') && navigator.appVersion && (parseInt(navigator.appVersion) == 2))?false:true; if(hours && not_NN2) { // NN2 cannot handle Dates, so skip this part if ( (typeof(hours) == 'string') && Date.parse(hours) ) { // already a Date string var numHours = hours; } else if (typeof(hours) == 'number') { // calculate Date from number of hours var numHours = (new Date((new Date()).getTime() + hours*3600000)).toGMTString(); } } document.cookie = name + '=' + escape(value) + ((numHours)?(';expires=' + numHours):'') + ((path)?';path=' + path:'') + ((domain)?';domain=' + domain:'') + ((secure && (secure == true))?'; secure':''); } } // WM_setCookie function WM_readCookie(name) { if(document.cookie == '') { // there's no cookie, so go no further return false; } else { // there is a cookie var firstChar, lastChar; var theBigCookie = document.cookie; firstChar = theBigCookie.indexOf(name); // find the start of 'name' var NN2Hack = firstChar + name.length; if((firstChar != -1) && (theBigCookie.charAt(NN2Hack) == '=')) { // if you found the cookie firstChar += name.length + 1; // skip 'name' and '=' lastChar = theBigCookie.indexOf(';', firstChar); // Find the end of the value string (i.e. the next ';'). if(lastChar == -1) lastChar = theBigCookie.length; return unescape(theBigCookie.substring(firstChar, lastChar)); } else { // If there was no cookie of that name, return false. return false; } } } // WM_readCookie function WM_killCookie(name, path, domain) { var theValue = WM_readCookie(name); // We need the value to kill the cookie if(theValue) { document.cookie = name + '=' + theValue + '; expires=Fri, 13-Apr-1970 00:00:00 GMT' + ((path)?';path=' + path:'') + ((domain)?';domain=' + domain:''); // set an already-expired cookie } } // WM_killCookie function switchMenu(op) { WM_killCookie("GracoMenus", "/", "graco.com") ; WM_setCookie ("GracoMenus", op, null, "/", "graco.com") ; location.reload(); } function checkAction(type, key) { var f = document.forms[type]; if (f.q.value == "") { alert("You must supply a search query!"); return false; } else if (f.action != "") { f.action = "http://"+window.location.hostname+"/products/SiteSearch.nsf/NewSearch?OpenAgent&Query="+f.q.value; return true; } else { return false; } } function setColor(el, bg) { if (el.style) el.style.backgroundColor = bg; } var bgBad = "#CCCCCC"; var bgGood = "white"; function validateSubscribe(whre) { var msg; msg = ""; if (whre == "S") { form = document.forms["Sub"]; } else if (whre == "N") { form = document.forms["NEWSub"]; } else if (whre == "U") { form = document.forms["unsub"]; } else if (whre == "C") { form = document.forms["Change"]; } if (whre == "C") { if (trim(form.email_old_confirm.value, "both") == "") { msg = msg+"\nYour old email address confirmed." ; form.email_old_confirm.focus() ; setColor(form.email_old_confirm, bgBad) ; } else { setColor(form.email_old_confirm, bgGood); } if (trim(form.email_old.value, "both") == "") { msg = msg+"\nYour old email address." ; form.email_old.focus() ; setColor(form.email_old, bgBad) ; } else { setColor(form.email_old, bgGood); } } if (whre == "N") { if (trim(form.firstname.value, "both") == "") { msg = msg+"\nYour first name." ; form.firstname.focus() ; setColor(form.firstname, bgBad) ; } else { setColor(form.firstname, bgGood); } if (trim(form.lastname.value, "both") == "") { msg = msg+"\nYour last name." ; form.firstname.focus() ; setColor(form.lastname, bgBad) ; } else { setColor(form.lastname, bgGood); } if (trim(form.zipcode.value, "both") == "") { msg = msg+"\nYour zipcode." ; form.zipcode.focus() ; setColor(form.zipcode, bgBad) ; } else { setColor(form.zipcode, bgGood); } } if (trim(form.email.value, "both") == "") { msg = msg+"\nYour email address." ; form.email.focus() ; setColor(form.email, bgBad) ; } else if (form.email.value.indexOf('@', 0) == -1 || form.email.value.indexOf('.', 0) == -1) { msg = msg+"\nYour email address is not valid." ; form.email.focus() ; setColor(form.email, bgBad) ; } else { setColor(form.email, bgGood); } if (trim(form.email_confirm.value, "both") == "") { msg = msg+"\nYour confirm email address." ; form.email_confirm.focus() ; setColor(form.email_confirm, bgBad) ; } else if (form.email_confirm.value.indexOf('@', 0) == -1 || form.email_confirm.value.indexOf('.', 0) == -1) { msg = msg+"\nYour email confirmation address is not valid." ; form.email_confirm.focus() ; setColor(form.email_confirm, bgBad) ; } else if (form.email.value != form.email_confirm.value) { msg = msg+"\nYour email and email confirmation do not match." ; form.email.focus() ; setColor(form.email, bgBad) ; setColor(form.email_confirm, bgBad) ; } else { setColor(form.email_confirm, bgGood); } if (msg != "") { alert("Please provide: "+msg) ; return false ; } else { return true ; } } function validateContactMsg() { var msg; msg = ""; form = document.forms["MContactUs"]; if (trim(form.Name.value, "both") == "") { msg = msg+"\nYour name." ; form.Name.focus() ; setColor(form.Name, bgBad) ; } else { setColor(form.Name, bgGood); } if (trim(form.Email.value, "both") == "") { msg = msg+"\nYour E-mail Address." ; form.Email.focus() ; setColor(form.Email, bgBad) ; } else if (form.Email.value.indexOf("@" , 0) == -1) { msg = msg+"\nNot a valid email address." ; form.Email.focus() ; setColor(form.Email, bgBad) ; } else { setColor(form.Email, bgGood); } if (trim(form.Subject.value, "both") == "") { msg = msg+"\nThe subject." ; form.Email.focus() ; setColor(form.Subject, bgBad) ; } else { setColor(form.Subject, bgGood); } if (trim(form.Message.value, "both") == "") { msg = msg+"\nThe message." ; form.Email.focus() ; setColor(form.Message, bgBad) ; } else { setColor(form.Message, bgGood); } if (msg != "") { alert("Please provide: "+msg+"\nSo we can contact you regarding your question/comment.") ; return false ; } else { return true ; } } function trim(arg,func) { var trimvalue = ""; arglen = arg.length; if (arglen < 1) return trimvalue; if (func == "left" || func== "both") { i = 0; pos = -1; while (i < arglen) { if (arg.charCodeAt(i) != 32 && !isNaN(arg.charCodeAt(i))) { pos = i; break; } i++; } } if (func == "right" || func== "both") { var lastpos = -1; i = arglen; while (i >= 0) { if (arg.charCodeAt(i) != 32 && !isNaN(arg.charCodeAt(i))) { lastpos = i; break; } i--; } } if (func == "left") { trimvalue = arg.substring(pos,arglen-1); } if (func == "right") { trimvalue = arg.substring(0,lastpos+1); } if (func == "both") { trimvalue = arg.substring(pos,lastpos + 1); } return trimvalue; } function popWinUp(URL, atts) { if (atts == "") { DEF_ATTRIB = "height=500,width=500,scrollbars,resizable"; } else { DEF_ATTRIB = atts; } child = window.open(URL, "spawn", DEF_ATTRIB); child.opener = self; child.focus(); } function SimpleSwap(newimg, oldimg){ document.images.img1.src = document.getElementById(newimg).src; document.getElementById(newimg).src = oldimg; } function MM_swapImgRestore() { //v3.0 if (display_menus) { var i,x,a=document.MM_sr; for(i=0;a&&i0&&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