﻿// JScript File
var navigation = function() {
    return {

        navigationOver: function(obj) {
            obj.className = 'leftNavigationMouseOver';
            if (obj.id === 'tdCompanies') {
                navigation.showCompanyNav();
            }
        },

        navigationOut: function(obj) {
            obj.className = 'leftNavigationBG';
            if (obj.id === 'tdCompanies') {
                navigation.hideCompanyNav();
            }
        },

        contactUs: function() {
            if (isIE) {
                window.navigate('http://www.SulliTool.com/Content_Pages/ContactUs.aspx');
            }
            else {
                location.href = 'http://www.SulliTool.com/Content_Pages/ContactUs.aspx';
            }
        },

        homePage: function() {
            if (isIE) {
                window.navigate('http://www.SulliTool.com/');
            }
            else {
                location.href = 'http://www.SulliTool.com/';
            }
        },

        aboutUs: function() {
            if (isIE) {
                window.navigate('http://www.SulliTool.com/Content_Pages/AboutUs.aspx');
            }
            else {
                location.href = 'http://www.SulliTool.com/Content_Pages/AboutUs.aspx';
            }
        },

        royalProducts: function() {
            if (isIE) {
                window.navigate('http://www.sullitool.com/RoyalProducts.aspx');
            }
            else {
                location.href = 'http://www.sullitool.com/RoyalProducts.aspx';
            }
        },

        stevensEngineering: function() {
            if (isIE) {
                window.navigate('http://www.sullitool.com/StevensEng.aspx');
            }
            else {
                location.href = 'http://www.sullitool.com/StevensEng.aspx';
            }
        },

        smwAutoBlock: function() {
            if (isIE) {
                window.navigate('http://www.sullitool.com/SMWAutoblock.aspx');
            }
            else {
                location.href = 'http://www.sullitool.com/SMWAutoblock.aspx';
            }
        },

        liveTooling: function() {
            if (isIE) {
                window.navigate('http://www.sullitool.com/LiveTooling.aspx');
            }
            else {
                location.href = 'http://www.sullitool.com/LiveTooling.aspx';
            }
        },
        raptor: function() {
            if (isIE) {
                window.navigate('http://www.sullitool.com/Raptor.aspx');
            }
            else {
                location.href = 'http://www.sullitool.com/Raptor.aspx';
            }
        },
        nobelChuck: function() {
            if (isIE) {
                window.navigate('http://www.sullitool.com/NobelChuck.aspx');
            }
            else {
                location.href = 'http://www.sullitool.com/NobelChuck.aspx';
            }
        },
        alberecht: function() {
            if (isIE) {
                window.navigate('http://www.sullitool.com/Albrecht.aspx');
            }
            else {
                location.href = 'http://www.sullitool.com/Albrecht.aspx';
            }
        },
        northField: function() {
            if (isIE) {
                window.navigate('http://www.sullitool.com/NorthField.aspx');
            }
            else {
                location.href = 'http://www.sullitool.com/NorthField.aspx';
            }
        },       
        
        companyHover: function(obj) {
            obj.className = 'companyLinkHover';
        },

        companyOut: function(obj) {
            obj.className = 'companyLink';
        },

        showCompanyNav: function() {
            $get('divCompanies').className = 'companyNavOver';
        },
        hideCompanyNav: function() {
            $get('divCompanies').className = 'companyNav';
        }
    };
} ();

var headerImages = function() {
    return {
        handleImageSwap: function(newImage) {
            var clickedDiv = newImage.parentNode;
            var mainDiv = $get('div3');
            if ((mainDiv.id !== clickedDiv.id) && (isIE)) {
                headerImages.swapImage(clickedDiv, mainDiv);
            }
        },
        swapImage: function(newObj, currentObj) {

            var newObjSrc = newObj.firstChild.src;
            var curObjSrc = currentObj.firstChild.src;

            var e_v = new RegExp(curObjSrc, "g");
            currentObj.firstChild.innerHTML = currentObj.firstChild.innerHTML.replace(e_v, newObjSrc);
            currentObj.firstChild.src = newObjSrc;

            e_v = new RegExp(newObjSrc, "g");
            newObj.firstChild.innerHTML = newObj.firstChild.innerHTML.replace(e_v, curObjSrc);
            newObj.firstChild.src = curObjSrc;
        }
    };
} ();
