/*################################################################################
##################################################################################
####  Page Scripts                                                            ####
####  Requires: jQuery                                                        ##*/


jQuery("document").ready(
    function(){
        //TOP DROP DOWN MENUS
        jQuery("div.TopLinkContainer").hover(
            function(){
                jQuery(this).find("span").addClass("Active");
                jQuery(this).find("img.LeftImage").attr("src", "/images/buttons/top_nav_left_active.gif");
                jQuery(this).find("img.RightImage").attr("src", "/images/buttons/top_nav_right_active.gif");
                jQuery(this).find("img.DownArrow").attr("src", "/images/buttons/top-nav-down-arrow-active.gif");
                jQuery(this).children("div.TopDropDown").css("display", "block").css("zIndex", "65535");
            },
            function(){
                jQuery(this).children("div.TopDropDown").css("display", "none");
                jQuery(this).find("span").removeClass("Active");
                jQuery(this).find("img.LeftImage").attr("src", "/images/buttons/top_nav_left.gif");
                jQuery(this).find("img.RightImage").attr("src", "/images/buttons/top_nav_right.gif");
                jQuery(this).find("img.DownArrow").attr("src", "/images/buttons/top-nav-down-arrow.gif");
            }
        );
        
        
        //DROP DOWN MENU ROUNDED CORNERS
            //curvyCorners: does not work in Safari
            if(jQuery.browser.safari == false && jQuery.browser.msie == false){
                var antiAlias = true;
                var settings = {
                  tl: false,
                  tr: { radius: 5 },
                  bl: { radius: 5 },
                  br: { radius: 5 },
                  antiAlias: antiAlias,
                  autoPad: false
                }
                var cornersObj = new curvyCorners(settings, "Container");
                cornersObj.applyCornersToAll();
            } else {
                jQuery.each(
                    jQuery("div.Container"),
                    function(){
                        jQuery(this)
                            .before(
                                '<div style="margin-left: 0px; margin-right: 4px; background-color: #747678; height: 1px; font-size: 1px; line-height: 1px; border-left: 1px solid white; border-right: 1px solid white; border-top: 1px solid white;"></div>' +
                                '<div style="margin-left: 0px; margin-right: 2px; background-color: #747678; height: 1px; font-size: 1px; line-height: 1px; border-left: 1px solid white; border-right: 1px solid white;"></div>' +
                                '<div style="margin-left: 0px; margin-right: 1px; background-color: #747678; height: 1px; font-size: 1px; line-height: 1px; border-left: 1px solid white; border-right: 1px solid white;"></div>'
                                
                            )
                            .after(
                                '<div style="margin-left: 1px; margin-right: 1px; background-color: #747678; height: 1px; font-size: 1px; line-height: 1px; border-left: 1px solid white; border-right: 1px solid white;"></div>' +
                                '<div style="margin-left: 2px; margin-right: 2px; background-color: #747678; height: 1px; font-size: 1px; line-height: 1px; border-left: 1px solid white; border-right: 1px solid white;"></div>' +
                                '<div style="margin-left: 4px; margin-right: 4px; background-color: #747678; height: 1px; font-size: 1px; line-height: 1px; border-left: 1px solid white; border-right: 1px solid white; border-bottom: 1px solid white;"></div>'
                            )
                            .css("border-bottom", "0px solid white")
                            .css("border-top", "0px solid white");
                    }
                );
            }
            
            
        //SEARCH BOX DEFAULT TEXT: CLEARS WHEN THE BOX IS CLICKED
            jQuery("input#SearchText").click(
                function(){
                    if(jQuery(this).val() == 'Search'){
                        jQuery(this).val('');
                    }
                }
            );
    }
);


jQuery("window").ready(
    function(){
        //SIFR FONT REPLACEMENTS
        if(typeof sIFR == "function"){
            sIFR.replaceElement(named({ sSelector: 'div#MainTitleMargins',
                                        sFlashSrc: '/scripts/sifr/fonts/whitneybook.swf',
                                        sWmode:    'transparent',
                                        sColor:    '#FFFFFF'
            }));
            
            if(jQuery.browser.msie && parseInt(jQuery.browser.version) < 7){
                jQuery("div#MainTitleMargins")
                    .css("position", "relative");
                jQuery("div#MainTitleMargins embed, div#MainTitleMargins object")
                    .css("float", "left")
                    .css("zIndex", "-1")
                    .css("margin-left", "18px")
                    .css("margin-top", "18px");
            }
        }
    }
);



/*################################################################################
##################################################################################
####  Catalent Movie Scripts                                                  ####
####                                                                          ##*/
//LAUNCH THE ZYDIS COMPARISON MOVIE PLAYER
function OpenZydis5mlMovie(){
    window.open("/movies/zydis5.htm","","toolbar=no,scrollbars=no,resizable=yes,status=no,width=320,height=240");
}