/**
 * Boxy 0.1.4 - Facebook-style dialog, with frills
 *
 * (c) 2008 Jason Frame
 * Licensed under the MIT License (LICENSE)
 */
jQuery.fn.boxy=function(options){
options=options||{};
return this.each(function(){
var node=this.nodeName.toLowerCase(),self=this;
if(node=='a'){
jQuery(this).click(function(){
var active=Boxy.linkedTo(this),
href=this.getAttribute('href'),
localOptions=jQuery.extend({actuator:this,title:this.title},options);
if(active){
active.show();
}else if(href.indexOf('#')>=0){
var content=jQuery(href.substr(href.indexOf('#'))),
newContent=content.clone(true);
content.remove();
localOptions.unloadOnHide=false;
new Boxy(newContent,localOptions);
}else{if(!localOptions.cache)localOptions.unloadOnHide=true;
Boxy.load(this.href,localOptions);
}
return false;
});
}else if(node=='form'){
jQuery(this).bind('submit.boxy',function(){
Boxy.confirm(options.message||'Please confirm:',function(){
jQuery(self).unbind('submit.boxy').submit();
});
return false;
});
}
});
};
function Boxy(element,options){
this.boxy=jQuery(Boxy.WRAPPER);
jQuery.data(this.boxy[0],'boxy',this);
this.visible=false;
this.options=jQuery.extend({},Boxy.DEFAULTS,options||{});
if(this.options.modal){
this.options=jQuery.extend(this.options,{center:true,draggable:false});
}
if(this.options.actuator){
jQuery.data(this.options.actuator,'active.boxy',this);
}
this.setContent(element||"<div></div>");
this._setupTitleBar();
this.boxy.css('display','none').appendTo(document.body);
this.toTop();
if(this.options.fixed){
if(jQuery.browser.msie&&jQuery.browser.version<7){
this.options.fixed=false;}else{
this.boxy.addClass('fixed');
}
}
if(this.options.width){
this.boxy.width(this.options.width);
}
if(this.options.height){
this.boxy.height(this.options.height);
}
if(this.options.show){
this.show();
}
if(this.options.center){
this.center();
}else{
this.moveTo(
Boxy._u(this.options.x)?this.options.x:Boxy.DEFAULT_X,
Boxy._u(this.options.y)?this.options.y:Boxy.DEFAULT_Y
);
}
$('.boxy-wrapper').css('filter','');
};
Boxy.EF=function(){};
jQuery.extend(Boxy,{
WRAPPER:"<table cellspacing='0' cellpadding='0' border='0' class='boxy-wrapper' id='boxywrapper'>"+
"<tr><td class='top-left'></td><td class='top'></td><td class='top-right'></td></tr>"+
"<tr><td class='left'></td><td class='boxy-inner'></td><td class='right'></td></tr>"+
"<tr><td class='bottom-left'></td><td class='bottom'></td><td class='bottom-right'></td></tr>"+
"</table>",
DEFAULTS:{
title:null,closeable:true,draggable:true,clone:false,actuator:null,center:true,show:true,modal:true,fixed:true,closeText:'Close',unloadOnHide:false,clickToFront:false,behaviours:Boxy.EF,afterDrop:Boxy.EF,afterShow:Boxy.EF,afterHide:Boxy.EF,beforeUnload:Boxy.EF},
DEFAULT_X:111,
DEFAULT_Y:66,
zIndex:12000,
dragConfigured:false,resizeConfigured:false,
dragging:null,
load:function(url,options){
options=options||{};
var ajax={
url:url,type:'GET',dataType:'html',cache:false,success:function(html){
html=jQuery(html);
if(options.filter)html=jQuery(options.filter,html);
new Boxy(html,options);
}
};
jQuery.each(['type','cache'],function(){
if(this in options){
ajax[this]=options[this];
delete options[this];
}
});
jQuery.ajax(ajax);
},
get:function(ele){
var p=jQuery(ele).parents('.boxy-wrapper');
return p.length?jQuery.data(p[0],'boxy'):null;
},
linkedTo:function(ele){
return jQuery.data(ele,'active.boxy');
},
alert:function(message,callback,options){
return Boxy.ask(message,['OK'],callback,options);
},
confirm:function(message,after,options){
return Boxy.ask(message,['OK','Cancel'],function(response){
if(response=='OK')after();
},options);
},
ask:function(question,answers,callback,options){
options=jQuery.extend({modal:true,closeable:false},
options||{},{show:true,unloadOnHide:true});
var body=jQuery('<div></div>').append(jQuery('<div class="question"></div>').html(question)),
buttons=jQuery('<form class="answer"></form>'),
map={},answerStrings=[];
if(answers instanceof Array){
for(var i=0;i<answers.length;i++){
map[answers[i]]=answers[i];
answerStrings.push(answers[i]);
}
}else{
for(var k in answers){
map[answers[k]]=k;
answerStrings.push(answers[k]);
}
}
buttons.html(jQuery.map(answerStrings,function(v){
if(v!='OK'){
return"<input type='button' value='"+v+"' class='answer-button'/>";
}
else{
return"<input type='button' src='images/overlay_close.png' class='closebutton'>";
}
}).join(' '));
jQuery('input[type=button]',buttons).click(function(){
var clicked=this;
Boxy.get(this).hide(function(){
if(callback)
callback(map[clicked.value]);
});
});
body.append(buttons);
var s=$.browser.version;
if($.browser.mozilla){
if(!s.match(/1.*/)){
setTimeout('setCloseBtn()',500);
}
}
return new Boxy(body,options);
},
isModalVisible:function(){
return jQuery('.boxy-modal-blackout').length>0;
},
_u:function(){
for(var i=0;i<arguments.length;i++){
if(typeof arguments[i]!='undefined'){
return false;
}
}
return true;
},
_handleResize:function(evt){
var d=jQuery(document);
jQuery('.boxy-modal-blackout').css('display','none').css({
width:d.width(),height:d.height()
}).css('display','block');
if($.browser.msie){
jQuery('.boxy-modal-blackout').css('display','none').css({
width:d.width()-21,height:d.height()
}).css('display','block');
}
},
_handleDrag:function(evt){
var d;
},
_nextZ:function(){
return Boxy.zIndex++;
},
_viewport:function(){
var d=document.documentElement,b=document.body,w=window;
return jQuery.extend(
jQuery.browser.msie?{left:b.scrollLeft||d.scrollLeft,top:b.scrollTop||d.scrollTop}:{left:w.pageXOffset,top:w.pageYOffset},
!Boxy._u(w.innerWidth)?{width:w.innerWidth,height:w.innerHeight}:
(!Boxy._u(d)&&!Boxy._u(d.clientWidth)&&d.clientWidth!=0?{width:d.clientWidth,height:d.clientHeight}:{width:b.clientWidth,height:b.clientHeight}));
}
});
Boxy.prototype={
estimateSize:function(){
this.boxy.css({visibility:'hidden',display:'block'});
var dims=this.getSize();
this.boxy.css('display','none').css('visibility','visible');
return dims;
},
getSize:function(){
return[this.boxy.width(),this.boxy.height()];
},
getContentSize:function(){
var c=this.getContent();
return[c.width(),c.height()];
},
getPosition:function(){
var b=this.boxy[0];
return[b.offsetLeft,b.offsetTop];
},
getCenter:function(){
var p=this.getPosition(),s=this.getSize();
return[Math.floor(p[0]+s[0]/2),Math.floor(p[1]+s[1]/2)];
},
getInner:function(){
return jQuery('.boxy-inner',this.boxy);
},
getContent:function(){
return jQuery('.boxy-content',this.boxy);
},
setContent:function(newContent){
newContent=jQuery(newContent).css({display:'block'}).addClass('boxy-content');
if(this.options.clone)newContent=newContent.clone(true);
this.getContent().remove();
this.getInner().append(newContent);
this._setupDefaultBehaviours(newContent);
this.options.behaviours.call(this,newContent);
return this;
},
moveTo:function(x,y){
this.moveToX(x).moveToY(y);
return this;
},
moveToX:function(x){
if(typeof x=='number')this.boxy.css({left:x});
else
this.centerX();
return this;
},
moveToY:function(y){
if(typeof y=='number')this.boxy.css({top:y});
else
this.centerY();
return this;
},
centerAt:function(x,y){
var s=this[this.visible?'getSize':'estimateSize']();
if(typeof x=='number')this.moveToX(x-s[0]/2);
if(typeof y=='number')this.moveToY(y-s[1]/2);
return this;
},
centerAtX:function(x){
return this.centerAt(x,null);
},
centerAtY:function(y){
return this.centerAt(null,y);
},
center:function(axis){
var v=Boxy._viewport();
var o=this.options.fixed?[0,0]:[v.left,v.top];
if(!axis||axis=='x')this.centerAt(o[0]+v.width/2,null);
if(!axis||axis=='y')this.centerAt(null,o[1]+v.height/2);
return this;
},
centerX:function(){
return this.center('x');
},
centerY:function(){
return this.center('y');
},
resize:function(width,height,after){
if(!this.visible){return{};}
var bounds=this._getBoundsForResize(width,height);
this.boxy.css({left:bounds[0],top:bounds[1]});
this.getContent().css({width:bounds[2],height:bounds[3]});
if(after){after(this);}
return this;
},
tween:function(width,height,after){
if(!this.visible){return{};}
var bounds=this._getBoundsForResize(width,height),self=this;
this.boxy.stop().animate({left:bounds[0],top:bounds[1]});
this.getContent().stop().animate({width:bounds[2],height:bounds[3]},function(){
if(after){after(self);}
});
return this;
},
isVisible:function(){
return this.visible;
},
show:function(){
if(this.visible){return{};}
if(this.options.modal){
var self=this;
if(!Boxy.resizeConfigured){
Boxy.resizeConfigured=true;
jQuery(window).resize(function(){Boxy._handleResize();});
}
var iewidth;
if($.browser.msie){
iewidth=jQuery(document).width()-21;
}else{
iewidth=jQuery(document).width();
}
this.modalBlackout=jQuery('<div class="boxy-modal-blackout"></div>')
.css({zIndex:Boxy._nextZ(),
opacity:0.7,
width:iewidth,
height:jQuery(document).height()})
.appendTo(document.body);
this.toTop();
if(this.options.closeable){
jQuery(document.body).bind('keypress.boxy',function(evt){
var key=evt.which||evt.keyCode;
if(key==27){
self.hide();
jQuery(document.body).unbind('keypress.boxy');
}
});
}
}
this.boxy.stop().css({opacity:1}).show();
this.visible=true;
this._fire('afterShow');
document.getElementById('boxywrapper').style.filter='';
document.getElementById('boxywrapper').style.width='';
return this;
},
hide:function(after){
if(!this.visible){return{};}
var self=this;
if(this.options.modal){
jQuery(document.body).unbind('keypress.boxy');
this.modalBlackout.animate({opacity:0},function(){
jQuery(this).remove();
});
}
$('.items').show();
this.boxy.stop().animate({opacity:0},300,function(){
self.boxy.css({display:'none'});
self.visible=false;
self._fire('afterHide');
if(after)after(self);
if(self.options.unloadOnHide)self.unload();
});
return this;
},
toggle:function(){
this[this.visible?'hide':'show']();
return this;
},
hideAndUnload:function(after){
this.options.unloadOnHide=true;
this.hide(after);
return this;
},
unload:function(){
this._fire('beforeUnload');
this.boxy.remove();
if(this.options.actuator){
jQuery.data(this.options.actuator,'active.boxy',false);
}
},
toTop:function(){
this.boxy.css({zIndex:Boxy._nextZ()});
return this;
},
getTitle:function(){
return jQuery('> .title-bar h2',this.getInner()).html();
},
setTitle:function(t){
jQuery('> .title-bar h2',this.getInner()).html(t);
return this;
},
_getBoundsForResize:function(width,height){
var csize=this.getContentSize();
var delta=[width-csize[0],height-csize[1]],p=this.getPosition();
return[Math.max(p[0]-delta[0]/2,0),
Math.max(p[1]-delta[1]/2,0),width,height];
},
_setupTitleBar:function(){
if(this.options.title){
var self=this,tb=jQuery("<div class='title-bar'></div>").html("<h2>"+this.options.title+"</h2>");
if(this.options.closeable){
tb.append(jQuery("<a href='#' class='close'></a>").html(this.options.closeText));
}
if(this.options.draggable){
tb[0].onselectstart=function(){return false;};
tb[0].unselectable='on';
tb[0].style.MozUserSelect='none';
if(!Boxy.dragConfigured){
jQuery(document).mousemove(Boxy._handleDrag);
Boxy.dragConfigured=true;
}
tb.mousedown(function(evt){
self.toTop();
Boxy.dragging=[self,evt.pageX-self.boxy[0].offsetLeft,evt.pageY-self.boxy[0].offsetTop];
jQuery(this).addClass('dragging');
}).mouseup(function(){
jQuery(this).removeClass('dragging');
Boxy.dragging=null;
self._fire('afterDrop');
});
}
this.getInner().prepend(tb);
this._setupDefaultBehaviours(tb);
}
},
_setupDefaultBehaviours:function(root){
var self=this;
if(this.options.clickToFront){
root.click(function(){self.toTop();});
}
jQuery('.close',root).click(function(){
self.hide();
return false;
}).mousedown(function(evt){evt.stopPropagation();});
},
_fire:function(event){
this.options[event].call(this);
}
};
function setCloseBtn(){
if($('.boxy-wrapper').length&&$.browser.mozilla){
$('.boxy-wrapper').each(function(i){
var t=$(this).position().top,l=$(this).position().left,w=$(this).width();
$(this).find('.closebutton').css({
top:t-17,
left:l+w-17
});
});
}
}
if($.browser.mozilla){
window.onscroll=setCloseBtn;
}
/*hoverIntent <http://cherne.net/brian/resources/jquery.hoverIntent.html> currently under both MIT and GPL licenses.*/
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);return{};}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}return{};};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);

/* JQZoom Evolution 1.0.1 - Javascript Image magnifier Copyright (c) Engineer Renzi Marco(www.mind-projects.it) $License : GPL */
(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:false,preloadText:'Loading zoom',preloadPosition:'center'};options=options||{};$.extend(settings,options);return this.each(function(){var a=$(this);var t=a.attr('title');$(a).removeAttr('title');$(a).css('outline-style','none');var img=$("img",this);var it=img.attr('title');img.removeAttr('title');var si=new Smallimage(img),sid={};var btop=0,bleft=0,l=new Loader(),ZoomTitle=(trim(t).length>0)?t:(trim(it).length>0)?it:null,ZoomTitleObj=new zoomTitle(),li=new Largeimage(a[0].href),lens=new Lens(),ld={},lil=false,scale={},stage=null,r=false,m={},firstime=0,preloadshow=false,isMouseDown=false,dragstatus=false;si.loadimage();$(this).click(function(){return false;});$(this).hover(function(e){m.x=e.pageX;m.y=e.pageY;activate();},function(){deactivate();});if(settings.alwaysOn){setTimeout(function(){activate();},150);}function activate(){if(!r){si.findborder();r=true;it=img.attr('title');img.removeAttr('title');t=a.attr('title');$(a).removeAttr('title');if(!li||$.browser.safari){li=new Largeimage(a[0].href);}if(!lil||$.browser.safari){li.loadimage();}else{if(settings.zoomType!='innerzoom'){stage=new Stage();stage.activate();}lens=new Lens;lens.activate();}a[0].blur();}};function deactivate(){if(settings.zoomType=='reverse'&&!settings.alwaysOn){img.css({'opacity':1});}if(!settings.alwaysOn){r=false;lil=false;$(lens.node).unbind('mousemove');lens.remove();if($('div.jqZoomWindow').length>0){stage.remove();}if($('div.jqZoomTitle').length>0){ZoomTitleObj.remove();}img.attr('title',it);a.attr('title',t);$().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':li.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;};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':'crosshair','display':'block'});if(a.css('position')!='absolute'&&a.parent().css('position')){a.css({'cursor':'crosshair','position':'relative','display':'block'});}if(a.parent().css('position')!='absolute'){a.parent().css('position','relative');}else{}if($.browser.safari||$.browser.opera){$(img).css({position:'absolute',top:'0px',left:'0px'});}sid.w=$(this).width();sid.h=$(this).height();sid.h=$(this).height();sid.pos=$(this).offset();sid.pos.l=$(this).offset().left;sid.pos.t=$(this).offset().top;sid.pos.r=sid.w+sid.pos.l;sid.pos.b=sid.h+sid.pos.t;a.height(sid.h);a.width(sid.w);if(settings.preloadImages){li.loadimage();}};return this;};function Lens(){this.node=document.createElement("div");$(this.node).addClass('jqZoomPup');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=si.node.src;this.node.appendChild(this.image);$(this.node).css({'opacity':1});break;case'innerzoom':this.image=new Image();this.image.src=li.node.src;this.node.appendChild(this.image);$(this.node).css({'opacity':1});break;default:break;}switch(settings.zoomType){case'innerzoom':ld.w=sid.w;ld.h=sid.h;break;default:ld.w=(settings.zoomWidth)/scale.x;ld.h=(settings.zoomHeight)/scale.y;break;}$(this.node).css({width:ld.w+'px',height:ld.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){m.x=e.pageX;m.y=e.pageY;lens.setposition(e);});break;case'innerzoom':$(this.node).css({top:0,left:0});if(settings.title){ZoomTitleObj.loadtitle();}li.setcenter();a.bind('mousemove',function(e){m.x=e.pageX;m.y=e.pageY;li.setinner(e);});break;default:(settings.alwaysOn)?lens.center():lens.setposition(null);$(a).bind('mousemove',function(e){m.x=e.pageX;m.y=e.pageY;lens.setposition(e);});break;}return this;};Lens.prototype.setposition=function(e){if(e){m.x=e.pageX;m.y=e.pageY;}if(firstime==0){var lensleft=(sid.w)/2-(ld.w)/2;var lenstop=(sid.h)/2-(ld.h)/2;$('div.jqZoomPup').show();if(settings.lens){this.node.style.visibility='visible';}else{this.node.style.visibility='hidden';$('div.jqZoomPup').hide();}firstime=1;}else{var lensleft=m.x-sid.pos.l-(ld.w)/2;var lenstop=m.y-sid.pos.t-(ld.h)/2;}if(overleft()){lensleft=0+bleft;}else	if(overright()){if($.browser.msie){lensleft=sid.w-ld.w+bleft+1;}else{lensleft=sid.w-ld.w+bleft-1;}}if(overtop()){lenstop=0+btop;}else	if(overbottom()){if($.browser.msie){lenstop=sid.h-ld.h+btop+1;}else{lenstop=sid.h-ld.h-1+btop;}}lensleft=parseInt(lensleft);lenstop=parseInt(lenstop);$('div.jqZoomPup',a).css({top:lenstop,left:lensleft});if(settings.zoomType=='reverse'){$('div.jqZoomPup img',a).css({'position':'absolute','top':-(lenstop-btop+1),'left':-(lensleft-bleft+1)});}this.node.style.left=lensleft+'px';this.node.style.top=lenstop+'px';li.setposition();function overleft(){return m.x-(ld.w+2*1)/2-bleft<sid.pos.l;};function overright(){return m.x+(ld.w+2*1)/2>sid.pos.r+bleft;};function overtop(){return m.y-(ld.h+2*1)/2-btop<sid.pos.t;};function overbottom(){return m.y+(ld.h+2*1)/2>sid.pos.b+btop;};return this;};Lens.prototype.center=function(){$('div.jqZoomPup',a).css('display','none');var lensleft=(sid.w)/2-(ld.w)/2;var lenstop=(sid.h)/2-(ld.h)/2;this.node.style.left=lensleft+'px';this.node.style.top=lenstop+'px';$('div.jqZoomPup',a).css({top:lenstop,left:lensleft});if(settings.zoomType=='reverse'){$('div.jqZoomPup img',a).css({'position':'absolute','top':-(lenstop-btop+1),'left':-(lensleft-bleft+1)});}li.setposition();if($.browser.msie){$('div.jqZoomPup',a).show();}else{setTimeout(function(){$('div.jqZoomPup').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.jqZoomPup',a).fadeOut('fast',function(){$(this).remove();});}else{$('div.jqZoomPup',a).remove();}};Lens.prototype.findborder=function(){var bordertop='';bordertop=$('div.jqZoomPup').css('borderTop');lensbtop='';var borderleft='';borderleft=$('div.jqZoomPup').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';l=new Loader();if(settings.showPreload&&!preloadshow){l.show();preloadshow=true;}document.body.appendChild(this.node);this.node.src=this.url;};this.node.onload=function(){this.style.display='block';var w=Math.round($(this).width());var	h=Math.round($(this).height());this.style.display='none';scale.x=(w/sid.w);scale.y=(h/sid.h);if($('div.preload').length>0){$('div.preload').remove();}lil=true;if(settings.zoomType!='innerzoom'&&r){stage=new Stage();stage.activate();}if(r){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-sid.pos.l))+'px';this.node.style.top=Math.ceil(-scale.y*Math.abs(e.pageY-sid.pos.t))+'px';$('div.jqZoomPup 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((sid.w)/2))+'px';this.node.style.top=Math.ceil(-scale.y*Math.abs((sid.h)/2))+'px';$('div.jqZoomPup img',a).css({'position':'absolute','top':this.node.style.top,'left':this.node.style.left});};function Stage(){var leftpos=sid.pos.l;var toppos=sid.pos.t;this.node=document.createElement("div");$(this.node).addClass('jqZoomWindow');$(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=(sid.pos.r+Math.abs(settings.xOffset)+settings.zoomWidth<screen.width)?(sid.pos.l+sid.w+Math.abs(settings.xOffset)):(sid.pos.l-settings.zoomWidth-Math.abs(settings.xOffset));topwindow=sid.pos.t+settings.yOffset+settings.zoomHeight;toppos=(topwindow<screen.height&&topwindow>0)?sid.pos.t+settings.yOffset:sid.pos.t;break;case"left":leftpos=(sid.pos.l-Math.abs(settings.xOffset)-settings.zoomWidth>0)?(sid.pos.l-Math.abs(settings.xOffset)-settings.zoomWidth):(sid.pos.l+sid.w+Math.abs(settings.xOffset));topwindow=sid.pos.t+settings.yOffset+settings.zoomHeight;toppos=(topwindow<screen.height&&topwindow>0)?sid.pos.t+settings.yOffset:sid.pos.t;break;case"top":toppos=(sid.pos.t-Math.abs(settings.yOffset)-settings.zoomHeight>0)?(sid.pos.t-Math.abs(settings.yOffset)-settings.zoomHeight):(sid.pos.t+sid.h+Math.abs(settings.yOffset));leftwindow=sid.pos.l+settings.xOffset+settings.zoomWidth;leftpos=(leftwindow<screen.width&&leftwindow>0)?sid.pos.l+settings.xOffset:sid.pos.l;break;case"bottom":toppos=(sid.pos.b+Math.abs(settings.yOffset)+settings.zoomHeight<$('body').height())?(sid.pos.b+Math.abs(settings.yOffset)):(sid.pos.t-settings.zoomHeight-Math.abs(settings.yOffset));leftwindow=sid.pos.l+settings.xOffset+settings.zoomWidth;leftpos=(leftwindow<screen.width&&leftwindow>0)?sid.pos.l+settings.xOffset:sid.pos.l;break;default:leftpos=(sid.pos.l+sid.w+settings.xOffset+settings.zoomWidth<screen.width)?(sid.pos.l+sid.w+Math.abs(settings.xOffset)):(sid.pos.l-settings.zoomWidth-Math.abs(settings.xOffset));toppos=(sid.pos.b+Math.abs(settings.yOffset)+settings.zoomHeight<screen.height)?(sid.pos.b+Math.abs(settings.yOffset)):(sid.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(li.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);};li.node.style.display='block';};Stage.prototype.remove=function(){switch(settings.hideEffect){case'hide':$('.jqZoomWindow').remove();break;case'fadeout':$('.jqZoomWindow').fadeOut(settings.fadeoutSpeed);break;default:$('.jqZoomWindow').remove();break;}};function zoomTitle(){this.node=jQuery('<div />').addClass('jqZoomTitle').html(''+ZoomTitle+'');this.loadtitle=function(){if(settings.zoomType=='innerzoom'){$(this.node).css({position:'absolute',top:sid.pos.b+3,left:(sid.pos.l+1),width:sid.w}).appendTo('body');}else{$(this.node).appendTo(stage.node);}};};zoomTitle.prototype.remove=function(){$('.jqZoomTitle').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=sid.pos.t+(sid.h-$(this.node).height())/2;loaderleft=sid.pos.l+(sid.w-$(this.node).width())/2;break;default:var loaderoffset=this.getoffset();loadertop=!isNaN(loaderoffset.top)?sid.pos.t+loaderoffset.top:sid.pos.t+0;loaderleft=!isNaN(loaderoffset.left)?sid.pos.l+loaderoffset.left:sid.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;};});};})(jQuery);function trim(s){while(s.substring(0,1)==' '){s=s.substring(1,s.length);}while(s.substring(s.length-1,s.length)==' '){s=s.substring(0,s.length-1);}return s;}

/*jQuery Tools 1.2.3 [scrollable, scrollable.autoscroll, scrollable.navigator] http://flowplayer.org/tools/*/
(function(e){function n(f,c){var a=e(c);return a.length<2?a:f.parent().find(c)}function t(f,c){var a=this,l=f.add(a),g=f.children(),k=0,m=c.vertical;j||(j=a);if(g.length>1)g=e(c.items,f);e.extend(a,{getConf:function(){return c},getIndex:function(){return k},getSize:function(){return a.getItems().size()},getNaviButtons:function(){return o.add(p)},getRoot:function(){return f},getItemWrap:function(){return g},getItems:function(){return g.children(c.item).not("."+c.clonedClass)},move:function(b,d){return a.seekTo(k+
b,d)},next:function(b){return a.move(1,b)},prev:function(b){return a.move(-1,b)},begin:function(b){return a.seekTo(0,b)},end:function(b){return a.seekTo(a.getSize()-1,b)},focus:function(){return j=a},addItem:function(b){b=e(b);if(c.circular){e(".cloned:last").before(b);e(".cloned:first").replaceWith(b.clone().addClass(c.clonedClass))}else g.append(b);l.trigger("onAddItem",[b]);return a},seekTo:function(b,d,h){if(c.circular&&b===0&&k==-1&&d!==0)return a;if(!c.circular&&b<0||b>a.getSize()||b<-1)return a;
var i=b;if(b.jquery)b=a.getItems().index(b);else i=a.getItems().eq(b);var q=e.Event("onBeforeSeek");if(!h){l.trigger(q,[b,d]);if(q.isDefaultPrevented()||!i.length)return a}i=m?{top:-i.position().top}:{left:-i.position().left};k=b;j=a;if(d===undefined)d=c.speed;g.animate(i,d,c.easing,h||function(){l.trigger("onSeek",[b])});return a}});e.each(["onBeforeSeek","onSeek","onAddItem"],function(b,d){e.isFunction(c[d])&&e(a).bind(d,c[d]);a[d]=function(h){e(a).bind(d,h);return a}});if(c.circular){var r=a.getItems().slice(-1).clone().prependTo(g),
s=a.getItems().eq(1).clone().appendTo(g);r.add(s).addClass(c.clonedClass);a.onBeforeSeek(function(b,d,h){if(!b.isDefaultPrevented())if(d==-1){a.seekTo(r,h,function(){a.end(0)});return b.preventDefault()}else d==a.getSize()&&a.seekTo(s,h,function(){a.begin(0)})});a.seekTo(0,0)}var o=n(f,c.prev).click(function(){a.prev()}),p=n(f,c.next).click(function(){a.next()});!c.circular&&a.getSize()>1&&a.onBeforeSeek(function(b,d){setTimeout(function(){if(!b.isDefaultPrevented()){o.toggleClass(c.disabledClass,
d<=0);p.toggleClass(c.disabledClass,d>=a.getSize()-1)}},1)});c.mousewheel&&e.fn.mousewheel&&f.mousewheel(function(b,d){if(c.mousewheel){a.move(d<0?1:-1,c.wheelSpeed||50);return false}});c.keyboard&&e(document).bind("keydown.scrollable",function(b){if(!(!c.keyboard||b.altKey||b.ctrlKey||e(b.target).is(":input")))if(!(c.keyboard!="static"&&j!=a)){var d=b.keyCode;if(m&&(d==38||d==40)){a.move(d==38?-1:1);return b.preventDefault()}if(!m&&(d==37||d==39)){a.move(d==37?-1:1);return b.preventDefault()}}});
e(a).trigger("onBeforeSeek",[c.initialIndex])}e.tools=e.tools||{version:"1.2.3"};e.tools.scrollable={conf:{activeClass:"active",circular:false,clonedClass:"cloned",disabledClass:"disabled",easing:"swing",initialIndex:0,item:null,items:".items",keyboard:true,mousewheel:false,next:".prev-next-navi .next",prev:".prev-next-navi .prev",speed:400,vertical:false,wheelSpeed:0}};var j;e.fn.scrollable=function(f){var c=this.data("scrollable");if(c)return c;f=e.extend({},e.tools.scrollable.conf,f);this.each(function(){c=new t(e(this),f);e(this).data("scrollable",
c)});return f.api?c:this}})(jQuery);
(function(c){var g=c.tools.scrollable;g.autoscroll={conf:{autoplay:true,interval:3E3,autopause:true}};c.fn.autoscroll=function(d){if(typeof d=="number")d={interval:d};var b=c.extend({},g.autoscroll.conf,d),h;this.each(function(){var a=c(this).data("scrollable");if(a)h=a;var e,i,f=true;a.play=function(){if(!e){f=false;e=setInterval(function(){a.next()},b.interval);a.next()}};a.pause=function(){e=clearInterval(e)};a.stop=function(){a.pause();f=true};b.autopause&&a.getRoot().add(a.getNaviButtons()).hover(function(){a.pause();
clearInterval(i)},function(){f||(i=setTimeout(a.play,b.interval))});b.autoplay&&setTimeout(a.play,b.interval)});return b.api?h:this}})(jQuery);
(function(d){function p(c,g){var h=d(g);return h.length<2?h:c.parent().find(g)}var m=d.tools.scrollable;m.navigator={conf:{navi:".navi",naviItem:null,activeClass:"active",indexed:false,idPrefix:null,history:false}};d.fn.navigator=function(c){if(typeof c=="string")c={navi:c};c=d.extend({},m.navigator.conf,c);var g;this.each(function(){function h(a,b,i){e.seekTo(b);if(j){if(location.hash)location.hash=a.attr("href").replace("#","")}else return i.preventDefault()}function f(){return k.find(c.naviItem||
"> *")}function n(a){var b=d("<"+(c.naviItem||"a")+"/>").click(function(i){h(d(this),a,i)}).attr("href","#"+a);a===0&&b.addClass(l);c.indexed&&b.text(a+1);c.idPrefix&&b.attr("id",c.idPrefix+a);return b.appendTo(k)}function o(a,b){a=f().eq(b.replace("#",""));a.length||(a=f().filter("[href="+b+"]"));a.click()}var e=d(this).data("scrollable"),k=p(e.getRoot(),c.navi),q=e.getNaviButtons(),l=c.activeClass,j=c.history&&d.fn.history;if(e)g=e;e.getNaviButtons=function(){return q.add(k)};f().length?f().each(function(a){d(this).click(function(b){h(d(this),
a,b)})}):d.each(e.getItems(),function(a){n(a)});e.onBeforeSeek(function(a,b){setTimeout(function(){if(!a.isDefaultPrevented()){var i=f().eq(b);!a.isDefaultPrevented()&&i.length&&f().removeClass(l).eq(b).addClass(l)}},1)});e.onAddItem(function(a,b){b=n(e.getItems().index(b));j&&b.history(o)});j&&f().history(o)});return c.api?g:this}})(jQuery);

/*Jquery Prosteps*/
(function($){$.fn.fakeClick=function(f){return $(this).removeAttr('href').css('cursor','pointer').click(f);};$.fn.placeholder=function(){return this.focus(function(){if($(this).val()===$(this).attr('alt')){$(this).val('');}}).blur(function(){if($(this).val()===''){$(this).val($(this).attr('alt'));}})};$.fn.userError=function(msg,altctr){if(msg&&msg!=''){$(this).addClass('error').parent().find('img.error').css('display','inline');$(this).parent().next('.error-holder').html(msg);}else{$(this).removeClass('error').parent().find('img.error').css('display','none');$(this).parent().next('.error-holder').html('');}return this;};$.fn.attrVal=function(attr){var v,i,c=$(this).attr('class').split(' ');for(i=0;i<c.length;i++){if(c[i].indexOf(attr)==0){v=c[i].replace(attr,'');break;}}return v;};$.fn.showIf=function(c,d){return c?$(this).show(d):$(this);};$.fn.hideIf=function(c,d){return c?$(this).hide(d):$(this);};})(jQuery);

/**
 * jQuery.ScrollTo - Easy element scrolling using jQuery.
 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL. */
;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._isSscrollable()};d.fn._isSscrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._isSscrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);
