﻿$(document).ready(function () {

//    // http://jdbartlett.github.com/innershiv
//    window.innerShiv = (function () {
//        var d, r;

//        return function (h, u) {
//            if (!d) {
//                d = document.createElement('div');
//                r = document.createDocumentFragment();
//                /*@cc_ond.style.display = 'none'; @*/
//            }

//            var e = d.cloneNode(true);
//            /*@cc_ondocument.body.appendChild(e); @*/
//            e.innerHTML = h;
//            /*@cc_ondocument.body.removeChild(e); @*/

//            if (u === false) return e.childNodes;

//            var f = r.cloneNode(true), i = e.childNodes.length;
//            while (i--) f.appendChild(e.firstChild);

//            return f;
//        }
    //    } ());

    /* Services carousel */
    $("#thumbstrip").jCarouselLite({
        btnNext: "#rightarrow",
        btnPrev: "#leftarrow",
        auto: 4000,
        speed: 1500,
        visible: 4,
        circular: true
    });


    function menuHoverOver() {
        $(this).find(".submenu").stop().fadeTo('fast', 1).show();
    }

    function menuHoverOut() {
        $(this).find(".submenu").stop().fadeTo('fast', 0, function () {
            $(this).hide();
        });
    }

    var config = {
        interval: 100,
        over: menuHoverOver,   
        timeout: 500,     
        out: menuHoverOut    
    };

    $(".main ul li .submenu").css({ 'opacity': '0' }); //Fade sub nav to 0 opacity on default
    $(".main ul li").hoverIntent(config);

    DD_belatedPNG.fix('.submenu, ul.strip p, .topshadow, #leftarrow, #rightarrow, .mainimgs, .partners a img, .pdflink');
});

function historyBack() {
    history.back();
}
