//----------------------------------------------------------------------------------------------- //FORM CONTROLS //----------------------------------------------------------------------------------------------- function buttonON(obj) { obj.className = "controls_button_hover"; return; } function buttonOFF(obj) { obj.className = "controls_button"; return; } //----------------------------------------------------------------------------------------------- //FORM CONTROLS //----------------------------------------------------------------------------------------------- function openreqwindow() { var reqpage = 'supportrequest.aspx'; var siteroot = 'http://www.securelement.com/'; newCustomWindow(reqpage, 410, 445); } //----------------------------------------------------------------------------------------------- //POP UPS //----------------------------------------------------------------------------------------------- var icustomwindow; function newCustomWindow(file,width,height,resize) { window.open(file,"icustomwnd","toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,height=" + height + ",width=" + width + ",resizable=" + resize + ",screenx=" + (screen.availWidth - width)/2 + ",screeny=" + (screen.availHeight - height)/2 + ",left=" + (screen.availWidth - width)/2 + ",top=" + (screen.availHeight - height)/2); } function newCustomWindowFrame(file,width,height,resize) { window.open(file,"icustomwnd","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,height=" + height + ",width=" + width + ",resizable=" + resize + ",screenx=" + (screen.availWidth - width)/2 + ",screeny=" + (screen.availHeight - height)/2 + ",left=" + (screen.availWidth - width)/2 + ",top=" + (screen.availHeight - height)/2); } function openPopup(url,name,width,height) { var oWindow; oWindow = window.open( url, name,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=' + width + ',height=' + height ); return oWindow; } function openFlashDemo(url,name) { window.open( url, name,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=701,height=459' ); } function openSignupForm(url,name) { window.open( url, name,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=701,height=459' ); } function openSolutionTestimonial(url,name) { window.open( url, name,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=400,height=300' ); } function openDesktop(file,width,height) { var oWindow = openPopup('','desktop',width,height); oWindow.document.write( '' ); oWindow.document.write( ' ' ); oWindow.document.write( ' SecurElement Infrastructure Solutions Desktop' ); oWindow.document.write( ' ' ); oWindow.document.write( ' ' ); oWindow.document.write( ' ' ); oWindow.document.write( ' ' ); oWindow.document.write( '' ); } function openEvent(id) { var root = 'http://www.securelement.com/' var url = root + 'eventdetail.aspx?eventID=' + id window.open (url,'link','width=400,height=250,scrollbars,resizable=no') } function openStory(id) { var root = 'http://www.securelement.com/' var url = root + 'storydetail.aspx?storyID=' + id window.open (url,'link','width=400,height=250,scrollbars,resizable=no') } function getDirections(location) { var root = 'http://www.securelement.com/' var url = root + 'directions/' + location + '.aspx' window.open (url,'link','width=420,height=250,scrollbars,resizable=no') } function GetDate() { var d, today = '', day = ''; d = new Date(); today += (d.getMonth() + 1) + "/"; if (today.length == 2) today = "0" + today; day = d.getDate() + "/"; if (day.length == 2) { today += "0" + day; } else { today += day; } today += d.getFullYear(); return(today); } function ValidDate(strDate) { if (strDate == '') return true; var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{2}|\d{4})$/; var matchArray = strDate.match(datePat); if (matchArray == null) return false; month = matchArray[1]; day = matchArray[3]; year = matchArray[4]; if (month < 1 || month > 12) return false; if (day < 1 || day > 31) return false; if ((month==4 || month==6 || month==9 || month==11) && day==31) return false; if (month == 2) { var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)); if (day>29 || (day==29 && !isleap)) return false; } return true; } function ValidInput(strItemCode, strValue) { var RE = ''; switch (strItemCode) { case 'company': { RE = /^[a-zA-Z]+((-|'|\s|.)[a-zA-Z0-9]+)*$/; break; } case 'email': { RE = /^[_a-zA-Z0-9-]+((\.|')[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+$/; break; } case 'name': { RE = /^[a-zA-Z]+((-|'|\s)[a-zA-Z0-9]+)*$/; break; } } if (RE == '') return false; if (strValue.match(RE)) return true; else return false; } function CurrentDate(item) { eval("if (document.iform." + item + ".value == '') document.iform." + item + ".value = GetDate()"); }