campuszips103547 = Array('434','448'); campuszips110315 = Array('440','441','442'); var agt=navigator.userAgent.toLowerCase(); var is_major = parseInt(navigator.appVersion); var is_minor = parseFloat(navigator.appVersion); var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1)); var is_ie3 = (is_ie && (is_major < 4)); var is_ie4 = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) ); var is_ie5 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5") !=-1)); var is_ie6 = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) ); var is_ie7 = (is_ie && (is_major == 4) && (agt.indexOf("msie 7.")!=-1) ); ie_ver = 6; if(is_ie) ie_ver = 1; if(is_ie3) ie_ver = 3; if(is_ie4) ie_ver = 4; if(is_ie5) ie_ver = 5; if(is_ie6) ie_ver = 6; if(is_ie7) ie_ver = 7; grouping = ''; function getCampus(){ pos = document.forms[0].campus_key.length; if(typeof(pos) == "undefined"){ AddCampus("Sandusky","668"); AddCampus("Sheffield Village","669"); }else{ for(i = document.forms[0].campus_key.length-1; i >= 0;i--){ document.forms[0].campus_key.options[i] = null; } AddCampus("Select One:",""); AddCampus("Sandusky","668"); AddCampus("Sheffield Village","669"); } } function setCampus(){ pos = document.forms[0].campus_key.length; if(typeof(pos) != "undefined"){ if(document.forms[0].campus_key.length == 2){ document.forms[0].campus_key.selectedIndex = 1; }else{ document.forms[0].campus_key.value = GetQueryVariable("campus_key"); } } } function getProgram(){ pos = document.forms[0].program_key.length; if(typeof(pos) == "undefined"){ }else{ for(i = document.forms[0].program_key.childNodes.length-1; i >= 0;i--){ document.forms[0].program_key.removeChild(document.forms[0].program_key.childNodes.item(i)); } for(i = document.forms[0].program_key.length-1; i >= 0;i--){ document.forms[0].program_key.options[i] = null; } } validateCampus(); pos = document.forms[0].campus_key.length; if(typeof(pos) == "undefined"){ var the_selected = document.forms[0].campus_key.value; }else{ var the_index = document.forms[0].campus_key.selectedIndex; var the_selected = document.forms[0].campus_key.options[the_index].value; } grouping = ''; switch (the_selected){ case "": AddProgram("Please choose a campus","",""); break; case "668": AddProgram("Select One:","",""); AddProgram("Accounting","Accounting",""); AddProgram("Accounting Clerk","Accounting Clerk",""); AddProgram("Business Administration","Business Administration",""); AddProgram("Finance","Finance",""); AddProgram("Human Resource Management","Human Resource Management",""); AddProgram("Information Technology Computer Support","Information Technology Computer Support",""); AddProgram("Information Technology Office Support","Information Technology Office Support",""); AddProgram("IT Certifications","IT Certifications",""); AddProgram("Legal Assistant","Legal Assistant",""); AddProgram("Medical Administrative Assistant","Medical Administrative Assistant",""); AddProgram("Medical Office Specialist","Medical Office Specialist",""); AddProgram("Microsoft Office Specialist Certification","Microsoft Office Specialist Certification",""); AddProgram("Office Support Specialist","Office Support Specialist",""); AddProgram("PC Support Specialist","PC Support Specialist",""); AddProgram("Real Estate Pre-Licensing","Real Estate Pre-Licensing",""); break; case "669": AddProgram("Select One:","",""); AddProgram("Accounting","Accounting",""); AddProgram("Accounting Clerk","Accounting Clerk",""); AddProgram("Business Administration","Business Administration",""); AddProgram("Finance","Finance",""); AddProgram("Human Resource Management","Human Resource Management",""); AddProgram("Information Technology Computer Support","Information Technology Computer Support",""); AddProgram("Information Technology Office Support","Information Technology Office Support",""); AddProgram("IT Certifications","IT Certifications",""); AddProgram("Legal Assistant","Legal Assistant",""); AddProgram("Medical Administrative Assistant","Medical Administrative Assistant",""); AddProgram("Medical Assisting","Medical Assisting",""); AddProgram("Medical Office Specialist","Medical Office Specialist",""); AddProgram("Microsoft Office Specialist","Microsoft Office Specialist",""); AddProgram("Office Support Specialist","Office Support Specialist",""); AddProgram("PC Support Specialist","PC Support Specialist",""); break; } setProgram(); } function setProgram(){ if(document.forms[0].program_key.length == 2){ document.forms[0].program_key.selectedIndex = 1; }else{ $program_key_tmp = GetQueryVariable("program_key"); if( $program_key_tmp != '' ) { document.forms[0].program_key.value = $program_key_tmp; } } } function AddCampus(name,value){ pos = document.forms[0].campus_key.length; if(typeof(pos) == "undefined"){ document.forms[0].campus_key.value = value; }else{ document.forms[0].campus_key.options[pos] = new Option(name,value,false,false); } } function AddProgram(name,value,group){ pos = document.forms[0].program_key.length; if(typeof(pos) == "undefined"){ document.forms[0].program_key.value = value; }else{ if(ie_ver <= 5){ document.forms[0].program_key.options[document.forms[0].program_key.length] = new Option(name, value, false, false) }else{ var objOption = document.createElement("option"); objOption.innerHTML = name; objOption.value = value; if(group == ""){ document.forms[0].program_key.appendChild(objOption); }else{ if(group != grouping){ optGroup = document.createElement('optgroup'); optGroup.label = group; grouping = group; } optGroup.appendChild(objOption); document.forms[0].program_key.appendChild(optGroup); } } } } function GetQueryVariable(variable) { var query = window.location.search.substring(1); var vars = query.split("&"); for (var i=0;i -1){ rVal += "\n-Sandusky."; } if(zip != "" && BinarySearchCampus(campuszips110315,zip) > -1){ rVal += "\n-Sheffield Village."; } return rVal; } function USZip(zip){ if(!(zip.substr(0,1) >= '0' && zip.substr(0,1) <= '9')){ return false; } if(!(zip.substr(1,1) >= '0' && zip.substr(1,1) <= '9')){ return false; } if(!(zip.substr(2,1) >= '0' && zip.substr(2,1) <= '9')){ return false; } return true; } function CAZip(zip){ if(!(zip.substr(0,1) >= 'A' && zip.substr(0,1) <= 'Z') && !(zip.substr(0,1) >= 'a' && zip.substr(0,1) <= 'z')){ return false; } if(!(zip.substr(1,1) >= '0' && zip.substr(1,1) <= '9')){ return false; } if(!(zip.substr(2,1) >= 'A' && zip.substr(2,1) <= 'Z') && !(zip.substr(2,1) >= 'a' && zip.substr(2,1) <= 'z')){ return false; } return true; } function BinarySearchCampus(ArrayToSearch, SearchFor){ first = 0; last = ArrayToSearch.length - 1; mid = Math.floor((first + last) / 2); while((first <= last) && (ArrayToSearch[mid]!=SearchFor.toUpperCase())){ if(SearchFor.toUpperCase() < ArrayToSearch[mid]){ last = mid - 1; }else if(SearchFor.toUpperCase() > ArrayToSearch[mid]){ first = mid + 1; } mid = Math.floor((first + last)/2); } if(ArrayToSearch[mid] == SearchFor.toUpperCase()){ return mid; }else{ return -1; } } zipVal = GetQueryVariable('zip'); if(zipVal != '') { document.forms[vFormName].elements['zip'].value = zipVal; } getCampus(); setCampus(); getProgram(); setProgram();