            YAHOO.util.Event.onContentReady("mainmenu", function () {
                var oMenuBar = new YAHOO.widget.MenuBar("mainmenu", { 
                                                            autosubmenudisplay: true, 
                                                            hidedelay: 1000, 
                                                            lazyload: true });
                var aSubmenuData = [                
                    {
                        id: "adults", 
                        itemdata: [ 
                            { text: "Women", url: "/c-37-store.aspx?categoryids=91,30&st=catadultwomen"},
                            { text: "Men", url: "/c-37-store.aspx?categoryids=91,29&st=catadultmen" },
                            { text: "Funny", url: "/c-37-store.aspx?categoryids=91,87&st=catadultfunny" },
                            { text: "Couples", url: "/c-37-store.aspx?categoryids=91,74&st=catadultcouples" },
                            { text: "Family", url: "/c-37-store.aspx?categoryids=91,101&st=catadultfamily" },
                        ]
                    },
                    {
                        id: "youth", 
                        itemdata: [
                            {
                                text: "Teens", URL: "/c-37-store.aspx?categoryids=92,32", 
                                submenu: { 
                                            id: "teens", 
                                            itemdata: [
                                                { text: "Girl", url: "/c-37-store.aspx?categoryids=92,32,30" },
                                                { text: "Boy", url: "/c-37-store.aspx?categoryids=92,32,29" },
                                                { text: "Unisex",  url: "/c-37-store.aspx?categoryids=92,32,102" },
                                            ] 
                                        }                           
                            }, 
                           { text: "Kids <font size=1px>(5-12yrs)</font>", URL: "/c-37-store.aspx?categoryids=92,27",
                                submenu: { 
                                            id: "kids", 
                                            itemdata: [
                                                { text: "Girl", url: "/c-37-store.aspx?categoryids=92,27,30" },
                                                { text: "Boy", url: "/c-37-store.aspx?categoryids=92,27,29" },
                                                { text: "Unisex",  url: "/c-37-store.aspx?categoryids=92,27,102" },
                                            ] 
                                        }                          
                            }, 
                            { text: "Toddlers <font size=1px>(1-4yrs)</font>", URL: "/c-37-store.aspx?categoryids=92,34",
                                submenu: { 
                                            id: "toddlers", 
                                            itemdata: [
                                                { text: "Girl", url: "/c-37-store.aspx?categoryids=92,34,30" },
                                                { text: "Boy", url: "/c-37-store.aspx?categoryids=92,34,29" },
                                                { text: "Unisex",  url: "/c-37-store.aspx?categoryids=92,34,102" },
                                            ] 
                                       }                          
                            }, 
                            { text: "Infants <font size=1px>(0-12mos)</font>", URL: "/c-37-store.aspx?categoryids=92,33",
                                submenu: { 
                                            id: "infants", 
                                           itemdata: [
                                                { text: "Girl", url: "/c-37-store.aspx?categoryids=92,33,30" },
                                                { text: "Boy", url: "/c-37-store.aspx?categoryids=92,33,29" },
                                                { text: "Unisex",  url: "/c-37-store.aspx?categoryids=92,33,102" },
                                                
                                            ] 
                                        }                         
                            }, 
                            { text: "Family", url: "/c-37-store.aspx?categoryids=101&st=catyouthfamily" },
                        ]   
                    },   
                    {
                        id: "pets", text: "Pets", disabled: true
                    
                    },                   
                    {
                        id: "accessories",
                        itemdata: [
                            { text: "Wigs, Hats & Headwear", url: "/c-94-accessories.aspx?categoryids=44&expand=36" },
                            { text: "Eyelashes, Make-up & Face Paint", url: "/c-94-accessories.aspx?categoryids=47&expand=36" },
                            { text: "Beards & Glasses", url: "/c-94-accessories.aspx?categoryids=48&expand=36" },
                            { text: "Masks", url: "/c-94-accessories.aspx?categoryids=42&expand=36" },
                            { text: "Prosthetics Scars & Wounds", url: "/c-94-accessories.aspx?categoryids=49&expand=36" },
                            { text: "Capes & Wings", url: "/c-94-accessories.aspx?categoryids=50&expand=36" },
                            { text: "Costume Props", url: "/c-94-accessories.aspx?categoryids=43&expand=36" },
                            { text: "Teeth Noses & Ears", url: "/c-94-accessories.aspx?categoryids=51&expand=36" },
                            { text: "Footwear & Hosiery", url: "/c-94-accessories.aspx?categoryids=52&expand=36" },
                            { text: "Weapons", url: "/c-94-accessories.aspx?categoryids=53&expand=36" },
                            { text: "TV & Movie Props", url: "/c-94-accessories.aspx?categoryids=54&expand=36" },
                            { text: "Party Decorations", url: "/c-94-accessories.aspx?categoryids=55&expand=36" },                                                                                                                                            
                        ]
                    }                    
                ];


                var ua = YAHOO.env.ua,
                    oAnim;  // Animation instance
                /*
                     "beforeshow" event handler for each submenu of the MenuBar
                     instance, used to setup certain style properties before
                     the menu is animated.
                */
                function onSubmenuBeforeShow(p_sType, p_sArgs) {
                    var oBody,
                        oElement,
                        oShadow,
                        oUL;
                    if (this.parent) {
                        oElement = this.element;
                        /*
                             Get a reference to the Menu's shadow element and 
                             set its "height" property to "0px" to syncronize 
                             it with the height of the Menu instance.
                        */
                        oShadow = oElement.lastChild;
                        oShadow.style.height = "0px";
                        /*
                            Stop the Animation instance if it is currently 
                            animating a Menu.
                        */  
                        if (oAnim && oAnim.isAnimated()) {               
                            oAnim.stop();
                            oAnim = null;                     
                        }
                        /*
                            Set the body element's "overflow" property to 
                            "hidden" to clip the display of its negatively 
                            positioned <ul> element.
                        */ 
                        oBody = this.body;
                        //  Check if the menu is a submenu of a submenu.
                        if (this.parent && 
                            !(this.parent instanceof YAHOO.widget.MenuBarItem)) {                       
                            /*
                                There is a bug in gecko-based browsers and Opera where 
                                an element whose "position" property is set to 
                                "absolute" and "overflow" property is set to 
                                "hidden" will not render at the correct width when
                                its offsetParent's "position" property is also 
                                set to "absolute."  It is possible to work around 
                                this bug by specifying a value for the width 
                                property in addition to overflow.
                            */
                            if (ua.gecko || ua.opera) {                           
                                oBody.style.width = oBody.clientWidth + "px";                            
                            }                                                       
                            /*
                                Set a width on the submenu to prevent its 
                                width from growing when the animation 
                                is complete.
                            */                          
                            if (ua.ie == 7) {
                                oElement.style.width = oElement.clientWidth + "px";
                            }                     
                        }   
                        oBody.style.overflow = "hidden";
                        /*
                            Set the <ul> element's "marginTop" property 
                            to a negative value so that the Menu's height
                            collapses.
                        */ 
                        oUL = oBody.getElementsByTagName("ul")[0];
                        oUL.style.marginTop = ("-" + oUL.offsetHeight + "px");                  
                    }
                }
                /*
                    "tween" event handler for the Anim instance, used to 
                    syncronize the size and position of the Menu instance's 
                    shadow and iframe shim (if it exists) with its 
                    changing height.
                */
                function onTween(p_sType, p_aArgs, p_oShadow) {
                    if (this.cfg.getProperty("iframe")) {                   
                        this.syncIframe();                
                    }                
                    if (p_oShadow) {                
                        p_oShadow.style.height = this.element.offsetHeight + "px";                    
                    }               
                }
                /*
                    "complete" event handler for the Anim instance, used to 
                    remove style properties that were animated so that the 
                    Menu instance can be displayed at its final height.
                */
                function onAnimationComplete(p_sType, p_aArgs, p_oShadow) {
                    var oBody = this.body,
                        oUL = oBody.getElementsByTagName("ul")[0];
                    if (p_oShadow) {                   
                        p_oShadow.style.height = this.element.offsetHeight + "px";                    
                    }
                    oUL.style.marginTop = "";
                    oBody.style.overflow = "";                    
                    //  Check if the menu is a submenu of a submenu.
                    if (this.parent && 
                        !(this.parent instanceof YAHOO.widget.MenuBarItem)) {
                        // Clear widths set by the "beforeshow" event handler
                        if (ua.gecko || ua.opera) {                       
                            oBody.style.width = "";                      
                        }                       
                        if (ua.ie == 7) {
                            this.element.style.width = "";
                        }                  
                    }                   
                }
                /*
                     "show" event handler for each submenu of the MenuBar 
                     instance - used to kick off the animation of the 
                     <ul> element.
                */
                function onSubmenuShow(p_sType, p_sArgs) {
                    var oElement,
                        oShadow,
                        oUL;              
                    if (this.parent) {
                        oElement = this.element;
                        oShadow = oElement.lastChild;
                        oUL = this.body.getElementsByTagName("ul")[0];                   
                        /*
                             Animate the <ul> element's "marginTop" style 
                             property to a value of 0.
                        */
                        oAnim = new YAHOO.util.Anim(oUL, 
                            { marginTop: { to: 0 } },
                            .2, YAHOO.util.Easing.easeOut);
                        oAnim.onStart.subscribe(function () {        
                            oShadow.style.height = "100%";                       
                        });   
                        oAnim.animate();   
                        /*
                            Subscribe to the Anim instance's "tween" event for 
                            IE to syncronize the size and position of a 
                            submenu's shadow and iframe shim (if it exists)  
                            with its changing height.
                        */    
                        if (YAHOO.env.ua.ie) {                          
                            oShadow.style.height = oElement.offsetHeight + "px";
                            /*
                                Subscribe to the Anim instance's "tween"
                                event, passing a reference Menu's shadow 
                                element and making the scope of the event 
                                listener the Menu instance.
                            */
                            oAnim.onTween.subscribe(onTween, oShadow, this);    
                        }    
                        /*
                            Subscribe to the Anim instance's "complete" event,
                            passing a reference Menu's shadow element and making 
                            the scope of the event listener the Menu instance.
                        */    
                        oAnim.onComplete.subscribe(onAnimationComplete, oShadow, this);                    
                    }                
                }
                /*
                     Subscribe to the "beforerender" event, adding a submenu 
                     to each of the items in the MenuBar instance.
                */
                oMenuBar.subscribe("beforeRender", function () {
                    if (this.getRoot() == this) {
                        this.getItem(0).cfg.setProperty("submenu", aSubmenuData[0]);
                        this.getItem(1).cfg.setProperty("submenu", aSubmenuData[1]);
                        this.getItem(2).cfg.setProperty("submenu", aSubmenuData[2]);
                        this.getItem(3).cfg.setProperty("submenu", aSubmenuData[3]);
                    }
                });
                /*
                     Subscribe to the "beforeShow" and "show" events for 
                     each submenu of the MenuBar instance.
                */                
                oMenuBar.subscribe("beforeShow", onSubmenuBeforeShow);
                oMenuBar.subscribe("show", onSubmenuShow);
                /*
                     Call the "render" method with no arguments since the 
                     markup for this MenuBar instance is already exists in 
                     the page.
                */
                oMenuBar.render();           
                oMenuBar.getItem(2).cfg.setProperty("submenu",null);       
            });
            
/* JS Image Swap functions from MM Dreamweaver - used in CS Home and Header */

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


/* other JS functions we use in costumestore */
function setLocation(url){
 window.location.href = url;
}

var nopic="/skins/skin_1/images/nopictureicon.gif";
function ImageLoadFailed(obj) {
 	if (obj.src.indexOf(nopic) == -1) {
		/* prevent endless loop if nopictureicon cannot load */
		obj.src = nopic;
	} else {
		obj.style.display = "none";
	}
}
