﻿
preload_image_object = new Image();
image_url = new Array();
image_url[0] = "/_layouts/images/DirectionsTraining.Images/navigation/aboutus.png";
image_url[2] = "/_layouts/images/DirectionsTraining.Images/navigation/aboutus_ro.png";
image_url[3] = "/_layouts/images/DirectionsTraining.Images/navigation/courses.png";
image_url[4] = "/_layouts/images/DirectionsTraining.Images/navigation/courses_ro.png";
image_url[5] = "/_layouts/images/DirectionsTraining.Images/navigation/certifications.png";
image_url[6] = "/_layouts/images/DirectionsTraining.Images/navigation/certifications_ro.png";
image_url[7] = "/_layouts/images/DirectionsTraining.Images/navigation/locations.png";
image_url[8] = "/_layouts/images/DirectionsTraining.Images/navigation/locations_ro.png";
image_url[9] = "/_layouts/images/DirectionsTraining.Images/navigation/contactus.png";
image_url[10] = "/_layouts/images/DirectionsTraining.Images/navigation/coutactus_ro.png";


for (var i = 0; i <= 3; i++) {
    preload_image_object.src = image_url[i];
}

$(function () {
    if ($('#contentwrapper-inner').height() < 800) {
        $('#linkbacktotop').css({ 'display': 'none' });
    }

    if ($.browser.msie) {
        $('hr').css({ 'border-style': 'none', 'width': '95%', 'background-color': 'transparent', 'border-top': '1px dotted #676767' });
    }
    else if ($.browser.mozilla) {
        $('hr').css({ 'border-style': 'none', 'width': '95%', 'background-color': 'transparent', 'border-top': '1px dotted #676767' });
    }
    else if ($.browser.opera) {
        $('hr').css({ 'border-style': 'none', 'width': '95%', 'background-color': 'transparent', 'border-top': '1px dotted #676767' });
    }
    else if ($.browser.webkit) {
        $('hr').css({ 'border-style': 'none', 'width': '95%', 'background-color': 'transparent', 'border-top': '1px dotted #676767' });
    }


    if ($.browser.msie && $.browser.version == 7) {
        $('#divsearchbox').css({ 'top': '55px', 'left': '847px' });
    }

    $("#divbreadcrumb span span").each(function () {
        if ($(this).text() == 'Directions Training') {
            var a = document.createElement('a');
            a.href = '/pages/home.aspx';
            a.alt = 'Home';
            $(a).text('Directions Training');
            $(this).replaceWith(a);
        }
    });

    $("#divbreadcrumb span span a").each(function () {
        $(this).text($(this).text().toLowerCase());
        $(this).text($(this).text().capitalize());
        if ($(this).text() == 'Pages') {
            $(this).closest('span').prev().remove();
            $(this).closest('span').remove();
        }
    });



    $("#divbreadcrumb span span").each(function () {
        if ($(this).text().indexOf('-') > -1) {
            $(this).text($(this).text().replace(/-/gi, ' '));
        }
    });

    var ary = new Array();
    var img = function () {
        img.prototype.url;
        img.prototype.rollover
        img.prototype.width;
        img.prototype.height;
    }

    $('#linklogin').hover(function () {
        $(this).css({ 'color': '#fff' });
    },
    function () {
        $(this).css({ 'color': '#000' });
    }).click(function () {
        $('#s4-ribbonrow').toggle();
    });
});





