/*
 Slimbox v2.02 - The ultimate lightweight Lightbox clone for jQuery
 (c) 2007-2009 Christophe Beyls <http://www.digitalia.be>
 MIT-style license.
*/
(function($){var win=$(window),options,images,activeImage=-1,activeURL,prevImage,nextImage,compatibleOverlay,middle,centerWidth,centerHeight,ie6=!window.XMLHttpRequest,operaFix=window.opera&&(document.compatMode=="CSS1Compat")&&($.browser.version>=9.3),documentElement=document.documentElement,preload={},preloadPrev=new Image(),preloadNext=new Image(),overlay,center,image,sizer,prevLink,nextLink,bottomContainer,bottom,caption,number,prevTextLink,nextTextLink;$(function(){$("body").append($([overlay=$('<div id="lbOverlay" />')[0],center=$('<div id="lbCenter" />')[0],bottomContainer=$('<div id="lbBottomContainer" />')[0]]).css("display","none"));image=$('<div id="lbImage" />').appendTo(center).append(sizer=$('<div style="position: relative;" />').append([prevLink=$('<a id="lbPrevLink" href="#" />').click(previous)[0],nextLink=$('<a id="lbNextLink" href="#" />').click(next)[0]])[0])[0];bottom=$('<div id="lbBottom" />').appendTo(bottomContainer).append([$('<a id="lbCloseLink" href="#" />').add(overlay).click(close)[0],caption=$('<div id="lbCaption" />')[0],number=$('<div id="lbNumber" />')[0],prevTextLink=$('<a id="lbPrevTextLink" href="#" />').click(previous)[0],nextTextLink=$('<a id="lbNextTextLink" href="#" />').click(next)[0],$('<div style="clear: both;" />')[0]])[0];});$.slimbox=function(_images,startImage,_options){options=$.extend({loop:false,overlayOpacity:0.8,overlayFadeDuration:400,resizeDuration:400,resizeEasing:"swing",initialWidth:250,initialHeight:250,imageFadeDuration:400,captionAnimationDuration:400,counterText:"Картинка {x} из {y}",prevText:"&laquo; Предыдущая",nextText:"Следующая &raquo;",closeKeys:[27,88,67],previousKeys:[37,80],nextKeys:[39,78]},_options);if(typeof _images=="string"){_images=[[_images,startImage]];startImage=0;}
middle=win.scrollTop()+((operaFix?documentElement.clientHeight:win.height())/2);centerWidth=options.initialWidth;centerHeight=options.initialHeight;$(center).css({top:Math.max(0,middle-(centerHeight/2)),width:centerWidth,height:centerHeight,marginLeft:-centerWidth/2}).show();compatibleOverlay=ie6||(overlay.currentStyle&&(overlay.currentStyle.position!="fixed"));if(compatibleOverlay)overlay.style.position="absolute";$(overlay).css("opacity",options.overlayOpacity).fadeIn(options.overlayFadeDuration);position();setup(1);images=_images;options.loop=options.loop&&(images.length>1);return changeImage(startImage);};$.fn.slimbox=function(_options,linkMapper,linksFilter){linkMapper=linkMapper||function(el){var title=$('img[title]',$(el));if(title)title=$(title).attr('title');if(title&&title!='undefined')el.title=title;return[el.href,el.title];};linksFilter=linksFilter||function(){return true;};var links=this;return links.unbind("click").click(function(){var link=this,startIndex=0,filteredLinks,i=0,length;filteredLinks=$.grep(links,function(el,i){return linksFilter.call(link,el,i);});for(length=filteredLinks.length;i<length;++i){if(filteredLinks[i]==link)startIndex=i;filteredLinks[i]=linkMapper(filteredLinks[i],i);}
return $.slimbox(filteredLinks,startIndex,_options);});};function position(){var l=win.scrollLeft(),w=operaFix?documentElement.clientWidth:win.width();$([center,bottomContainer]).css("left",l+(w/2));if(compatibleOverlay)$(overlay).css({left:l,top:win.scrollTop(),width:w,height:win.height()});}
function setup(open){$("object").add(ie6?"select":"embed").each(function(index,el){if(open)$.data(el,"slimbox",el.style.visibility);el.style.visibility=open?"hidden":$.data(el,"slimbox");});var fn=open?"bind":"unbind";win[fn]("scroll resize",position);$(document)[fn]("keydown",keyDown);}
function keyDown(event){var code=event.keyCode,fn=$.inArray;return(fn(code,options.closeKeys)>=0)?close():(fn(code,options.nextKeys)>=0)?next():(fn(code,options.previousKeys)>=0)?previous():false;}
function previous(){return changeImage(prevImage);}
function next(){return changeImage(nextImage);}
function changeImage(imageIndex){if(imageIndex>=0){activeImage=imageIndex;activeURL=images[activeImage][0];prevImage=(activeImage||(options.loop?images.length:0))-1;nextImage=((activeImage+1)%images.length)||(options.loop?0:-1);stop();center.className="lbLoading";preload=new Image();preload.onload=animateBox;preload.src=activeURL;}
return false;}
function animateBox(){center.className="";$(image).css({backgroundImage:"url("+activeURL+")",visibility:"hidden",display:""});$(sizer).width(preload.width);$([sizer,prevLink,nextLink]).height(preload.height);$(caption).html(images[activeImage][1]||"");$(number).html((((images.length>1)&&options.counterText)||"").replace(/{x}/,activeImage+1).replace(/{y}/,images.length));$(prevTextLink).html((images.length>1&&prevImage>=0)?options.prevText:'');$(nextTextLink).html((images.length>1&&nextImage>=0)?options.nextText:'');if(prevImage>=0)preloadPrev.src=images[prevImage][0];if(nextImage>=0)preloadNext.src=images[nextImage][0];centerWidth=image.offsetWidth;centerHeight=image.offsetHeight;var top=Math.max(0,middle-(centerHeight/2));if(center.offsetHeight!=centerHeight){$(center).animate({height:centerHeight,top:top},options.resizeDuration,options.resizeEasing);}
if(center.offsetWidth!=centerWidth){$(center).animate({width:centerWidth,marginLeft:-centerWidth/2},options.resizeDuration,options.resizeEasing);}
$(center).queue(function(){$(bottomContainer).css({width:centerWidth,top:top+centerHeight,marginLeft:-centerWidth/2,visibility:"hidden",display:""});$(image).css({display:"none",visibility:"",opacity:""}).fadeIn(options.imageFadeDuration,animateCaption);});}
function animateCaption(){if(prevImage>=0)$(prevLink).show();if(nextImage>=0)$(nextLink).show();$(bottom).css("marginTop",-bottom.offsetHeight).animate({marginTop:0},options.captionAnimationDuration);bottomContainer.style.visibility="";}
function stop(){preload.onload=null;preload.src=preloadPrev.src=preloadNext.src=activeURL;$([center,image,bottom]).stop(true);$([prevLink,nextLink,image,bottomContainer]).hide();}
function close(){if(activeImage>=0){stop();activeImage=prevImage=nextImage=-1;$(center).hide();$(overlay).stop().fadeOut(options.overlayFadeDuration,setup);}
return false;}})(jQuery);jQuery(function($){$("a[rel^='lightbox']").slimbox({},null,function(el){return(this==el)||((this.rel.length>8)&&(this.rel==el.rel));});});;var Basket={};Basket.inprocess=false;Basket.repeatOrder=function(a_Link,iOrderId,sBasketHref){if(Basket.inprocess){return false;}
if(!confirm('Вы действительно хотите повторить данный заказ?\n\nПри повторении заказа все его позиции, доступные на данный \nмомент в каталоге, будут помещены в вашу текущую корзину.')){return false;}
var url=$(a_Link).attr('href');var tmp=a_Link;$(tmp).fadeTo('slow',0.1);$('#basketgoodsdiv',document).fadeTo('slow',0.2);Basket.inprocess=true;var offset=$(a_Link).offset();$('#basketpopup').css({left:offset.left,top:offset.top-$('div.header').height()});$.get(url+'&rand='+Math.random(),null,function(response){$(document).append(response);$('#basketgoodsdiv',document).html($(response).html());$('#basketgoodsdiv',document).fadeTo('slow',1);$('#basketpopup').fadeTo('slow',1,function(){$(this).fadeOut('slow')});$('a[href="'+url+'"]').fadeTo('slow',1);Basket.inprocess=false;if(confirm('Корзина обновлена!\nПозиции из вашего старого заказа успешно помещены в корзину.\nХотите перейти к оформлению заявки?')){window.location=sBasketHref;}
else{}},'html');return false;}
Basket.addGood=function(alink,single){if(Basket.inprocess){return false;}
var url=$(alink).attr('href');if(url.lastIndexOf('?add=')!==-1){var add=true;}
else{var add=false;if(!confirm('Вы действительно хотите удалить эту позицию?'))
return false;}
var tmp=alink;$(tmp).fadeTo('slow',0.1);$(alink).unbind('click').bind('click',function(){return false;});$('#basketgoodsdiv',document).fadeTo('slow',0.2);Basket.inprocess=true;var offset=$(alink).offset();$('#basketpopup').css({left:offset.left,top:offset.top-$('div.header').height()});$.get(url+'&rand='+Math.random(),null,function(response){$(document).append(response);$('#basketgoodsdiv',document).html($(response).html());$('#basketgoodsdiv',document).fadeTo('slow',1);$('#basketpopup').fadeTo('slow',1,function(){$(this).fadeOut('slow')});if(add){newurl=url.replace(/\?add\=/g,'?rem=');}
else{newurl=url.replace(/\?rem\=/g,'?add=');}
if(add){}
else{}
if(single){$('a[href="'+url+'"]').unbind('click').bind('click',function(){Basket.addGood(alink);return false;});}
else{$('a[href="'+url+'"]').attr('href',newurl).addClass(add?'rb':'gb').removeClass(add?'gb':'rb').unbind('click').bind('click',function(){Basket.addGood(alink);return false;});}
$('a[href="'+url+'"]').fadeTo('slow',1);Basket.inprocess=false;},'html');return false;}
Basket.recalcBasket=function(){var form=$('#basketgoods_form');var data=form.serialize();if(Basket.inprocess){return false;}
var url=form.attr('action');$('#basketgoodsdiv',document).fadeTo('slow',0.2);Basket.inprocess=true;$.post(url+'&rand='+Math.random(),data,function(response){$(document).append(response);$('#basketgoodsdiv',document).html($(response).html());$('#basketgoodsdiv',document).fadeTo('slow',1);Basket.inprocess=false;});return false;}
Basket.orderBasket=function(submitbutton){var form=$('#basketgoods_form');if(submitbutton)
$('input[type=hidden][name=submitbutton]',form).val(submitbutton);form.submit();}
Basket.clear=function(alink){if(Basket.inprocess){return false;}
if(!confirm('Вы действительно хотите очистить свою корзину?')){return;}
var url=$(alink).attr('href');$('#basketgoodsdiv',document).fadeTo('slow',0.2);Basket.inprocess=true;$.get(url+'&rand='+Math.random(),null,function(response){$('#basketgoodsdiv',document).html($(response).html());$('a.rb',document).each(function(){newurl=$(this).attr('href').replace(/\?rem\=/g,'?add=');$(this).attr('href',newurl).addClass('gb').removeClass('rb');});$('#basketgoodsdiv',document).fadeTo('slow',1);Basket.inprocess=false;});}
Basket.updateBasketBlock=function(str,str2){var data=eval('('+str+')');if(str2)var goods=eval('('+str2+')');$('#basketblock_itemscount').fadeTo('slow',0.1,function(){if(typeof(data.basket_itemscount)!=='undefined'&&data.basket_itemscount!=0){$('#basketblock_itemscount').html(data.basket_itemscount).fadeTo('slow',1);$('#basketblock_link2basket').fadeIn('slow',0);}
else{$('#basketblock_itemscount').html('0').fadeTo('slow',1);$('#basketblock_link2basket').fadeOut('slow',0);}});}
jQuery(document).ready(function(){initSliders();});var jslider_animation=false;function initSliders(){if(typeof(jslider)=='undefined')return false;$('.jslider').wrap('<div id="jslider" style="border:0px solid; position: absolute; left: 0; right: 0; margin: 0; overflow: hidden; padding-bottom: 20px;"></div>')
if($('.jslider .lbl').html()){$('.jslider .bg').fadeTo('fast',0.4);}
else{$('.jslider .bg').fadeTo('fast',0.4).hide();}
$('.jslider a.prev_slide').bind('click',function(){prevSlide();return false});$('.jslider a.next_slide').bind('click',function(){nextSlide();return false});$('.jslider a').css({'outer-border':'none'});slidersPreload();}
function nextSlide(){if(jslider_animation)return;jslider_animation=true;var width=$('#jslider').width();var height=$('#jslider').height();$('#jslider').width(width).height(height);var height=$('.jslider').height();var id=$('.jslider').attr('id').substring(7);var firstid=null;var nextid=id;for(i in jslider){if(firstid===null)firstid=i;if(nextid==-1)nextid=i;if(i==id)nextid=-1;}
if(nextid==-1)nextid=firstid;var newslide=getSlide(nextid);$(newslide).css({'position':'relative','left':width+'px','top':'-'+height+'px'});$(newslide).appendTo('#jslider');$('#jslider'+id).css({'position':'relative'}).animate({'left':'-'+width+'px','opacity':'hide'},400,'swing',function(){$('#jslider'+id).remove();$('#jslider'+nextid).css({'top':'0'});});$(newslide).animate({left:0},400,'swing',function(){jslider_animation=false;});}
function prevSlide(){if(jslider_animation)return;jslider_animation=true;var width=$('#jslider').width();var height=$('#jslider').height();$('#jslider').width(width).height(height);var height=$('.jslider').height();var id=$('.jslider').attr('id').substring(7);var lastid=null;var previd=id;for(i in jslider){if(i==id)previd=lastid;lastid=i;}
if(previd==null)previd=lastid;var newslide=getSlide(previd);$(newslide).css({'position':'relative','left':'-'+width+'px','top':'0'});$(newslide).prependTo('#jslider');var height=$(newslide).height();$('#jslider'+id).css({'position':'relative','top':'-'+height+'px'}).animate({'left':width+'px','opacity':'hide'},400,'swing',function(){$('#jslider'+id).remove();});$(newslide).animate({left:0},400,'swing',function(){jslider_animation=false;});}
function getSlide(id){var slide=jQuery('.jslider').clone();slide.attr('id','jslider'+id);jQuery('img.pic',slide).attr('src',jslider[id].src_item_image);var lbl=jslider[id].item_info.replace(/\n/g,'<br />');jQuery('div.lbl',slide).html(lbl);if(lbl){jQuery('.bg',slide).show();}
else{jQuery('.bg',slide).hide();}
jQuery('a.prev_slide',slide).bind('click',function(){prevSlide();return false});jQuery('a.next_slide',slide).bind('click',function(){nextSlide();return false});return slide;}
function slidersPreload(){for(i in jslider){jQuery('<img>').attr('src',jslider[i].src_item_image);}};var InnovisBamSlidePixCount=2;var iPerWidth;function initInnovisBamSlide(){var eViewCont=$('#bamslide');var eViewContParent=$('#bamslide').parent();var eWideCont=$('#bamslide #bamslide_container');var eBams=$('#bamslide #bamslide_container div');if(eViewCont.length&&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;iPerWidth=iFullWidth/(iCount/2);if(1||bEmptyImgs){iPerWidth=240;iFullWidth=iPerWidth*(iCount/2);}
var tmp=Math.floor(($(window).width()-410)/iPerWidth);InnovisBamSlidePixCount=tmp;eViewCont.css({'width':Math.round(iPerWidth*InnovisBamSlidePixCount)+'px'});var eArrowToRight=$('<div id="bamslide_arrowtoright" style="background: url(\'/pix/big-right.png\'); height: 61px; width: 33px; cursor: pointer; position: absolute; display: none; "></div>');var eArrowToLeft=$('<div id="bamslide_arrowtoleft" 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*InnovisBamSlidePixCount)+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;});}}
var InnovisSpecSlidePixCount=4;function initInnovisSpecSlide(){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.length&&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=195;iFullWidth_S=iPerWidth_S*(iCount_S/1);}
var tmp=Math.floor(($(window).width()-410)/iPerWidth_S);InnovisSpecSlidePixCount=tmp;eViewCont_S.css({'width':Math.round(iPerWidth_S*InnovisSpecSlidePixCount)+'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()+30;var iTopPos_S=eViewCont_S.offset().top+(eViewCont_S.height()/2);eArrowToRight_S.css({'left':iLeftPos_S+'px','top':(iTopPos_S-eArrowToRight_S.height())+'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*InnovisSpecSlidePixCount)+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;});}}
var InnovisSpecNewsSlidePixCount=4;function initInnovisNewsSlide(){var eViewCont_S=$('#we_news_mainpage');var eViewContParent_S=$('#we_news_mainpage').parent();var eWideCont_S=$('#we_news_mainpage #we_news_mainpage_container');var eGoods=$('#we_news_mainpage #we_news_mainpage_container div');if(eViewCont_S.length&&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=195;iFullWidth_S=iPerWidth_S*(iCount_S/1);}
var tmp=Math.floor(($(window).width()-410)/iPerWidth_S);InnovisSpecNewsSlidePixCount=tmp;eViewCont_S.css({'width':Math.round(iPerWidth_S*InnovisSpecNewsSlidePixCount)+'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()+30;var iTopPos_S=eViewCont_S.offset().top+(eViewCont_S.height()/2);eArrowToRight_S.css({'left':iLeftPos_S+'px','top':(iTopPos_S-eArrowToRight_S.height())+'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*InnovisSpecNewsSlidePixCount)+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;});}}
var InnovisSpecHitSlidePixCount=4;function initInnovisHitSlide(){var eViewCont_S=$('#we_hit_mainpage');var eViewContParent_S=$('#we_hit_mainpage').parent();var eWideCont_S=$('#we_hit_mainpage #we_hit_mainpage_container');var eGoods=$('#we_hit_mainpage #we_hit_mainpage_container div');if(eViewCont_S.length&&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=195;iFullWidth_S=iPerWidth_S*(iCount_S/1);}
var tmp=Math.floor(($(window).width()-410)/iPerWidth_S);InnovisSpecHitSlidePixCount=tmp;eViewCont_S.css({'width':Math.round(iPerWidth_S*InnovisSpecHitSlidePixCount)+'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()+30;var iTopPos_S=eViewCont_S.offset().top+(eViewCont_S.height()/2);eArrowToRight_S.css({'left':iLeftPos_S+'px','top':(iTopPos_S-eArrowToRight_S.height())+'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*InnovisSpecNewsSlidePixCount)+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();initInnovisNewsSlide();initInnovisHitSlide();});;function slider(elemId,sliderWidth,range1,range2,step,minId,maxId,withNulls,toFixed){var knobWidth=12;var knobHeight=11;var sliderHeight=3;var offsX,tmp,currentKnob,offset;var d=document;var isIE=d.all||window.opera;var point=sliderWidth/(range2-range1);d.getElementById(elemId).style.position="relative";var slider=d.createElement('DIV');slider.id=elemId+'_slider';slider.className='slider';d.getElementById(elemId).appendChild(slider);var knobMin=d.createElement('DIV');knobMin.id=elemId+'_knob_min';knobMin.className='knob-min';d.getElementById(elemId).appendChild(knobMin);var knobMax=d.createElement('DIV');knobMax.id=elemId+'_knob_max';knobMax.className='knob-max';d.getElementById(elemId).appendChild(knobMax);knobMin.style.left=-knobWidth+'px';knobMin.style.top=sliderHeight+'px';knobMin.style.width=knobWidth+'px';knobMin.style.height=knobHeight+'px';knobMax.style.left=sliderWidth+'px';knobMax.style.top=sliderHeight+'px';knobMax.style.width=knobWidth+'px';knobMax.style.height=knobHeight+'px';slider.style.width=sliderWidth+'px';slider.style.height=sliderHeight+'px';if(isIE){knobMin.onmousedown=startCoordMin;knobMax.onmousedown=startCoordMax;slider.onclick=sliderClick;document.onmouseup=endCoord;}else{knobMin.addEventListener("mousedown",startCoordMin,true);knobMax.addEventListener("mousedown",startCoordMax,true);slider.addEventListener("click",sliderClick,true);document.addEventListener("mouseup",endCoord,true);}
function setPosMin(x){var pos=0;if(x<-knobWidth)
pos=-knobWidth;else if(x>sliderWidth-knobWidth)
pos=sliderWidth-knobWidth;else{if(step==0)
pos=x;else
pos=Math.round(x/(step*point))*step*point;}
pos=Math.min(pos,getPosMax()-knobWidth);knobMin.style.left=pos+'px';if(d.getElementById(minId))
d.getElementById(minId).value=getValueMin();}
function setPosMax(x){var pos=0;if(x<0)
pos=0;else if(x>sliderWidth)
pos=sliderWidth;else{if(step==0)
pos=x;else
pos=Math.round(x/(step*point))*step*point;}
pos=Math.max(pos,getPosMin()+knobWidth);knobMax.style.left=pos+'px';if(d.getElementById(maxId))
d.getElementById(maxId).value=getValueMax();}
function getValueMin(){if(toFixed)
var val=((parseInt(knobMin.style.left)+knobWidth)/point+range1).toFixed(1);else
var val=Math.round((parseInt(knobMin.style.left)+knobWidth)/point)+range1;return(val==range1&&withNulls)?"":val;}
function getValueMax(){if(toFixed)
var val=(parseInt(knobMax.style.left)/point+range1).toFixed(1);else
var val=Math.round(parseInt(knobMax.style.left)/point)+range1;return(val==range2&&withNulls)?"":val;}
function getPosMin(){return parseInt(knobMin.style.left);}
function getPosMax(){return parseInt(knobMax.style.left);}
function setMin(x){x=Math.max(x,range1);if(getValueMax())
x=Math.min(x,getValueMax());else
x=Math.min(x,range2);setPosMin(Math.round((x-range1)*point)-knobWidth);}
function setMax(x){x=Math.min(x,range2);if(getValueMin())
x=Math.max(x,getValueMin());else
x=Math.max(x,range1);setPosMax((x-range1)*point);}
function sliderClick(event){if(!offset)offset=getOffset(slider);var x;if(isIE){if(!event)event=window.event;if(event.srcElement!=slider)return;x=event.offsetX-Math.round(knobWidth/2);}
else x=event.pageX-offset.left-knobWidth/2;if(x<getPosMin()){setPosMin(x);}else if(x>getPosMax()){setPosMax(x);}else if(getPosMax()-x<x-getPosMin()){setPosMax(x);}else{setPosMin(x);}}
function startCoordMin(event){currentKnob=1;_startCoord(event);}
function startCoordMax(event){currentKnob=2;_startCoord(event);}
function _startCoord(event){offset=getOffset(slider);if(isIE){if(!event)event=window.event;if(currentKnob==1)
offsX=event.clientX-parseInt(knobMin.style.left);else
offsX=event.clientX-parseInt(knobMax.style.left);document.onmousemove=mov;}
else{document.addEventListener("mousemove",mov,true);}}
function mov(event){var x;if(isIE){if(!event)event=window.event;x=event.clientX-offsX;}else{x=event.pageX-offset.left-knobWidth/2;}
if(currentKnob==1){setPosMin(x);}else{setPosMax(x);}
removeSelection();}
function endCoord(){if(isIE)document.onmousemove=null;else document.removeEventListener("mousemove",mov,true);}
function removeSelection(){if(window.getSelection){window.getSelection().removeAllRanges();}else if(document.selection&&document.selection.clear)
document.selection.clear();}
this.setMin=setMin;this.setMax=setMax;}
function getOffset(elem){if(elem.getBoundingClientRect){return getOffsetRect(elem);}else{return getOffsetSum(elem);}}
function getOffsetRect(elem){var box=elem.getBoundingClientRect();var body=document.body;var docElem=document.documentElement;var scrollTop=window.pageYOffset||docElem.scrollTop||body.scrollTop;var scrollLeft=window.pageXOffset||docElem.scrollLeft||body.scrollLeft;var clientTop=docElem.clientTop||body.clientTop||0;var clientLeft=docElem.clientLeft||body.clientLeft||0;var top=box.top+scrollTop-clientTop;var left=box.left+scrollLeft-clientLeft;return{top:Math.round(top),left:Math.round(left)};}
function getOffsetSum(elem){var top=0,left=0;while(elem){top=top+parseFloat(elem.offsetTop);left=left+parseFloat(elem.offsetLeft);elem=elem.offsetParent;}
return{top:Math.round(top),left:Math.round(left)}};var timerShowId=null;var timerHideId=null;var defaultProgressShowTime=500;var defaultHideTimeout=3000;function showHelpProcess(id,el,timeout){var show=function(){$(el).trigger('showhelp');showHelp(id,el,timeout);}
timerShowId=window.setTimeout(show,defaultProgressShowTime);}
function hideHelpProcess(closeNow){cancelHelpHide();timeout=$("#helpWindow").data('timeout')||defaultHideTimeout;if(closeNow){timeout=0;}
var hide=function(){var el=$("#helpWindow").data('element');$(el).trigger('hidehelp');$("#helpWindow").hide();}
timerHideId=window.setTimeout(hide,timeout);}
function getHelpWindow(){return $('#helpWindow').css('z-index',500).show();}
function showHelp(text,el,timeout){cancelHelpShow();cancelHelpHide();var wnd=getHelpWindow();wnd.find('#help_content')[0].innerHTML=text;if($.browser.msie&&$.browser.version.substr(0,1)<=6){wnd.find('#help_content').css('width','auto');wnd.css('width','');var width=wnd.find('#help_content')[0].offsetWidth+20;if(width>parseInt(wnd.css('max-width'))){width=parseInt(wnd.css('max-width'));}else if(width<parseInt(wnd.css('min-width'))){width=parseInt(wnd.css('min-width'));}
wnd.css('width',width);wnd.find('#help_content').css('width','100%');}
var wndHeight=wnd[0].offsetHeight;var wndWidth=wnd[0].offsetWidth;var offset=$(el).offset();var left=offset.left;var top=offset.top+$(el).height()+2;var scrollTop=($.browser.safari)?document.body.scrollTop:document.documentElement.scrollTop;var scrollLeft=($.browser.safari)?document.body.scrollLeft:document.documentElement.scrollLeft;if(left+wndWidth-scrollLeft>document.documentElement.clientWidth){left=document.documentElement.clientWidth-wndWidth+scrollLeft-10;}
if(top+wndHeight-scrollTop>document.documentElement.clientHeight){top=offset.top-wndHeight;}
wnd.css('left',Math.max(left,0));wnd.css('top',Math.max(top,0));wnd.removeData('timeout');hideHelpProcess();wnd.data('timeout',timeout||defaultHideTimeout);wnd.data('element',el);}
function cancelHelpShow(){window.clearTimeout(timerShowId);}
function cancelHelpHide(){window.clearTimeout(timerHideId);}
