var chooseDown = false; var collegesDown = false; var myProgramSource = new Array(); var myCollegeSource = new Array(); function validateForm() { var myProgramSelection = $("#form-search #ac-program").val(); var myCollegeSelection = $("#form-search #ac-college").val(); var collegeURL = "/colleges/index.php?college=" + myCollegeSelection; var programURL = "/programs/index.php?program=" + myProgramSelection; var program_list = JSON.parse('[\"Agribusiness and Applied Economics\",\"Agricultural Business & Management\",\"Agricultural Production\\/Farm & Ranch Management\",\"Agricultural Science, General\",\"Agricultural Systems Management\",\"Agriculture Sales & Service\\/Ag Industry & Technology\",\"Animal & Range Sciences\",\"Animal Health Management\",\"Bioinformatics and Computational Biology\",\"Biology, Fisheries and Wildlife\",\"Cereal Science\",\"Communications, Health\\/Agriculture\\/Management\",\"Crop & Weed Sciences\",\"Culinary Arts\",\"Earth System & Policy\",\"Energy Management\",\"Engineering, Environmental\",\"Entomology\",\"Environmental & Conservation Science\",\"Environmental Geoscience\",\"Environmental Technology\\/Lab & Field Tech\",\"Environmental Technology\\/Science\",\"Equine Science\",\"Floral Design & Greenhouse Technology\",\"Flowershop Technology\",\"Food Protection\",\"Food Safety\",\"Food Science\",\"Geographic Information System\",\"Geology\",\"Golf Course Grounds Technology\",\"Horticulture\",\"International Agribusiness\",\"Landscape Design\\/Technology\",\"Natural Resources Management\",\"Plant Pathology\",\"Plant Sciences\",\"Power Plant Technology\",\"Process Plant Technology\",\"Range Science\",\"Soil Science\",\"Studies in Community & Environment\",\"Sustainable Vegetable Production\",\"Therapeutic Riding\",\"Urban Forestry Technology\",\"Veterinary Technology\",\"Water and Wastewater Technology\",\"Wildlife & Fisheries Technology\\/Science\",\"Zoology\",\"Architectural Drafting & Estimating Technology\",\"Architecture\",\"Building Construction Technology\",\"Carpentry, Residential\",\"Construction Engineering\",\"Construction Management\",\"Construction Management Technology\",\"Environmental Design\",\"Heating, Ventilation and Air Conditioning\",\"Landscape Architecture\",\"Lineworker, Electrical\",\"Mechanical Systems\",\"Plumbing\",\"Sustainable Construction Technology\",\"Art\",\"Art Entrepreneurship\",\"Art, Graphic Design and Communications\",\"Arts, Visual\",\"Broadcasting\",\"Communications, General\\/Mass\",\"Digital Audio Production\",\"Graphic Design Technology\\/New Art Media\",\"Information Processing\",\"Interior Design\",\"Journalism\",\"Library and Information Technologies\",\"Music\",\"Music Composition\",\"Musical Theatre\",\"Public History\",\"Public Relations and Advertising\",\"Theater Arts\",\"Web Development\",\"Webmaster\\/Web Designer\",\"Writing & Editing\",\"Administration\\/Leadership, Educational\",\"American Sign Language & Interpretive Certification Training Program\",\"Autistic Spectrum Disorder\",\"Biology for Teachers\",\"Chemistry for Teachers\",\"Human Development & Family Science\",\"College Teaching\",\"Communication Disorders\\/Sciences and Disorders\",\"Communication Sciences & Disorders\",\"Community-Based Literacy as Applied Linguistics\",\"Corp Training and Performance ITD\",\"Counseling and Guidance\",\"Counselor Education and Supervision\",\"Digital Enterprise\",\"Early Childhood\\/Special Education\",\"Education\",\"Education Foundation & Research\",\"Education, Art\",\"Education, Biological Sciences\",\"Education, Business\",\"Education, Career & Technical\",\"Education, Chemistry\",\"Education, Communication\",\"Education, Composite Chemistry\",\"Education, Composite Science\",\"Education, Early Childhood\",\"Education, Earth Sciences\",\"Education, Elementary\",\"Education, English\",\"Education, Family & Consumer Sciences\",\"Education, Foreign Language\",\"Education, General Studies\",\"Education, Geography\",\"Education, Health\",\"Education, History\",\"Education, Industrial Arts\\/Technology\",\"Education, Life & Physical Sciences\",\"Education, Mathematics\",\"Education, Middle\\/High Level\",\"Education, Music\",\"Education, Nursing\",\"Education, Physical\",\"Education, Public Health\",\"Education, Reading\",\"Education, Social Science\\/Social Studies\",\"Education, Speech and Theater\",\"Education, Technology\",\"eLearning\",\"English Language Learners\",\"English\\/Practical Writing\\/Rhetoric, Writing, Culture\",\"Food and Nutrition\\/Community Nutrition\",\"General Studies\",\"Health Ed\\/Community; School\",\"Higher Education\",\"Human Services: Intellectual and Developmental Disabilities\",\"K-12 Technology Integration ITD\",\"Language, Foreign & Classical\",\"Linguistics\",\"Middle School Science & Engineering for Teachers\",\"Paraeducation\",\"Physical Education, Exercise Science and Wellness\",\"Physics for Teachers\",\"School Psychology\",\"STEM Education\",\"Social Science\",\"Special Education\",\"Special Education\\/Early Childhood\",\"Special Education\\/Emotional\",\"Special Education\\/Learning Disabilities\",\"Special Education\\/Strategist\",\"Specific Learning Disabilities\",\"Speech Communication\",\"Speech-Language Pathology\",\"Speech-Language Pathology Assistant\",\"Women and Gender Studies\",\"Studies, Indian\",\"Studies, International\",\"Teaching & Learning\",\"Teaching English Language Learners\",\"Transfer\\/Pre-Professional\\/University Parallel\",\"Accountancy\",\"Accounting\",\"Accounting & Computing\",\"Banking & Finance\",\"Bookkeeping\",\"Business Economics\\/Economics\\/Applied Economics\",\"Economics\\/Applied Economic\",\"Family Financial Planning\",\"Finance\",\"Managerial Finance and Accounting\",\"Addiction Studies\",\"Administrative Assistant\\/Health Information Management\",\"Administrative Assistant\\/Medical\",\"Advanced Nursing Practice\",\"Athletic Training\\/Corporate Fitness\\/Human Performance & Fitness\",\"Behavioral Statistics\",\"Caregiver Services\",\"Clinical Lab Science\",\"Conflict Transformation\",\"Couple and Family Therapy\",\"Cytotechnology\",\"Dental Assisting\",\"Dental Hygiene\",\"Developmental Sciences\",\"Dietetics\",\"EMT - Paramedic Technology\",\"Exercise Science\\/Leisure Studies\\/Sports Management\",\"Fitness & Wellness\",\"Fitness Trainer and Technician\",\"Gerontology\",\"Health Administration\",\"Health Information\\/Technician\\/Management\",\"Health Science\",\"Histotechnician\",\"Kinesiology\",\"Managerial Psychology\",\"Massage Therapy\",\"Medical Assistant\",\"Medical Coding\",\"Medical Lab Science\",\"Medical Laboratory Technician\",\"Medical Transcription\",\"Medicine (Physicians)\",\"Mental Health Care Associate\",\"Nurse Assistant\",\"Nurse Practitioner\\/Specialist\",\"Nursing Administration\",\"Nursing, Practical\",\"Nursing, Registered\",\"Nutrition\",\"Occupational Safety and Environmental Health\",\"Occupational Therapy\",\"Occupational Therapy Assistant\",\"Paramedic (EMT) Technology\",\"Pharmaceutical Sciences\",\"Pharmacy\",\"Pharmacy Technician\",\"Phlebotomy Technician\",\"Physical Therapy\",\"Psychology, Clinical\",\"Psychology, Counseling\",\"Psychology\\/Applied Psychology\\/Experimental\",\"Public Health\",\"Radiologic Technology\\/Sciences\",\"Recreation Management, Sports and Recreational Studies\",\"Speech-Language Hearing Sciences\",\"Surgical Technology\",\"Hotel\\/Restaurant\\/Hospitality\\/Tourism Management\",\"Recreation Management, Sports and Recreational Leadership\",\"Anthropology\",\"Community Management\\/Development\",\"Eligibility Worker\",\"Forensic Psychology\",\"Human Services\",\"Philosophy \\/Humanities\",\"Policy Analysis\",\"Psychology\\/Applied Psych\\/Experimental\",\"Rehabilitation & Human Services\",\"Social Work\",\"Sociology\",\"Application Software Specialist\",\"Computer Information Systems\",\"Computer Science\\/Programming\",\"Computer Support Specialist\",\"Computer Systems Tech\",\"Computer Technology Management\",\"Computerized Office Management\",\"Customer Relationship Management\",\"Computer Engineering\",\"Enterprise Applications\",\"Information Assurance\\/Network Security\",\"Information Systems\",\"Information Technology\",\"Knowledge Management\",\"Management Information Systems\\/Information Tech\",\"New Media and Web Design\",\"Petroleum Engineering Technology\",\"Petroleum Production Technology\",\"Software Engineering\",\"Webmaster\\/Web Designer\\/Development & Design\",\"Criminal Justice\\/Studies\",\"Emergency Management\",\"Forensic Science\",\"Indian Law\",\"Law (J.D.)\",\"Law Enforcement\",\"Paralegal\\/Legal Assistant\",\"Peace Officer\",\"Police Management & Investigation\",\"Private Security Officer\",\"US Air Transportation Policy\",\"Administrative Assistant\",\"Advertising and Marketing\",\"Applied Management\",\"Business Administration & Management\",\"Business and Management, General\\/Applied\",\"Business Integration Management\",\"Energy Management\\/Economics & Finance\",\"Entrepreneurship\",\"Human Resources Development\\/Management\",\"International Business\",\"Legal\",\"Management\",\"Managerial Finance & Accounting\",\"Marketing\",\"Marketing Management\",\"Medical\",\"Merchandising\",\"Nonprofit Leadership\",\"Office Supervision & Management\",\"Public Administration\",\"Reception Services\",\"Small Business Management\",\"Social Entrepreneurship\",\"Sports Management\",\"Statistics\",\"Auto Body Repair\",\"Automotive Technology\",\"Caterpillar Dealer Service\",\"Diesel Technology\",\"Electrical Technology\",\"Electronics\\/Telecommunications Technology\",\"Engineering & Surveying Technology, Civil\",\"Engineering Technician\",\"Heating, Ventilation, Air Conditioning and Refrigeration Technology\",\"Industrial Technology\\/Mechanical Maintenance Technology\",\"John Deere Ag Technology\",\"Materials and Nanotechnology\",\"Mechanics, Automotive\",\"Micromanufactoring Technology\",\"Nanoscience Technology\",\"Nuclear Power Technology\",\"Petroleum Automation and Control\",\"Precision Machining Technology\",\"Recreational Engines Technology\",\"Technical Studies\",\"Welding\",\"Wind Energy Technician\",\"Apparel, Merchandising, and Design\",\"Marketing\\/Marketing Management\",\"Professional Selling\",\"Aeronautics\",\"Aerospace Sciences\",\"Airport\\/Aviation Management\",\"Anatomy\",\"Atmospheric Sciences\\/Studies\",\"Aviation\",\"Bioinformatics & Computational Biology\",\"Biology\",\"Biology, Cell & Molecular\",\"Biomedical Engineering\",\"Biotechnology\",\"Botany\",\"Chemistry\",\"Earth\\/Environmental Science\",\"Economics\\/Applied Economics\",\"Engineering and Management, Industrial\",\"Engineering, Agricultural & Biosystems\",\"Engineering, Chemical\",\"Engineering, Civil\",\"Engineering, Electrical\",\"Engineering, Electrical & Computer\",\"Engineering, General\",\"Engineering, Geological\",\"Engineering, Manufacturing\",\"Engineering, Mechanical\",\"Engineering, Petroleum\",\"Engineering, Sustainable Energy\",\"Engineeringand Surveying Technology, Civil\",\"Environmental Technology\",\"Genomics and Bioinformatics\",\"Geographic Information Science\",\"Geography\",\"Greenhouse Technology\",\"Land Surveying and Civil Engineering Technology\",\"Mathematics\",\"Microbiology\",\"Microelectronics Technology\",\"Molecular Pathogenesis\",\"Pharmacology, Physiology & Therapeutics\",\"Physical Science\",\"Physics\",\"Political Science\",\"Renewable Generation Technology\",\"Science, General\",\"Scientific Computing\",\"Simulator Maintenance Technology\",\"Space Studies\",\"Airport\\/Aviation Technology Management\",\"Supply Chain Management\",\"Transportation and Urban Systems\",\"Truck Driving\",\"Agricultural Economics\",\"General Agriculture\",\"Sports and Urban Turfgrass Management\",\"Agriculture Communication\",\"English\",\"French\",\"Spanish\",\"Management Communication\",\"Education, French\",\"Education, Physics\",\"Education, Spanish\",\"Respiratory Care\",\"History\",\"Precision Agriculture\",\"Education, Speech-Language Pathology\",\"Photography\",\"Pre-Engineering\",\"Child Development Associate\",\"Paraprofessional Educator Early Childhood\",\"Exercise Science and Nutrition\",\"Exercise Science\",\"Land Management\",\"Applied Statistics\",\"Transportation and Logistics\",\"Veterinary Science\"]'); if ( myProgramSelection != '') { for( var i = 0; i < program_list.length; i++ ) { if( myProgramSelection.toLowerCase() == program_list[i].toLowerCase() ) { var programURL = "/colleges/index.php?program=" + myProgramSelection; break; } } $('#form-search').attr( 'action',programURL ); $('#form-search').submit(); } else if ( myCollegeSelection != '' ) { $('#form-search').submit(); } return false; } function programdata() { xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if(xmlhttp.readyState == 4 && xmlhttp.status == 200) { var data = xmlhttp.responseText; var source = data.split('\n'); for (var i = 0; i < source.length; i++) { myProgramSource.push( { label: source[i], //value: '/colleges/index.php?program=' + encodeURIComponent(source[i]) } ); } } } xmlhttp.open("POST","/autocomplete.php?source=programs",true); xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); xmlhttp.send(); } function collegedata() { xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if(xmlhttp.readyState == 4 && xmlhttp.status == 200) { var data = xmlhttp.responseText; var source = data.split('\n'); for (var i = 0; i < source.length; i++) { myCollegeSource.push( { label: source[i], //value: '/colleges/index.php?college=' + encodeURIComponent(source[i]) } ); } } } xmlhttp.open("POST","/autocomplete.php?source=schools",true); xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); xmlhttp.send(); } /* $(function() { $( "#form-search #ac-program" ).autocomplete({ source: myProgramSource, select: function( event, ui ) { window.location.href = ui.item.value; } }); $( "#form-search #ac-college" ).autocomplete({ source: myCollegeSource, select: function( event, ui ) { window.location.href = ui.item.value; } }); });*/ $(document).ready(function() { $('a[href=#top]').click(function(){ $('html, body').animate({scrollTop:0}, 'slow'); return false; }); $('.program-anchors a').click(function(){ $('html, body').animate({scrollTop: $( $.attr(this, 'href') ).offset().top -100}, 'slow'); return false; }); $( "#form-search #ac-program" ).click(function() { if (jQuery("#form-search #ac-program").data('autocomplete')) { jQuery("#form-search #ac-program").autocomplete("destroy"); jQuery("#form-search #ac-program").removeData('autocomplete'); } programdata(); $( "#form-search #ac-program" ).autocomplete({ source: myProgramSource, select: function( event, ui ) { //window.location.href = ui.item.value; window.location.href = '/colleges/index.php?program=' + encodeURIComponent(ui.item.label); } }); }); $( "#form-search #ac-college" ).click(function() { if (jQuery("#form-search #ac-college").data('autocomplete')) { jQuery("#form-search #ac-college").autocomplete("destroy"); jQuery("#form-search #ac-college").removeData('autocomplete'); } collegedata(); $( "#form-search #ac-college" ).autocomplete({ source: myCollegeSource, select: function( event, ui ) { //window.location.href = ui.item.value; window.location.href = '/colleges/index.php?college=' + encodeURIComponent(ui.item.label); } }); }); // autocomplete //$("#form-search #ac-college").autocomplete('/autocomplete.php?source=schools', { minChars: 0, delay: 0, maxCacheLength: 1000 }); //$("#form-search #ac-program").autocomplete('/autocomplete.php?source=programs', { minChars: 0, delay: 0, maxCacheLength: 1000 }); $('#form-search input[type=button]').click( function() { //$('#form-search').submit(); validateForm(); }); $('#form-search input[type=text]').keypress(function (e) { if (e.which == 13) { //$('#form-search').submit(); validateForm(); } }); $("#form-search #ac-program").click( function() { validateForm(); /*var mySelection = $("#form-search #ac-program").val(); if ( mySelection != '') { var base_url = window.location.origin; window.location.assign( base_url + '/programs/index.php?program=' + mySelection); }*/ }); $("#form-search #ac-college").click( function() { var mySelection = $("#form-search #ac-college").val(); if ( mySelection != '') { $('#form-search').submit(); } }); //$("#form-search-mobile #ac-college").autocomplete('/autocomplete.php?source=schools', { minChars: 0, delay: 0, maxCacheLength: 1000 }); //$("#form-search-mobile #ac-program").autocomplete('/autocomplete.php?source=programs', { minChars: 0, delay: 0, maxCacheLength: 1000 }); $('#form-search-mobile input[type=button]').click( function(){ $('#form-search-mobile').submit(); } ); $('#form-search-mobile input[type=text]').keypress(function (e) { if (e.which == 13) { $('#form-search-mobile').submit(); } }); //mobile menu $( "#mobile-menu" ).click(function() { $( "#open" ).fadeIn( "fast", function() { $("#mobile-menu" ).hide(); $("#close" ).show(); }); }); $( "#close" ).click(function() { $( "#open" ).fadeOut( "fast", function() { $("#close" ).hide(); $("#mobile-menu" ).show(); }); }); // parallax on ports if( $('#port').length > 0 ) { $('.parallax-layer').parallax({ mouseport: $("#port") }); $('.parallax-layer').parallax({ mouseport: $("#port-two") }); $('.parallax-layer').parallax({ mouseport: $("#port-three") }); $('.parallax-layer').parallax({ mouseport: $("#port-four") }); } //college pages facts //$( "#fact, #fact-two, #fact-three, #fact-four" ).click(function() { //$(this).next().fadeIn( "fast", function() { //$(this).prev().hide(); //}); //}); //$( "#fact-open, #fact-two-open, #fact-three-open, #fact-four-open" ).click(function() { //$(this).next().fadeIn( "fast", function() { //$(this).prev().hide(); //}); //}); $( "#fact" ).click(function() { $( "#fact-open" ).fadeIn( "fast", function() { $("#fact" ).hide(); }); }); $( "#fact-open" ).click(function() { $( "#fact" ).fadeIn( "fast", function() { $("#fact-open" ).hide(); }); }); $( "#fact-two" ).click(function() { $( "#fact-two-open" ).fadeIn( "fast", function() { $("#fact-two" ).hide(); }); }); $( "#fact-two-open" ).click(function() { $( "#fact-two" ).fadeIn( "fast", function() { $("#fact-two-open" ).hide(); }); }); $( "#fact-three" ).click(function() { $( "#fact-three-open" ).fadeIn( "fast", function() { $("#fact-three" ).hide(); }); }); $( "#fact-three-open" ).click(function() { $( "#fact-three" ).fadeIn( "fast", function() { $("#fact-three-open" ).hide(); }); }); $( "#fact-four" ).click(function() { $( "#fact-four-open" ).fadeIn( "fast", function() { $("#fact-four" ).hide(); }); }); $( "#fact-four-open" ).click(function() { $( "#fact-four" ).fadeIn( "fast", function() { $("#fact-four-open" ).hide(); }); }); //video homepage /*$(".various").fancybox({ maxWidth : 800, maxHeight : 600, fitToView : false, width : '70%', height : '70%', autoSize : false, closeClick : false, openEffect : 'none', closeEffect : 'none' }); $(".vimeo").fancybox({ width: 700, height: 394, type: 'iframe', fitToView : false });*/ //chart homepage $('#fancybox-manual-b').click(function() { $.fancybox.open({ href : '/chart/index.html', type : 'iframe', padding : 0 }); }); // dropdown search $( '#choose' ).click(function() { chooseDown = true; if(collegesDown) $( '#schools' ).mouseleave(); $('#search').slideDown( 'fast' ); $('#choose').slideUp( 'fast' ); }); $( '#search #minus' ).click(function() { chooseDown = false; $('#choose').slideDown( 'fast' ); $('#search').slideUp( 'fast' ); }); // colleges menu $('#colleges').mouseenter(function() { collegesDown = true; if( chooseDown ) $( '#search #minus' ).click(); $( '#schools' ).slideDown( 'fast' ); }); $('#schools').mouseleave(function() { collegesDown = false; $(this).slideUp( 'fast' ); }); $('#colleges').prev().mouseenter(function() { if(collegesDown) $( '#schools' ).mouseleave(); }); $('#colleges').next().mouseenter(function() { if(collegesDown) $( '#schools' ).mouseleave(); }); // home content function initSection(sectionName) { $('#' + sectionName).click(function() { $( '#' + sectionName + '-ex' ).slideToggle( 'fast', function() { $('#' + sectionName).hide(); }); }); $( '#' + sectionName + '-ex' ).click(function() { $( '#' + sectionName ).show( 'fast', function() { $('#' + sectionName + '-ex' ).hide(); }); }); } var sections = new Array( 'beaker', 'pilot', 'arms', 'classroom', 'mechanic', 'grass', 'smile', 'connect', 'glasses', 'science', 'aid' ); for(ii = 0; ii < sections.length; ii++) initSection(sections[ii]); });