﻿//Precondition: Jquery has loaded first

//Initialized from server
var MobileModePreferenceURL = '';

// Preload the images common to all pages
//urls in javascript resolve relative to the page they are run from rather than relative to this javascript file.
//urls in CSS on the other hand resolve relative to their own location (opposite)

// Preload image method
jQuery.preloadImages = function () {
    for (var i = 0; i < arguments.length; i++) {
        jQuery("<img>").attr("src", arguments[i]);
    }
}
// Preload this site's images
var bp = "App_Themes/BIWFD/images/"; //basePath
$.preloadImages(bp + "Top.jpg", bp + "bottom.jpg", bp + "ContentBack.gif", bp + "LeftItemHover_Top.jpg", bp + "LeftItemHover_Bottom.jpg", bp + "LeftItemHover_Back.jpg");

function ScheduleGetMobileModePreference() {
    $(document).ready(function () {
        setTimeout('GetModalMobilePreference();', 1000);
    });
}

function GetModalMobilePreference() {

    var r = confirm('Would you prefer to view our mobile site instead?');
    if (r == true) {
        //redirect to set the preference.
        window.location = MobileModePreferenceURL;
    }
    else {
        //False will be implied 
    }
}



