//Menu Expand if (!document.getElementById) document.getElementById = function() { return null; } function initializeMenu(menuId, actuatorId) { var menu = document.getElementById(menuId); var actuator = document.getElementById(actuatorId); if (menu == null || actuator == null) return; if (window.opera) return; // I'm too tired actuator.onclick = function() { var display = menu.style.display; this.parentNode.style.backgroundImage = (display == "block"); menu.style.display = (display == "block") ? "none" : "block"; return false; } } // JavaScript : initializeMenus window.onload = function() { initializeMenu("partyMenu", "partyActuator"); initializeMenu("craftsMenu", "craftsActuator"); initializeMenu("teacherMenu", "teacherActuator"); initializeMenu("everydayMenu", "everydayActuator"); initializeMenu("holidayMenu", "holidayActuator"); initializeMenu("saleMenu", "saleActuator"); } // boxCloseOnOff function turn(x) { if (!document.getElementById) return false; var partyObj = document.getElementById("partyMenu"); var craftsObj = document.getElementById("craftsMenu"); var teacherObj = document.getElementById("teacherMenu"); var everydayObj = document.getElementById("everydayMenu"); var holidayObj = document.getElementById("holidayMenu"); var saleObj = document.getElementById("saleMenu"); if (x == "1") { partyObj.style.display = "block"; craftsObj.style.display = "none"; teacherObj.style.display = "none"; everydayObj.style.display = "none"; holidayObj.style.display = "none"; saleObj.style.display = "none"; } if (x == "2") { partyObj.style.display = "none"; craftsObj.style.display = "block"; teacherObj.style.display = "none"; everydayObj.style.display = "none"; holidayObj.style.display = "none"; saleObj.style.display = "none"; } if (x == "3") { partyObj.style.display = "none"; craftsObj.style.display = "none"; teacherObj.style.display = "block"; everydayObj.style.display = "none"; holidayObj.style.display = "none"; saleObj.style.display = "none"; } if (x == "4") { partyObj.style.display = "none"; craftsObj.style.display = "none"; teacherObj.style.display = "none"; everydayObj.style.display = "block"; holidayObj.style.display = "none"; saleObj.style.display = "none"; } if (x == "5") { partyObj.style.display = "none"; craftsObj.style.display = "none"; teacherObj.style.display = "none"; everydayObj.style.display = "none"; holidayObj.style.display = "block"; saleObj.style.display = "none"; } if (x == "6") { partyObj.style.display = "none"; craftsObj.style.display = "none"; teacherObj.style.display = "none"; everydayObj.style.display = "none"; holidayObj.style.display = "none"; saleObj.style.display = "block"; } if (x == "off") { everydayObj.style.display = "none"; craftsObj.style.display = "none"; teacherObj.style.display = "none"; partyObj.style.display = "none"; holidayObj.style.display = "none"; saleObj.style.display = "none"; } } function setFocus() { //Determine if there is a text field to focus on if (document.forms.length > 1) { //getting the form after the Search form var field = document.forms[1]; for (i = 0; i < field.length; i++) { if ((field.elements[i].type == "text") && (field.elements[i].style.display != "none")) { document.forms[1].elements[i].focus(); break; } } } } function checkziplength(form) //Zip code { var letters = form.zipc1.value.length +1; if (letters <= 5) {form.zipc1.focus()} else {form.zipc2.focus()} } function printWindow() { bV = parseInt(navigator.appVersion); if (bV >= 4) window.print(); } function Certify(URL) { popupWin = window.open(URL, 'Participant', 'location,scrollbars,width=450,height=300') window.top.name = 'opener'; } function getSelectedRadio(buttonGroup) { // returns the array number of the selected radio button or -1 if no button is selected if (buttonGroup[0]) { // if the button group is an array (one button is not an array) for (var i=0; i 0) { // First see if the checkbox is checked. If so, submit if (document.prod_frm.pz_Flag.checked == true) { return true; } // Now get all the text and prompt for confirmation var message = ""; for (i = 0; i < linesize; i++) { var pzObj = document.getElementsByName("pz_" + i); // Only one element of that name is possible var line_message=pzObj[0].value; //call the function to test for special characters temp1 = validatePersonalization(line_message); if (temp1 == "") { if (line_message != "") { message+=(line_message + '\n'); } } else{ invChar = temp1 + invChar; } } if ((message == "") && (invChar == "")) { alert("Please enter personalization or check no personalization.\n"); return false; } else if (invChar != "") { alert("Please enter personalization without special character(s):\n\n" + invChar); return false; } } return true; } function validatePersonalization(message) { // This function checks for special characters // in personalization. // 4/28/2005 // Ann talked with Ralph and it was decided // to display the valid characters instead of the invalid // characters -- there are less valid than invalid var validchars = " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$&()-/,.?;:'\""; var temp = ""; for (cnt = 0; cnt < message.length; cnt++) { var letter = message.charAt(cnt); //the letter was not found in the string of validchars if (validchars.indexOf(letter) == -1) { temp = temp + letter; } //continue the loop continue; } //end for return temp; } function GotoURL(dl) { top.location.href = dl.droplist.options[dl.droplist.selectedIndex].value; } function clearText(thefield) { if (thefield.defaultValue==thefield.value) thefield.value = "" } function restoreText(thefield) { if(thefield.value == "") thefield.value = thefield.defaultValue } //history functions /** * Constructor */ function HistoryStack () { /** Current stack loaded in memory, which will also be cached to cookies. */ this.stack = new Array(); /** Pointer to current location in the history stack. */ this.current = -1; /** Max size of the history stack. */ this.stack_limit = 15; } /** * Return the name of the current resource in the * history stack. */ HistoryStack.prototype.getCurrent = function () { return this.stack[this.current]; }; /** * Add the resource to the next position after the "current" pointer. * If there are items existing past current, they will first be cut * off the end of the stack. The stack will also be truncated to * "stack_limit" if it has grown to large. */ HistoryStack.prototype.addResource = function(resource) { if (this.stack.length > 0) { this.stack = this.stack.slice(0, this.current + 1); } this.stack.push(resource); while (this.stack.length > this.stack_limit) { this.stack.shift(); } this.current = this.stack.length - 1; this.save(); }; HistoryStack.prototype.setResource = function(resource) { this.stack.pop(); this.stack.push(resource); this.save(); }; HistoryStack.prototype.removeResources = function(count) { if (this.stack.length >= count) { for (i=0;i<=count;i++) { this.stack.pop(); } } this.save(); }; /** * Handle navigation within the history stack. Any negative argument * will go backwards in the stack and positive arguments will go * forward. If zero is passed to the method, the page will be * reloaded. */ HistoryStack.prototype.go = function(increment) { // Go back... if (increment < 0) { this.current = Math.max(0, this.current + increment); // Go forward... } else if (increment > 0) { this.current = Math.min(this.stack.length - 1, this.current + increment); // Reload... } else { location.reload(); } this.save(); }; /** * Returns boolean value whether there is a previous * entry in the history stack. */ HistoryStack.prototype.hasPrev = function() { return (this.current > 0); }; /** * Returns boolean value whether there is a suceeding * entry in the history stack. */ HistoryStack.prototype.hasNext = function() { return (this.current < this.stack.length - 1 && this.current > -1); }; /** * Save the current history stack and pointer to cookies */ HistoryStack.prototype.save = function() { this.setCookie('CHStack', this.stack.toString()); this.setCookie('CHCurrent', this.current); }; /** * Load the history stack and pointer from cookies. */ HistoryStack.prototype.load = function() { var tmp_stack = this.getCookie('CHStack'); if (tmp_stack != '') { this.stack = tmp_stack.split(','); } var tmp_current = parseInt(this.getCookie('CHCurrent')); if (tmp_current >= -1) { this.current = tmp_current; } }; /** * Save a name/value pair as a browser cookie, to expire at * end of session. */ HistoryStack.prototype.setCookie = function(name, value) { var cookie_str = name + "=" + escape(value); document.cookie = cookie_str; }; /** * Retrieve a cookie value by the given name. */ HistoryStack.prototype.getCookie = function(name) { if (!name) return ''; var raw_cookies, tmp, i; var cookies = new Array(); raw_cookies = document.cookie.split('; '); for (i=0; i < raw_cookies.length; i++) { tmp = raw_cookies[i].split('='); cookies[tmp[0]] = unescape(tmp[1]); } if (cookies[name] != null) { return cookies[name]; } else { return ''; } }; function PerformSort(dl) { cmCreateManualLinkClickTag(dl.sortby.options[dl.sortby.selectedIndex].value, dl.sortby.options[dl.sortby.selectedIndex].text); if ( dl.sortby.options[dl.sortby.selectedIndex].value != "default" ) top.location.href = dl.sortby.options[dl.sortby.selectedIndex].value; }; //General purpose form submit for on change events to post a form function performSubmit(x) { x.submit(); } //Added by Clint 11/08 //Below is JS copied from Bizzare Voice Library for the Warning Modal windows. function spGetLocation(elementId) { var obj = document.getElementById(elementId); if (obj) { var w = obj.offsetWidth; var h = obj.offsetHeight; var posX = 0; var posY = 0; while (obj) { posX += obj.offsetLeft; posY += obj.offsetTop; obj = obj.offsetParent; } return {left:posX, top:posY, width:w, height:h}; } else { return {left:0, top:0, width:0, height:0}; } } var spPointerPosX = 0; var spPointerPosY = 0; function spGetMouseXY(e) { if (!e) { e = window.event; } if (document.documentElement && document.documentElement.scrollTop) { spPointerPosX = e.clientX + document.documentElement.scrollLeft; spPointerPosY = e.clientY + document.documentElement.scrollTop; } else if ((document.childNodes)&&(!document.all)&&(!navigator.taintEnabled)&&(!navigator.accentColorName)) { spPointerPosX = e.clientX; spPointerPosY = e.clientY; } else if (document.body) { spPointerPosX = e.clientX + document.body.scrollLeft; spPointerPosY = e.clientY + document.body.scrollTop; } else { spPointerPosX = e.pageX; spPointerPosY = e.pageY; } if (spPointerPosX <= 0) { spPointerPosX = 0; } if (spPointerPosY <= 0) { spPointerPosY = 0; } } window.document.onmousemove = spGetMouseXY; function spSetPos(theDiv, offsetX, offsetY) { if (offsetY == undefined) { offsetY = 0; } document.getElementById(theDiv).style.top = spPointerPosY-offsetY+"px"; document.getElementById(theDiv).style.left = spPointerPosX-offsetX+"px"; } function spToggleDivWithIEControlsFrame2(targetId, ieControlsFrameId2, ieControlsFrameTitle2) { if (document.getElementById(targetId).style.display=="block") { spCloseDivs(targetId, ieControlsFrameId2); } else { spExpandDivWithIEControlsFrame2(targetId, ieControlsFrameId2, ieControlsFrameTitle2); } } function spExpandDivWithIEControlsFrame2(targetId, ieControlsFrameId2, ieControlsFrameTitle2) { spOpenDivs(targetId); var isExplorer = document.all && ((navigator.userAgent.indexOf("MSIE 5.5") > -1)); if (isExplorer) { //var ieControlsFrame = document.getElementById(ieControlsFrameId2) if (!ieControlsFrame) { //ieControlsFrame=document.createElement('iframe'); //ieControlsFrame.id=ieControlsFrameId2; //ieControlsFrame.title=ieControlsFrameTitle2; //ieControlsFrame.src=""; //ieControlsFrame.scrolling="no"; //ieControlsFrame.frameBorder="0"; } //if(ieControlsFrame) { //var target = document.getElementById(targetId2); //Removed the following to fix IE6 quirk //if(target) { //target.parentNode.insertBefore(ieControlsFrame, target); //var targetLocation = spGetLocation(targetId2); //ieControlsFrame.style.width = targetLocation.width; //ieControlsFrame.style.height = targetLocation.height; //} //ieControlsFrame.style.filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)'; //spOpenDivs(ieControlsFrameId2); //} } } function spOpenDivs() { for (var i=0; i