﻿/*thumbnail.js*/var Zoom=function(options){this.SetOptions(options);this.warp=$(this.options.warp).find("a");this.thumbnail=$(this.options.thumbnail);this.ImgWidth=this.options.ImgWidth;this.ImgHeight=this.options.ImgHeight;this.loading=this.options.loading;this.init();this.LoadImage();};Zoom.prototype={init:function(){this.image=[],this.image_src=[];for(var i=0;i<this.thumbnail.length;i++){this.image_src.push($(this.thumbnail[i]).attr("src"));this.image.push(new Image());$(this.thumbnail[i]).css({display:"none"});$(this.warp[i]).append(this.loading);}},SetOptions:function(options){this.options={warp:".thumbnail_box",thumbnail:".thumbnail",ImgWidth:200,ImgHeight:200,loading:"<img class='loading' src='..//images/loading.gif' />"};$.extend(this.options,options||{});},AutoScaling:function(source,index){if(source.width>0&&source.height>0){if(source.width/source.height>=this.ImgWidth/this.ImgHeight){if(source.width>this.ImgWidth){$(this.thumbnail[index]).width(this.ImgWidth);$(this.thumbnail[index]).height((source.height*this.ImgWidth)/source.width);}else{$(this.thumbnail[index]).width(source.width);$(this.thumbnail[index]).height(source.height);}}else{if(source.height>this.ImgHeight){$(this.thumbnail[index]).height(this.ImgHeight);$(this.thumbnail[index]).width((source.width*this.ImgHeight)/source.height);}else{$(this.thumbnail[index]).width(source.width);$(this.thumbnail[index]).height(source.height);}}}source=new Image();},LoadImage:function(){var _this=this;for(var j=0;j<this.image_src.length;j++){(function(){var index=j;$(_this.image[index]).load(function(){if(_this.image[index].width==0||_this.image[index].height==0)return;_this.AutoScaling(_this.image[index],index);$(_this.warp[index]).find("img").remove(".loading");$(_this.thumbnail[index]).css({display:"inline"});_this.image[index]=new Image();});_this.image[index].src=_this.image_src[index];})();}}};/*search_popup.js*/var WindowProperties=function(){};WindowProperties.prototype={GetWindowScrollTop:function(){var WindowScrollTop=$(window).scrollTop();return WindowScrollTop;},GetWindowClientHeight:function(){var WindowHeight=$(window).height();return WindowHeight;},GetWindowClientWidth:function(){var WindowWidht=$(window).width();;return WindowWidht;}};var PopUp=function(options){this._window=new WindowProperties();this.SetOptions(options);this.Marks=$(this.options.Marks);this.Wrapper=$("#"+this.options.Wrapper);this.Pointer=$("#"+this.options.Pointer);this._Pointer_width=this.Pointer.outerWidth();this._Marks_height=this.Marks.height();this._Marks_width=this.Marks.outerWidth();this._Wrapper_height=this.Wrapper.outerHeight();this._Wrapper_width=this.Wrapper.outerWidth();this._img=new Image();this.BigImage=$("#"+this.options.BigImage);this.ImgSrc=[];this.ImgWidth=this.options.ImgWidth;this.ImgHeight=this.options.ImgHeight;this.LoadingSrc=this.options.LoadingSrc;this.loadingImage=$("<img alt=\"loading...\" title=\"picture loading...\" src=\""+this.LoadingSrc+"\" />");this.Link=$(this.options.Link);this.ImageLink=$("#"+this.options.ImageLink);};PopUp.prototype={SetOptions:function(options){this.options={Marks:".load_list",Link:".pro_link",Wrapper:"pop",Pointer:"pointer",BigImage:"BigImage",ImageLink:"ImgLink",ImgWidth:263,ImgHeight:263,LoadingSrc:"..//images/loading.gif"};$.extend(this.options,options||{});},SetPosition:function(){var obj_this=this;for(var i=0;i<this.Marks.length;i++){(function(){var p=i;$(obj_this.Marks[p]).mouseover(function(){var _WindowScrollTop=obj_this._window.GetWindowScrollTop();var _WindowHeight=obj_this._window.GetWindowClientHeight();var _WindowWidth=obj_this._window.GetWindowClientWidth();var Marks_offset_top=$(obj_this.Marks[p]).offset().top;var Marks_offset_left=$(obj_this.Marks[p]).offset().left;var zz=_WindowHeight-(Marks_offset_top-_WindowScrollTop);var dd=Marks_offset_top-(obj_this._Wrapper_height-zz);var ee=_WindowWidth-Marks_offset_left;obj_this.Pointer.css({top:parseInt(Marks_offset_top+obj_this._Marks_height)+"px"});if(zz>obj_this._Wrapper_height){obj_this.Wrapper.css({top:parseInt(Marks_offset_top-obj_this._Wrapper_height/4)+"px"});}else{obj_this.Wrapper.css({top:parseInt(dd)+"px"});}if(ee>obj_this._Wrapper_width){obj_this.Pointer.removeClass("ri");obj_this.Wrapper.removeClass("ri");obj_this.Pointer.css({left:parseInt(Marks_offset_left+10)+"px"});obj_this.Wrapper.css({left:parseInt(Marks_offset_left+10)+"px"});}else{obj_this.Pointer.addClass("ri");obj_this.Wrapper.addClass("ri");obj_this.Pointer.css({left:parseInt(Marks_offset_left-obj_this._Marks_width/8)+"px"});obj_this.Wrapper.css({left:parseInt(Marks_offset_left-obj_this._Wrapper_width-obj_this._Marks_width/8+21)+"px"});}});obj_this.Marks[p].onclick=function(){return false;};})();}},LoadImage:function(){var obj_this=this;for(var i=0;i<this.Marks.length;i++){this.ImgSrc.push($(this.Marks[i]).attr("href"));(function(){var p=i;$(obj_this.Marks[p]).bind("mouseenter",function(){obj_this.ImageLink.attr("href","#blank");obj_this.BigImage.attr("src","..//images/blank.gif");obj_this.BigImage.hide();obj_this.BigImage.after(obj_this.loadingImage);$(obj_this._img).load(function(){if(obj_this._img.width==0||obj_this._img.height==0)return;obj_this.PreLoad(obj_this._img.src,$(obj_this.Link[p]).attr("href"));this._img=new Image();});obj_this._img.src=obj_this.ImgSrc[p];});})();}},PreLoad:function(){this.AutoScaling();this.BigImage.attr("src",arguments[0]);this.loadingImage.remove();this.BigImage.show();this.ImageLink.attr("href",arguments[1]);},AutoScaling:function(){if(this._img.width>0&&this._img.height>0){if(this._img.width/this._img.height>=this.ImgWidth/this.ImgHeight){if(this._img.width>this.ImgWidth){this.BigImage.width(this.ImgWidth);this.BigImage.height((this._img.height*this.ImgWidth)/this._img.width);}else{this.BigImage.width(this._img.width);this.BigImage.height(this._img.height);}}else{if(this._img.height>this.ImgHeight){this.BigImage.height(this.ImgHeight);this.BigImage.width((this._img.width*this.ImgHeight)/this._img.height);}else{this.BigImage.width(this._img.width);this.BigImage.height(this._img.height);}}}this._img=new Image();},Start:function(){this.SetPosition();this.LoadImage();var obj_this=this;for(var i=0;i<this.Marks.length;i++){$(this.Marks[i]).bind("mouseenter",function(){obj_this.Wrapper.css({display:"block"});obj_this.Pointer.css({display:"block"});}).bind("mouseleave",function(){obj_this.Wrapper.css({display:"none"});obj_this.Pointer.css({display:"none"});});}this.Pointer.bind("mouseenter",function(){obj_this.Wrapper.css({display:"block"});obj_this.Pointer.css({display:"block"});}).bind("mouseleave",function(){obj_this.Wrapper.css({display:"none"});obj_this.Pointer.css({display:"none"});});this.Wrapper.bind("mouseenter",function(){obj_this.Wrapper.css({display:"block"});obj_this.Pointer.css({display:"block"});}).bind("mouseleave",function(){obj_this.Wrapper.css({display:"none"});obj_this.Pointer.css({display:"none"});});}};/*lazy.js*/var LazyLoad=function(options){this.SetOptions(options);this.container=$("#"+this.options.container);this.childs=$(this.options.childs);this.childsImg=$(this.options.childs+" > img");this.data=[];this.oldScroll=this.options.oldScroll;this.newScroll=this.options.newScroll;this.ImgWidth=this.options.ImgWidth;this.ImgHeight=this.options.ImgHeight;this.isZoom=this.options.isZoom;this.Initialize();this.ScrollLoad();this.ResizeLoad();};LazyLoad.prototype={SetOptions:function(options){this.options={container:null,childs:null,oldScroll:0,newScroll:0,isZoom:false,ImgWidth:200,ImgHeight:200};$.extend(this.options,options||{});},Initialize:function(){if(this.isZoom){this.CreateImage();}this.Mheight=this.container.height()+this.container.offset().top;for(var i=0;i<this.childs.length;i++){this.data.push($(this.childs[i]).offset().top);$(this.childsImg[i]).attr({src:"..//images/blank.gif"});}this.RunLoad();},CreateImage:function(){this.image=[],this.image_src=[];for(var i=0;i<this.childsImg.length;i++){this.image_src.push($(this.childsImg[i]).attr("lazyload_src"));this.image.push(new Image());}},LoadImage:function(i){var _this=this;(function(){var index=i;$(_this.image[index]).load(function(){if(_this.image[index].width==0||_this.image[index].height==0)return;_this.AutoScaling(_this.image[index],index);_this.image[index]=new Image();});_this.image[index].src=_this.image_src[index];})();},AutoScaling:function(source,index){if(source.width>0&&source.height>0){if(source.width/source.height>=this.ImgWidth/this.ImgHeight){if(source.width>this.ImgWidth){$(this.childsImg[index]).width(this.ImgWidth);$(this.childsImg[index]).height((source.height*this.ImgWidth)/source.width);}else{$(this.childsImg[index]).width(source.width);$(this.childsImg[index]).height(source.height);}}else{if(source.height>this.ImgHeight){$(this.childsImg[index]).height(this.ImgHeight);$(this.childsImg[index]).width((source.width*this.ImgHeight)/source.height);}else{$(this.childsImg[index]).width(source.width);$(this.childsImg[index]).height(source.height);}}}source=new Image();},Before:function(){var _Cheight;_Cheight=$(window).height()+$(window).scrollTop();return _Cheight;},Compare:function(iHeight){var Cheight;Cheight=this.Before();return Cheight-iHeight;},RunLoad:function(){var compareValue,_this=this;this.oldScroll=$(window).scrollTop();for(var i=0;i<this.data.length;i++){compareValue=this.Compare(this.data[i]);if(compareValue>0&&!!$(this.childsImg[i]).attr("lazyload_src")){if(this.isZoom){this.LoadImage(i);}$(this.childsImg[i]).attr("src",function(){return $(_this.childsImg[i]).attr("lazyload_src")});$(this.childsImg[i]).removeAttr("lazyload_src");}}},ScrollLoad:function(){var _this=this;$(window).bind("scroll",function(){_this.newScroll=$(window).scrollTop();_this.StopLoad();if(_this.newScroll-_this.oldScroll<0){return;}_this.RunLoad();});},ResizeLoad:function(){var _this=this;$(window).bind("resize",function(){_this.RunLoad();});},StopLoad:function(){var Cheight;Cheight=this.Before();if(Cheight>this.Mheight){$(window).unbind();}}};
function expandkeyword(){var expandmore=$(".expandmore");var expandcon=$(".expandcon");$(expandmore).click(function(){$(this).hide();$(expandcon).show();});};
/*BuyerScroll*/var BuyerScroll=function(options){this.SetOptions(options);this.lButton=this.options.lButton;this.rButton=this.options.rButton;this.oList=this.options.oList;this.showSum=this.options.showSum;this.iList=$("#"+this.options.oList+" > "+this.options.iList);this.initSrc=$("#"+this.options.oList+" > "+this.options.iList+" "+this.options.initSrc);this.ImgWidth=this.options.ImgWidth;this.ImgHeight=this.options.ImgHeight;this.iListSum=this.iList.length;this.iListWidth=this.iList.outerWidth(true);this.moveWidth=this.iListWidth*this.showSum;this.dividers=Math.ceil(this.iListSum/this.showSum);this.moveMaxOffset=(this.dividers-1)*this.moveWidth;this.Init()};BuyerScroll.prototype={SetOptions:function(options){this.options={lButton:"left_scroll",rButton:"right_scroll",oList:"carousel_ul",iList:".box_col",initSrc:".pro_link",showSum:4,ImgWidth:144,ImgHeight:144};$.extend(this.options,options||{})},Init:function(){var pItemsLenght=(this.showSum*this.dividers)-this.iListSum,_iList=this.options.iList.split(".");if(pItemsLenght!=0){for(var j=0;j<pItemsLenght;j++){$("#"+this.oList).append("<div class="+_iList[1]+"></div>")}this.iList=$("#"+this.options.oList+" > "+this.options.iList);this.iListSum=this.iList.length}this.CreateImage();for(var i=0;i<this.showSum;i++){this.LoadImage(i)}this.LeftScroll();this.RightScroll()},ReturnLeft:function(){return isNaN(parseInt($("#"+this.oList).css("left")))?0:parseInt($("#"+this.oList).css("left"))},LeftScroll:function(){if(this.dividers==1)return;var _this=this,currentOffset;$("#"+this.lButton).click(function(){currentOffset=_this.ReturnLeft();if(currentOffset==0){for(var i=1;i<=_this.showSum;i++){$(_this.iList[_this.iListSum-i]).prependTo($("#"+_this.oList))}$("#"+_this.oList).css({left:-_this.moveWidth});$("#"+_this.oList+":not(:animated)").animate({left:"+="+_this.moveWidth},{duration:"slow",complete:function(){for(var j=_this.showSum+1;j<=_this.iListSum;j++){$(_this.iList[_this.iListSum-j]).prependTo($("#"+_this.oList))}$("#"+_this.oList).css({left:-_this.moveWidth*(_this.dividers-1)});_this.CurrentLoad()}})}else{$("#"+_this.oList+":not(:animated)").animate({left:"+="+_this.moveWidth},{duration:"slow",complete:function(){_this.CurrentLoad()}})}})},RightScroll:function(){if(this.dividers==1)return;var _this=this,currentOffset;$("#"+this.rButton).click(function(){currentOffset=_this.ReturnLeft();if(Math.abs(currentOffset)>=_this.moveMaxOffset){for(var i=0;i<_this.showSum;i++){$(_this.iList[i]).appendTo($("#"+_this.oList))}$("#"+_this.oList).css({left:-_this.moveWidth*(_this.dividers-2)});$("#"+_this.oList+":not(:animated)").animate({left:"-="+_this.moveWidth},{duration:"slow",complete:function(){for(var j=_this.showSum;j<_this.iListSum;j++){$(_this.iList[j]).appendTo($("#"+_this.oList))}$("#"+_this.oList).css({left:0});_this.CurrentLoad()}})}else{$("#"+_this.oList+":not(:animated)").animate({left:"-="+_this.moveWidth},{duration:"slow",complete:function(){_this.CurrentLoad()}})}})},CreateImage:function(){this.image=[],this.image_src=[];for(var i=0;i<this.initSrc.length;i++){this.image_src.push($(this.initSrc[i]).attr("init"));this.image.push(new Image())}},LoadImage:function(i){if(!$(this.initSrc[i]).attr("init")){return}var _this=this,size=[];(function(){var index=i;$(_this.image[index]).load(function(){if(_this.image[index].width==0||_this.image[index].height==0)return;size.push(_this.AutoScaling(_this.image[index],index));$(_this.initSrc[index]).append("<img src="+$(_this.initSrc[i]).attr("init")+" width="+size[0][0]+" height="+size[0][1]+" />");$(_this.initSrc[index]).removeAttr("init");_this.image[index]=new Image();size=[]});_this.image[index].src=_this.image_src[index]})()},AutoScaling:function(source,index){var iWidth,iHeight;if(source.width>0&&source.height>0){if(source.width/source.height>=this.ImgWidth/this.ImgHeight){if(source.width>this.ImgWidth){iWidth=this.ImgWidth;iHeight=(source.height*this.ImgWidth)/source.width}else{iWidth=source.width;iHeight=source.height}}else{if(source.height>this.ImgHeight){iHeight=this.ImgHeight;iWidth=(source.width*this.ImgHeight)/source.height}else{iWidth=source.width;iHeight=source.height}}}source=new Image();return[parseInt(iWidth),parseInt(iHeight)]},CurrentLoad:function(){var k=Math.abs(parseInt(this.ReturnLeft()/this.iListWidth));for(var j=k;j<=k+(this.showSum-1);j++){this.LoadImage(j)}}};
/*ddaccordion.js*/var ddaccordion={contentclassname:{},expandone:function(headerclass,selected){this.toggleone(headerclass,selected,"expand")},collapseone:function(headerclass,selected){this.toggleone(headerclass,selected,"collapse")},expandall:function(headerclass){var $=jQuery
var $headers=$('.'+headerclass)
$('.'+this.contentclassname[headerclass]+':hidden').each(function(){$headers.eq(parseInt($(this).attr('contentindex'))).trigger("evt_accordion")})},collapseall:function(headerclass){var $=jQuery
var $headers=$('.'+headerclass)
$('.'+this.contentclassname[headerclass]+':visible').each(function(){$headers.eq(parseInt($(this).attr('contentindex'))).trigger("evt_accordion")})},toggleone:function(headerclass,selected,optstate){var $=jQuery
var $targetHeader=$('.'+headerclass).eq(selected)
var $subcontent=$('.'+this.contentclassname[headerclass]).eq(selected)
if(typeof optstate=="undefined"||optstate=="expand"&&$subcontent.is(":hidden")||optstate=="collapse"&&$subcontent.is(":visible"))
$targetHeader.trigger("evt_accordion")},expandit:function($targetHeader,$targetContent,config,useractivated,directclick){this.transformHeader($targetHeader,config,"expand")
$targetContent.slideDown(config.animatespeed,function(){config.onopenclose($targetHeader.get(0),parseInt($targetHeader.attr('headerindex')),$targetContent.css('display'),useractivated)
if(config.postreveal=="gotourl"&&directclick){var targetLink=($targetHeader.is("a"))?$targetHeader.get(0):$targetHeader.find('a:eq(0)').get(0)
if(targetLink)
setTimeout(function(){location=targetLink.href},200)}})},collapseit:function($targetHeader,$targetContent,config,isuseractivated){this.transformHeader($targetHeader,config,"collapse")
$targetContent.slideUp(config.animatespeed,function(){config.onopenclose($targetHeader.get(0),parseInt($targetHeader.attr('headerindex')),$targetContent.css('display'),isuseractivated)})},transformHeader:function($targetHeader,config,state){$targetHeader.addClass((state=="expand")?config.cssclass.expand:config.cssclass.collapse).removeClass((state=="expand")?config.cssclass.collapse:config.cssclass.expand)
if(config.htmlsetting.location=='src'){$targetHeader=($targetHeader.is("img"))?$targetHeader:$targetHeader.find('img').eq(0)
$targetHeader.attr('src',(state=="expand")?config.htmlsetting.expand:config.htmlsetting.collapse)}
else if(config.htmlsetting.location=="prefix")
$targetHeader.find('.accordprefix').html((state=="expand")?config.htmlsetting.expand:config.htmlsetting.collapse)
else if(config.htmlsetting.location=="suffix")
$targetHeader.find('.accordsuffix').html((state=="expand")?config.htmlsetting.expand:config.htmlsetting.collapse)},urlparamselect:function(headerclass){var result=window.location.search.match(new RegExp(headerclass+"=((\\d+)(,(\\d+))*)","i"))
if(result!=null)
result=RegExp.$1.split(',')
return result},getCookie:function(Name){var re=new RegExp(Name+"=[^;]+","i")
if(document.cookie.match(re))
return document.cookie.match(re)[0].split("=")[1]
return null},setCookie:function(name,value){document.cookie=name+"="+value+"; path=/"},init:function(config){document.write('<style type="text/css">\n')
document.write('.'+config.contentclass+'{display: none}\n')
document.write('<\/style>')
jQuery(document).ready(function($){ddaccordion.urlparamselect(config.headerclass)
var persistedheaders=ddaccordion.getCookie(config.headerclass)
ddaccordion.contentclassname[config.headerclass]=config.contentclass
config.cssclass={collapse:config.toggleclass[0],expand:config.toggleclass[1]}
config.revealtype=config.revealtype||"click"
config.revealtype=config.revealtype.replace(/mouseover/i,"mouseenter")
if(config.revealtype=="clickgo"){config.postreveal="gotourl"
config.revealtype="click"}
if(typeof config.togglehtml=="undefined")
config.htmlsetting={location:"none"}
else
config.htmlsetting={location:config.togglehtml[0],collapse:config.togglehtml[1],expand:config.togglehtml[2]}
config.oninit=(typeof config.oninit=="undefined")?function(){}:config.oninit
config.onopenclose=(typeof config.onopenclose=="undefined")?function(){}:config.onopenclose
var lastexpanded={}
var expandedindices=ddaccordion.urlparamselect(config.headerclass)||((config.persiststate&&persistedheaders!=null)?persistedheaders:config.defaultexpanded)
if(typeof expandedindices=='string')
expandedindices=expandedindices.replace(/c/ig,'').split(',')
var $subcontents=$('.'+config["contentclass"])
if(expandedindices.length==1&&expandedindices[0]=="-1")
expandedindices=[]
if(config["collapseprev"]&&expandedindices.length>1)
expandedindices=[expandedindices.pop()]
if(config["onemustopen"]&&expandedindices.length==0)
expandedindices=[0]
$('.'+config["headerclass"]).each(function(index){if(/(prefix)|(suffix)/i.test(config.htmlsetting.location)&&$(this).html()!=""){$('<span class="accordprefix"></span>').prependTo(this)
$('<span class="accordsuffix"></span>').appendTo(this)}
$(this).attr('headerindex',index+'h')
$subcontents.eq(index).attr('contentindex',index+'c')
var $subcontent=$subcontents.eq(index)
var needle=(typeof expandedindices[0]=="number")?index:index+''
if(jQuery.inArray(needle,expandedindices)!=-1){if(config.animatedefault==false)
$subcontent.show()
ddaccordion.expandit($(this),$subcontent,config,false)
lastexpanded={$header:$(this),$content:$subcontent}}
else{$subcontent.hide()
config.onopenclose($(this).get(0),parseInt($(this).attr('headerindex')),$subcontent.css('display'),false)
ddaccordion.transformHeader($(this),config,"collapse")}})
$('.'+config["headerclass"]).bind("evt_accordion",function(e,isdirectclick){var $subcontent=$subcontents.eq(parseInt($(this).attr('headerindex')))
if($subcontent.css('display')=="none"){ddaccordion.expandit($(this),$subcontent,config,true,isdirectclick)
if(config["collapseprev"]&&lastexpanded.$header&&$(this).get(0)!=lastexpanded.$header.get(0)){ddaccordion.collapseit(lastexpanded.$header,lastexpanded.$content,config,true)}
lastexpanded={$header:$(this),$content:$subcontent}}
else if(!config["onemustopen"]||config["onemustopen"]&&lastexpanded.$header&&$(this).get(0)!=lastexpanded.$header.get(0)){ddaccordion.collapseit($(this),$subcontent,config,true)}})
$('.'+config["headerclass"]).bind(config.revealtype,function(){if(config.revealtype=="mouseenter"){clearTimeout(config.revealdelay)
var headerindex=parseInt($(this).attr("headerindex"))
config.revealdelay=setTimeout(function(){ddaccordion.expandone(config["headerclass"],headerindex)},config.mouseoverdelay||0)}
else{$(this).trigger("evt_accordion",[true])
return false}})
$('.'+config["headerclass"]).bind("mouseleave",function(){clearTimeout(config.revealdelay)})
config.oninit($('.'+config["headerclass"]).get(),expandedindices)
$(window).bind('unload',function(){$('.'+config["headerclass"]).unbind()
var expandedindices=[]
$('.'+config["contentclass"]+":visible").each(function(index){expandedindices.push($(this).attr('contentindex'))})
if(config.persiststate==true&&$('.'+config["headerclass"]).length>0){expandedindices=(expandedindices.length==0)?'-1c':expandedindices
ddaccordion.setCookie(config.headerclass,expandedindices)}})})}}
