function popup(mypage, myname, w, h, scroll) { var winl = (screen.width - w) / 2; var wint = (screen.height - h) / 2; winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable' win = window.open(mypage, myname, winprops) if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); } } function ValidateForm(formname) { var x; var alertmsg; x=0; alertmsg = "The following fields are required: "; if(formname=="join.asp") { if (document.form.company.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Company";x = x + 1;} if (document.form.contact.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Contact";x = x + 1;} if (document.form.title.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Title";x = x + 1;} if (document.form.address.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Address";x = x + 1;} if (document.form.city.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "City";x = x + 1;} if (document.form.state.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "State";x = x + 1;} if (document.form.zip.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Zip";x = x + 1;} if (document.form.phone.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Phone";x = x + 1;} if (document.form.email.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Email";x = x + 1;} if (document.form.btype.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Type";x = x + 1;} if (document.form.bclass.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Classification";x = x + 1;} if (document.form.employees.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Employees";x = x + 1;} if (document.form.professionals.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Professionals";x = x + 1;} } if(formname=="register.asp") { if (document.form.contact.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Name";x = x + 1;} if (document.form.email.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Email";x = x + 1;} } if(formname=="request.asp") { if (document.form.name.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Name";x = x + 1;} if (document.form.address.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Address";x = x + 1;} if (document.form.city.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "City";x = x + 1;} if (document.form.state.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "State";x = x + 1;} if (document.form.zip.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Zip";x = x + 1;} if (document.form.email.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Email";x = x + 1;} } if(formname=="contact.asp") { if (document.form.name.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Name";x = x + 1;} if (document.form.email.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Email";x = x + 1;} if (document.form.subject.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Subject";x = x + 1;} if (document.form.body.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Body";x = x + 1;} } if(formname=="uclaapp.asp") { if (document.form.name.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Name";x = x + 1;} if (document.form.nickname.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Friends Call Me";x = x + 1;} if (document.form.photo.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Photo";x = x + 1;} if (document.form.email.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Email";x = x + 1;} if (document.form.dob.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Date of Birth";x = x + 1;} if (document.form.sex.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Sex";x = x + 1;} if (document.form.race.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Race";x = x + 1;} if (document.form.school.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "School";x = x + 1;} if (document.form.grade.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Grade";x = x + 1;} if (document.form.phone.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Phone";x = x + 1;} if (document.form.address.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Address";x = x + 1;} if (document.form.parent.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Parent";x = x + 1;} if (document.form.code.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Code";x = x + 1;} } if(formname=="submitevent.asp") { if (document.form.name.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Name";x = x + 1;} if (document.form.phone.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Phone";x = x + 1;} if (document.form.email.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Email";x = x + 1;} if (document.form.org.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Organization";x = x + 1;} if (document.form.date.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Date";x = x + 1;} if (document.form.time.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Time";x = x + 1;} if (document.form.event.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Event";x = x + 1;} if (document.form.details.value == ""){if (x > 0){alertmsg = alertmsg + ", ";}alertmsg = alertmsg + "Details";x = x + 1;} } if (x == 0) { document.form.submit(); } else { alert(alertmsg); return false; } } function GetDirections() { var x; var alertmsg; x=0; alertmsg = "The following fields are required: "; if (document.form1.location.value == "") { if (x > 0){alertmsg = alertmsg + ", ";} alertmsg = alertmsg + "Location"; x = x + 1; } if (document.form1.fromstreet.value == "") { if (x > 0){alertmsg = alertmsg + ", ";} alertmsg = alertmsg + "Your Street"; x = x + 1; } if (document.form1.fromzip.value == "") { if (x > 0){alertmsg = alertmsg + ", ";} alertmsg = alertmsg + "Your Zip"; x = x + 1; } if (x == 0) { document.form1.submit(); } else { alert(alertmsg); return false; } } function borderit(which,color){ if (document.all||document.getElementById) { which.style.borderColor=color; } } function ShowSlide(direction,slidecount) { var thisslide = 0; thisslide = parseInt(document.getElementById("slide").value) + direction; if (thisslide < 0){thisslide = slidecount - 1;} if (thisslide > slidecount - 1){thisslide = 0;} document.getElementById("slide").value = thisslide; document.getElementById("simage").src = "http://www.visitnewalbany.com/images/tour/" + tourpics[thisslide][0]; document.getElementById("sname").innerHTML = tourpics[thisslide][1]; document.getElementById("stext").innerHTML = tourpics[thisslide][2]; } function ValidateApp() { var tcode = document.getElementById("code").value; var tid = document.getElementById("timage").value; var xmlUrl = "include/ucla.asp?tcode="+tcode+"&tid="+tid; createXMLHttpRequest(); xmlHttp.onreadystatechange = handleStateChange; xmlHttp.open("GET",xmlUrl,true); xmlHttp.send(null); } function handleStateChange() { if(xmlHttp.readyState==4) { if(xmlHttp.status==200) { GetAppResults(); } } } function GetAppResults() { var results = xmlHttp.responseXML; var iItem = null; var iItemValue; var iItems = results.getElementsByTagName("result"); iItemValue = iItems[0].getElementsByTagName("tresponse")[0].firstChild.nodeValue; if(iItemValue == "ok") { } else { alert(iItemValue); document.getElementById("code").value = ""; document.getElementById("code").focus(); } } function ValidateEmail() { var temail = document.getElementById("email").value; var xmlUrl = "include/email.asp?temail="+temail; createXMLHttpRequest(); xmlHttp.onreadystatechange = handleStateChangeEmail; xmlHttp.open("GET",xmlUrl,true); xmlHttp.send(null); } function handleStateChangeEmail() { if(xmlHttp.readyState==4) { if(xmlHttp.status==200) { GetEmailResults(); } } } function GetEmailResults() { var results = xmlHttp.responseXML; var iItem = null; var iItemValue; var iItems = results.getElementsByTagName("result"); iItemValue = iItems[0].getElementsByTagName("tresponse")[0].firstChild.nodeValue; if(iItemValue == "ok") { } else { alert(iItemValue); document.getElementById("email").focus(); } } function createXMLHttpRequest() { if(window.ActiveXObject) { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } else if (window.XMLHttpRequest) { xmlHttp = new XMLHttpRequest(); } }