// JavaScript Document

// Parser
function callbk(text) { <!--4.) Good:TEXT(1)-->
    document.getElementById('showSetRightTextID').innerHTML = text;
}
// Body maps specific
function map() {
	doAjax('bodyMaps/map_to_nis2.php','','callbk','post','0', 'showSetRightTextID'); // Right
	callAHAH('bodyMaps/maptoNIS.html','showtime', 'Please wait -- updating content...'); // Left
}
function vision() {
	doAjax('bodyMaps/vision_image.html','','callbk','post','0', 'showSetRightTextID'); // Right
	callAHAH('bodyMaps/vision.html','showtime', 'Fithching Vision and Mission -- Please wait...'); // Left
}
function ad3() {
	doAjax('bodyMaps/ad3_image.htm','','callbk','post','0', 'showSetRightTextID'); // Right
	callAHAH('bodyMaps/ad3_text.htm','showtime', 'Please wait -- Requesting server data...'); // Left
}
function ad3_2() {
	/*doAjax('bodyMaps/ad3_image.htm','','callbk','post','0', 'showSetRightTextID'); // Right*/
	callAHAH('bodyMaps/ad3_text2.htm','showtime', 'Please wait -- Requesting server data...'); // Left
}

function toTop() { // #################### Optional: Not yet implemented ####################
	callAHAH('toTop','topToTop', 'Please wait -- Requesting server data...');
}
function relatedLinks() { // #################### Optional: Related links ####################
	doAjax('page/home/links.html','','callbk','post','0', 'showSetRightTextID');
}
// Home Menu Specific
function getNewsBulletin() { // NEWS/BULLETIN
	doAjax('page/1/1_image.html','','callbk','post','0', 'showSetRightTextID'); // Right
	callAHAH('page/1/1_text.html','showtime', 'Please wait -- NEWS/BULLETIN data...'); // Left
}
function CompanyInAFlash() { // NIS IN FLASH
	doAjax('page/1/2_image.html','','callbk','post','0', 'showSetRightTextID'); // Right
	callAHAH('page/1/2_text.html','showtime', 'Please wait -- Requesting server data...'); // Left
}
function goingToCompany() { // GOING TO NIS
	doAjax('page/home/virtual_tour_image.html','','callbk','post','0', 'showSetRightTextID'); // Right
	callAHAH('page/home/virtual_tour_text.html','showtime', 'Please wait -- Requesting server data...'); // Left
}
function mapToNIS() { // MAP TO NIS :::::::::Formerly: getServerMap()
	map();
}
function ps() { // PROSPECTIVE STUDENTS
	prospectiveStudents();
}

// About NIS Specific
function visionMission() { // VISION MISSION
	vision();
}

function administration() { // ADMINISTRATION
	doAjax('page/about_us/administration_image.html','','callbk','post','0', 'showSetRightTextID'); // Right
	callAHAH('page/about_us/administration.html','showtime', 'Please wait -- Requesting server data...'); // Left
}
function admission() {
	doAjax('page/about_us/administration_image.html','','callbk','post','0', 'showSetRightTextID'); // Right
	callAHAH('page/about_us/admission.html','showtime', 'Please wait -- Requesting server data...'); // Left	
}
function classroom() {
	doAjax('page/about_us/history_image.html','','callbk','post','0', 'showSetRightTextID'); // Right
	callAHAH('page/about_us/classroom.html','showtime', 'Please wait -- Requesting server data...'); // Left	
}
//####################################FINISED UNTIL HERE##################################################
function offices() { // OFFICES
	doAjax('page/about_us/offices_image.html','','callbk','post','0', 'showSetRightTextID'); // Right
	callAHAH('page/about_us/offices.html','showtime', 'Please wait -- Requesting server data...'); // Left
}
function facilities() { // FACILITIES
	doAjax('page/about_us/facilities_image.html','','callbk','post','0', 'showSetRightTextID'); // Right
	callAHAH('page/about_us/facilities.html','showtime', 'Please wait -- Requesting server data...'); // Left
}
function transferees() { // TRANSFEREES
	doAjax('page/home/bulletin_image.html','','callbk','post','0', 'showSetRightTextID'); // Right
	callAHAH('page/about_us/transferees.html','showtime', 'Please wait -- Requesting server data...'); // Left
}

// Admission Specific
function policiesAndProcedures() { // POLICIES PROCEDURES
	doAjax('page/admission/policies_and_procedures_image.html','','callbk','post','0', 'showSetRightTextID'); // Right
	callAHAH('page/admission/policies_and_procedures.php','showtime', 'Please wait -- Requesting server data...'); // Left
}
function applicationForms() { // APPLICATION FORMS
	callAHAH('page/admission/application_forms.html','showtime', 'Please wait - page updating ...');
}
function onlineEnrollment() { // ENROLLMENT '
	//alert('ASDFASDF');
	callAHAH('page/interactive/onlineEnrollment.html','showtime', 'Please wait - page updating ...');
	//doAjax('page/admission/policies_and_procedures_image.html','','callbk','post','0', 'showSetRightTextID');
}
function register() { // p
	callAHAH('page/interactive/register.html','showtime', 'Please wait - page updating ...');
}
function grants() { // GRANTS
	callAHAH('page/admission/grants.html','showtime', 'Please wait - page updating ...');
}
function brochures() { // ENROLLMENT BROCHURES
	callAHAH('page/admission/enrollment_brochures.html','showtime', 'Ficthing Brochure ...');
}
function ts() { // TRANSFEREES
	transferees();
}

// Campus Life Specific
function forum() { // STUDENT FORUM

}
function culture() { // CULTURE
	doAjax('page/campus_life/culture_image.html','','callbk','post','0', 'showSetRightTextID'); // Right
	callAHAH('page/campus_life/culture_text.html','showtime', 'Please wait -- Requesting server data...'); // Left	
}
function athletics() { // ATHLETICS
	doAjax('page/campus_life/athletics_image.html','','callbk','post','0', 'showSetRightTextID'); // Right
	callAHAH('page/campus_life/athletics_text.html','showtime', 'Please wait -- Requesting server data...'); // 	
}
function guidanceCounselling() { // GUIDANCE COUNSELLING
	doAjax('page/campus_life/guidance_counselling_image.html','','callbk','post','0', 'showSetRightTextID'); // Right
	callAHAH('page/campus_life/guidance_counselling_text.html','showtime', 'Please wait -- Requesting server data...'); // 
}
function library() { // LIBRARY
	doAjax('page/campus_life/library_image.html','','callbk','post','0', 'showSetRightTextID'); // Right
	callAHAH('page/campus_life/library_text.html','showtime', 'Please wait -- Requesting server data...'); //
}
function as() { // ADMISSION
	admission();
}

// Services Life Specific
function email() { // EMAIL ==> <a href="/final.php?option=com_roundcube
	
}
function studentLogin() { // STUDENT LOGIN ==> change to login() or change to whatever is right
// page/interactive/loginSection.html
	//doAjax('page/campus_life/library_image.html','','callbk','post','0', 'showSetRightTextID'); // Right
	callAHAH('page/interactive/loginSection.html','showtime', 'Please wait -- Requesting server data...'); //
}
function enrollmentInfo() { // ONLINE ENROLLMENT
	callAHAH('page/interactive/enrollment_info.html','showtime', 'Please wait -- Requesting server data...'); //
}
function studentInfo() { // STUDENT INFO
	callAHAH('page/interactive/studentInfo.html','showtime', 'Please wait -- Requesting server data...'); //
}
function tuitionAndFees() { // STUDENT RECORDS APPLICATION ==> change to 
	//alert("We will be updating you soon with the student records application section. Keep visiting this website to get in touch with our latest updates.");
	callAHAH('page/interactive/tuition_and_Fees.html','showtime', 'Please wait -- Requesting server data...');
}

// Contact Us Specific
function generalInfo() { // GENERAL INFORMATION
	callAHAH('page/contact_us/general_information.html','showtime', 'Please wait -- Requesting server data...');	
}
function admissionOffice() { // ADMISSION OFFICE
	callAHAH('page/contact_us/admission_office.html','showtime', 'Please wait -- Requesting server data...');
}
function directorOffice() { // DIRECTOR OFFICE
	callAHAH('page/contact_us/director_office.html','showtime', 'Please wait -- Requesting server data...');
}
function financeOffice() { // FINANCE
	callAHAH('page/contact_us/finance.html','showtime', 'Please wait -- Requesting server data...');
}

// Check Mail Specific
function checkMail() { // CHECK MAIL
	
}
function registerMail() { // REGISTER
	
}
function mailAssist() { // NEED ASSISTANCE
	callAHAH('page/myMail/needAssistance.html','showtime', 'Please wait -- Requesting server data...'); //
}


// ############### Special Effects #####################

// Website Finished March 26, 2009

// ####################VALIDATORS#########################

function validate() {
  if (isEmpty(document.myform.first_name.value)) {
        alert("Error: First Name is required.");
        document.myform.first_name.focus();
        return false;
  } else {
	  var name =''; //First Name
	  name+=document.myform.first_name.value;
  }
  if (isEmpty(document.myform.last_name.value)) {
        alert("Error: Last Name is required.");
        document.myform.last_name.focus();
        return false;
  } else {
	  var last =''; //Last Name
	  last+=document.myform.last_name.value;
  }
  if (isEmpty(document.myform.email.value)) {
        alert("Error: Email Name is required.");
        document.myform.email.focus();
        return false;
  } else {
	  var email =''; // Email
	  email+=document.myform.email.value;
  }
  if (isEmpty(document.myform.username.value)) {
        alert("IMPORTANT: Username cannot be empty");
        document.myform.username.focus();
        return false;
  } else {
	  var user =''; // User
	  user+=document.myform.username.value;
  }
  if (isEmpty(document.myform.password1.value)) {
        alert("Error: Password must not be empty");
        document.myform.password1.focus();
        return false;
  } 
  if (isEmpty(document.myform.password2.value)) {
        alert("Error: Password confirmation must not be empty");
        document.myform.password2.focus();
        return false;
  }
  if (document.myform.password2.value==document.myform.password1.value) {
	  var pass =''; // Pass
	  pass+=document.myform.password2.value;
  } else {
	  alert("IMPORTANT: Confirmation password does not match");
      document.myform.password2.focus();
      return false;
  }
  if (isEmpty(document.myform.city.value)) {
      alert("HELLO "+name+' '+last+" Please enter your city before we will process your request");
      document.myform.password2.focus();
        return false;
  } else {
	  var city =''; // City
	  city+=document.myform.city.value;
  }
  if (isEmpty(document.myform.province_or_state.value)) {
      alert("Please "+name+' '+last+" enter your Province or State so we can process your request");
      document.myform.province_or_state.focus();
        return false;
  } else {
	  var prov =''; // Prov
	  prov+=document.myform.province_or_state.value;
  }
  if (isEmpty(document.myform.country.value)) {
      alert(name+' '+last+"Country must not be left empty");
      document.myform.country.focus();
        return false;
  } else {
	  var count=''; // Country
	  count+=document.myform.country.value;
  }
  if (isEmpty(document.myform.captcha.value)) {
      alert(name+' '+last+" Verification Code must not be empty");
      document.myform.captcha.focus();
        return false;
  } else {
	  var captcha=''; // Captcha
	  captcha+=document.myform.captcha.value;
  }
  return doAjax('page/interactive/myLoginAjax.php','param=PARAM'+'&name='+name+'&last='+last+'&email='+email+'&user='+user+'&pass='+pass+'&city='+city+'&prov='+prov+'&count='+count+'&captcha='+captcha,'parseThis','post','0');
  //req.open("GET",url+'?'+query+'&rand='+myRand,true);
}

/////////////////////////////////// NEW function
var c= '';
function changeTextAndPost(c, changeID) {
	paramID = changeID;
	//Comment After Debug...
	// For form submission using AJAX XML responseText POST:::::::
	if (c == '1') { url = 'test.php'; } // user clicks the vision banner button in front triggers vision()
	if (c == '2') { url = 'registrationTable.html'; } // user clicks on "NIS IN A FLASH"
	if (c == '3') { url = 'page/interactive/loginSection.html'; } // user login section
	// if (c == '4') { url = 'page/interactive/viewUsersAjax.php?session_name=session_ID'; } // user login section // back up
	if (c == '4') { url = 'users/view_users.php'; } // user login section
	if (c == '5') { url = 'users/logout.php'; } // user login section
	if (c == '6') { url = 'page/interactive/student_code.php'; } // user login section
	
	return doWiseAjax(url,'param=bob','parseThis','post','0', paramID); // call doWiseAjax with params for other divisions particularly for texts
}


<!--
// ############### Special Effects #####################

function random(num) {
	return Math.floor(Math.random() * num) + 1;
}
myRan = random(11);
ran = random(10);
function delayer(){
    setTimeout('changer(myRan)', 5000);
}
function changer(myRan){
    callAHAH('changer/changer_'+myRan+'.html','scenes', loadImg);
	setTimeout('delayer2()', 5000);
}
function delayer2(){
    callAHAH('changer/changer_2.html','scenes', '<font color ="white">Please wait -- Requesting server data...</font>');
	setTimeout('changer(myRan)', 5000);
}
loadImg= '<img src="SlidePix/'+ran+'.jpg" alt="" name="css_r3_c1" width="979" height="230" border="0" usemap="#css_r3_c1Map" id="css_r3_c1" />';


function random(num) {
	return Math.floor(Math.random() * num) + 1;
}


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//New project:

// JavaScript Document
// The following are a good example of using Ajax
function theAds(text) {
    document.getElementById('scenes').innerHTML = text;
}
//botique:
function bags() {
	doAjax('13/html/bags.php','pid=4','theAds','get','0', 'scenes'); // The call back function "theAds" can be analyzed in the myAJAX.js of root/js/ajax/myAJAX.js
}
function ad1() {
	callAHAH('ads/ad1.htm','scenes', 'Please wait -- Requesting server data...'); //
}

function ad2() {
	callAHAH('ads/ad2.htm','scenes', 'Please wait -- Requesting server data...'); //
}

function Menu4_1() {
	doAjax('page/4/1.htm','','theAds','post','0', 'scenes'); // Right
}
function Menu4_2() {
	doAjax('page/4/2.htm','','theAds','post','0', 'scenes'); // Right
}
function Menu4_3() {
	doAjax('page/4/3.htm','','theAds','post','0', 'scenes'); // Right
}
function Menu4_4() {
	doAjax('page/4/4.htm','','theAds','post','0', 'scenes'); // Right
}
function Menu4_5() {
	doAjax('page/4/5.htm','','theAds','post','0', 'scenes'); // Right
}
function Menu4_6() {
	doAjax('page/4/6.htm','','theAds','post','0', 'scenes'); // Right
}
function bags() {
	doAjax('13/html/bags.php','pid=4','theAds','get','0', 'scenes'); // The call back function "theAds" can be analyzed in the myAJAX.js of root/js/ajax/myAJAX.js
}
function apparel() {
	doAjax('13/html/apparel.php','pid=9','theAds','get','0', 'body');
	//init();
	initLightbox(); // Yes, you may want to have the lightbox not load until after the AJAX returns, then call it.
	//new Lightbox();
}
function footwear() {
	doAjax('13/html/footwear.php','pid=9','theAds','get','0', 'body');
}
function gears() {
	doAjax('13/html/gears.php','pid=9','theAds','get','0', 'body');
}
function accessories() {
	doAjax('13/html/accessories.php','pid=9','theAds','get','0', 'body');
}


/////////////////////////////////////new\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
/*function ad1() {
	callAHAH('ads/ad2.htm','scenes', 'Please wait -- Requesting server data...'); //
}*/
function aboutus() {
	//doAjax('pages/1/2_image.html','','callbk','post','0', 'showSetRightTextID'); // Right
	callAHAH('pages/aboutus/aboutus.html','scenes', 'Please wait -- Requesting server data...'); // Left
}

function missionvision() {
	callAHAH('pages/missionvision/missionvision.html','scenes', 'Please wait -- Requesting server data...');
	// doAjax('pages/missionvision/missionvision.html','pid=9','theAds','get','0', 'body');
}

function sof() {
	// callAHAH('pages/missionvision/sof.html','scenes', 'Please wait -- Requesting server data...');
	// doAjax('pages/missionvision/missionvision.html','pid=9','theAds','get','0', 'body');
}

function tenetsoffaith() {
	//doAjax('pages/1/2_image.html','','callbk','post','0', 'showSetRightTextID'); // Right
	// callAHAH('pages/aboutus/tenetsoffaith.html','showtime', 'Please wait -- Requesting server data...'); // Left
	callAHAH('pages/aboutus/tenetsoffaith.html','scenes', 'Please wait -- Requesting server data...');
}

function jcv() {
	doAjax('pages/aboutus/history_image.html','','callbk','post','0', 'showSetRightTextID'); // Right
	callAHAH('pages/aboutus/jcv.html','showtime', 'Please wait -- Requesting server data...'); // Left
}

function history() { // HISTORY 
	doAjax('pages/aboutus/history_image.html','','callbk','post','0', 'showSetRightTextID'); // Right
	callAHAH('pages/aboutus/history.html','showtime', 'Please wait -- Requesting server data...'); // Left
}

function leaders() { // HISTORY 
	doAjax('pages/aboutus/blank.html','','callbk','post','0', 'showSetRightTextID'); // Right
	callAHAH('pages/aboutus/leaders.html','showtime', 'Please wait -- Requesting server data...'); // Left
}