﻿function showSearch(name) {
    $('#relatedRel').hide();
    $('#relatedPop').hide();
    $('#' + name).show();
}

function setThumb(name) {
    var objectName = $(name);
    var objectNameImg = $('#Img' + objectName.attr("id"));
    objectName.qtip({
        content: '<img src="../Img/' + objectName.attr("id") + '_big.jpg" border="0" style="border:1px solid #CDCDCD"/><br/><p>' + objectNameImg.attr("alt") + '</p>',
        show: {
            when: { event: 'mouseover' },
            effect: { type: 'fade', length: 500 }
        },
        hide: 'mouseout',
        position: {
            corner: {
                target: 'topRight',
                tooltip: 'bottomLeft'
            },
            adjust: {
                x: -75,
                y: 5
            }
        },
        style: {
            padding: 5,
            width: 335,
            color: '#4B4C4E',
            textAlign: 'center',
            border: {
                width: 1,
                color: '#CDCDCD'
            }
        }
    });
    mouseOverOpac(name);
}
        function setDropShadow(name) {
            $(document).ready(function() {
                $(name).wrap("<div class='highlight1'><div class='highlight2'>" +
     "<div class='highlight3'></div></div></div>");
            });
        }
        function mouseOverOpac(name) {
            var onMouseOutOpacity = 1.0;
            $(name).opacityrollover({
                mouseOutOpacity: onMouseOutOpacity,
                mouseOverOpacity: .6,
                fadeSpeed: 'medium',
                exemptionSelector: '.selected'
            });
        }
        function clearAllMenu4(array) {
            for (var i = array.length - 1; i >= 0; --i) {
                $("#menu4_" + array[i]).removeClass('menu4A')
                $("#div4_" + array[i]).hide();
            }
        }
        function showMenu4(name) {
            $("#menu4_" + name).addClass('menu4A');
            $("#div4_" + name).show();
        }
        function clearAll() {
            if (document.images) {
                if (document.images[headername + "menu_prem"]) {
                    menu_prem = document.images[headername + "menu_prem"];
                    menu_part = document.images[headername + "menu_part"];
                    menu_cab = document.images[headername + "menu_cab"];
                    menu_flr = document.images[headername + "menu_flr"];
                    menu_org = document.images[headername + "menu_org"];
                    if (menu_prem.src.charAt(menu_prem.src.length - 5) != 3) {
                        menu_prem.src = "../img/menu_prem_1.gif";
                    }
                    if (menu_part.src.charAt(menu_part.src.length - 5) != 3) {
                        menu_part.src = "../img/menu_part_1.gif";
                    }
                    if (menu_cab.src.charAt(menu_cab.src.length - 5) != 3) {
                        menu_cab.src = "../img/menu_cab_1.gif";
                    }
                    if (menu_flr.src.charAt(menu_flr.src.length - 5) != 3) {
                        menu_flr.src = "../img/menu_flr_1.gif";
                    }
                    if (menu_org.src.charAt(menu_org.src.length - 5) != 3) {
                        menu_org.src = "../img/menu_org_1.gif";
                    }
                    $('#menuSub_prem').hide();
                    $('#menuSub_part').hide();
                    $('#menuSub_cab').hide();
                    $('#menuSub_flr').hide();
                    $('#menuSub_org').hide();
                }
            }
        }
        function swapMenu(Name, shortname, Num) {
            clearAll();
            if (document.images) {
                document.images[Name].src = "../Img/menu_" + shortname + "_" + Num + ".gif";
                $('#menuSub_' + shortname).show();
            } 
        }
        function swapHead(Name, Num) {
            if (document.images) {
                document.images[Name].src = "../Img/" + Name + "_" + Num + ".gif";
            } 
        }
        function swapJPG(Name, Num) {
            if (document.images) {
                document.images[Name].src = "../Img/" + Name + "_" + Num + ".jpg";
            }
        }
        function faqSwapR(faqCounter, maxFaqCounter) {
            $('#faq_' + faqCounter).hide();
            if (faqCounter < maxFaqCounter) {
                faqCounter = faqCounter + 1;
            }
            else {
                faqCounter = 0;
            }
            $('#faq_' + faqCounter).show();
            faqCounterText(faqCounter, maxFaqCounter); 
            return faqCounter;
        }
        function faqSwapL(faqCounter, maxFaqCounter) {
            $('#faq_' + faqCounter).hide();
            if (faqCounter > 0) {
                faqCounter = faqCounter - 1;
            }
            else {
                faqCounter = maxFaqCounter;
            }
            $('#faq_' + faqCounter).show();
            faqCounterText(faqCounter, maxFaqCounter);
            return faqCounter;
        }
        function faqShow(faqCounter, maxFaqCounter) {
            $('#faq_' + faqCounter).show();
            faqCounterText(faqCounter, maxFaqCounter);
            return faqCounter;
        }
        function faqCounterText(faqCounter, maxFaqCounter) {
            $('#faq_Count').html(faqCounter+1);
            $('#faq_Count_Max').html(maxFaqCounter+1);
        }
        
        

