/*
	Copyright (c) 2004-2008, The Dojo Foundation
	All Rights Reserved.

	Licensed under the Academic Free License version 2.1 or above OR the
	modified BSD license. For more information on Dojo licensing, see:

		http://dojotoolkit.org/book/dojo-book-0-9/introduction/licensing
*/


dojo.require("site.globalnav.GlobalNav");
site.globalnav.config={items:[{id:"products",content:{url:"/includes/panel_nav/catalog.tmpl",param:"CATEGORY_ID"},template:{detail:{hdDir:"/images/pnav/product/headers/",thumbDir:"/product/images/56x56/"}},items:[{name:"Holiday",id:"holiday",cmcat:"CAT794",header:"/images/gnav/gnav_holiday_157x18_off.gif",content:{url:"/whats_new/holiday.tmpl"},template:{detail:{baseClass:"panelnav_cell_category"}}},{name:"What's New",id:"whatsnew",cmcat:"CAT794",header:"/images/gnav/gnav_whatsnew_157x18_off.gif",content:{url:"/whats_new/panel_nav.tmpl"},template:{detail:{baseClass:"panelnav_cell_category"}}},{name:"Eyes",id:"CAT148",cmcat:"CAT148",header:"/images/gnav/gnav_eyes_157x18_off.gif"},{name:"Lips",id:"CAT163",cmcat:"CAT163",header:"/images/gnav/gnav_lips_157x18_off.gif"},{name:"Face",id:"CAT155",cmcat:"CAT155",header:"/images/gnav/gnav_face_157x18_off.gif"},{name:"Prep+Primer",id:"CAT172",cmcat:"CAT172",header:"/images/gnav/gnav_primer_157x18_off.gif"},{name:"Studio",id:"CAT1921",cmcat:"CAT1921",header:"/images/gnav/gnav_studio_157x18_off.gif"},{name:"Mineralize",id:"CAT869",cmcat:"CAT869",header:"/images/gnav/gnav_mineralize_157x18_off.gif"},{name:"Multi-use",id:"CAT793",cmcat:"CAT793",header:"/images/gnav/gnav_multiuse_157x18_off.gif"},{name:"Skincare",id:"CAT176",cmcat:"CAT176",header:"/images/gnav/gnav_skincare_157x18_off.gif"},{name:"Brushes",id:"CAT144",cmcat:"CAT144",header:"/images/gnav/gnav_brushes_157x18_off.gif"},{name:"Nails",id:"CAT170",cmcat:"CAT170",header:"/images/gnav/gnav_nails_157x18_off.gif"},{name:"Fragrance",id:"CAT161",cmcat:"CAT161",header:"/images/gnav/gnav_fragrance_157x18_off.gif"},{name:"Kit Essentials",id:"CAT133",cmcat:"CAT133",header:"/images/gnav/gnav_kit_essentials_157x18_off.gif"},{name:"Accessories",id:"CAT139",cmcat:"CAT139",header:"/images/gnav/gnav_accessories_157x18_off.gif"},{name:"Custom Palette",id:"CAT791",cmcat:"CAT791",header:"/images/gnav/gnav_custompalette_157x18_off.gif",uri:"/product/custom_palette.tmpl"},{name:"Goodbyes",id:"discontinued",cmcat:"CAT789",header:"/images/gnav/gnav_discontinuedproducts_157x18_off.gif",content:{url:"/discontinued/panel_nav.tmpl",param:"dquery",featured:{"name":"Featured Goodbyes","id":"featured_goodbyes","header":"/discontinued/images/headers/pnav_featured_goodbyes_250x18_off.gif","uri":"/product/featured_goodbyes.tmpl"}},template:{detail:{type:"simpleDetail",baseClass:"panelnav_cell_category"}},search:{formFieldId:"disc_search_input",formSubmitId:"disc_search_submit"}},{name:"Gift Card",id:"CAT792",cmcat:"CAT792",header:"/images/gnav/gnav_giftcard_157x18_off.gif",content:{url:"/giftcards/panel_nav.tmpl"}}]},{id:"makeup_artistry",items:[{name:"In The News",id:"newsworthy",header:"/images/gnav/gnav_newsworthy_157x18_off.gif",uri:"/makeup_artistry/newsworthy.tmpl"},{name:"The Artists",id:"artists",cmcat:"CAT1048",header:"/images/gnav/gnav_theartists_157x18_off.gif",content:{url:"/makeup_artistry/artists/panel_nav.tmpl",handleAs:"html",cms:true}},{name:"Looks",id:"looks",cmcat:"CAT81",header:"/images/gnav/gnav_looks_157x18_off.gif",content:{url:"/makeup_artistry/looks/panel_nav.tmpl",widget:"ProductSubNav"}},{name:"Artistry in Action",id:"artistry_in_action",cmcat:"260",header:"/images/gnav/gnav_artistry_in_action_157x18_off.gif",content:{url:"/makeup_artistry/artistry_action/panel_nav.tmpl"}},{name:"Faves",id:"faves",header:"/images/gnav/gnav_faves_157x18_off.gif",content:{url:"/makeup_artistry/faves/panel_nav.tmpl",widget:"SectionDescSubNav"},template:{detail:{baseClass:"panelnav_cell_category"}}},{name:"Email an Artist",id:"email_an_artist",cmcat:"1300",header:"/images/gnav/gnav_email_an_artist_157x18_off.gif",content:{url:"/makeup_artistry/email_artist/panel_nav.tmpl"},template:{detail:{type:"simpleDetail"}}},{name:"MAC Pro",id:"macpro",cmcat:"280",header:"/images/gnav/gnav_macpro_157x18_off.gif",content:{url:"/makeup_artistry/mac_pro/panel_nav.tmpl",handleAs:"html"}}]},{id:"giving_back",cmcat:"290",content:{url:"/giving_back/panel_nav.tmpl"},template:{detail:{type:"simpleDetail",baseClass:"panelnav_cell_category"}}},{id:"my_mac",cmcat:"1000",handleAs:"html",hasLoaded:true},{id:"customer_service",cmcat:"1400",content:{url:"/customer_service/panel_nav.tmpl",handleAs:"html",cms:true}},{id:"search",cmcat:"1700",content:{url:"/search/includes/panel_nav.tmpl",param:"query"},search:{formFieldId:"search",formSubmitId:"search_button",errorPopup:"pop_search_invalid"}}],altTypes:{"header_only":{detail:{baseClass:"panelnav_cell_header_only"}},"simple_detail":{detail:{template:"SimpleDetail"}}}};
function cmLookup(){
var _1={};
var _2={};
var _3=0;
var _4=site.globalnav.config.items;
for(x in _4){
for(y in _4[x]){
if(y==="items"){
var _5=_4[x].items;
for(var _6 in _5){
if(typeof (_5[_6].id)!="undefined"&&typeof (_5[_6].cmcat)!="undefined"){
_1[_5[_6].id]=_5[_6].name;
}
if(!(_5[_6].id.match("CAT[0-9]*"))){
_2[_5[_6].id]=_5[_6].cmcat;
}
}
}else{
if(typeof (_4[x].id)!="undefined"&&typeof (_4[x].cmcat)!="undefined"){
if(!(_4[x].id.match("CAT[0-9]*"))){
_2[_4[x].id]=_4[x].cmcat;
}else{
_1[_4[x].id]=_4[x].name;
}
}
}
}
}
return {map:_1,corrected_cat:_2};
};
var cm_map_lookup=cmLookup();
var cm_map=cm_map_lookup.map;
var cm_corrected_cat=cm_map_lookup.corrected_cat;
dojo.addOnLoad(function(){
var _7={};
if(dojo.global.page_data&&dojo.global.page_data.panel_nav){
_7=dojo.global.page_data.panel_nav["default"];
}
dojo.global.globalNavSetId="globalnav_container";
if(!dijit.byId(dojo.global.globalNavSetId)||!dojo.byId("globalnav")){
return;
}
var _8=new site.globalnav.GlobalNav({config:site.globalnav.config,defaultState:_7,globalNavSetId:dojo.global.globalNavSetId});
var cm=site.globalnav.Coremetrics;
setTimeout(function(){
cm.init();
},5000);
});
cm_map["CAT1124"]="Brunette Blonde Redhead : Brunette Blonde Redhead Looks";
cm_map["CAT972"]="Dame Edna : dameednalooks";
cm_map["CAT848"]="Viva Glam : Viva Glam VI Special Edition Looks";
cm_map["CAT1493"]="Style Warrior : Style Warrior Looks";
cm_map["CAT1439"]="A Rose Romance : A Rose Romance Looks";
cm_map["CAT1834"]="Richard Phillips : Richard Phillips Looks";
cm_map["CAT1812"]="Maira Kalman : Maira Kalman Looks";
cm_map["CAT1821"]="Marilyn Minter : Marilyn Minter Looks";
cm_map["CAT1923"]="Style Black : Style Black Looks";
site.globalnav.Coremetrics={init:function(){
dojo.subscribe("/panelnav/event/show",this,function(_a){
var _b=this;
var t=function(){
if(_a.type==="panel"){
_b.panelClickOpen(_a);
}else{
if(_a.type==="accordion"){
_b.open(_a);
}
}
};
setTimeout(t,600);
});
},open:function(_d){
if(typeof _d.parentId!="undefined"){
var _e=_d.parentId.match("CAT[0-9]*");
var _f=_d.id.match("CAT[0-9]*");
if(cm_map[_e]){
cmCreatePageviewTag("MPP : "+cm_map[_e]+" : "+_d.displayName,"",_f,"");
}else{
_e=_d.id.match("CAT[0-9]*");
if(typeof cm_map[_e]!="undefined"){
cmCreatePageviewTag("MPP : "+cm_map[_e],"",_f,"");
}
}
}
this.ElementTag(_d,"open");
},close:function(){
},panelClickOpen:function(_10){
var s=_10.sectionId;
var d=_10.itemId;
if(s==="makeup_artistry"){
s="Makeup Artistry";
}
if(typeof s!="undefined"&&typeof d!="undefined"){
if(d.match("CAT[0-9]*")){
cmCreatePageviewTag(s+" : "+_10.displayName,"",d,"");
}else{
cmCreatePageviewTag(s+" : "+_10.displayName,"",cm_corrected_cat[d],"");
}
}
this.ElementTag(_10,"open");
},panelClickClose:function(_13){
},SubNavChildClick:function(_14){
var d=this.activeItemId.match("CAT[0-9]*");
var s=_14.match("CAT[0-9]*");
var _17=this.parentId.match("CAT[0-9]*");
if(typeof cm_map[d]!="undefined"){
cmCreatePageviewTag(cm_map[d]+" : "+this.id,"",s,"");
}
},ElementTag:function(_18,_19){
if(!_18.parentId||!_18.id){
return;
}
var _1a=_18.parentId.match("CAT[0-9]*");
var _1b=_18.id.match("CAT[0-9]*");
var _1c="NAV ";
if(typeof _18.sectionId!="undefined"&&_18.sectionId!=""){
_1c=_1c+_18.sectionId+" ";
}
if(typeof cm_map[_1a]!="undefined"&&cm_map[_1a]!=""){
_1c=_1c+cm_map[_1a]+" ";
}
if(typeof _18.displayName!="undefined"&&_18.displayName!=""){
_1c=_1c+_18.displayName.replace(/\s/g,"_")+" ";
}
if(typeof cm_map[_18.id]!="undefined"&&cm_map[_18.id]!=""){
_1c=_1c+cm_map[_18.id].replace(/\s/g,"_")+" ";
}
EL=_1c.match(/[\w-'\+]+/g);
var _1d="";
var inc=2;
if(EL.length>1){
inc=2;
}else{
inc=1;
}
for(i=0;i<=EL.length-inc;i++){
_1d=_1d+EL[i]+" : ";
}
_1d=_1d.slice(0,-2);
cmCreatePageElementTag(EL[EL.length-1],_1d);
}};
