/*
	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:"신제품",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:"아이",id:"CAT148",cmcat:"CAT148",header:"/images/gnav/gnav_eyes_157x18_off.gif"},{name:"립",id:"CAT163",cmcat:"CAT163",header:"/images/gnav/gnav_lips_157x18_off.gif"},{name:"페이스",id:"CAT155",cmcat:"CAT155",header:"/images/gnav/gnav_face_157x18_off.gif"},{name:"Studio",id:"CAT1921",cmcat:"CAT1921",header:"/images/gnav/gnav_studio_157x18_off.gif"},{name:"미네랄라이즈",id:"CAT869",cmcat:"CAT869",header:"/images/gnav/gnav_mineralize_157x18_off.gif"},{name:"다기능 제품",id:"CAT793",cmcat:"CAT793",header:"/images/gnav/gnav_multiuse_157x18_off.gif"},{name:"프라이머",id:"CAT172",cmcat:"CAT172",header:"/images/gnav/gnav_primer_157x18_off.gif"},{name:"스킨케어",id:"CAT176",cmcat:"CAT176",header:"/images/gnav/gnav_skincare_157x18_off.gif"},{name:"브러시",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:"메이크업 도구",id:"CAT133",cmcat:"CAT133",header:"/images/gnav/gnav_kit_essentials_157x18_off.gif"},{name:"액세서리",id:"CAT139",cmcat:"CAT139",header:"/images/gnav/gnav_accessories_157x18_off.gif"}]},{id:"makeup_artistry",items:[{name:"In The News",id:"newsworthy",header:"/images/gnav/gnav_newsworthy_157x18_off.gif",uri:"/makeup_artistry/newsworthy.tmpl"},{name:"M·A·C 아티스트 소개",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:"룩과 메이크업 팁",id:"looks",cmcat:"CAT81",header:"/images/gnav/gnav_looks_157x18_off.gif",content:{url:"/makeup_artistry/looks/panel_nav.tmpl"},subnavType:"products"},{name:"메이크업 테크닉 동영상",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:"아티스트 추천 BEST 제품",id:"faves",header:"/images/gnav/gnav_faves_157x18_off.gif",content:{url:"/makeup_artistry/faves/panel_nav.tmpl",handleAs:"html",cms:true}},{name:"아티스트에게 이메일 보내기",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:"locator",cmcat:"1100",content:{url:"/locator/panel_nav.tmpl"},template:{detail:"simpleDetail"}},{id:"customer_service",cmcat:"1400",content:{url:"/customer_service/panel_nav.tmpl",handleAs:"html",cms:true}},{id:"search",cmcat:"1700",formFieldId:"search",formSubmitId:"search_button"}],altTypes:{"header_only":{detail:{baseClass:"panelnav_cell_header_only"}},"simple_detail":{detail:{template:"SimpleDetail"}}}};
var cm_map={};
var cm_corrected_cat={};
var skipcount=0;
for(x in site.globalnav.config){
for(y in site.globalnav.config[x]){
if(y==="items"){
var items=site.globalnav.config[x].items;
for(var element in items){
if(typeof (items[element].id)!="undefined"&&typeof (items[element].cmcat)!="undefined"){
cm_map[items[element].id]=items[element].name;
}
if(!(items[element].id.match("CAT[0-9]*"))){
cm_corrected_cat[items[element].id]=items[element].cmcat;
}
}
}else{
if(typeof (site.globalnav.config[x].id)!="undefined"&&typeof (site.globalnav.config[x].cmcat)!="undefined"){
if(!(site.globalnav.config[x].id.match("CAT[0-9]*"))){
cm_corrected_cat[site.globalnav.config[x].id]=site.globalnav.config[x].cmcat;
}else{
cm_map[site.globalnav.config[x].id]=site.globalnav.config[x].name;
}
}
}
}
}
dojo.addOnLoad(function(){
var _1={};
if(dojo.global.page_data&&dojo.global.page_data.panel_nav){
_1=dojo.global.page_data.panel_nav["default"];
}
dojo.global.globalNavSetId="globalnav_container";
var _2=new site.globalnav.GlobalNav({config:site.globalnav.config,defaultState:_1,globalNavSetId:dojo.global.globalNavSetId});
var cm=site.globalnav.Coremetrics;
setTimeout(function(){
cm.init();
},5000);
});
site.globalnav.Coremetrics={init:function(){
dojo.subscribe("/panelnav/event/show",this,function(_4){
var _5=this;
var t=function(){
if(_4.type==="panel"){
_5.panelClickOpen(_4);
}else{
if(_4.type==="accordion"){
_5.open(_4);
}
}
};
setTimeout(t,600);
});
},open:function(_7){
if(typeof _7.parentId!="undefined"){
var _8=_7.parentId.match("CAT[0-9]*");
var _9=_7.id.match("CAT[0-9]*");
if(cm_map[_8]){
cmCreatePageviewTag("MPP : "+cm_map[_8]+" : "+_7.displayName,"",_9,"");
}else{
_8=_7.id.match("CAT[0-9]*");
if(typeof cm_map[_8]!="undefined"){
cmCreatePageviewTag("MPP : "+cm_map[_8],"",_9,"");
}
}
}
this.ElementTag(_7,"open");
},close:function(){
},panelClickOpen:function(_a){
var s=_a.sectionId;
var d=_a.itemId;
if(s==="makeup_artistry"){
s="Makeup Artistry";
}
if(typeof s!="undefined"&&typeof d!="undefined"){
if(d.match("CAT[0-9]*")){
cmCreatePageviewTag(s+" : "+_a.displayName,"",d,"");
}else{
cmCreatePageviewTag(s+" : "+_a.displayName,"",cm_corrected_cat[d],"");
}
}
this.ElementTag(_a,"open");
},panelClickClose:function(_d){
},SubNavChildClick:function(_e){
var d=this.activeItemId.match("CAT[0-9]*");
var s=_e.match("CAT[0-9]*");
var _11=this.parentId.match("CAT[0-9]*");
if(typeof cm_map[d]!="undefined"){
cmCreatePageviewTag(cm_map[d]+" : "+this.id,"",s,"");
}
},ElementTag:function(_12,_13){
var _14=_12.parentId.match("CAT[0-9]*");
var _15=_12.id.match("CAT[0-9]*");
if(_12.id==="gnav_products"){
cm_map[_12.id]="PRODUCTS";
}else{
if(_12.id==="gnav_makeup_artistry"){
cm_map[_12.id]="ARTISTRY";
}else{
if(_12.id==="pnav_giving_back_panel"){
cm_map[_12.id]="GIVING_BACK";
}else{
if(_12.id==="pnav_my_mac_panel"){
cm_map[_12.id]="MY_MAC";
}else{
if(_12.id==="pnav_locator_panel"){
cm_map[_12.id]="LOCATOR";
}else{
if(_12.id==="pnavset_products_panel"||_12.id==="pnavset_makeup_artistry_panel"||_12.id==="pnav_giving_back_panel"){
cm_map[_12.id]=cm_map[_12.itemId];
}
}
}
}
}
}
var _16="NAV ";
if(typeof _12.sectionId!="undefined"&&_12.sectionId!=""){
_16=_16+_12.sectionId+" ";
}
if(typeof cm_map[_14]!="undefined"&&cm_map[_14]!=""){
_16=_16+cm_map[_14]+" ";
}
if(typeof _12.displayName!="undefined"&&_12.displayName!=""){
_16=_16+_12.displayName.replace(/\s/g," ")+" ";
}
if(typeof cm_map[_12.id]!="undefined"&&cm_map[_12.id]!=""){
_16=_16+cm_map[_12.id].replace(/\s/g," ")+" ";
}
EL=_16.match(/[\w-'\+]+/g);
var _17="";
var inc=2;
if(EL.length>1){
inc=2;
}else{
inc=1;
}
for(i=0;i<=EL.length-inc;i++){
_17=_17+EL[i]+" : ";
}
_17=_17.slice(0,-2);
if(typeof cm_map[_12.id]=="undefined"){
_17=_17+" : "+cm_map[_14];
if(_12.sectionId==="makeup_artistry"){
_17="NAV : makeup_artistry";
}
cmCreatePageElementTag(_12.displayName,_17);
}else{
if(typeof _12.sectionId=="undefined"){
cmCreatePageElementTag(_12.displayName,_17);
}else{
if(_12.sectionId!=""){
_17=_17+" : "+_12.sectionId;
}
if(_12.sectionId==="makeup_artistry"){
_17="NAV : makeup_artistry";
}
cmCreatePageElementTag(_12.displayName,_17);
}
}
}};
