function redirect(page) { window.location.href = page } function open_window(page,params) { window.open(page,"popup",params) } function reset_iframe(id,src) { var _frame = document.getElementById(id); _frame.src = src; } function IsNumeric(sText) { var ValidChars = "0123456789."; var IsNumber=true; var Char; for (i = 0; i < sText.length && IsNumber == true; i++) { Char = sText.charAt(i); if (ValidChars.indexOf(Char) == -1) { IsNumber = false; } } return IsNumber; } function stopBubbling(e) { if(!e) e = window.event; if(e.stopPropagation) e.stopPropagation(); if(e.preventDefault) e.preventDefault(); e.cancelBubble = true; e.cancel = true; e.returnValue = false; return false; } function default_button(btnID, e) { var btn = document.getElementById(btnID); if (document.all) { if (e.keyCode == 13) { stopBubbling(e) btn.click(); } } else if (document.getElementById || document.layers) { if (e.which == 13) { if( btn && btn.click ) { stopBubbling(e) btn.click(); } else if ( btn && btn.onclick ) { var temp = eval(btn.onclick); if( temp ) { stopBubbling(e) temp(e); } } } } } function ShowInternationalDealer(ddl) { var value = ddl[ddl.selectedIndex].value; if( value != '0' ) { open_window(value, 'redirect', 'width=500px, height=500px, resizable=1, scrollbars=1'); } } function FindLocalRetailer(tbx_zip, ddl_states, mBehaviorID, baseURL) { var zip = tbx_zip.value; var state = ddl_states[ddl_states.selectedIndex].value; if( (zip == '' || zip == 'zip' ) && state == '' ) { alert("Invalid Zip Code And State"); return false; } var m = $find(mBehaviorID); if( m ) { var url = baseURL + '?zip=' + zip + '&state=' + state m.set_dynamicContextKey('{src: ' + url + ', width: 800px, height: 600px;}'); m.show() } return true; } function EmailSignup(tbxID, modalID, baseURL, e) { var tbx = $get(tbxID); if( tbx ) { if( tbx.value == '' || tbx.value == 'enter email address' ) { stopBubbling(e) setTimeout('alert(\'Invalid Email Address\');', 100); return false; } else { OpenModal(modalID, baseURL + 'I_thanks.php?e=' + tbx.value, '610px', '300px', 'no') tbx.value = 'enter email address'; return true; } } } function SearchProducts(url, tbxSearchID) { var Query = $get(tbxSearchID).value; if( Query == '' || Query == 'find products') { alert('Invalid Search Criteria'); return false } redirect(url + '?q=' + Query); return false; } function ValidatePhoneParts(part1, part2, part3) { //Validate Part 1 if( part1.length != 3 || !IsNumeric(part1) ) { return false } //Validate Part 2 if( part2.length != 3 || !IsNumeric(part2) ) { return false } //Validate Part 3 if( part3.length != 4 || !IsNumeric(part3) ) { return false } return true; } function PhoneNumberAutoTab(tbx, nextTbxID, e) { var tbx_next = $get(nextTbxID); var sourceKeyCode = (e.keyCode) ? e.keyCode : e.charCode; if( sourceKeyCode != 9 && sourceKeyCode != 16) { if( tbx.value.length == tbx.maxLength ) { tbx_next.focus(); } } else { stopBubbling(e) } } /***IMAGE CACHING FUNCTIONS***/ function MM_swapImgRestore() { //v3.0 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