/*
* cacheImage: a jQuery plugin
*
* cacheImage is a simple jQuery plugin for pre-caching images.  The
* plugin can be used to eliminate flashes of unstyled content (FOUC) and
* improve perceived page load time.  Callbacks for load, error and abort
* events are provided.
*
* For usage and examples, visit:
* http://github.com/alexrabarts/jquery-cacheimage
*
* Licensed under the MIT:
* http://www.opensource.org/licenses/mit-license.php
*
* Copyright (c) 2008 Stateless Systems (http://statelesssystems.com)
*
* @author   Alex Rabarts (alexrabarts -at- gmail -dawt- com)
* @requires jQuery v1.2 or later
* @version  0.1
*/
(function($) {$.extend($, { cacheImage: function(src, options) { if (typeof src === 'object') {$.each(src, function() {$.cacheImage(String(this), options); }); }var image = new Image(); options = options || {}; $.each(['load', 'error', 'abort'], function() { var e = String(this); if (typeof options[e] === 'function') { $(image)[e](options[e]); }});image.src = src;return image;}});$.extend($.fn, {cacheImage: function(options) {return this.each(function() {$.cacheImage(this.src, options);});}});})(jQuery);


/* 
* jScrollPane - ScrollBar
*
* For usage and examples, visit:
* http://www.kelvinluck.com/assets/jquery/jScrollPane/jScrollPane.html
*
*/
(function(A){A.jScrollPane={active:[]};A.fn.jScrollPane=function(C){C=A.extend({},A.fn.jScrollPane.defaults,C);var B=function(){return false};return this.each(function(){var O=A(this);O.css("overflow","hidden");var X=this;if(A(this).parent().is(".jScrollPaneContainer")){var Ac=C.maintainPosition?O.position().top:0;var L=A(this).parent();var d=L.innerWidth();var Ad=L.outerHeight();var M=Ad;A(">.jScrollPaneTrack, >.jScrollArrowUp, >.jScrollArrowDown",L).remove();O.css({top:0})}else{var Ac=0;this.originalPadding=O.css("paddingTop")+" "+O.css("paddingRight")+" "+O.css("paddingBottom")+" "+O.css("paddingLeft");this.originalSidePaddingTotal=(parseInt(O.css("paddingLeft"))||0)+(parseInt(O.css("paddingRight"))||0);var d=O.innerWidth();var Ad=O.innerHeight();var M=Ad;O.wrap(A("<div></div>").attr({className:"jScrollPaneContainer"}).css({height:Ad+"px",width:d+"px"}));A(document).bind("emchange",function(Ae,Af,p){O.jScrollPane(C)})}if(C.reinitialiseOnImageLoad){var N=A.data(X,"jScrollPaneImagesToLoad")||A("img",O);var G=[];if(N.length){N.each(function(p,Ae){A(this).bind("load",function(){if(A.inArray(p,G)==-1){G.push(Ae);N=A.grep(N,function(Ag,Af){return Ag!=Ae});A.data(X,"jScrollPaneImagesToLoad",N);C.reinitialiseOnImageLoad=false;O.jScrollPane(C)}}).each(function(Af,Ag){if(this.complete||this.complete===undefined){this.src=this.src}})})}}var o=this.originalSidePaddingTotal;var l={height:"auto",width:d-C.scrollbarWidth-C.scrollbarMargin-o+"px"};if(C.scrollbarOnLeft){l.paddingLeft=C.scrollbarMargin+C.scrollbarWidth+"px"}else{l.paddingRight=C.scrollbarMargin+"px"}O.css(l);var m=O.outerHeight();var i=Ad/m;if(i<0.99){var H=O.parent();H.append(A("<div></div>").attr({className:"jScrollPaneTrack"}).css({width:C.scrollbarWidth+"px"}).append(A("<div></div>").attr({className:"jScrollPaneDrag"}).css({width:C.scrollbarWidth+"px"}).append(A("<div></div>").attr({className:"jScrollPaneDragTop"}).css({width:C.scrollbarWidth+"px"}),A("<div></div>").attr({className:"jScrollPaneDragBottom"}).css({width:C.scrollbarWidth+"px"}))));var z=A(">.jScrollPaneTrack",H);var P=A(">.jScrollPaneTrack .jScrollPaneDrag",H);if(C.showArrows){var g;var Ab;var S;var r;var j=function(){if(r>4||r%4==0){y(u+Ab*b)}r++};var K=function(p){A("html").unbind("mouseup",K);g.removeClass("jScrollActiveArrowButton");clearInterval(S)};var Z=function(){A("html").bind("mouseup",K);g.addClass("jScrollActiveArrowButton");r=0;j();S=setInterval(j,100)};H.append(A("<a></a>").attr({href:"javascript:;",className:"jScrollArrowUp"}).css({width:C.scrollbarWidth+"px"}).html("Scroll up").bind("mousedown",function(){g=A(this);Ab=-1;Z();this.blur();return false}).bind("click",B),A("<a></a>").attr({href:"javascript:;",className:"jScrollArrowDown"}).css({width:C.scrollbarWidth+"px"}).html("Scroll down").bind("mousedown",function(){g=A(this);Ab=1;Z();this.blur();return false}).bind("click",B));var Q=A(">.jScrollArrowUp",H);var J=A(">.jScrollArrowDown",H);if(C.arrowSize){M=Ad-C.arrowSize-C.arrowSize;z.css({height:M+"px",top:C.arrowSize+"px"})}else{var s=Q.height();C.arrowSize=s;M=Ad-s-J.height();z.css({height:M+"px",top:s+"px"})}}var w=A(this).css({position:"absolute",overflow:"visible"});var D;var Y;var b;var u=0;var V=i*Ad/2;var a=function(Ae,Ag){var Af=Ag=="X"?"Left":"Top";return Ae["page"+Ag]||(Ae["client"+Ag]+(document.documentElement["scroll"+Af]||document.body["scroll"+Af]))||0};var f=function(){return false};var v=function(){n();D=P.offset(false);D.top-=u;Y=M-P[0].offsetHeight;b=2*C.wheelSpeed*Y/m};var E=function(p){v();V=a(p,"Y")-u-D.top;A("html").bind("mouseup",T).bind("mousemove",h);if(A.browser.msie){A("html").bind("dragstart",f).bind("selectstart",f)}return false};var T=function(){A("html").unbind("mouseup",T).unbind("mousemove",h);V=i*Ad/2;if(A.browser.msie){A("html").unbind("dragstart",f).unbind("selectstart",f)}};var y=function(Ae){Ae=Ae<0?0:(Ae>Y?Y:Ae);u=Ae;P.css({top:Ae+"px"});var Af=Ae/Y;w.css({top:((Ad-m)*Af)+"px"});O.trigger("scroll");if(C.showArrows){Q[Ae==0?"addClass":"removeClass"]("disabled");J[Ae==Y?"addClass":"removeClass"]("disabled")}};var h=function(p){y(a(p,"Y")-D.top-V)};var q=Math.max(Math.min(i*(Ad-C.arrowSize*2),C.dragMaxHeight),C.dragMinHeight);P.css({height:q+"px"}).bind("mousedown",E);var k;var R;var I;var t=function(){if(R>8||R%4==0){y((u-((u-I)/2)))}R++};var Aa=function(){clearInterval(k);A("html").unbind("mouseup",Aa).unbind("mousemove",e)};var e=function(p){I=a(p,"Y")-D.top-V};var U=function(p){v();e(p);R=0;A("html").bind("mouseup",Aa).bind("mousemove",e);k=setInterval(t,100);t()};z.bind("mousedown",U);H.bind("mousewheel",function(Ae,Ag){v();n();var Af=u;y(u-Ag*b);var p=Af!=u;return !p});var F;var W;function c(){var p=(F-u)/C.animateStep;if(p>1||p<-1){y(u+p)}else{y(F);n()}}var n=function(){if(W){clearInterval(W);delete F}};var x=function(Af,p){if(typeof Af=="string"){$e=A(Af,O);if(!$e.length){return}Af=$e.offset().top-O.offset().top}H.scrollTop(0);n();var Ae=-Af/(Ad-m)*Y;if(p||!C.animateTo){y(Ae)}else{F=Ae;W=setInterval(c,C.animateInterval)}};O[0].scrollTo=x;O[0].scrollBy=function(Ae){var p=-parseInt(w.css("top"))||0;x(p+Ae)};v();x(-Ac,true);A("*",this).bind("focus",function(Ah){var Ag=A(this);var Aj=0;while(Ag[0]!=O[0]){Aj+=Ag.position().top;Ag=Ag.offsetParent()}var p=-parseInt(w.css("top"))||0;var Ai=p+Ad;var Af=Aj>p&&Aj<Ai;if(!Af){var Ae=Aj-C.scrollbarMargin;if(Aj>p){Ae+=A(this).height()+15+C.scrollbarMargin-Ad}x(Ae)}});if(location.hash){x(location.hash)}A(document).bind("click",function(Ae){$target=A(Ae.target);if($target.is("a")){var p=$target.attr("href");if(p.substr(0,1)=="#"){x(p)}}});A.jScrollPane.active.push(O[0])}else{O.css({height:Ad+"px",width:d-this.originalSidePaddingTotal+"px",padding:this.originalPadding});O.parent().unbind("mousewheel")}})};A.fn.jScrollPane.defaults={scrollbarWidth:10,scrollbarMargin:5,wheelSpeed:18,showArrows:false,arrowSize:0,animateTo:false,dragMinHeight:1,dragMaxHeight:99999,animateInterval:100,animateStep:3,maintainPosition:true,scrollbarOnLeft:false,reinitialiseOnImageLoad:false};A(window).bind("unload",function(){var C=A.jScrollPane.active;for(var B=0;B<C.length;B++){C[B].scrollTo=C[B].scrollBy=null}})})(jQuery);


/* 
 * jQuery.MouseWheel
 * 
 * Copyright (c) 2009 Brandon Aaron (http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
 * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
 *
 * Version: 3.0.2
 * 
 * Requires: 1.2.2+
 */
(function(c){var a=["DOMMouseScroll","mousewheel"];c.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var d=a.length;d;){this.addEventListener(a[--d],b,false)}}else{this.onmousewheel=b}},teardown:function(){if(this.removeEventListener){for(var d=a.length;d;){this.removeEventListener(a[--d],b,false)}}else{this.onmousewheel=null}}};c.fn.extend({mousewheel:function(d){return d?this.bind("mousewheel",d):this.trigger("mousewheel")},unmousewheel:function(d){return this.unbind("mousewheel",d)}});function b(f){var d=[].slice.call(arguments,1),g=0,e=true;f=c.event.fix(f||window.event);f.type="mousewheel";if(f.wheelDelta){g=f.wheelDelta/120}if(f.detail){g=-f.detail/3}d.unshift(f,g);return c.event.handle.apply(this,d)}})(jQuery);


/*
* JQZoom Evolution 1.0.1 - Javascript Image magnifier
* Modified for k-eCommerce - kZoom
*
* Copyright (c) Engineer Renzi Marco(www.mind-projects.it)
*
* $Date: 12-12-2008
*
*	ChangeLog:
*  
* $License : GPL,so any change to the code you should copy and paste this section,and would be nice to report this to me(renzi.mrc@gmail.com).
*
* http://www.mind-projects.it/projects/jqzoom/index.php#documentation
*/
(function($){$.fn.jqzoom=function(options){var settings={zoomType:'standard',zoomWidth:200,zoomHeight:200,xOffset:10,yOffset:0,position:"right",lens:true,lensReset:false,imageOpacity:0.2,title:true,alwaysOn:false,showEffect:'show',hideEffect:'hide',fadeinSpeed:'fast',fadeoutSpeed:'slow',preloadImages:true,showPreload:true,preloadText:'Loading zoom',preloadPosition:'center'};options=options||{};$.extend(settings,options);return this.each(function(){var a=$(this);var aTitle=a.attr('title');$(a).removeAttr('title');$(a).css('outline-style','none');$(a).attr('href','');var img=$("img",this);var imageTitle=img.attr('title');var imageZoomUrl=img.attr('imgZoomUrl');var imageZoomHeight=img.attr('imgZoomHeight');var imageZoomWidth=img.attr('imgZoomWidth');img.removeAttr('title');var smallimage=new Smallimage(img);var smallimagedata={};var btop=0;var bleft=0;var loader=null;loader=new Loader();var ZoomTitle=(trim(aTitle).length>0)?aTitle:(trim(imageTitle).length>0)?imageTitle:null;var ZoomTitleObj=new zoomTitle();var largeimage=null;var lens=new Lens();var lensdata={};var largeimageloaded=false;var scale={};var stage=null;var running=false;var mousepos={};var firstime=0;var preloadshow=false;var isMouseDown=false;var dragstatus=false
smallimage.loadimage();$(this).click(function(){return false;});$(this).mouseenter(function(e){if(!running){mousepos.x=e.pageX;mousepos.y=e.pageY;if(img.attr('imgZoomUrl')!=""){activate();}
else{deactivate();}}}).mouseleave(deactivate);$(window).resize(function(){if(running){smallimagedata.pos=img.offset();smallimagedata.pos.l=img.offset().left;smallimagedata.pos.t=img.offset().top;smallimagedata.pos.r=smallimagedata.w+smallimagedata.pos.l;smallimagedata.pos.b=smallimagedata.h+smallimagedata.pos.t;leftpos=(smallimagedata.pos.r+Math.abs(settings.xOffset)+settings.zoomWidth<screen.width)?(smallimagedata.pos.l+smallimagedata.w+Math.abs(settings.xOffset)):(smallimagedata.pos.l-settings.zoomWidth-Math.abs(settings.xOffset));topwindow=smallimagedata.pos.t+settings.yOffset+settings.zoomHeight;toppos=(topwindow<screen.height&&topwindow>0)?smallimagedata.pos.t+settings.yOffset:smallimagedata.pos.t;$('div.kZoomWindow').css('left',leftpos);$('div.kZoomWindow').css('top',toppos);}});if(settings.alwaysOn){setTimeout(function(){activate();},150);}
function activate(){if(!running){smallimage.findborder();running=true;imageTitle=img.attr('title');img.removeAttr('title');aTitle=a.attr('title');imageZoomHeight=img.attr('imgZoomHeight');imageZoomWidth=img.attr('imgZoomWidth');$(a).removeAttr('title');if(!largeimage||$.browser.safari){largeimage=new Largeimage(img.attr('imgZoomUrl'));}
else{largeimage.url=img.attr('imgZoomUrl');}
if(!largeimageloaded||$.browser.safari){largeimage.loadimage();}else{if(settings.zoomType!='innerzoom'){stage=new Stage();stage.activate();}
lens=new Lens;lens.activate();}
img[0].blur();return false;}};function deactivate(){if(settings.zoomType=='reverse'&&!settings.alwaysOn){img.css({'opacity':1});}
largeimage.url="";if(!settings.alwaysOn){running=false;largeimageloaded=false;$(lens.node).unbind('mousemove');lens.remove();if($('div.kZoomWindow').length>0){stage.remove();}
if($('div.kZoomTitle').length>0){ZoomTitleObj.remove();}
img.attr('title',imageTitle);a.attr('title',aTitle);$().unbind();a.unbind('mousemove');firstime=0;if(jQuery('.zoom_ieframe').length>0){jQuery('.zoom_ieframe').remove();}}else{if(settings.lensReset){switch(settings.zoomType){case'innerzoom':largeimage.setcenter();break;default:lens.center();break;};}}
if(settings.alwaysOn){activate();}};function Smallimage(image){this.node=image[0];this.loadimage=function(){this.node.src=image[0].src;if($.browser.safari){this.node.onload();}};this.findborder=function(){var bordertop='';bordertop=$(img).css('border-top-width');btop='';var borderleft='';borderleft=$(img).css('border-left-width');bleft='';if(bordertop){for(i=0;i<3;i++){var x=[];x=bordertop.substr(i,1);if(isNaN(x)==false){btop=btop+''+bordertop.substr(i,1);}else{break;}}}
if(borderleft){for(i=0;i<3;i++){if(!isNaN(borderleft.substr(i,1))){bleft=bleft+borderleft.substr(i,1)}else{break;}}}
btop=(btop.length>0)?eval(btop):0;bleft=(bleft.length>0)?eval(bleft):0;};this.node.onload=function(){a.css({'cursor':'pointer','display':'block'});if(a.css('position')!='absolute'&&a.parent().css('position')){if($.browser.mozilla){a.css({'cursor':'pointer','position':'relative','display':'inline-block'});}else if($.browser.opera){a.css({'cursor':'pointer','position':'relative','display':'block'});}else{a.css({'cursor':'pointer','position':'relative','display':'block'});}}
if(a.parent().css('position')!='absolute'){a.parent().css('position','relative');}
else{}
smallimagedata.w=$(this).width();smallimagedata.h=$(this).height();smallimagedata.h=$(this).height();smallimagedata.pos=$(this).offset();smallimagedata.pos.l=$(this).offset().left;smallimagedata.pos.t=$(this).offset().top;smallimagedata.pos.r=smallimagedata.w+smallimagedata.pos.l;smallimagedata.pos.b=smallimagedata.h+smallimagedata.pos.t;a.height(smallimagedata.h);a.width(smallimagedata.w);if(settings.preloadImages){if(largeimage){largeimage.loadimage();}}};return this;};function Lens(){this.node=document.createElement("div");$(this.node).addClass('kZoomPreview');this.node.onerror=function(){$(lens.node).remove();lens=new Lens();lens.activate();};this.loadlens=function(){switch(settings.zoomType){case'reverse':this.image=new Image();this.image.src=smallimage.node.src;this.node.appendChild(this.image);$(this.node).css({'opacity':1});break;case'innerzoom':this.image=new Image();this.image.src=largeimage.node.src;this.node.appendChild(this.image);$(this.node).css({'opacity':1});break
default:break;};switch(settings.zoomType){case'innerzoom':lensdata.w=smallimagedata.w;lensdata.h=smallimagedata.h;break;default:lensdata.w=(settings.zoomWidth)/scale.x;lensdata.h=(settings.zoomHeight)/scale.y;break;};$(this.node).css({width:lensdata.w+'px',height:lensdata.h+'px',position:'absolute',display:'none',borderWidth:1+'px'});a.append(this.node);};return this;};Lens.prototype.activate=function(){this.loadlens();switch(settings.zoomType){case'reverse':img.css({'opacity':settings.imageOpacity});(settings.alwaysOn)?lens.center():lens.setposition(null);a.bind('mousemove',function(e){mousepos.x=e.pageX;mousepos.y=e.pageY;lens.setposition(e);});break;case'innerzoom':$(this.node).css({top:0,left:0});if(settings.title){ZoomTitleObj.loadtitle();}
largeimage.setcenter();a.bind('mousemove',function(e){mousepos.x=e.pageX;mousepos.y=e.pageY;largeimage.setinner(e);});break;default:(settings.alwaysOn)?lens.center():lens.setposition(null);$(a).bind('mousemove',function(e){mousepos.x=e.pageX;mousepos.y=e.pageY;lens.setposition(e);});break;};return this;};Lens.prototype.setposition=function(e){if(e){mousepos.x=e.pageX;mousepos.y=e.pageY;}
if(firstime==0){var lensleft=mousepos.x-smallimagedata.pos.l-(lensdata.w)/2;var lenstop=mousepos.y-smallimagedata.pos.t-(lensdata.h)/2;$('div.kZoomPreview').show()
if(settings.lens){this.node.style.visibility='visible';}
else{this.node.style.visibility='hidden';$('div.kZoomPreview').hide();}
firstime=1;}else{var lensleft=mousepos.x-smallimagedata.pos.l-(lensdata.w)/2;var lenstop=mousepos.y-smallimagedata.pos.t-(lensdata.h)/2;}
if(overleft()){lensleft=0+bleft;}else
if(overright()){if($.browser.msie){lensleft=smallimagedata.w-lensdata.w+bleft+1;}else{lensleft=smallimagedata.w-lensdata.w+bleft-1;}}
if(overtop()){lenstop=0+btop;}else
if(overbottom()){if($.browser.msie){lenstop=smallimagedata.h-lensdata.h+btop+1;}else{lenstop=smallimagedata.h-lensdata.h-1+btop;}}
lensleft=parseInt(lensleft);lenstop=parseInt(lenstop);$('div.kZoomPreview',a).css({top:lenstop,left:lensleft});if(settings.zoomType=='reverse'){$('div.kZoomPreview img',a).css({'position':'relative','top':-(lenstop-btop+1),'left':-(lensleft-bleft+1)});}
this.node.style.left=lensleft+'px';this.node.style.top=lenstop+'px';largeimage.setposition();function overleft(){return mousepos.x-(lensdata.w+2*1)/2-bleft<smallimagedata.pos.l;};function overright(){return mousepos.x+(lensdata.w+2*1)/2>smallimagedata.pos.r+bleft;};function overtop(){return mousepos.y-(lensdata.h+2*1)/2-btop<smallimagedata.pos.t;};function overbottom(){return mousepos.y+(lensdata.h+2*1)/2>smallimagedata.pos.b+btop;};return this;};Lens.prototype.center=function(){$('div.kZoomPreview',a).css('display','none');var lensleft=(smallimagedata.w)/2-(lensdata.w)/2;var lenstop=(smallimagedata.h)/2-(lensdata.h)/2;this.node.style.left=lensleft+'px';this.node.style.top=lenstop+'px';$('div.kZoomPreview',a).css({top:lenstop,left:lensleft});if(settings.zoomType=='reverse'){$('div.kZoomPreview img',a).css({'position':'absolute','top':-(lenstop-btop+1),'left':-(lensleft-bleft+1)});}
largeimage.setposition();if($.browser.msie){$('div.kZoomPreview',a).show();}else{setTimeout(function(){$('div.kZoomPreview').fadeIn('fast');},10);}};Lens.prototype.getoffset=function(){var o={};o.left=parseInt(this.node.style.left);o.top=parseInt(this.node.style.top);return o;};Lens.prototype.remove=function(){if(settings.zoomType=='innerzoom'){$('div.kZoomPreview',a).fadeOut('fast',function(){$(this).remove();});}else{$('div.kZoomPreview',a).remove();}};Lens.prototype.findborder=function(){var bordertop='';bordertop=$('div.kZoomPreview').css('borderTop');lensbtop='';var borderleft='';borderleft=$('div.kZoomPreview').css('borderLeft');lensbleft='';if($.browser.msie){var temp=bordertop.split(' ');bordertop=temp[1];var temp=borderleft.split(' ');borderleft=temp[1];}
if(bordertop){for(i=0;i<3;i++){var x=[];x=bordertop.substr(i,1);if(isNaN(x)==false){lensbtop=lensbtop+''+bordertop.substr(i,1);}else{break;}}}
if(borderleft){for(i=0;i<3;i++){if(!isNaN(borderleft.substr(i,1))){lensbleft=lensbleft+borderleft.substr(i,1)}else{break;}}}
lensbtop=(lensbtop.length>0)?eval(lensbtop):0;lensbleft=(lensbleft.length>0)?eval(lensbleft):0;};function Largeimage(url){this.url=url;this.node=new Image();this.loadimage=function(){if(!this.node)
this.node=new Image();this.node.style.position='absolute';this.node.style.display='none';this.node.style.left='-5000px';this.node.style.top='10px';loader=new Loader();if(settings.showPreload&&!preloadshow){loader.show();preloadshow=true;}
document.body.appendChild(this.node);this.node.width=imageZoomWidth;this.node.height=imageZoomHeight;this.node.src=this.url;};this.node.onload=function(){this.style.display='block';var w=0;var h=0;w=Math.round(imageZoomWidth);h=Math.round(imageZoomHeight);this.style.display='none';scale.x=(w/smallimagedata.w);scale.y=(h/smallimagedata.h);if($('div.preload').length>0){$('div.preload').remove();}
largeimageloaded=true;if(settings.zoomType!='innerzoom'&&running){stage=new Stage();stage.activate();}
if(running){lens=new Lens();lens.activate();}
if($('div.preload').length>0){$('div.preload').remove();}};return this;};Largeimage.prototype.setposition=function(){this.node.style.left=Math.ceil(-scale.x*parseInt(lens.getoffset().left)+bleft)+'px';this.node.style.top=Math.ceil(-scale.y*parseInt(lens.getoffset().top)+btop)+'px';};Largeimage.prototype.setinner=function(e){this.node.style.left=Math.ceil(-scale.x*Math.abs(e.pageX-smallimagedata.pos.l))+'px';this.node.style.top=Math.ceil(-scale.y*Math.abs(e.pageY-smallimagedata.pos.t))+'px';$('div.kZoomPreview img',a).css({'position':'absolute','top':this.node.style.top,'left':this.node.style.left});};Largeimage.prototype.setcenter=function(){this.node.style.left=Math.ceil(-scale.x*Math.abs((smallimagedata.w)/2))+'px';this.node.style.top=Math.ceil(-scale.y*Math.abs((smallimagedata.h)/2))+'px';$('div.kZoomPreview img',a).css({'position':'absolute','top':this.node.style.top,'left':this.node.style.left});};function Stage(){var leftpos=smallimagedata.pos.l;var toppos=smallimagedata.pos.t;this.node=document.createElement("div");$(this.node).addClass('kZoomWindow');$(this.node).css({position:'absolute',width:Math.round(settings.zoomWidth)+'px',height:Math.round(settings.zoomHeight)+'px',display:'none',zIndex:10000,overflow:'hidden'});switch(settings.position){case"right":leftpos=(smallimagedata.pos.r+Math.abs(settings.xOffset)+settings.zoomWidth<screen.width)?(smallimagedata.pos.l+smallimagedata.w+Math.abs(settings.xOffset)):(smallimagedata.pos.l-settings.zoomWidth-Math.abs(settings.xOffset));topwindow=smallimagedata.pos.t+settings.yOffset+settings.zoomHeight;toppos=(topwindow<screen.height&&topwindow>0)?smallimagedata.pos.t+settings.yOffset:smallimagedata.pos.t;break;case"left":leftpos=(smallimagedata.pos.l-Math.abs(settings.xOffset)-settings.zoomWidth>0)?(smallimagedata.pos.l-Math.abs(settings.xOffset)-settings.zoomWidth):(smallimagedata.pos.l+smallimagedata.w+Math.abs(settings.xOffset));topwindow=smallimagedata.pos.t+settings.yOffset+settings.zoomHeight;toppos=(topwindow<screen.height&&topwindow>0)?smallimagedata.pos.t+settings.yOffset:smallimagedata.pos.t;break;case"top":toppos=(smallimagedata.pos.t-Math.abs(settings.yOffset)-settings.zoomHeight>0)?(smallimagedata.pos.t-Math.abs(settings.yOffset)-settings.zoomHeight):(smallimagedata.pos.t+smallimagedata.h+Math.abs(settings.yOffset));leftwindow=smallimagedata.pos.l+settings.xOffset+settings.zoomWidth;leftpos=(leftwindow<screen.width&&leftwindow>0)?smallimagedata.pos.l+settings.xOffset:smallimagedata.pos.l;break;case"bottom":toppos=(smallimagedata.pos.b+Math.abs(settings.yOffset)+settings.zoomHeight<$('body').height())?(smallimagedata.pos.b+Math.abs(settings.yOffset)):(smallimagedata.pos.t-settings.zoomHeight-Math.abs(settings.yOffset));leftwindow=smallimagedata.pos.l+settings.xOffset+settings.zoomWidth;leftpos=(leftwindow<screen.width&&leftwindow>0)?smallimagedata.pos.l+settings.xOffset:smallimagedata.pos.l;break;default:leftpos=(smallimagedata.pos.l+smallimagedata.w+settings.xOffset+settings.zoomWidth<screen.width)?(smallimagedata.pos.l+smallimagedata.w+Math.abs(settings.xOffset)):(smallimagedata.pos.l-settings.zoomWidth-Math.abs(settings.xOffset));toppos=(smallimagedata.pos.b+Math.abs(settings.yOffset)+settings.zoomHeight<screen.height)?(smallimagedata.pos.b+Math.abs(settings.yOffset)):(smallimagedata.pos.t-settings.zoomHeight-Math.abs(settings.yOffset));break;};this.node.style.left=leftpos+'px';this.node.style.top=toppos+'px';return this;};Stage.prototype.activate=function(){if(!this.node.firstChild)
this.node.appendChild(largeimage.node);if(settings.title){ZoomTitleObj.loadtitle();}
document.body.appendChild(this.node);switch(settings.showEffect){case'show':$(this.node).show();break;case'fadein':$(this.node).fadeIn(settings.fadeinSpeed);break;default:$(this.node).show();break;};$(this.node).show();if($.browser.msie&&$.browser.version<7){this.ieframe=$('<iframe class="zoom_ieframe" frameborder="0" src="#"></iframe>').css({position:"absolute",left:this.node.style.left,top:this.node.style.top,zIndex:99,width:settings.zoomWidth,height:settings.zoomHeight}).insertBefore(this.node);};largeimage.node.style.display='block';};Stage.prototype.remove=function(){switch(settings.hideEffect){case'hide':$('.kZoomWindow').remove();break;case'fadeout':$('.kZoomWindow').fadeOut(settings.fadeoutSpeed);break;default:$('.kZoomWindow').remove();break;};};function zoomTitle(){this.node=jQuery('<div />').addClass('kZoomTitle').html(''+ZoomTitle+'');this.loadtitle=function(){if(settings.zoomType=='innerzoom'){$(this.node).css({position:'absolute',top:smallimagedata.pos.b+3,left:(smallimagedata.pos.l+1),width:smallimagedata.w}).appendTo('body');}else{$(this.node).appendTo(stage.node);}};};zoomTitle.prototype.remove=function(){$('.kZoomTitle').remove();};function Loader(){this.node=document.createElement("div");$(this.node).addClass('preload');$(this.node).html(settings.preloadText);$(this.node).appendTo("body").css('visibility','hidden');this.show=function(){switch(settings.preloadPosition){case'center':loadertop=smallimagedata.pos.t+(smallimagedata.h-$(this.node).height())/2;loaderleft=smallimagedata.pos.l+(smallimagedata.w-$(this.node).width())/2;break;default:var loaderoffset=this.getoffset();loadertop=!isNaN(loaderoffset.top)?smallimagedata.pos.t+loaderoffset.top:smallimagedata.pos.t+0;loaderleft=!isNaN(loaderoffset.left)?smallimagedata.pos.l+loaderoffset.left:smallimagedata.pos.l+0;break;};$(this.node).css({top:loadertop,left:loaderleft,position:'absolute',visibility:'visible'});};return this;};Loader.prototype.getoffset=function(){var o=null;o=$('div.preload').offset();return o;};});}
function trim(stringa){while(stringa.substring(0,1)==' '){stringa=stringa.substring(1,stringa.length);}
while(stringa.substring(stringa.length-1,stringa.length)==' '){stringa=stringa.substring(0,stringa.length-1);}
return stringa;};})(jQuery);







/*
* jCountdown
* Creates a countdown timer from a jQuery object. Allows you to format
* the way the time is displayed.
*
* $(<selector>).countdown({params});
*
* If you want to replace the 
*
*/
(function($) { $.fn.countdown = function(params) { var self = this; self.display = $(this); self.target = new Date(params.date); self.message = params.message ? params.message : "It's Here!!"; self.addZeros = params.addZeros ? params.addZeros : false; self.onTick = params.onTick ? params.onTick : function() { return true }; self.onFinish = params.onFinish ? params.onFinish : function() { return true }; self._tick = function() { var now = (self.target - new Date()); if (now.valueOf() < 0) { window.clearInterval(self._interval); if (!self.onFinish(self.display)) { return } self.display.html(self.message); return }; var seconds = now.valueOf() / 1000; var day = (Math.floor(seconds / 86400)) % 86400; var hrs = (Math.floor(seconds / 3600)) % 24; var min = (Math.floor(seconds / 60)) % 60; var sec = (Math.floor(seconds / 1)) % 60; if (!self.onTick(self.display, day, hrs, min, sec)) { return }; if (self.addZeros) { hrs = (hrs + "").length < 2 ? "0" + hrs : hrs; min = (min + "").length < 2 ? "0" + min : min; sec = (sec + "").length < 2 ? "0" + sec : sec }; self.display.html(day + "<span>days</span>" + hrs + "<span>hrs</span>" + min + "<span>min</span>" + sec + "<span>sec</span>") }; self._interval = window.setInterval(self._tick, params.interval ? params.interval : 1000); if (!params.delayStart) { self._tick }; return this } })(jQuery);



/*
* SimpleModal 1.2.3 - jQuery Plugin
* http://www.ericmmartin.com/projects/simplemodal/
* Copyright (c) 2009 Eric Martin
* Dual licensed under the MIT and GPL licenses
* Revision: $Id: jquery.simplemodal.js 185 2009-02-09 21:51:12Z emartin24 $
*/

(function($) { var ie6 = $.browser.msie && parseInt($.browser.version) == 6 && typeof window['XMLHttpRequest'] != "object", ieQuirks = null, w = []; $.modal = function(data, options) { return $.modal.impl.init(data, options); }; $.modal.close = function() { $.modal.impl.close(); }; $.fn.modal = function(options) { return $.modal.impl.init(this, options); }; $.modal.defaults = { opacity: 50, overlayId: 'simplemodal-overlay', overlayCss: {}, containerId: 'simplemodal-container', containerCss: {}, dataCss: {}, zIndex: 1000, close: true, closeHTML: '<a class="modalCloseImg" title="Close"></a>', closeClass: 'simplemodal-close', position: null, persist: false, onOpen: null, onShow: null, onClose: null }; $.modal.impl = { opts: null, dialog: {}, init: function(data, options) { if (this.dialog.data) { return false; } ieQuirks = $.browser.msie && !$.boxModel; this.opts = $.extend({}, $.modal.defaults, options); this.zIndex = this.opts.zIndex; this.occb = false; if (typeof data == 'object') { data = data instanceof jQuery ? data : $(data); if (data.parent().parent().size() > 0) { this.dialog.parentNode = data.parent(); if (!this.opts.persist) { this.dialog.orig = data.clone(true); } } } else if (typeof data == 'string' || typeof data == 'number') { data = $('<div/>').html(data); } else { alert('SimpleModal Error: Unsupported data type: ' + typeof data); return false; } this.dialog.data = data.addClass('simplemodal-data').css(this.opts.dataCss); data = null; this.create(); this.open(); if ($.isFunction(this.opts.onShow)) { this.opts.onShow.apply(this, [this.dialog]); } return this; }, create: function() { w = this.getDimensions(); if (ie6) { this.dialog.iframe = $('<iframe src="javascript:false;"/>').css($.extend(this.opts.iframeCss, { display: 'none', opacity: 0, position: 'fixed', height: w[0], width: w[1], zIndex: this.opts.zIndex, top: 0, left: 0 })).appendTo('form'); } this.dialog.overlay = $('<div/>').attr('id', this.opts.overlayId).addClass('simplemodal-overlay').css($.extend(this.opts.overlayCss, { display: 'none', opacity: this.opts.opacity / 100, height: w[0], width: w[1], position: 'fixed', left: 0, top: 0, zIndex: this.opts.zIndex + 1 })).appendTo('form'); this.dialog.container = $('<div/>').attr('id', this.opts.containerId).addClass('simplemodal-container').css($.extend(this.opts.containerCss, { display: 'none', position: 'fixed', zIndex: this.opts.zIndex + 2 })).append(this.opts.close ? $(this.opts.closeHTML).addClass(this.opts.closeClass) : '').appendTo('form'); this.setPosition(); if (ie6 || ieQuirks) { this.fixIE(); } this.dialog.container.append(this.dialog.data.hide()); }, bindEvents: function() { var self = this; $('.' + this.opts.closeClass).bind('click.simplemodal', function(e) { e.preventDefault(); self.close(); }); $(window).bind('resize.simplemodal', function() { w = self.getDimensions(); self.setPosition(); if (ie6 || ieQuirks) { self.fixIE(); } else { self.dialog.iframe && self.dialog.iframe.css({ height: w[0], width: w[1] }); self.dialog.overlay.css({ height: w[0], width: w[1] }); } }); }, unbindEvents: function() { $('.' + this.opts.closeClass).unbind('click.simplemodal'); $(window).unbind('resize.simplemodal'); }, fixIE: function() { var p = this.opts.position; $.each([this.dialog.iframe || null, this.dialog.overlay, this.dialog.container], function(i, el) { if (el) { var bch = 'document.body.clientHeight', bcw = 'document.body.clientWidth', bsh = 'document.body.scrollHeight', bsl = 'document.body.scrollLeft', bst = 'document.body.scrollTop', bsw = 'document.body.scrollWidth', ch = 'document.documentElement.clientHeight', cw = 'document.documentElement.clientWidth', sl = 'document.documentElement.scrollLeft', st = 'document.documentElement.scrollTop', s = el[0].style; s.position = 'absolute'; if (i < 2) { s.removeExpression('height'); s.removeExpression('width'); s.setExpression('height', '' + bsh + ' > ' + bch + ' ? ' + bsh + ' : ' + bch + ' + "px"'); s.setExpression('width', '' + bsw + ' > ' + bcw + ' ? ' + bsw + ' : ' + bcw + ' + "px"'); } else { var te, le; if (p && p.constructor == Array) { var top = p[0] ? typeof p[0] == 'number' ? p[0].toString() : p[0].replace(/px/, '') : el.css('top').replace(/px/, ''); te = top.indexOf('%') == -1 ? top + ' + (t = ' + st + ' ? ' + st + ' : ' + bst + ') + "px"' : parseInt(top.replace(/%/, '')) + ' * ((' + ch + ' || ' + bch + ') / 100) + (t = ' + st + ' ? ' + st + ' : ' + bst + ') + "px"'; if (p[1]) { var left = typeof p[1] == 'number' ? p[1].toString() : p[1].replace(/px/, ''); le = left.indexOf('%') == -1 ? left + ' + (t = ' + sl + ' ? ' + sl + ' : ' + bsl + ') + "px"' : parseInt(left.replace(/%/, '')) + ' * ((' + cw + ' || ' + bcw + ') / 100) + (t = ' + sl + ' ? ' + sl + ' : ' + bsl + ') + "px"'; } } else { te = '(' + ch + ' || ' + bch + ') / 2 - (this.offsetHeight / 2) + (t = ' + st + ' ? ' + st + ' : ' + bst + ') + "px"'; le = '(' + cw + ' || ' + bcw + ') / 2 - (this.offsetWidth / 2) + (t = ' + sl + ' ? ' + sl + ' : ' + bsl + ') + "px"'; } s.removeExpression('top'); s.removeExpression('left'); s.setExpression('top', te); s.setExpression('left', le); } } }); }, getDimensions: function() { var el = $(window); var h = $.browser.opera && $.browser.version > '9.5' && $.fn.jquery <= '1.2.6' ? document.documentElement['clientHeight'] : el.height(); return [h, el.width()]; }, setPosition: function() { var top, left, hCenter = (w[0] / 2) - ((this.dialog.container.height() || this.dialog.data.height()) / 2), vCenter = (w[1] / 2) - ((this.dialog.container.width() || this.dialog.data.width()) / 2); if (this.opts.position && this.opts.position.constructor == Array) { top = this.opts.position[0] || hCenter; left = this.opts.position[1] || vCenter; } else { top = hCenter; left = vCenter; } this.dialog.container.css({ left: left, top: top }); }, open: function() { this.dialog.iframe && this.dialog.iframe.show(); if ($.isFunction(this.opts.onOpen)) { this.opts.onOpen.apply(this, [this.dialog]); } else { this.dialog.overlay.show(); this.dialog.container.show(); this.dialog.data.show(); } this.bindEvents(); }, close: function() { if (!this.dialog.data) { return false; } if ($.isFunction(this.opts.onClose) && !this.occb) { this.occb = true; this.opts.onClose.apply(this, [this.dialog]); } else { if (this.dialog.parentNode) { if (this.opts.persist) { this.dialog.data.hide().appendTo(this.dialog.parentNode); } else { this.dialog.data.remove(); this.dialog.orig.appendTo(this.dialog.parentNode); } } else { this.dialog.data.remove(); } this.dialog.container.remove(); this.dialog.overlay.remove(); this.dialog.iframe && this.dialog.iframe.remove(); this.dialog = {}; } this.unbindEvents(); } }; })(jQuery);


