(function($){$.extend({metadata:{defaults:{type:'class',name:'metadata',cre:/({.*})/,single:'metadata'},setType:function(type,name){this.defaults.type=type;this.defaults.name=name;},get:function(elem,opts){var settings=$.extend({},this.defaults,opts);if(!settings.single.length)settings.single='metadata';var data=$.data(elem,settings.single);if(data)return data;data="{}";if(settings.type=="class"){var m=settings.cre.exec(elem.className);if(m)
data=m[1];}else if(settings.type=="elem"){if(!elem.getElementsByTagName)return;var e=elem.getElementsByTagName(settings.name);if(e.length)
data=$.trim(e[0].innerHTML);}else if(elem.getAttribute!=undefined){var attr=elem.getAttribute(settings.name);if(attr)
data=attr;}
if(data.indexOf('{')<0)
data="{"+data+"}";data=eval("("+data+")");$.data(elem,settings.single,data);return data;}}});$.fn.metadata=function(opts){return $.metadata.get(this[0],opts);};})(jQuery);;;if(window.jQuery)(function($){if($.browser.msie)try{document.execCommand("BackgroundImageCache",false,true)}catch(e){};$.fn.rating=function(options){if(this.length==0)return this;if(typeof arguments[0]=='string'){if(this.length>1){var args=arguments;return this.each(function(){$.fn.rating.apply($(this),args);});};$.fn.rating[arguments[0]].apply(this,$.makeArray(arguments).slice(1)||[]);return this;};var options=$.extend({},$.fn.rating.options,options||{});$.fn.rating.calls++;this.not('.star-rating-applied').addClass('star-rating-applied').each(function(){var control,input=$(this);var eid=(this.name||'unnamed-rating').replace(/\[|\]/g,'_').replace(/^\_+|\_+$/g,'');var context=$(this.form||document.body);var raters=context.data('rating');if(!raters||raters.call!=$.fn.rating.calls)raters={count:0,call:$.fn.rating.calls};var rater=raters[eid];if(rater)control=rater.data('rating');if(rater&&control)
control.count++;else{control=$.extend({},options||{},($.metadata?input.metadata():($.meta?input.data():null))||{},{count:0,stars:[],inputs:[]});control.serial=raters.count++;rater=$('<span class="star-rating-control"/>');input.before(rater);rater.addClass('rating-to-be-drawn');if(input.attr('disabled'))control.readOnly=true;rater.append(control.cancel=$('<div class="rating-cancel"><a title="'+control.cancel+'">'+control.cancelValue+'</a></div>').mouseover(function(){$(this).rating('drain');$(this).addClass('star-rating-hover');}).mouseout(function(){$(this).rating('draw');$(this).removeClass('star-rating-hover');}).click(function(){$(this).rating('select');}).data('rating',control));};var star=$('<div class="star-rating rater-'+control.serial+'"><a title="'+(this.title||this.value)+'">'+this.value+'</a></div>');rater.append(star);if(this.id)star.attr('id',this.id);if(this.className)star.addClass(this.className);if(control.half)control.split=2;if(typeof control.split=='number'&&control.split>0){var stw=($.fn.width?star.width():0)||control.starWidth;var spi=(control.count%control.split),spw=Math.floor(stw/control.split);star.width(spw).find('a').css({'margin-left':'-'+(spi*spw)+'px'})};if(control.readOnly)
star.addClass('star-rating-readonly');else
star.addClass('star-rating-live').mouseover(function(){$(this).rating('fill');$(this).rating('focus');}).mouseout(function(){$(this).rating('draw');$(this).rating('blur');}).click(function(){$(this).rating('select');});if(this.checked)control.current=star;input.hide();input.change(function(){$(this).rating('select');});star.data('rating.input',input.data('rating.star',star));control.stars[control.stars.length]=star[0];control.inputs[control.inputs.length]=input[0];control.rater=raters[eid]=rater;control.context=context;input.data('rating',control);rater.data('rating',control);star.data('rating',control);context.data('rating',raters);});$('.rating-to-be-drawn').rating('draw').removeClass('rating-to-be-drawn');return this;};$.extend($.fn.rating,{calls:0,focus:function(){var control=this.data('rating');if(!control)return this;if(!control.focus)return this;var input=$(this).data('rating.input')||$(this.tagName=='INPUT'?this:null);if(control.focus)control.focus.apply(input[0],[input.val(),$('a',input.data('rating.star'))[0]]);},blur:function(){var control=this.data('rating');if(!control)return this;if(!control.blur)return this;var input=$(this).data('rating.input')||$(this.tagName=='INPUT'?this:null);if(control.blur)control.blur.apply(input[0],[input.val(),$('a',input.data('rating.star'))[0]]);},fill:function(){var control=this.data('rating');if(!control)return this;if(control.readOnly)return;this.rating('drain');this.prevAll().andSelf().filter('.rater-'+control.serial).addClass('star-rating-hover');},drain:function(){var control=this.data('rating');if(!control)return this;if(control.readOnly)return;control.rater.children().filter('.rater-'+control.serial).removeClass('star-rating-on').removeClass('star-rating-hover');},draw:function(){var control=this.data('rating');if(!control)return this;this.rating('drain');if(control.current){control.current.data('rating.input').attr('checked','checked');control.current.prevAll().andSelf().filter('.rater-'+control.serial).addClass('star-rating-on');}
else
$(control.inputs).removeAttr('checked');control.cancel[control.readOnly||control.required?'hide':'show']();this.siblings()[control.readOnly?'addClass':'removeClass']('star-rating-readonly');},select:function(value,wantCallBack){var control=this.data('rating');if(!control)return this;if(control.readOnly)return;control.current=null;if(typeof value!='undefined'){if(typeof value=='number')
return $(control.stars[value]).rating('select',undefined,wantCallBack);if(typeof value=='string')
$.each(control.stars,function(){if($(this).data('rating.input').val()==value)$(this).rating('select',undefined,wantCallBack);});}
else
control.current=this[0].tagName=='INPUT'?this.data('rating.star'):(this.is('.rater-'+control.serial)?this:null);this.data('rating',control);this.rating('draw');var input=$(control.current?control.current.data('rating.input'):null);if((wantCallBack||wantCallBack==undefined)&&control.callback)control.callback.apply(input[0],[input.val(),$('a',control.current)[0]]);},readOnly:function(toggle,disable){var control=this.data('rating');if(!control)return this;control.readOnly=toggle||toggle==undefined?true:false;if(disable)$(control.inputs).attr("disabled","disabled");else $(control.inputs).removeAttr("disabled");this.data('rating',control);this.rating('draw');},disable:function(){this.rating('readOnly',true,true);},enable:function(){this.rating('readOnly',false,false);}});$.fn.rating.options={cancel:'Cancel Rating',cancelValue:'',split:0,starWidth:16};$(function(){$('input[type=radio].star').rating();});})(jQuery);;(function($){$.fn.boxShadow=function(o){if(!o)return;var b=o.split(' '),x=parseInt(b[0]),y=parseInt(b[1]),blur=0,color='';if(b.length==3){color=b[2]}else{blur=parseInt(b[2]);color=b[3]};return $(this).each(function(){var a=$(this),off=a.offset();a.after('<div></div>').next().css({width:a.width()+parseInt(a.css('padding-left'))+parseInt(a.css('padding-right')),height:a.height()+parseInt(a.css('padding-bottom'))+parseInt(a.css('padding-top')),position:'absolute','z-index':-1,backgroundColor:color,left:off.left+x-blur+'px',top:off.top+y-blur+'px'});if(blur)a.next().css('filter','progid:DXImageTransform.Microsoft.Blur(pixelradius='+blur+', enabled="true")')});}})(jQuery);function initInnovisBamSlide(){var eViewCont=$('#bamslide');var eViewContParent=$('#bamslide').parent();var eWideCont=$('#bamslide #bamslide_container');var eBams=$('#bamslide #bamslide_container div');if(eViewCont&&eViewCont.offset()&&eViewContParent&&eWideCont&&eBams){var iFullWidth=0;var iCount=0;var bEmptyImgs=false;eBams.each(function(){if($(this).outerWidth()<=10){bEmptyImgs=true;}
iFullWidth+=$(this).outerWidth();++iCount;});iFullWidth=iFullWidth/2;var iPerWidth=iFullWidth/(iCount/2);if(1||bEmptyImgs){iPerWidth=240;iFullWidth=iPerWidth*(iCount/2);}
eViewCont.css({'width':Math.round(iPerWidth*2)+'px'});var eArrowToRight=$('<div style="background: url(\'/pix/big-right.png\'); height: 61px; width: 33px; cursor: pointer; position: absolute; display: none; "></div>');var eArrowToLeft=$('<div style="background: url(\'/pix/big-left.png\'); height: 61px; width: 33px; cursor: pointer; position: absolute; display: none; "></div>');var iRightArrowHeight=eArrowToRight.height();var iLeftArrowHeight=eArrowToLeft.height();var iLeftPos=eViewCont.offset().left+eViewCont.width()+30;var iTopPos=eViewCont.offset().top+(eViewCont.height()/2);eArrowToRight.css({'left':iLeftPos+'px','top':(iTopPos-eArrowToRight.height())+'px','display':'block'}).appendTo(eViewContParent).hover(function(){$(this).css({'backgroundPosition':'0px -'+iRightArrowHeight+'px'});},function(){$(this).css({'backgroundPosition':'0px 0px'});});eArrowToLeft.css({'left':iLeftPos+'px','top':iTopPos+'px'}).appendTo(eViewContParent).hover(function(){$(this).css({'backgroundPosition':'0px -'+iLeftArrowHeight+'px'});},function(){$(this).css({'backgroundPosition':'0px 0px'});});var iMinMarginLeft=-iFullWidth+(iPerWidth*2)+10;var inProcess=false;eArrowToRight.click(function(){if(inProcess)return;inProcess=true;var iMarginLeft=parseInt(eWideCont.css('marginLeft'));if(iMarginLeft<=iMinMarginLeft){return;}
eArrowToLeft.show();eWideCont.animate({'marginLeft':iMarginLeft-iPerWidth},200,function(){iMarginLeft=parseInt(eWideCont.css('marginLeft'));if(iMarginLeft<=iMinMarginLeft){eArrowToRight.hide();}
inProcess=false;});return false;});eArrowToLeft.click(function(){if(inProcess)return;inProcess=true;var iMarginLeft=parseInt(eWideCont.css('marginLeft'));if(iMarginLeft>-10){return;}
eArrowToRight.show();eWideCont.animate({'marginLeft':iMarginLeft+iPerWidth},200,function(){iMarginLeft=parseInt(eWideCont.css('marginLeft'));if(iMarginLeft>-10){eArrowToLeft.hide();}
inProcess=false;});return false;});}}
function initInnovisSpecSlide(){var show=4;var eViewCont_S=$('#we_recomend_mainpage');var eViewContParent_S=$('#we_recomend_mainpage').parent();var eWideCont_S=$('#we_recomend_mainpage #we_recomend_mainpage_container');var eGoods=$('#we_recomend_mainpage #we_recomend_mainpage_container div');if(eViewCont_S&&eViewCont_S.offset()&&eViewContParent_S&&eWideCont_S&&eGoods){var iFullWidth_S=0;var iCount_S=0;var bEmptyImgs_S=false;eGoods.each(function(){if($(this).outerWidth()<=10){bEmptyImgs_S=true;}
iFullWidth_S+=$(this).outerWidth();++iCount_S;});iFullWidth_S=iFullWidth_S/1;var iPerWidth_S=iFullWidth_S/(iCount_S/1);if(0||bEmptyImgs_S){iPerWidth_S=190;iFullWidth_S=iPerWidth_S*(iCount_S/1);}
eViewCont_S.css({'width':Math.round(iPerWidth_S*show)+'px'});eWideCont_S.css({'width':Math.round(iFullWidth_S+10)+'px'});var eArrowToRight_S=$('<div style="background: url(\'/pix/right.png\'); background-repeat: no-repeat; height: 31px; width: 22px; cursor: pointer; position: absolute; display: none; "></div>');var eArrowToLeft_S=$('<div style="background: url(\'/pix/left.png\'); background-repeat: no-repeat; height: 31px; width: 22px; cursor: pointer; position: absolute; display: none; "></div>');var iRightArrowHeight_S=eArrowToRight_S.height();var iLeftArrowHeight_S=eArrowToLeft_S.height();var iLeftPos_S=eViewCont_S.offset().left+eViewCont_S.width()+20;var iTopPos_S=eViewCont_S.offset().top+(eViewCont_S.height()/2);eArrowToRight_S.css({'left':iLeftPos_S+'px','top':(iTopPos_S-31)+'px','display':'block'}).appendTo(eViewContParent_S).hover(function(){$(this).css({'backgroundPosition':'0px -'+iRightArrowHeight_S+'px'});},function(){$(this).css({'backgroundPosition':'0px 0px'});});eArrowToLeft_S.css({'left':iLeftPos_S+'px','top':iTopPos_S+'px'}).appendTo(eViewContParent_S).hover(function(){$(this).css({'backgroundPosition':'0px -'+iLeftArrowHeight_S+'px'});},function(){$(this).css({'backgroundPosition':'0px 0px'});});var iMinMarginLeft_S=-iFullWidth_S+(iPerWidth_S*show)+10;var inProcess_S=false;eArrowToRight_S.click(function(){if(inProcess_S)return;inProcess_S=true;var iMarginLeft_S=parseInt(eWideCont_S.css('marginLeft'));if(iMarginLeft_S<=iMinMarginLeft_S){return;}
eArrowToLeft_S.show();eWideCont_S.animate({'marginLeft':iMarginLeft_S-iPerWidth_S},200,function(){iMarginLeft_S=parseInt(eWideCont_S.css('marginLeft'));if(iMarginLeft_S<=iMinMarginLeft_S){eArrowToRight_S.hide();}
inProcess_S=false;});return false;});eArrowToLeft_S.click(function(){if(inProcess_S)return;inProcess_S=true;var iMarginLeft_S=parseInt(eWideCont_S.css('marginLeft'));if(iMarginLeft_S>-10){return;}
eArrowToRight_S.show();eWideCont_S.animate({'marginLeft':iMarginLeft_S+iPerWidth_S},200,function(){iMarginLeft_S=parseInt(eWideCont_S.css('marginLeft'));if(iMarginLeft_S>-10){eArrowToLeft_S.hide();}
inProcess_S=false;});return false;});}}
$(function(){initInnovisBamSlide();initInnovisSpecSlide();});
