function ValidateEmailAddress( theAddress ) { var validDigits = "0123456789"; if (theAddress.value.length == 0) { return false } // end if if (theAddress.value.length > 0) { i = theAddress.value.indexOf("@"); j = theAddress.value.indexOf(".",i); k = theAddress.value.indexOf(","); kk = theAddress.value.indexOf(" "); jj = theAddress.value.lastIndexOf(".")+1; len = theAddress.value.length; aol = theAddress.value.substring(len-7,len).toLowerCase(); www = theAddress.value.substring(0,4).toLowerCase(); // for REAL idiots! if (!((i>0) && (j>(1+1)) && (k==-1) && (kk==-1) && (len-jj >=2) && (len-jj<=3) && (www!="www.") )) { return false; } // end if // AOL specific tests // // A valid AOL address can not: // -be shorter than 3 or longer than 10 characters (10 char limit lifted - 28-feb-2000 - jds) // -begin with numerals // -contain periods, underscores, dashes or other punctuation characters if (aol=="aol.com") { name = theAddress.value.substring(0,i); p = (name.indexOf(".")!=-1) || (name.indexOf(",")!=-1) || (name.indexOf("_")!=-1) || (name.indexOf("-")!=-1); n = (validDigits.indexOf(name.substring(0,1))!=-1); if ( (name.length<3) || (p) || (n) ) { return false; } // end if } // end else } // end if return true; } // validateemailaddress() function getParentByClassName(element, className) { var parent = element; if (className) { while (parent && parent.className != className) { parent = parent.parentNode; } } return parent; } function getFirstChildByClassRegex(element, tagName, classRegex, stopClassRegex) { var match; var child = element.firstChild; while (child != null && (!child.className || !child.className.match(stopClassRegex))) { if (child.tagName && child.tagName == tagName && child.className && child.className.match(classRegex)) { match = child; break; } else { match = getFirstChildByClassRegex(child, tagName, classRegex, stopClassRegex); if (match) { break; } } child = child.nextSibling; } return match; } function addEventToElement(target, eventType, func, useCapture) { var result = false; if (target.addEventListener) { target.addEventListener(eventType, func, useCapture); result = true; } else if (target.attachEvent) { result = target.attachEvent("on" + eventType, func); } else { alert("Handler could not be attached"); } return result; } function addEventToElements(targets, eventType, func, useCapture) { var result = true; for (var i = 0; i < targets.length; i++) { result &= addEventToElement(targets[i], eventType, func, useCapture); } return result; } function removeEventFromElement(target, eventType, func, useCapture) { var result = false; if (target.removeEventListener) { target.removeEventListener(eventType, func, useCapture); result = true; } else if (target.detachEvent) { result = target.detachEvent("on" + eventType, func); } else { alert("Handler could not be removed"); } return result; } function removeEventFromElements(targets, eventType, func, useCapture) { var result = true; for (var i = 0; i < targets.length; i++) { result &= removeEventFromElement(targets[i], eventType, func, useCapture); } return result; } function getEvent(event) { if (!event) { var event = window.event; } return event; } function getEventSource(event) { if (event.srcElement) { var source = event.srcElement; } else if (event.currentTarget) { var source = event.currentTarget; } else { alert("Event source not found!"); } return source; } var console = Console(); function Console() { this.canvas = null; this.println = consolePrintln; this.show = consoleShow; } function consolePrintln(object) { if (!this.canvas) { this.canvas = window.open("about:blank", "Console", "toolbar = no, width = 640, height = 480, directories = no, status = no, scrollbars = yes, resize = no, menubar = no"); } this.canvas.document.write(object); this.canvas.document.write("
"); } function consoleShow(object) { this.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); for (property in object) { this.println(property + " = " + eval("object." + property)); } this.println("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"); } // Wind tunnel pop-up function openWindTunnel() { window.open('/portal/DynamicContent/en_US/home/wind_tunnel_video.jsp','mywindow','width=300,height=250,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no,top=200,left=200'); } //Generic popup function openPopup(url) { window.open(url,'mywindow','width=300,height=250,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no,top=200,left=200'); } //Generic popup function openPopup(url, width, height) { window.open(url,'mywindow','width='+width+',height='+height+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no,top=200,left=200'); } //Generic window close function closeWindow() { window.opener = self; window.close(); } //Generic scrolling, resizeable popup function openScrollingResizeablePopup(url, width, height) { window.open(url,'mywindow','width='+width+',height='+height+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=yes,top=200,left=200'); } // Simulator directions pop-up function openSimDirections() { window.open('/portal/DynamicContent/en_US/home/simulator_directions.jsp','mywindow','width=500,height=475,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no,top=200,left=200'); } function doChanges(imgIndex,text) { //document.images['marketRollover'].src=CachedRolloverImages[imgIndex-1]; //document.getElementById("rollText").innerHTML=text; } function random() { var xRand = Math.round(5*Math.random()); document.images['random'].src = CachedImageNames[xRand]; } function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function handleLangForm() { var langCodesSelect = document.langForm.languageCodes; var si = langCodesSelect.selectedIndex; var selectedLanguage = langCodesSelect[si].value; var screenOut = "ko_KR"; screenOut = ""; if ( selectedLanguage == screenOut ) { document.location.href="http://www.korea.modine.com/"; } else { createCookie('prefLang',selectedLanguage,60); document.langForm.submit(); } } function openHVACWindow( pathEnd ) { window.open('/portal/DynamicContent' + pathEnd,'HVACWindow','width=600,height=565,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=no,top=75,left=200').focus(); } //Form validation methods 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 trim(str){ return str.replace(/^\s+|\s+$/g, '') }