//----------------------------------------------------------------------------------------------- //FORM CONTROLS //----------------------------------------------------------------------------------------------- function buttonON(obj) { obj.className = "controls_button_hover"; return; } function buttonOFF(obj) { obj.className = "controls_button"; return; } function SearchSummaryRowON(obj) { obj.className = "search_summary_row_hover"; return; } function SearchSummaryRowOFF(obj) { obj.className = "search_summary_row"; return; } //----------------------------------------------------------------------------------------------- //POP UPS //----------------------------------------------------------------------------------------------- function openEvent(id) { var root = 'http://www.cciconsulting.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.cciconsulting.com/' var url = root + 'storydetail.aspx?storyID=' + id window.open (url,'link','width=400,height=250,scrollbars,resizable=no') } function openHype(id) { var root = 'http://www.cciconsulting.com/' var url = root + 'hypedetail.aspx?hypeID=' + id window.open (url,'link','width=400,height=250,scrollbars,resizable=no') } function getDirections(location) { var root = 'http://www.cciconsulting.com/' var url = root + 'directions/' + location + '.aspx' window.open (url,'link','width=420,height=250,scrollbars,resizable=no') } var icustomwindow; function newCustomWindow(file,width,height) { if (icustomwindow != null && !icustomwindow.closed) icustomwindow.close(); icustomwindow = open('http://www.cciconsulting.com/' + file,"icustomwnd","height=" + height + ",width=" + width + ",resizable=no,scrollbars=yes,screenx=" + (screen.availWidth - width)/2 + ",screeny=" + (screen.availHeight - height)/2 + ",left=" + (screen.availWidth - width)/2 + ",top=" + (screen.availHeight - height)/2); if (icustomwindow.opener == null) icustomwindow.opener = self; } 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()"); }