/* COMA-BUILD: 2010-09-03 15:56 */
var NM_ComProductNavigation=NM_Component.extend({blnInitFacets:false,blnInitPreselection:false,strFilterUrl:'',strFilerUrlHash:'',objFilterUrlHash:null,arrFilterList:[],arrDefaultList:[],intWinScrollHeight:0,intLoadingPos:0,strProductLink:'',objLastSelection:{},initialize:function(objParam)
{this.parent(objParam);this.strProductLink=objParam.product_link;this.strFilterUrl=objParam.filter_url;this.objFilterUrlHash=new Hash();this.registerEventLoad();this.registerRequest('filter');},onLoad:function()
{this.initLoadingDim();this.initUrlHash();this.setFilterList();this.initFacets();},onHashChange:function()
{if(this.strFilerUrlHash!=window.location.hash)
{this.initUrlHash();this.blnInitPreselection=false;this.blnInitFacets=false;this.setFilterList();this.initFacets();this.log('onHashChange:'+this.strFilerUrlHash);}
else
{}},initUrlHash:function()
{this.strFilerUrlHash=window.location.hash;if(this.strFilerUrlHash!='')
{var arrHash=decodeURIComponent(this.strFilerUrlHash.replace('#filter/','')).split('/');arrHash.each(function(strFilter){var arrMatch=strFilter.match(/(.*)\>\{(.*)\}/);if($type(arrMatch)=='array')
{this.objFilterUrlHash.set(arrMatch[1],arrMatch[2].split(';'));}}.bind(this));}},setFilterList:function()
{this.arrFilterList=$$('#'+this.getName()+' li.filter');this.arrDefaultList=$$('#'+this.getName()+' li.list');},initFacets:function()
{if(false==this.blnInitFacets)
{this.arrFilterList.removeEvents('mouseover');var objFilter={};var blnStartPreselect=false;var blnPreselectFilter=false;this.arrFilterList.each(function(elmFacet){blnPreselectFilter=false;objFilter={};objFilter.attribute=$E('.filter_attribute',elmFacet).getValue();objFilter.type=$E('.filter_type',elmFacet).getValue();objFilter.id='#facet_'+objFilter.attribute;var arrHashValue=this.getFacetHashValues(objFilter.attribute);$ES('li',elmFacet).filterByClass('enabled').each(function(elmLi){if(false==this.blnInitPreselection&&arrHashValue.length>0)
{if(true==arrHashValue.contains($E('input',elmLi).getProperty('value')))
{this.selectItem(elmLi,objFilter);blnPreselectFilter=true;blnStartPreselect=true;}}
$E('a',elmLi).removeProperty('href');elmLi.addEvent('click',this.initFilterItem.bindWithEvent(this,[elmLi,objFilter]));}.bind(this));if(true==blnPreselectFilter)
{this.setFilterUrl(objFilter);}}.bind(this));if(false==this.blnInitPreselection&&true==blnStartPreselect)
{NM_RequestDispatcher.fire(this.getDispatchRequest({fh_url:encodeURIComponent(this.getFilterUrl())}));}
this.blnInitPreselection=true;this.blnInitFacets=true;}},getFacetHashValues:function(strAttribute)
{var arrHashValue=[];if(false==this.blnInitPreselection&&true==this.objFilterUrlHash.hasKey(strAttribute))
{arrHashValue=this.objFilterUrlHash.get(strAttribute);}
return arrHashValue;},initFilterItem:function(event,elmLi,objFilter)
{if(false==$E('input',elmLi).getProperty('disabled'))
{this.dir('initFilterItem(): <objFilter>',objFilter);event.stop();this.objLastSelection.elm=elmLi;this.objLastSelection.filter=objFilter;this.selectItem(elmLi,objFilter);this.setFilterUrl(objFilter)
NM_RequestDispatcher.fire(this.getDispatchRequest({fh_url:encodeURIComponent(this.getFilterUrl())}));}},initListItem:function(event,elmLi,strUrl)
{event.stop();this.strFilterUrl=strUrl;this.log('filter url: '+strUrl);NM_RequestDispatcher.fire(this.getDispatchRequest({fh_url:encodeURIComponent(this.getFilterUrl())}));},cbOnSuccess:function(strEvent)
{switch(strEvent)
{case'filter':this.blnInitFacets=false;this.setFilterList();this.initFacets();break;}},cbOnComplete:function(objResData)
{var objComRes=new NM_ComResponse(objResData)
switch(objComRes.getEvent())
{case'filter':this.replaceComHtml($(this.getName()),objComRes.getContent());break;}},cbOnWait:function(strEvent,blnStart)
{switch(strEvent)
{case'filter':if(true==blnStart)
{this.disableAll();var elmWait=new Element('div').setStyle('height',0).setProperty('id',this.getName()+'Wait');new Element('div').setProperty('id','waitStatus').setStyle('top',(window.getScrollTop()+this.intLoadingOffsetY)+'px').injectInside(elmWait);new Element('div').setProperty('id','waitBg').setOpacity(0.85).setStyle('height',this.intWinScrollHeight+'px').injectInside(elmWait);elmWait.injectTop($('NM_GridPage'));}
else
{this.enableAll();if($type($(this.getName()+'Wait'))=='element')
{$(this.getName()+'Wait').remove();}}
break;}},cbOnError:function()
{this.error('onError');},cbOnException:function(strEvent,objParam)
{switch(strEvent)
{case'filter':this.cbOnWait(strEvent,true);var strFHUrl=this.getFilterUrl();this.selectItem(this.objLastSelection.elm,this.objLastSelection.filter);this.setFilterUrl(this.objLastSelection.filter);window.location.href=this.strProductLink.replace(/_fh_url_/,strFHUrl);break;}},setFilterUrl:function(objFilter)
{var arrValueList=this.getSelectedFacetValues(objFilter.id);var objRegExFilter=eval('/(\\/|%2F)'+objFilter.attribute+'(\<|%3C|\>|%3E)(\{|%7B)(.*?)(\}|%7D)/i');var strFHUrl='';var strFacetUrl='';var strHash='';if(arrValueList.length>0)
{strFacetUrl=encodeURIComponent('/'+objFilter.attribute+'>{'+arrValueList.join(';')+'}');if(true==this.strFilerUrlHash.contains(objFilter.attribute))
{strHash=this.strFilerUrlHash.replace(objRegExFilter,strFacetUrl);}
else
{var objRegExHash=new RegExp(/filter(.*)(\}|%7D)/i);var arrRegExHash=objRegExHash.exec(this.strFilerUrlHash);if($type(arrRegExHash)=='array')
{strHash=this.strFilerUrlHash.replace(objRegExHash,'filter'+arrRegExHash[1]+arrRegExHash[2]+strFacetUrl);}
else
{strHash='filter'+strFacetUrl;}}
if(true==this.strFilterUrl.contains(objFilter.attribute))
{strFHUrl=this.strFilterUrl.replace(objRegExFilter,strFacetUrl);}
else
{var objRegExFHUrl=new RegExp(/fh_location(.*)(\}|%7D)/i);var arrRegExFHUrl=objRegExFHUrl.exec(this.strFilterUrl);if($type(arrRegExFHUrl)=='array')
{strFHUrl=this.strFilterUrl.replace(objRegExFHUrl,'fh_location'+arrRegExFHUrl[1]+arrRegExFHUrl[2]+strFacetUrl);}}}
else
{strFacetUrl='';strHash=this.strFilerUrlHash.replace(objRegExFilter,'');if(strHash=='filter')
{strHash='';}
strFHUrl=this.strFilterUrl.replace(objRegExFilter,'');}
this.strFilerUrlHash=strHash;window.location.hash=strHash;window.location.replace(window.location.href);this.log('setFilterUrl(): <strFilerUrlHash> = '+decodeURIComponent(strHash));this.strFilterUrl=strFHUrl;this.log('setFilterUrl(): <strFilterUrl> = '+decodeURIComponent(strFHUrl));},getFilterUrl:function()
{return this.strFilterUrl;},getDispatchRequest:function(objParam)
{var objCaller=new NM_RequestDispatchCaller();objCaller.setName(this.getName());objCaller.setObject('obj'+this.getName());objCaller.setMethodOnSuccess('cbOnSuccess');objCaller.setMethodOnWait('cbOnWait');objCaller.setMethodOnException('cbOnException');var objDispatcher=new NM_RequestDispatchDispatcher();objDispatcher.setDispatcher('product_overview');objDispatcher.setUrl('/ajax/cr.mb1');objDispatcher.setParam(objParam);var objDR=new NM_RequestDispatchRequest();objDR.setEvent('filter');objDR.setCaller(objCaller);objDR.setDispatcher(objDispatcher);return objDR;},getSelectedFacetValues:function(strFilterId)
{var arrValueList=[];$$(strFilterId+' ol input').each(function(elmInput){if(true==elmInput.getProperty('checked'))
{arrValueList.push(elmInput.getValue());}}.bind(arrValueList));return arrValueList;},enableAll:function()
{$ES('li.filterItem').filterByClass('disabled').each(function(elmLi){elmLi.addClass('enabled');elmLi.removeClass('disabled');$E('a',elmLi).removeClass('disabled');$E('input',elmLi).removeProperty('disabled');});},disableAll:function()
{$ES('li.filterItem').filterByClass('enabled').each(function(elmLi){elmLi.removeClass('enabled');elmLi.addClass('disabled');$E('a',elmLi).addClass('disabled');$E('input',elmLi).setProperty('disabled','disabled');});},selectItem:function(elmLiSel,objFilter)
{switch(objFilter.type)
{case'checkbox':this.selectCheckbox(elmLiSel,objFilter);break;case'radio':this.selectRadio(elmLiSel,objFilter);break;}},selectCheckbox:function(elmLiSel,objFilter)
{if(true==$E('input',elmLiSel).getProperty('checked'))
{$E('input',elmLiSel).removeProperty('checked')
elmLiSel.removeClass('checked');}
else
{$E('input',elmLiSel).setProperty('checked','checked')
elmLiSel.addClass('checked');}},selectRadio:function(elmLiSel,objFilter)
{$$(objFilter.id+' ol li').each(function(elmLi){if(elmLi==elmLiSel)
{this.selectCheckbox(elmLiSel,objFilter);}
else
{$E('input',elmLi).removeProperty('checked')
elmLi.removeClass('checked');}}.bind(this));},initLoadingDim:function()
{this.intWinScrollHeight=window.getScrollHeight();this.intLoadingOffsetY=window.getHeight()/2.7;}});var NM_ComProductTyping=NM_Component.extend({text:'',strMore:'',interval:'',strObjectName:'',moreInfoAvailable:false,moreInfoVisible:false,blnHide:false,blnDispatchInfoboxEvent:false,blnInfoVisible:false,blnIsVisible:true,height:'',initialize:function(objParam){this.text=objParam.arrText;this.strMore=objParam.strMore;this.height=70;this.strObjectName=objParam.strObjectName;this.infobox=new Element('div',{'styles':{'position':'absolute','display':'block','overflow':'hidden','margin':'0px','padding':'5px','width':'190px','height':'70px','opacity':'0','z-index':'100'},'id':'pricepanel_text'});this.infobox_content=new Element('div',{'styles':{'position':'relative','overflow':'hidden','font-size':'10pt','display':'block','clear':'both'}});this.infobox_content.addEvent('mouseout',function(){this.hideInfoDelayed();}.bind(this));this.infobox_content.addEvent('mouseover',function(){this.blnHide=false;}.bind(this));this.morelink=new Element('a',{'href':'javascript:'+this.strObjectName+'.moreInfo()','styles':{'text-decoration':'underline','float':'right'}});this.morelink.addEvent('mouseover',function(){this.blnHide=false;}.bind(this));this.fx=this.infobox.effects({duration:500,transition:Fx.Transitions.Quint});this.infobox_content.inject(this.infobox);this.morelink.inject(this.infobox);this.moretext='';},showInfo:function(strText,event){var text=strText;var strShortText='';var arrWords=text.split(' ');if(arrWords.length>20){this.moretext=text;for(i=0;i<20;i++){strShortText+=arrWords[i]+' ';}
strShortText+='...';this.morelink.innerHTML=this.strMore;this.morelink.setStyle('opacity',1);this.moreInfoAvailable=true;this.blnDispatchInfoboxEvent=true;}
else{this.morelink.innerHTML='';strShortText=text;}
var intLines=(arrWords.length/22);intLines=intLines.round();this.height=(intLines*16+10);var x=event.clientX;var y=event.clientY+window.getScrollTop()+10;this.infobox_content.setHTML(strShortText);this.infobox.setStyle('left',(x-30)+'px');this.infobox.setStyle('top',y+'px');if(this.blnInfoVisible==false){this.infobox.inject(document.body);this.fx.start({'opacity':[0,0.9],'height':[0,this.height],'width':[190,190]});this.blnInfoVisible=true;}
this.blnHide=false;},moreInfo:function(){if(window.ie6&&$('NM_ComTabContent')!=null){$('NM_ComTabContent').getElements('li').setStyle('position','static');}
this.morelink.setStyle('opacity',0);this.moreInfoVisible=true;this.infobox_content.setHTML(this.moretext);this.fx.start({'width':[190,360],'height':[this.height,200]});},hideInfoDelayed:function(){clearInterval(this.interval);if(this.blnInfoVisible==true){this.blnHide=true;this.interval=setInterval(this.strObjectName+".hideInfo()",500);}},hideInfo:function(param){clearInterval(this.interval);if(this.blnHide==true){if(window.ie6&&$('NM_ComTabContent')!=null){$('NM_ComTabContent').getElements('li').setStyle('position','relative');}
if(this.moreInfoVisible==true){this.fx.start({'opacity':[0.9,0],'height':[200,0],'width':[360,190]});this.moreInfoVisible=false;}
else{this.fx.start({'opacity':[0.9,0],'height':[this.height,0]});}
this.setVisibleFalse.delay(600,this);this.blnHide=false;}},setVisibleFalse:function(){this.blnInfoVisible=false;}});var NM_ComCompareProductItem=NM_Component.extend({strComName:'',strCookieName:'',intCategoryId:0,strPopupUrl:'',objCategoryDataHash:null,strCookieData:null,arrElmProductCompareItemList:null,strButtonText:'',strselectedText:'',initialize:function(objParam)
{this.parent(objParam);this.strCookieName=objParam.cookieName;this.intCategoryId=parseInt(objParam.categoryId);this.strPopupUrl=objParam.popupUrl;this.strWarningMore=objParam.warningMore;this.strButtonText=objParam.buttonText;this.strselectedText=objParam.selectedText;this.intProductCount=0;this.strCookieData=this.getCookie();this.objCategoryDataHash=this.getCategoryData(this.intCategoryId);this.registerEventLoad();},onLoad:function()
{this.initProductCompareItemList();this.initProductCompareButton();},initProductCompareItemList:function(){this.arrElmProductCompareItemList=$$('.NM_ComProductCompareItem');if($type(this.arrElmProductCompareItemList)=='array')
{var objCategoryDataHash=this.objCategoryDataHash;var strselectedText=this.strselectedText;this.arrElmProductCompareItemList.forEach(function(objElm){var blnInputDisabled=true;var text=this.objCategoryDataHash.length+' '+strselectedText+' ';if(objCategoryDataHash.length=="4")
{var intProductId=parseInt(objElm.getElement('input').value);if(false==objCategoryDataHash.hasKey(intProductId))
{blnInputDisabled=true;text=' '+this.strWarningMore+' ';$E('a',objElm).style.display='none';$E('label',objElm).style.display='block';$E('label',objElm).innerHTML='';$E('label',objElm).appendText(this.strButtonText);}
else
{blnInputDisabled=false;}}
else{blnInputDisabled=false;}
$E('label',objElm).removeClass('disable');objElm.getElement('span').innerHTML='';objElm.getElement('span').appendText(text);objElmInput=$E('input',objElm);objElmInput.disabled=blnInputDisabled;if(true==this.objCategoryDataHash.hasKey(parseInt(objElmInput.value))){objElmInput.setProperty('checked',1);this.intProductCount++;}
objElmInput.addEvent('click',this.handleProduct.bind(this).pass(objElmInput));}.bind(this));}},initProductCompareButton:function(){var arrElmCompareButton=$ES('.btnCompare',this.strComName);if($type(arrElmCompareButton)=='array'){arrElmCompareButton.forEach(function(objElm){objElm.removeEvents();if(this.objCategoryDataHash.length>0){objElm.addEvent('click',this.openPopup.bind(this,objElm.name));objElm.removeClass('btnCompareDeactive');objElm.addClass('btnCompareActive');}
else
{objElm.removeEvents();objElm.removeClass('btnCompareActive');objElm.addClass('btnCompareDeactive');}}.bind(this));}},handleProduct:function(objElm){if(objElm.getValue()>0){this.addProduct(objElm);this.intProductCount++;var objCategoryDataHash=this.objCategoryDataHash;var strButtonText=this.strButtonText;var strWarningMore=this.strWarningMore;var strselectedText=this.strselectedText;this.arrElmProductCompareItemList.forEach(function(objElm){var text=objCategoryDataHash.length+' '+strselectedText+' ';if(objCategoryDataHash.length=="4")
{var checked=objElm.getElement('input').getProperty('checked');var intProductId=parseInt(objElm.getElement('input').value);if(false==objCategoryDataHash.hasKey(intProductId))
{objElm.getElement('input').disabled=true;objElm.getElement('label').innerHTML='';objElm.getElement('label').style.display='block';objElm.getElement('label').appendText(strButtonText);objElm.getElement('a').style.display='none';text=' '+strWarningMore+' ';}else
{objElm.getElement('input').disabled=false;objElm.getElement('label').style.display='none';}}
else
{objElm.getElement('input').disabled=false;}
var myElement=objElm.getElement('span');myElement.innerHTML=text;});}
else{this.deleteProduct(objElm);this.intProductCount--;var objCategoryDataHash=this.objCategoryDataHash;var strselectedText=this.strselectedText;this.arrElmProductCompareItemList.forEach(function(objElm){var text=objCategoryDataHash.length+' '+strselectedText+' ';objElm.getElement('input').disabled=false;objElm.getElement('label').innerHTML='';objElm.getElement('label').style.display='none';objElm.getElement('a').style.display='block';objElm.getElement('span').innerHTML=text;});}
this.initProductCompareButton();},addProduct:function(objElm){var intProductId=parseInt(objElm.getValue());this.objCategoryDataHash.set(intProductId,intProductId);this.setCookie();},deleteProduct:function(objElm){var intProductId=parseInt(objElm.value);if(true==this.objCategoryDataHash.hasKey(intProductId))
{this.objCategoryDataHash.remove(intProductId);this.setCookie();}},setCookie:function(){var strCategoryValue=this.intCategoryId+':'+(this.objCategoryDataHash.keys()).join(',')+'#';if(this.strCookieData.search(this.intCategoryId)!=-1){this.strCookieData=this.strCookieData.replace(eval('/'+parseInt(this.intCategoryId)+'(.*?)#/'),strCategoryValue);}
else{this.strCookieData+=strCategoryValue;}
Cookie.set(this.strCookieName,encodeURIComponent(this.strCookieData),{duration:0,path:'/'});},getCookie:function(){var strCookieData=Cookie.get(this.strCookieName);if($type(strCookieData)=='string'&&strCookieData!=''){strCookieData=decodeURIComponent(strCookieData);}
else{strCookieData='';}
return strCookieData;},getCategoryData:function(intCategoryId){var objCategoryDataHash=new Hash();var arrMatch=this.strCookieData.match(eval('/'+parseInt(intCategoryId)+'(.*?)#/'));if($type(arrMatch)=='array'&&arrMatch.length>1){var arrCookieDataCategory=arrMatch[1].replace(':','').split(',');for(var intCnt=0;intCnt<arrCookieDataCategory.length;intCnt++){if(false==isNaN(arrCookieDataCategory[intCnt])&&arrCookieDataCategory[intCnt]>0){objCategoryDataHash.set(arrCookieDataCategory[intCnt],true);}}}
return objCategoryDataHash;},openPopup:function(objElm)
{if(false==this.objCategoryDataHash.hasKey(objElm))
{if(this.intProductCount<4)
{document.getElementById('productCompare_'+objElm).click();}}
if(this.intProductCount==0)
{}
else if(this.intProductCount>4)
{NM_Layer.showMessage('',this.strWarningMore,250,100);}
else
{try
{NM_Layer.showUrl(this.strPopupUrl,825,710,'no');}
catch(e)
{this.log('openPopup: error');}}}});var NM_ComProductAvailability=NM_Component.extend({objConst:{'layer_width_min':100},elmLayerTpl:'',strLinkCR:'',objFX:null,elmProductItem:null,initialize:function(objParam)
{this.parent(objParam);this.strLinkCR=objParam.link_cr;this.registerEventLoad();this.registerRequest('filter');},onLoad:function()
{this.registerEvents();this.elmLayerTpl=$E('.'+this.strComName);$E('.'+this.strComName).remove();},registerEvents:function()
{this.arrElmList=$$('.colorImages');this.arrElmList.each(function(elmItem,intIndex){var handleShow=null;var intProductId=$E('input.availabilityProductId',elmItem).getValue();elmItem.addEvent('mouseenter',function(){handleShow=this.requestData.bind(this).pass([elmItem,intProductId]).delay(300,this);}.bind(this));elmItem.addEvent('mouseleave',function(){$clear(handleShow);this.hideLayer(intProductId);}.bind(this));}.bind(this));},cbOnComplete:function(objRespData)
{var objComRes=new NM_ComResponse(objRespData)
switch(objComRes.getEvent())
{case'filter':this.registerEvents();break;}},requestData:function(elmItem,intProductId)
{elmParentElement=elmItem.getParent();while(false==elmParentElement.hasClass('NM_ComProductItem'))
{elmParentElement=elmParentElement.getParent();}
this.elmProductItem=elmParentElement;var elmLayer=$E('.'+this.getName()+intProductId);if($type(elmLayer)!='element')
{var objClientRequest=new Ajax(this.strLinkCR,{method:'get',postBody:{product_id:intProductId},onComplete:this.cbRequestData.bind(this)}).request();}
else
{this.showLayer(elmLayer);}},cbRequestData:function(strResponse)
{if(strResponse!='')
{try
{var objResponse=Json.evaluate(strResponse);if($type(objResponse)=='object')
{this.generateContent(objResponse);}
else
{this.error('cbRequestData(): no valid Json string');}}
catch(e)
{alert(e);this.error('cbRequestData(): '+e);}}},generateContent:function(objData)
{var elmLayer=this.elmLayerTpl.clone();elmLayer.addClass(this.getName()+objData.product_id);var elmTRTpl=new Element('tr').addClass('data');var elmTDTpl=new Element('td');var elmTHTpl=new Element('th');objData.color_list.forEach(function(objColor,intCnt){var elmTH=elmTHTpl.clone();if(objColor.image_path!='')
{elmTH.setProperty('title',objColor.name);elmTH.setStyle('background-image','url('+objColor.image_path+')');}
else
{elmTH.setText(objColor.name);}
elmTH.injectInside($E('thead tr.color',elmLayer));}.bind(this));$E('thead tr.size th.space',elmLayer).setProperty('colspan',objData.color_list.length);var intRowCnt=0;var objHash=$H(objData.stock_status);var elmTableBody=$E('tbody',elmLayer);objHash.each(function(objRow,intCnt){var elmTR=elmTRTpl.clone();elmTR.addClass((intRowCnt++%2==1)?'even':'odd');var elmTDSize=elmTDTpl.clone();elmTDSize.setText(objRow.name).addClass('size');elmTDSize.injectInside(elmTR);var objStatusHash=$H(objRow.color);objStatusHash.each(function(objColor){var elmTDStatus=elmTDTpl.clone();elmTDStatus.addClass((objColor.status==0)?'onStock':(objColor.status==1)?'soldOut':'notAvailable').addClass('status');elmTDStatus.injectInside(elmTR);elmTDStatus.setProperty('title',objColor.name);}.bind(this));elmTR.injectInside(elmTableBody);}.bind(this));elmLayer.injectTop($E('body'))
var objTableSize=$E('table',elmLayer).getSize();if(objTableSize.size.x<this.objConst.layer_width_min)
{objTableSize.size.x=this.objConst.layer_width_min;}
elmLayer.setStyle('width',objTableSize.size.x+'px');this.showLayer(elmLayer);},showLayer:function(elmLayer)
{if($type(elmLayer)=='element')
{if(this.objFX!=null)
{this.objFX.stop();this.objFX=null;}
$ES('.'+this.getName()).setOpacity(0);if($type(this.elmProductItem)=='element')
{var objPos=$E('.colorImages',this.elmProductItem).getPosition();var objSize=elmLayer.getSize();elmLayer.setStyles({'left':objPos.x+'px','top':objPos.y-(objSize.size.y)+'px'});}
this.objFX=new Fx.Style(elmLayer,'opacity').start(0,1);}},hideLayer:function(intProductId)
{if(this.objFX!=null)
{this.objFX.stop();this.objFX=null;}
var elmLayer=$E('.'+this.getName()+intProductId);if($type(elmLayer)=='element')
{if(true==window.ie6)
{elmLayer.setOpacity(0);$ES('.'+this.getName()).setOpacity(0);}
else
{var floOpacity=elmLayer.getStyle('opacity');this.objFX=new Fx.Style(elmLayer,'opacity').start(floOpacity,0).chain(function(){elmLayer.setOpacity(0);$ES('.'+this.getName()).setOpacity(0);}.bind(this));}}}});var NM_ComBrandLogoBox=NM_Component.extend({blnShowSlider:false,intSliderIncrement:6,intNumberBrand:10,elmBrandSlider:'',elmRightButton:'',elmLeftButton:'',intCurrentElement:1,initialize:function(objParam)
{this.intNumberBrand=objParam.number_brands;this.intSliderIncrement=objParam.js_increment;this.blnShowSlider=objParam.show_slider;this.elmLeftButton=$E('#parentBox .left');this.elmRightButton=$E('#parentBox .right');this.elmBrandSlider=new Fx.Scroll($('brandSlider'),{duration:2000,wait:true,transition:Fx.Transitions.Back.easeOut});if(false==this.blnShowSlider)
{this.displayButton(this.elmLeftButton,false);this.displayButton(this.elmRightButton,false);}
else
{this.parent(objParam);this.registerEventLoad(objParam);this.displayButton(this.elmLeftButton,false);}},onLoad:function(objParam)
{this.elmLeftButton.addEvent('click',this.scrollBrandBar.bind(this).pass('left'));this.elmRightButton.addEvent('click',this.scrollBrandBar.bind(this).pass('right'));},scrollBrandBar:function(strDirection)
{var intNewPosition=1;if(strDirection=='left')
{intNewPosition=this.intCurrentElement-this.intSliderIncrement;}
else
{intNewPosition=this.intCurrentElement+this.intSliderIncrement;}
if(intNewPosition<=1)
{intNewPosition=1;this.displayButton(this.elmLeftButton,false);}
else if((intNewPosition+this.intSliderIncrement)>this.intNumberBrand)
{this.displayButton(this.elmRightButton,false);}
else
{this.displayButton(this.elmRightButton,true);this.displayButton(this.elmLeftButton,true);}
this.elmBrandSlider.toElement('sliderElement_'+intNewPosition);this.intCurrentElement=intNewPosition;},displayButton:function(elmButton,blnStatus)
{if(false==blnStatus)
{elmButton.addClass('hide');}
else
{elmButton.removeClass('hide');}}});var NM_ComProductList=NM_Component.extend({initialize:function(objParam)
{this.parent(objParam);var objComReq=new NM_ComRequest();objComReq.setComInitParam({tpl:objParam.type});objComReq.setComDisplayParam({listType:objParam.list_type});this.registerRequest('filter',objComReq);},cbOnComplete:function(objResData)
{var objComRes=new NM_ComResponse(objResData)
switch(objComRes.getEvent())
{case'filter':this.replaceComHtml($(this.getName()),objComRes.getContent());break;}}});var NM_ComProductBrowser=NM_Component.extend({initialize:function(objParam)
{this.parent(objParam);this.registerRequest('filter');},cbOnComplete:function(objRespData)
{var objComRes=new NM_ComResponse(objRespData)
switch(objComRes.getEvent())
{case'filter':$$('.'+this.getName()).each(function(elmCom){if(true==elmCom.hasClass('ProductBrowserTop'))
{this.replaceComHtml(elmCom,objComRes.getContent().top);}
else
{this.replaceComHtml(elmCom,objComRes.getContent().bottom);}}.bind(this));break;}}});