﻿/*******************************
*   LOCATE FLASH MOVE ON PAGE  *
*******************************/

function getFlashMovieObject(movieName) {
    if (window.document[movieName]) {
        return window.document[movieName];
    }
    if (navigator.appName.indexOf("Microsoft Internet") == -1) {
        if (document.embeds && document.embeds[movieName])
            return document.embeds[movieName];
    }
    else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
    {
        return document.getElementById(movieName);
    }
}

/*******************************
*   FLASH REPLACEMENT TEXT     *
*******************************/

function runSifr() {
    if (typeof sIFR == "function") {
        
        sIFR.replaceElement(named({ sSelector: 'h2.helvetica-neue', sFlashSrc: '/flash/helveticaneue.swf', sColor: '#cccccc', sWmode: 'transparent' }));
        sIFR.replaceElement(named({ sSelector: 'span.helvetica-neue', sFlashSrc: '/flash/helveticaneue.swf', sColor: '#cccccc', sWmode: 'transparent' }));
        
        sIFR.setup();
    }
}


/*******************************
*   JQUERY PAGE LOAD EVENT     *
*******************************/

$(document).ready(
    function() {
        if (window.attachEvent) {
            $(document).pngFix();
        }
        runSifr();
        Shadowbox.init();
        if (typeof mapLoad == "function") {
            mapLoad();
        }
        if (typeof locateSelectedSwatch == "function" && document.getElementById("ctl00_ContentPlaceHolderMainBody_RepeaterGrip_ctl00_ProductColorSwatches")) {
            locateSelectedSwatch();
        }

        if (getFlashMovieObject("gripflash")) {
            getFlashMovieObject("gripflash").focus();
        }
    }
);

/********************************
*    SUCKERFISH DROP DOWN-MENUS *
*    FOR IE6                    *
********************************/

function suckerFishSetup() {

    var sfEls = document.getElementById("nav").getElementsByTagName("LI");
    for (var i = 0; i < sfEls.length; i++) {
        sfEls[i].onmouseover = function() {
            this.className += " sfhover";
        }
        sfEls[i].onmouseout = function() {
            this.className = this.className.replace(new RegExp(" sfhover\\b"), "");
        }
    }
}

if (window.attachEvent) {
    window.attachEvent("onload", suckerFishSetup);
}

