ProductJS={entitledItems:[],selectedAttributes:new Object(),errorMessages:new Object(),langId:"-1",storeId:"",catalogId:"",setCommonParameters:function(_1,_2,_3){
this.langId=_1;
this.storeId=_2;
this.catalogId=_3;
},setEntitledItems:function(_4){
this.entitledItems=_4;
},setSelectedAttribute:function(_5,_6){
this.selectedAttributes[_5]=_6;
},getCatalogEntryId:function(){
var _7=[];
for(attribute in this.selectedAttributes){
_7.push(attribute+"_"+this.selectedAttributes[attribute]);
}
return this.resolveSKU(_7);
},resolveSKU:function(_8){
var _9="";
var _a=_8.length;
for(x in this.entitledItems){
var _9=this.entitledItems[x].catentry_id;
var _b=this.entitledItems[x].Attributes;
var _c=0;
for(index in _b){
_c++;
}
if(_a>=_c){
var _d=0;
for(attributeName in _8){
var _e=_8[attributeName];
if(_e in _b){
_d++;
}
}
if(_c==_d){
return _9;
}
}
}
return null;
},PopUpAdd2ShopCartAjax:function(_f){
var _10=[];
var _11=eval("("+dojo.byId(_f).innerHTML+")");
this.setEntitledItems(_11);
var _12=this.getCatalogEntryId();
if(_12!=null){
_10.storeId=this.storeId;
_10.catalogId=this.catalogId;
_10.langId=this.langId;
_10.orderId=".";
_10.quantity="1";
_10.catEntryId=_12;
wc.service.invoke("AjaxAddOrderItem",_10);
cursor_wait();
}else{
alert(this.getErrorMessage("ERR_RESOLVING_SKU"));
}
},PopUpAdd2WishListAjax:function(_13){
var _14=[];
var _15=eval("("+dojo.byId(_13).innerHTML+")");
this.setEntitledItems(_15);
var _16=this.getCatalogEntryId();
if(_16!=null){
_14.storeId=this.storeId;
_14.catalogId=this.catalogId;
_14.langId=this.langId;
_14.URL="SuccessfulAJAXRequest";
_14.catEntryId=_16;
wc.service.invoke("AjaxInterestItemAdd",_14);
cursor_wait();
}else{
alert(this.getErrorMessage("ERR_RESOLVING_SKU"));
}
},ProductPageAdd2ShopCartAjax:function(_17,_18,_19){
var _1a=[];
var _1b=dojo.io.encodeForm(dojo.byId(_17));
var _1c="";
if(_19){
_1c=this.getCatalogEntryId();
}else{
_1c=_18;
}
_1a=queryToParamObject(_1b,_1a,false);
if(_1c!=null){
_1a.storeId=this.storeId;
_1a.catalogId=this.catalogId;
_1a.langId=this.langId;
_1a.orderId=".";
_1a.catEntryId=_1c;
wc.service.invoke("AjaxAddOrderItem",_1a);
cursor_wait();
}else{
alert(this.getErrorMessage("ERR_RESOLVING_SKU"));
}
},ProductPageAdd2WishListAjax:function(_1d,_1e,_1f){
var _20=[];
var _21=dojo.io.encodeForm(dojo.byId(_1d));
var _22="";
if(_1f){
_22=this.getCatalogEntryId();
}else{
_22=_1e;
}
_20=queryToParamObject(_21,_20,false);
if(_22!=null){
_20.storeId=this.storeId;
_20.catalogId=this.catalogId;
_20.langId=this.langId;
_20.URL="SuccessfulAJAXRequest";
_20.catEntryId=_22;
wc.service.invoke("AjaxInterestItemAdd",_20);
cursor_wait();
}else{
alert(this.getErrorMessage("ERR_RESOLVING_SKU"));
}
},Add2NewsLetterAjax:function(_23){
},Add2RSSFeedsAjax:function(_24){
},setErrorMessage:function(key,_26){
this.errorMessages[key]=_26;
},getErrorMessage:function(key){
var _28=this.errorMessages[key];
if(_28==null){
_28="Could not get the message value for specified key "+key;
}
return _28;
}};

