﻿/*
created by: Brian Gaines
created on: 9/26/2007
filename: _facimg.js
comments:   
    This javascript file contains client scripts specific to the 
    facilities and is stored in the root of all the facility web
    pages. Make sure you reference the _fw.js file as it contains
    functions this script file needs.
    
    The functions contained in this file are specifically geared 
    on image preloading to enhance page peformance.
    
    **Make use of the variable rootpath to obtain the correct path
    of where the files are referenced in development mode vs. 
    production mode (see comments in _fw.js regarding this).
*/

// -------------------------------------
//      INITIALIZATIONS
// -------------------------------------

var isLanding = checkCurrentPage('Default.aspx');
var isDefault = checkCurrentPage('Home.aspx');
var isRoomSpecs = checkCurrentPage('RoomSpecs.aspx');
var isPhotos = checkCurrentPage('Photos.aspx');
var isVirtualTour = checkCurrentPage('VirtualTour.aspx');
var isAvailability = checkCurrentPage('Availability.aspx');
var isDirections = checkCurrentPage('Directions.aspx');
var isRecruiting = checkCurrentPage('Recruiting.aspx');
var isHotels = checkCurrentPage('Hotels.aspx');
var isRestaurants = checkCurrentPage('Restaurants.aspx');
var isActivities =  checkCurrentPage('LocalActivities.aspx');
var isJoinDb = checkCurrentPage('Join.aspx');

function Init() {
    
    preloadImages();
    
}

// -------------------------------------
//      IMAGE PRELOADS
// -------------------------------------

function preloadImages() {

	if (document.images) {
	
	    // ---------------------------------
	    //      NAVIGATION PRELOADS
	    // ---------------------------------
	
	    //top navigation
        topnav_home_off=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_nav_home_01.gif");
        topnav_home_on=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_nav_home_01b.gif");

        topnav_about_off=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_nav_home_02.gif");
        topnav_about_on=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_nav_home_02b.gif");

        topnav_news_off=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_nav_home_03.gif");
        topnav_news_on=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_nav_home_03b.gif");

        topnav_tech_off=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_nav_home_04.gif");
        topnav_tech_on=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_nav_home_04b.gif");

        topnav_contact_off=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_nav_home_05.gif");
        topnav_contact_on=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_nav_home_05b.gif");

        topnav_submit_off=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_nav_home_06.gif");        
        topnav_submit_on=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_nav_home_06b.gif");  
            
        //divisional navigation
        facnav_fachome_off=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fac_home_stat.jpg");
        facnav_fachome_on=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fac_home_over.jpg");

        facnav_nethome_off=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fac_network_static.jpg");
        facnav_nethome_on=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fac_network_over.jpg");
        
        facnav_quanthome_off=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fac_quant_static.jpg");
        facnav_quanthome_on=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fac_quant_over.jpg");            
        
            
        //side navigation
        if (isLanding == false) {
        
                //COMMENTS: 
                //1. fonav_ = field office navigation; 
                //2. <page_name> make sure page_name mirrors that of page_type enum if creating new ones
                //3. _on = hover over image / _off = hover off image
                fonav_locations_off=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_fac_locations_a.gif");
                fonav_locations_on=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_fac_locations_b.gif");

                fonav_facility_info_off=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_focusgroups_fac1.gif");
                fonav_facility_info_on=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_focusgroups_fac1b.gif");        

                fonav_room_specs_off=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_focusgroups_fac2.gif");
                fonav_room_specs_on=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_focusgroups_fac2b.gif");        

                fonav_photos_off=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_focusgroups_fac3.gif");
                fonav_photos_on=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_focusgroups_fac3b.gif");        

                fonav_virtual_tour_off=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_focusgroups_fac4.gif");
                fonav_virtual_tour_on=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_focusgroups_fac4b.gif");        

                fonav_check_availability_off=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_focusgroups_fac5.gif");
                fonav_check_availability_on=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_focusgroups_fac5b.gif");        

                fonav_directions_off=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_focusgroups_fac6.gif");
                fonav_directions_on=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_focusgroups_fac6b.gif");        

                fonav_recruiting_area_off=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_focusgroups_fac7.gif");
                fonav_recruiting_area_on=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_focusgroups_fac7b.gif");        

                fonav_hotels_off=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_focusgroups_fac8.gif");
                fonav_hotels_on=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_focusgroups_fac8b.gif");        

                fonav_restaurants_off=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_focusgroups_fac9.gif");
                fonav_restaurants_on=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_focusgroups_fac9b.gif");        

                fonav_local_activities_off=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_focusgroups_fac10.gif");
                fonav_local_activities_on=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_focusgroups_fac10b.gif");                

                fonav_joindb_off=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_focusgroups_fac11.gif");
                fonav_joindb_on=newImage(rootpath + "App_Themes/Default/Facility/Navigation/fieldwork_focusgroups_fac11b.gif");
        
        }

	    // ---------------------------------
	    //      PAGE SPECIFIC PRELOADS
	    // ---------------------------------

        switch(true){
            case isLanding:
                //nothing at this time;
                break;
            case isDefault:
                //nothing at this time;            
                break;
            case isRoomSpecs:
                //nothing at this time;            
                break;
            case isPhotos:
                //nothing at this time;            
                break;
            case isVirtualTour:
                //nothing at this time;            
                break;
            case isAvailability:
                //nothing at this time;            
                break;
            case isDirections:
                //nothing at this time;            
                break;
            case isRecruiting:
            
                rec_zipcodes_off=newImage(rootpath + "App_Themes/Default/Facility/Page/RecruitingArea/fieldwork_download_pdf_a.jpg");
                rec_zipcodes_on=newImage(rootpath + "App_Themes/Default/Facility/Page/RecruitingArea/fieldwork_download_pdf_b.jpg");

                break;
            case isHotels:
                //nothing at this time;            
                break;
            case isRestaurants:
                //nothing at this time;            
                break;
            case isActivities:
                //nothing at this time;            
                break;
            case isJoinDb:
                //nothing at this time;
                break;
        }
        
        preloadFlag = true;
        
    }
}
