jQuery.fn.prettyPhotoHover=function(a){a=jQuery.extend({zoomIcon:"img/common/image_zoom.png",zoomIconWidth:40,zoomIconHeight:40,overlayOpacity:.5,animationSpeed:300,imageFadeColor:"#000"},a);return this.each(function(){var i=jQuery(this),b=i.children("img"),k=b.width(),j=b.height(),f=b.css("padding-top"),d=b.css("padding-left"),e=b.css("border-top-width"),c=b.css("border-left-width");f=+f.replace("px","");d=+d.replace("px","");e=+e.replace("px","");c=+c.replace("px","");var g=jQuery('<img class="zoom-icon"/>').attr({src:a.zoomIcon}).css({position:"absolute",top:j/2-a.zoomIconHeight/2+d+c,left:k/2-a.zoomIconWidth/2+d+c}).fadeTo(0,0),h=jQuery('<span class="prettyPhotoOverlay" style="background:'+a.imageFadeColor+'; display:block; position:absolute;"/>').css({top:f+e+"px",left:d+c+"px"}).width(k).height(j).fadeTo(0,0);b.css("display","block").addClass("prettyPhotoImg");i.addClass("prettyPhotoLink").css({position:"relative",display:"block"}).append(h).append(g).hover(function(){h.stop().fadeTo(a.animationSpeed,a.overlayOpacity);g.stop().fadeTo(a.animationSpeed,a.overlayOpacity)},function(){h.stop().fadeTo(a.animationSpeed,0);g.stop().fadeTo(a.animationSpeed,0)})})};jQuery.fn.pragmaNavigation=function(a){a=jQuery.extend({initialSubnavZIndex:1e3,slideDownSpeed:400,slideUpSpeed:200,slideDownEffect:"easeOutBounce",slideUpEffect:"easeOutQuart",eventTimeoutTime:200,subnavL1offsetTop:50,subnavL1offsetLeft:0,subnavsOffsetTop:-16,subnavsOffsetLeft:10,contentWidth:960,contentBoundryTolerance:20,pointerDownImgNormal:"http://www.nprg.com/Content/images/drop-down-icon.png",pointerDownImgeHover:"http://www.nprg.com/Content/images/drop-down-icon-hover.png",pointerRightImgNormal:"http://www.nprg.com/Content/images/arrow-list.gif",pointerRightImgeHover:"http://www.nprg.com/Content/images/arrow-list-hover.gif",pointerDownPosTop:18,pointerDownPosRight:10,pointerDownWidth:15,pointerDownHeight:16,pointerRightPosTop:6,pointerRightPosLeft:153},a);return this.each(function(){var j=jQuery(this),b=jQuery.data,q=a.initialSubnavZIndex,o=0,n=0,d=0,f=false,e=false,r={},p={},c={};j.find("ul.level-1").wrap('<div class="main-nav-subnav level-1"></div>');j.find("ul.level-n").wrap('<div class="main-nav-subnav level-n"></div>');l(j);function l(h){var c=h.children("ul").children("li");c.each(function(){var c=jQuery(this);o++;var j="item_"+o;b(c,"UID",j);b(c,"level",d);r[j]=c;if(c.find("ul.subnav-list").size()>0){if(d==0){var t=jQuery("<img/>").attr({src:g(d,"normal"),width:a.pointerDownWidth,height:a.pointerDownHeight}).css({position:"absolute",top:a.pointerDownPosTop,right:a.pointerDownPosRight});c.children("a").addClass("has-subnav").append(t)}else{var q=jQuery("<img/>").attr({src:g(d,"normal")}).css({display:"block",position:"absolute",top:a.pointerRightPosTop,left:a.pointerRightPosLeft});c.children("a").prepend(q)}var h=c.children("div.main-nav-subnav");n++;var i="sub_"+n;b(c,"subnavUID",i);b(h,"UID",i);var w=d;d++;b(h,"level",d);var m=f;f=f?f+"|"+j:j;b(h,"parentItemUIDs",f);b(h,"parentSubnavUIDs",e);var k=e;e=e?e+"|"+i:i;p[i]=h;v(c,h);u(c,h);s(h);l(h);d=w;e=k;f=m}})}function u(d,e){d.mouseenter(function(){var h=b(d,"UID");if(c[h])clearTimeout(c[h]);else{d.addClass("item-hover");d.children("a").children("img").attr({src:g(b(d,"level"),"hover")})}var f=b(e,"UID");if(c[f])clearTimeout(c[f]);else{w(d,e);e.animate({height:"show"},a.slideDownSpeed,a.slideDownEffect)}}).mouseleave(function(){var f=k(d),a=i(e);c[b(d,"UID")]=f;c[b(e,"UID")]=a})}function s(a){a.mouseenter(function(){for(var f=m(a),d=0;d<f.length;d++){var g=f[d];c[g]&&clearTimeout(c[g])}if(h(a))for(var e=h(a),d=0;d<e.length;d++){var i=e[d];clearTimeout(c[i])}c[b(a,"UID")]&&clearTimeout(c[b(a,"UID")])}).mouseleave(function(){var l=i(a);c[b(a,"UID")]=l;for(var g=m(a),d=0;d<g.length;d++){var j=g[d],q=r[j],o=k(q);c[j]=o}if(h(a))for(var e=h(a),d=0;d<e.length;d++){var f=e[d],n=p[f],l=i(n);c[f]=l}})}function g(c,b){return c==0?b=="hover"?a.pointerDownImgeHover:a.pointerDownImgNormal:b=="hover"?a.pointerRightImgeHover:a.pointerRightImgNormal}function m(a){return b(a,"parentItemUIDs").split("|")}function h(a){return b(a,"parentSubnavUIDs")?b(a,"parentSubnavUIDs").split("|"):false}function k(d){function e(){c[b(d,"UID")]=undefined;d.removeClass("item-hover");d.children("a").children("img").attr({src:g(b(d,"level"),"normal")})}return setTimeout(e,a.eventTimeoutTime)}function i(d){function e(){c[b(d,"UID")]=undefined;d.animate({height:"hide"},a.slideUpSpeed,a.slideUpEffect)}return setTimeout(e,a.eventTimeoutTime)}function v(b,a){a.remove().prependTo("body").css({"z-index":q}).hide().children("ul.subnav-list").css("display","block");q++}function w(g,e){var c=g.offset(),i=g.outerWidth(),f=e.outerWidth();if(b(e,"level")==1)var h=c.top+a.subnavL1offsetTop,d=c.left+a.subnavL1offsetLeft;else{var h=c.top+a.subnavsOffsetTop,d=c.left+i+a.subnavsOffsetLeft;if(d+f>t())d=c.left-f-a.subnavsOffsetLeft}e.css({top:h,left:d})}function t(){var b=a.contentWidth+a.contentBoundryTolerance*2,c=jQuery(window).width();return c<b?c:(c-b)/2+b}})};jQuery(function(a){a.InFieldLabels=function(d,c,e){var b=this;b.$label=a(d);b.label=d;b.$field=a(c);b.field=c;b.$label.data("InFieldLabels",b);b.showing=true;b.init=function(){b.options=a.extend({},a.InFieldLabels.defaultOptions,e);if(b.$field.val()!=""){b.$label.hide();b.showing=false}b.$field.focus(function(){b.fadeOnFocus()}).blur(function(){b.checkForEmpty(true)}).bind("keydown.infieldlabel",function(a){b.hideOnChange(a)}).change(function(){b.checkForEmpty()}).bind("onPropertyChange",function(){b.checkForEmpty()})};b.fadeOnFocus=function(){b.showing&&b.setOpacity(b.options.fadeOpacity)};b.setOpacity=function(a){b.$label.stop().animate({opacity:a},b.options.fadeDuration);b.showing=a>0};b.checkForEmpty=function(a){if(b.$field.val()==""){b.prepForShow();b.setOpacity(a?1:b.options.fadeOpacity)}else b.setOpacity(0)};b.prepForShow=function(){if(!b.showing){b.$label.css({opacity:0}).show();b.$field.bind("keydown.infieldlabel",function(a){b.hideOnChange(a)})}};b.hideOnChange=function(a){if(a.keyCode==16||a.keyCode==9)return;if(b.showing){b.$label.hide();b.showing=false}b.$field.unbind("keydown.infieldlabel")};b.init()};a.InFieldLabels.defaultOptions={fadeOpacity:.5,fadeDuration:300};a.fn.inFieldLabels=function(b){return this.each(function(){var c=a(this).attr("for");if(!c)return;var d=a("input#"+c+"[type='text'],input#"+c+"[type='password'],textarea#"+c);if(d.length==0)return;new a.InFieldLabels(this,d[0],b)})}});jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,d,a,b,c){return jQuery.easing[jQuery.easing.def](e,d,a,b,c)},easeInQuad:function(e,a,b,c,d){return c*(a/=d)*a+b},easeOutQuad:function(e,a,b,c,d){return-c*(a/=d)*(a-2)+b},easeInOutQuad:function(e,a,b,c,d){return(a/=d/2)<1?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b},easeInCubic:function(e,a,b,c,d){return c*(a/=d)*a*a+b},easeOutCubic:function(e,a,b,c,d){return c*((a=a/d-1)*a*a+1)+b},easeInOutCubic:function(e,a,b,c,d){return(a/=d/2)<1?c/2*a*a*a+b:c/2*((a-=2)*a*a+2)+b},easeInQuart:function(e,a,b,c,d){return c*(a/=d)*a*a*a+b},easeOutQuart:function(e,a,b,c,d){return-c*((a=a/d-1)*a*a*a-1)+b},easeInOutQuart:function(e,a,b,c,d){return(a/=d/2)<1?c/2*a*a*a*a+b:-c/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(e,a,b,c,d){return c*(a/=d)*a*a*a*a+b},easeOutQuint:function(e,a,b,c,d){return c*((a=a/d-1)*a*a*a*a+1)+b},easeInOutQuint:function(e,a,b,c,d){return(a/=d/2)<1?c/2*a*a*a*a*a+b:c/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(e,d,b,a,c){return-a*Math.cos(d/c*(Math.PI/2))+a+b},easeOutSine:function(e,d,a,b,c){return b*Math.sin(d/c*(Math.PI/2))+a},easeInOutSine:function(e,d,a,b,c){return-b/2*(Math.cos(Math.PI*d/c)-1)+a},easeInExpo:function(e,b,a,c,d){return b==0?a:c*Math.pow(2,10*(b/d-1))+a},easeOutExpo:function(e,d,a,b,c){return d==c?a+b:b*(-Math.pow(2,-10*d/c)+1)+a},easeInOutExpo:function(e,a,b,c,d){return a==0?b:a==d?b+c:(a/=d/2)<1?c/2*Math.pow(2,10*(a-1))+b:c/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(e,a,b,c,d){return-c*(Math.sqrt(1-(a/=d)*a)-1)+b},easeOutCirc:function(e,a,b,c,d){return c*Math.sqrt(1-(a=a/d-1)*a)+b},easeInOutCirc:function(e,a,b,c,d){return(a/=d/2)<1?-c/2*(Math.sqrt(1-a*a)-1)+b:c/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(h,d,e,a,f){var g=1.70158,b=0,c=a;if(d==0)return e;if((d/=f)==1)return e+a;if(!b)b=f*.3;if(c<Math.abs(a)){c=a;var g=b/4}else var g=b/(2*Math.PI)*Math.asin(a/c);return-(c*Math.pow(2,10*(d-=1))*Math.sin((d*f-g)*(2*Math.PI)/b))+e},easeOutElastic:function(h,d,e,a,f){var g=1.70158,b=0,c=a;if(d==0)return e;if((d/=f)==1)return e+a;if(!b)b=f*.3;if(c<Math.abs(a)){c=a;var g=b/4}else var g=b/(2*Math.PI)*Math.asin(a/c);return c*Math.pow(2,-10*d)*Math.sin((d*f-g)*(2*Math.PI)/b)+a+e},easeInOutElastic:function(h,a,e,b,f){var g=1.70158,c=0,d=b;if(a==0)return e;if((a/=f/2)==2)return e+b;if(!c)c=f*(.3*1.5);if(d<Math.abs(b)){d=b;var g=c/4}else var g=c/(2*Math.PI)*Math.asin(b/d);return a<1?-.5*(d*Math.pow(2,10*(a-=1))*Math.sin((a*f-g)*(2*Math.PI)/c))+e:d*Math.pow(2,-10*(a-=1))*Math.sin((a*f-g)*(2*Math.PI)/c)*.5+b+e},easeInBack:function(f,b,c,d,e,a){if(a==undefined)a=1.70158;return d*(b/=e)*b*((a+1)*b-a)+c},easeOutBack:function(f,b,c,d,e,a){if(a==undefined)a=1.70158;return d*((b=b/e-1)*b*((a+1)*b+a)+1)+c},easeInOutBack:function(f,a,c,d,e,b){if(b==undefined)b=1.70158;return(a/=e/2)<1?d/2*(a*a*(((b*=1.525)+1)*a-b))+c:d/2*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)+c},easeInBounce:function(e,d,c,a,b){return a-jQuery.easing.easeOutBounce(e,b-d,0,a,b)+c},easeOutBounce:function(e,a,b,c,d){return(a/=d)<1/2.75?c*(7.5625*a*a)+b:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+.75)+b:a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+.9375)+b:c*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(e,c,d,b,a){return c<a/2?jQuery.easing.easeInBounce(e,c*2,0,b,a)*.5+d:jQuery.easing.easeOutBounce(e,c*2-a,0,b,a)*.5+b*.5+d}});(function(a){a.extend(a.fn,{validate:function(c){if(!this.length){c&&c.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return}var b=a.data(this[0],"validator");if(b)return b;b=new a.validator(c,this[0]);a.data(this[0],"validator",b);if(b.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){b.cancelSubmit=true});this.submit(function(c){b.settings.debug&&c.preventDefault();function a(){if(b.settings.submitHandler){b.settings.submitHandler.call(b,b.currentForm);return false}return true}if(b.cancelSubmit){b.cancelSubmit=false;return a()}if(b.form()){if(b.pendingRequest){b.formSubmitted=true;return false}return a()}else{b.focusInvalid();return false}})}return b},valid:function(){if(a(this[0]).is("form"))return this.validate().form();else{var b=false,c=a(this[0].form).validate();this.each(function(){b|=c.element(this)});return b}},removeAttrs:function(d){var c={},b=this;a.each(d.split(/\s/),function(d,a){c[a]=b.attr(a);b.removeAttr(a)});return c},rules:function(i,e){var b=this[0];if(i){var f=a.data(b.form,"validator").settings,g=f.rules,d=a.validator.staticRules(b);switch(i){case"add":a.extend(d,a.validator.normalizeRule(e));g[b.name]=d;if(e.messages)f.messages[b.name]=a.extend(f.messages[b.name],e.messages);break;case"remove":if(!e){delete g[b.name];return d}var h={};a.each(e.split(/\s/),function(b,a){h[a]=d[a];delete d[a]});return h}}var c=a.validator.normalizeRules(a.extend({},a.validator.metadataRules(b),a.validator.classRules(b),a.validator.attributeRules(b),a.validator.staticRules(b)),b);if(c.required){var j=c.required;delete c.required;c=a.extend({required:j},c)}return c}});a.extend(a.expr[":"],{blank:function(b){return!a.trim(b.value)},filled:function(b){return!!a.trim(b.value)},unchecked:function(a){return!a.checked}});a.format=function(c,b){if(arguments.length==1)return function(){var b=a.makeArray(arguments);b.unshift(c);return a.format.apply(this,b)};if(arguments.length>2&&b.constructor!=Array)b=a.makeArray(arguments).slice(1);if(b.constructor!=Array)b=[b];a.each(b,function(a,b){c=c.replace(new RegExp("\\{"+a+"\\}","g"),b)});return c};a.validator=function(b,c){this.settings=a.extend({},a.validator.defaults,b);this.currentForm=c;this.init()};a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",errorElement:"label",focusInvalid:true,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(a){this.lastActive=a;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass);this.errorsFor(a).hide()}},onfocusout:function(a){!this.checkable(a)&&(a.name in this.submitted||!this.optional(a))&&this.element(a)},onkeyup:function(a){(a.name in this.submitted||a==this.lastElement)&&this.element(a)},onclick:function(a){a.name in this.submitted&&this.element(a)},highlight:function(c,b){a(c).addClass(b)},unhighlight:function(c,b){a(c).removeClass(b)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",dateDE:"Bitte geben Sie ein g\u00c3\u00bcltiges Datum ein.",number:"Please enter a valid number.",numberDE:"Bitte geben Sie eine Nummer ein.",digits:"Please enter only digits",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:a.format("Please enter no more than {0} characters."),minlength:a.format("Please enter at least {0} characters."),rangelength:a.format("Please enter a value between {0} and {1} characters long."),range:a.format("Please enter a value between {0} and {1}."),max:a.format("Please enter a value less than or equal to {0}."),min:a.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=a(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm);this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var d=this.groups={};a.each(this.settings.groups,function(c,b){a.each(b.split(/\s/),function(b,a){d[a]=c})});var c=this.settings.rules;a.each(c,function(d,b){c[d]=a.validator.normalizeRule(b)});function b(c){var b=a.data(this[0].form,"validator");b.settings["on"+c.type]&&b.settings["on"+c.type].call(b,this[0])}a(this.currentForm).delegate("focusin focusout keyup",":text, :password, :file, select, textarea",b).delegate("click",":radio, :checkbox",b);this.settings.invalidHandler&&a(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){this.checkForm();a.extend(this.submitted,this.errorMap);this.invalid=a.extend({},this.errorMap);!this.valid()&&a(this.currentForm).triggerHandler("invalid-form",[this]);this.showErrors();return this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){b=this.clean(b);this.lastElement=b;this.prepareElement(b);this.currentElements=a(b);var c=this.check(b);if(c)delete this.invalid[b.name];else this.invalid[b.name]=true;if(!this.numberOfInvalids())this.toHide=this.toHide.add(this.containers);this.showErrors();return c},showErrors:function(b){if(b){a.extend(this.errorMap,b);this.errorList=[];for(var c in b)this.errorList.push({message:b[c],element:this.findByName(c)[0]});this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm();this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(b){var a=0;for(var c in b)a++;return a},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return this.size()==0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus()}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&a.grep(this.errorList,function(a){return a.element.name==b.name}).length==1&&b},elements:function(){var c=this,b={};return a([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&c.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in b||!c.objectLength(a(this).rules()))return false;b[this.name]=true;return true})},clean:function(b){return a(b)[0]},errors:function(){return a(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext)},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=a([]);this.toHide=a([]);this.formSubmitted=false;this.currentElements=a([])},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset();this.toHide=this.errorsFor(a)},check:function(b){b=this.clean(b);if(this.checkable(b))b=this.findByName(b.name)[0];var e=a(b).rules(),c=false;for(method in e){var f={method:method,parameters:e[method]};try{var d=a.validator.methods[method].call(this,b.value.replace(/\r/g,""),b,f.parameters);if(d=="dependency-mismatch"){c=true;continue}c=false;if(d=="pending"){this.toHide=this.toHide.not(this.errorsFor(b));return}if(!d){this.formatAndAdd(b,f);return false}}catch(g){this.settings.debug&&window.console&&console.log("exception occured when checking element "+b.id+", check the '"+f.method+"' method");throw g;}}if(c)return;this.objectLength(e)&&this.successList.push(b);return true},customMetaMessage:function(c,d){if(!a.metadata)return;var b=this.settings.meta?a(c).metadata()[this.settings.meta]:a(c).metadata();return b&&b.messages&&b.messages[d]},customMessage:function(c,b){var a=this.settings.messages[c];return a&&(a.constructor==String?a:a[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(arguments[a]!==undefined)return arguments[a];return undefined},defaultMessage:function(b,c){return this.findDefined(this.customMessage(b.name,c),this.customMetaMessage(b,c),!this.settings.ignoreTitle&&b.title||undefined,a.validator.messages[c],"<strong>Warning: No message defined for "+b.name+"</strong>")},formatAndAdd:function(b,c){var a=this.defaultMessage(b,c.method);if(typeof a=="function")a=a.call(this,c.parameters,b);this.errorList.push({message:a,element:b});this.errorMap[b.name]=a;this.submitted[b.name]=a},addWrapper:function(a){if(this.settings.wrapper)a=a.add(a.parents(this.settings.wrapper));return a},defaultShowErrors:function(){for(var a=0;this.errorList[a];a++){var b=this.errorList[a];this.settings.highlight&&this.settings.highlight.call(this,b.element,this.settings.errorClass);this.showLabel(b.element,b.message)}if(this.errorList.length)this.toShow=this.toShow.add(this.containers);if(this.settings.success)for(var a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(var a=0,c=this.validElements();c[a];a++)this.settings.unhighlight.call(this,c[a],this.settings.errorClass);this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(c,d){var b=this.errorsFor(c);if(b.length){b.removeClass().addClass(this.settings.errorClass);b.attr("generated")&&b.html(d)}else{b=a("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(c),generated:true}).addClass(this.settings.errorClass).html(d||"");if(this.settings.wrapper)b=b.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();if(!this.labelContainer.append(b).length)this.settings.errorPlacement?this.settings.errorPlacement(b,a(c)):b.insertAfter(c)}if(!d&&this.settings.success){b.text("");typeof this.settings.success=="string"?b.addClass(this.settings.success):this.settings.success(b)}this.toShow=this.toShow.add(b)},errorsFor:function(a){return this.errors().filter("[for='"+this.idOrName(a)+"']")},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){var c=this.currentForm;return a(document.getElementsByName(b)).map(function(d,a){return a.form==c&&a.name==b&&a||null})},getLength:function(c,b){switch(b.nodeName.toLowerCase()){case"select":return a("option:selected",b).length;case"input":if(this.checkable(b))return this.findByName(b.name).filter(":checked").length}return c.length},depend:function(a,b){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,b):true},dependTypes:{"boolean":function(a){return a},string:function(c,b){return!!a(c,b.form).length},"function":function(b,a){return b(a)}},optional:function(b){return!a.validator.methods.required.call(this,a.trim(b.value),b)&&"dependency-mismatch"},startRequest:function(a){if(!this.pending[a.name]){this.pendingRequest++;this.pending[a.name]=true}},stopRequest:function(c,b){this.pendingRequest--;if(this.pendingRequest<0)this.pendingRequest=0;delete this.pending[c.name];if(b&&this.pendingRequest==0&&this.formSubmitted&&this.form())a(this.currentForm).submit();else!b&&this.pendingRequest==0&&this.formSubmitted&&a(this.currentForm).triggerHandler("invalid-form",[this])},previousValue:function(b){return a.data(b,"previousValue")||a.data(b,"previousValue",previous={old:null,valid:true,message:this.defaultMessage(b,"remote")})}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(b,c){b.constructor==String?(this.classRuleSettings[b]=c):a.extend(this.classRuleSettings,b)},classRules:function(d){var c={},b=a(d).attr("class");b&&a.each(b.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])});return c},attributeRules:function(e){var b={},d=a(e);for(method in a.validator.methods){var c=d.attr(method);if(c)b[method]=c}if(b.maxlength&&/-1|2147483647|524288/.test(b.maxlength))delete b.maxlength;return b},metadataRules:function(b){if(!a.metadata)return{};var c=a.data(b.form,"validator").settings.meta;return c?a(b).metadata()[c]:a(b).metadata()},staticRules:function(c){var d={},b=a.data(c.form,"validator");if(b.settings.rules)d=a.validator.normalizeRule(b.settings.rules[c.name])||{};return d},normalizeRules:function(b,c){a.each(b,function(f,d){if(d===false){delete b[f];return}if(d.param||d.depends){var e=true;switch(typeof d.depends){case"string":e=!!a(d.depends,c.form).length;break;case"function":e=d.depends.call(c,c)}if(e)b[f]=d.param!==undefined?d.param:true;else delete b[f]}});a.each(b,function(e,d){b[e]=a.isFunction(d)?d(c):d});a.each(["minlength","maxlength","min","max"],function(){if(b[this])b[this]=Number(b[this])});a.each(["rangelength","range"],function(){if(b[this])b[this]=[Number(b[this][0]),Number(b[this][1])]});if(a.validator.autoCreateRanges){if(b.min&&b.max){b.range=[b.min,b.max];delete b.min;delete b.max}if(b.minlength&&b.maxlength){b.rangelength=[b.minlength,b.maxlength];delete b.minlength;delete b.maxlength}}if(b.messages)delete b.messages;return b},normalizeRule:function(b){if(typeof b=="string"){var c={};a.each(b.split(/\s/),function(){c[this]=true});b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c;a.validator.messages[b]=d;c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(d,b,e){if(!this.depend(e,b))return"dependency-mismatch";switch(b.nodeName.toLowerCase()){case"select":var c=a("option:selected",b);return c.length>0&&(b.type=="select-multiple"||(a.browser.msie&&!c[0].attributes.value.specified?c[0].text:c[0].value).length>0);case"input":if(this.checkable(b))return this.getLength(d,b)>0;default:return a.trim(d).length>0}},remote:function(f,b,e){if(this.optional(b))return"dependency-mismatch";var d=this.previousValue(b);if(!this.settings.messages[b.name])this.settings.messages[b.name]={};this.settings.messages[b.name].remote=typeof d.message=="function"?d.message(f):d.message;e=typeof e=="string"&&{url:e}||e;if(d.old!==f){d.old=f;var c=this;this.startRequest(b);var g={};g[b.name]=f;a.ajax(a.extend(true,{url:e,mode:"abort",port:"validate"+b.name,dataType:"json",data:g,success:function(a){if(a){var f=c.formSubmitted;c.prepareElement(b);c.formSubmitted=f;c.successList.push(b);c.showErrors()}else{var e={};e[b.name]=a||c.defaultMessage(b,"remote");c.showErrors(e)}d.valid=a;c.stopRequest(b,a)}},e));return"pending"}else if(this.pending[b.name])return"pending";return d.valid},minlength:function(d,b,c){return this.optional(b)||this.getLength(a.trim(d),b)>=c},maxlength:function(d,b,c){return this.optional(b)||this.getLength(a.trim(d),b)<=c},rangelength:function(e,b,d){var c=this.getLength(a.trim(e),b);return this.optional(b)||c>=d[0]&&c<=d[1]},min:function(c,a,b){return this.optional(a)||c>=b},max:function(c,a,b){return this.optional(a)||c<=b},range:function(b,c,a){return this.optional(c)||b>=a[0]&&b<=a[1]},email:function(b,a){return this.optional(a)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(b)},url:function(b,a){return this.optional(a)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(b)},date:function(b,a){return this.optional(a)||!/Invalid|NaN/.test(new Date(b))},dateISO:function(b,a){return this.optional(a)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(b)},dateDE:function(b,a){return this.optional(a)||/^\d\d?\.\d\d?\.\d\d\d?\d?$/.test(b)},number:function(b,a){return this.optional(a)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(b)},numberDE:function(b,a){return this.optional(a)||/^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(b)},digits:function(b,a){return this.optional(a)||/^\d+$/.test(b)},creditcard:function(a,e){if(this.optional(e))return"dependency-mismatch";if(/[^0-9-]+/.test(a))return false;var d=0,b=0,c=false;a=a.replace(/\D/g,"");for(n=a.length-1;n>=0;n--){var f=a.charAt(n),b=parseInt(f,10);if(c)if((b*=2)>9)b-=9;d+=b;c=!c}return d%10==0},accept:function(c,b,a){a=typeof a=="string"?a:"png|jpe?g|gif";return this.optional(b)||c.match(new RegExp(".("+a+")$","i"))},equalTo:function(c,d,b){return c==a(b).val()}}})})(jQuery);(function(a){var c=a.ajax,b={};a.ajax=function(d){d=a.extend(d,a.extend({},a.ajaxSettings,d));var e=d.port;if(d.mode=="abort"){b[e]&&b[e].abort();return b[e]=c.apply(this,arguments)}return c.apply(this,arguments)}})(jQuery);(function(a){a.each({focus:"focusin",blur:"focusout"},function(c,b){a.event.special[b]={setup:function(){if(a.browser.msie)return false;this.addEventListener(c,a.event.special[b].handler,true)},teardown:function(){if(a.browser.msie)return false;this.removeEventListener(c,a.event.special[b].handler,true)},handler:function(c){arguments[0]=a.event.fix(c);arguments[0].type=b;return a.event.handle.apply(this,arguments)}}});a.extend(a.fn,{delegate:function(d,b,c){return this.bind(d,function(e){var d=a(e.target);if(d.is(b))return c.apply(d,arguments)})},triggerEvent:function(b,c){return this.triggerHandler(b,[a.event.fix({type:b,target:c})])}})})(jQuery);jQuery(window).load(function(){setTimeout(function(){$("#slider").nivoSlider({effect:"random",slices:12,animSpeed:500,pauseTime:7e3,startSlide:0,directionNav:true,controlNav:true,keyboardNav:false,pauseOnHover:false})},300)});$(document).ready(function(){$("#main-nav").pragmaNavigation();var a;$("#login-box").hover(function(){clearTimeout(a);$(this).stop().animate({top:-15},300).find("#login-box-slide-btn").removeClass("down").addClass("up")},function(){a=setTimeout(function(){$("#login-box").stop().animate({top:-65},800).find("#login-box-slide-btn").removeClass("up").addClass("down")},300)});$("#login-box-slide-btn").click(function(){$(this).removeClass("up").addClass("down").parent().stop().animate({top:-65},300)});$("label.infield").inFieldLabels();$("a.prettyPhoto").prettyPhotoHover().prettyPhoto({theme:"neutrino_light",opacity:.6});var b=$("div.tabs > div");$("div.tabs ul.tabNavigation a").click(function(){b.hide().filter(this.hash).show();$("div.tabs ul.tabNavigation a").removeClass("selected");$(this).addClass("selected");return false}).filter(":first").click();$("#contact-form").validate({rules:{name_field:{required:true},subject_field:{required:true},email_field:{required:true,email:true},message_field:{required:true}},messages:{name:"Please specify your name",subject:"Please specify your subject line",message:"Please specify your message",email:{required:"We need your email address to contact you",email:"Your email address must be in the format of name@domain.com"}}});$(function(){$("#contact-form").submit(function(){$.post("../contact.php",$("#contact-form").serialize(),function(a){if(a.emailsent=="yes")$("#contact-form").fadeOut(1e3,function(){$("#form-info").html("Your message has been sent.<br />Thank you.").fadeIn()});else $("#form-info").html("Sorry there was a problem with your email. Please try again.")},"json");return false})});$("#footer-contact-form").validate({rules:{email:{required:true,email:true},message:{required:true}},messages:{message:"Please specify your message",email:{required:"We need your email address to contact you",email:"Your email address must be in the format of name@domain.com"}}});$(function(){$("#footer-contact-form").submit(function(){$.post("../contact-footer.php",$("#footer-contact-form").serialize(),function(a){if(a.emailsent=="yes")$("#footer-contact-form").fadeOut(1e3,function(){$("#footer-form-info").html("Your message has been sent.<br />Thank you.").fadeIn()});else $("#footer-form-info").html("Sorry there was a problem with your email. Please try again.")},"json");return false})})});(function(a){a.prettyPhoto={version:"2.5.6"};a.fn.prettyPhoto=function(c){c=jQuery.extend({animationSpeed:"normal",opacity:.8,showTitle:true,allowresize:true,default_width:500,default_height:344,counter_separator_label:"/",theme:"light_rounded",hideflash:false,wmode:"opaque",autoplay:true,modal:false,changepicturecallback:function(){},callback:function(){},markup:'<div class="pp_pic_holder">       <div class="pp_top">        <div class="pp_left"></div>        <div class="pp_middle"></div>        <div class="pp_right"></div>       </div>       <div class="pp_content_container">        <div class="pp_left">        <div class="pp_right">         <div class="pp_content">          <div class="pp_loaderIcon"></div>          <div class="pp_fade">           <a href="#" class="pp_expand" title="Expand the image">Expand</a>           <div class="pp_hoverContainer">            <a class="pp_next" href="#">next</a>            <a class="pp_previous" href="#">previous</a>           </div>           <div id="pp_full_res"></div>           <div class="pp_details clearfix">            <a class="pp_close" href="#">Close</a>            <p class="pp_description"></p>            <div class="pp_nav">             <a href="#" class="pp_arrow_previous">Previous</a>             <p class="currentTextHolder">0/0</p>             <a href="#" class="pp_arrow_next">Next</a>            </div>           </div>          </div>         </div>        </div>        </div>       </div>       <div class="pp_bottom">        <div class="pp_left"></div>        <div class="pp_middle"></div>        <div class="pp_right"></div>       </div>      </div>      <div class="pp_overlay"></div>      <div class="ppt"></div>',image_markup:'<img id="fullResImage" src="" />',flash_markup:'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',quicktime_markup:'<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>',iframe_markup:'<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',inline_markup:'<div class="pp_inline clearfix">{content}</div>'},c);if(a.browser.msie&&parseInt(a.browser.version)==6)c.theme="light_square";a(".pp_overlay").size()==0&&z();var j=true,u=false,f,d,g,n,q,r,l,m,k=a(window).height(),i=a(window).width(),e=0,o=x();a(window).scroll(function(){o=x();p();t()});a(window).resize(function(){p();t()});a(document).keydown(function(b){if(d.is(":visible"))switch(b.keyCode){case 37:a.prettyPhoto.changePage("previous");break;case 39:a.prettyPhoto.changePage("next");break;case 27:!c.modal&&a.prettyPhoto.close()}});a(this).each(function(){a(this).bind("click",function(){_self=this;theRel=a(this).attr("rel");galleryRegExp=/\[(?:.*)\]/;theGallery=galleryRegExp.exec(theRel);var c=[],d=[],b=[];if(theGallery)a("a[rel*="+theGallery+"]").each(function(f){if(a(this)[0]===a(_self)[0])e=f;c.push(a(this).attr("href"));d.push(a(this).find("img").attr("alt"));b.push(a(this).attr("title"))});else{c=a(this).attr("href");d=a(this).find("img").attr("alt")?a(this).find("img").attr("alt"):"";b=a(this).attr("title")?a(this).attr("title"):""}a.prettyPhoto.open(c,d,b);return false})});a.prettyPhoto.open=function(j,k,i){a.browser.msie&&a.browser.version==6&&a("select").css("visibility","hidden");c.hideflash&&a("object,embed").css("visibility","hidden");images=a.makeArray(j);titles=a.makeArray(k);descriptions=a.makeArray(i);image_set=a(images).size()>0?true:false;y(a(images).size());a(".pp_loaderIcon").show();n.show().fadeTo(c.animationSpeed,c.opacity);d.find(".currentTextHolder").text(e+1+c.counter_separator_label+a(images).size());if(descriptions[e])d.find(".pp_description").show().html(unescape(descriptions[e]));else d.find(".pp_description").hide().text("");if(titles[e]&&c.showTitle){hasTitle=true;g.html(unescape(titles[e]))}else hasTitle=false;movie_width=parseFloat(b("width",images[e]))?b("width",images[e]):c.default_width.toString();movie_height=parseFloat(b("height",images[e]))?b("height",images[e]):c.default_height.toString();if(movie_width.indexOf("%")!=-1||movie_height.indexOf("%")!=-1){movie_height=parseFloat(a(window).height()*parseFloat(movie_height)/100-100);movie_width=parseFloat(a(window).width()*parseFloat(movie_width)/100-100);u=true}d.fadeIn(function(){imgPreloader="";switch(v(images[e])){case"image":imgPreloader=new Image;nextImage=new Image;if(image_set&&e>a(images).size())nextImage.src=images[e+1];prevImage=new Image;if(image_set&&images[e-1])prevImage.src=images[e-1];d.find("#pp_full_res")[0].innerHTML=c.image_markup;d.find("#fullResImage").attr("src",images[e]);imgPreloader.onload=function(){f=h(imgPreloader.width,imgPreloader.height);_showContent()};imgPreloader.onerror=function(){alert("Image cannot be loaded. Make sure the path is correct and image exist.");a.prettyPhoto.close()};imgPreloader.src=images[e];break;case"youtube":f=h(movie_width,movie_height);movie="http://www.youtube.com/v/"+b("v",images[e]);if(c.autoplay)movie+="&autoplay=1";toInject=c.flash_markup.replace(/{width}/g,f.width).replace(/{height}/g,f.height).replace(/{wmode}/g,c.wmode).replace(/{path}/g,movie);break;case"vimeo":f=h(movie_width,movie_height);movie_id=images[e];movie="http://vimeo.com/moogaloop.swf?clip_id="+movie_id.replace("http://vimeo.com/","");if(c.autoplay)movie+="&autoplay=1";toInject=c.flash_markup.replace(/{width}/g,f.width).replace(/{height}/g,f.height).replace(/{wmode}/g,c.wmode).replace(/{path}/g,movie);break;case"quicktime":f=h(movie_width,movie_height);f.height+=15;f.contentHeight+=15;f.containerHeight+=15;toInject=c.quicktime_markup.replace(/{width}/g,f.width).replace(/{height}/g,f.height).replace(/{wmode}/g,c.wmode).replace(/{path}/g,images[e]).replace(/{autoplay}/g,c.autoplay);break;case"flash":f=h(movie_width,movie_height);flash_vars=images[e];flash_vars=flash_vars.substring(images[e].indexOf("flashvars")+10,images[e].length);filename=images[e];filename=filename.substring(0,filename.indexOf("?"));toInject=c.flash_markup.replace(/{width}/g,f.width).replace(/{height}/g,f.height).replace(/{wmode}/g,c.wmode).replace(/{path}/g,filename+"?"+flash_vars);break;case"iframe":f=h(movie_width,movie_height);frame_url=images[e];frame_url=frame_url.substr(0,frame_url.indexOf("iframe")-1);toInject=c.iframe_markup.replace(/{width}/g,f.width).replace(/{height}/g,f.height).replace(/{path}/g,frame_url);break;case"inline":myClone=a(images[e]).clone().css({width:c.default_width}).wrapInner('<div id="pp_full_res"><div class="pp_inline clearfix"></div></div>').appendTo(a("body"));f=h(a(myClone).width(),a(myClone).height());a(myClone).remove();toInject=c.inline_markup.replace(/{content}/g,a(images[e]).html())}if(!imgPreloader){d.find("#pp_full_res")[0].innerHTML=toInject;_showContent()}})};a.prettyPhoto.changePage=function(b){if(b=="previous"){e--;if(e<0){e=0;return}}else{if(a(".pp_arrow_next").is(".disabled"))return;e++}if(!j)j=true;w(function(){a.prettyPhoto.open(images,titles,descriptions)});a("a.pp_expand,a.pp_contract").fadeOut(c.animationSpeed)};a.prettyPhoto.close=function(){d.find("object,embed").css("visibility","hidden");a("div.pp_pic_holder,div.ppt,.pp_fade").fadeOut(c.animationSpeed);n.fadeOut(c.animationSpeed,function(){a("#pp_full_res").html("");d.attr("style","").find("div:not(.pp_hoverContainer)").attr("style","");p();a.browser.msie&&a.browser.version==6&&a("select").css("visibility","visible");c.hideflash&&a("object,embed").css("visibility","visible");e=0;c.callback()});j=true};_showContent=function(){a(".pp_loaderIcon").hide();projectedTop=o.scrollTop+(k/2-f.containerHeight/2);if(projectedTop<0)projectedTop=0+g.height();d.find(".pp_content").animate({height:f.contentHeight},c.animationSpeed);d.animate({top:projectedTop,left:i/2-f.containerWidth/2,width:f.containerWidth},c.animationSpeed,function(){d.find(".pp_hoverContainer,#fullResImage").height(f.height).width(f.width);d.find(".pp_fade").fadeIn(c.animationSpeed);if(image_set&&v(images[e])=="image")d.find(".pp_hoverContainer").show();else d.find(".pp_hoverContainer").hide();if(c.showTitle&&hasTitle){g.css({top:d.offset().top-25,left:d.offset().left+20,display:"none"});g.fadeIn(c.animationSpeed)}f.resized&&a("a.pp_expand,a.pp_contract").fadeIn(c.animationSpeed);c.changepicturecallback()})};function w(b){d.find("#pp_full_res object,#pp_full_res embed").css("visibility","hidden");d.find(".pp_fade").fadeOut(c.animationSpeed,function(){a(".pp_loaderIcon").show();b&&b()});g.fadeOut(c.animationSpeed)}function y(b){if(e==b-1){d.find("a.pp_next").css("visibility","hidden");d.find("a.pp_arrow_next").addClass("disabled").unbind("click")}else{d.find("a.pp_next").css("visibility","visible");d.find("a.pp_arrow_next.disabled").removeClass("disabled").bind("click",function(){a.prettyPhoto.changePage("next");return false})}if(e==0){d.find("a.pp_previous").css("visibility","hidden");d.find("a.pp_arrow_previous").addClass("disabled").unbind("click")}else{d.find("a.pp_previous").css("visibility","visible");d.find("a.pp_arrow_previous.disabled").removeClass("disabled").bind("click",function(){a.prettyPhoto.changePage("previous");return false})}if(b>1)a(".pp_nav").show();else a(".pp_nav").hide()}function h(b,a){hasBeenResized=false;s(b,a);imageWidth=b;imageHeight=a;if((m>i||l>k)&&j&&c.allowresize&&!u){hasBeenResized=true;notFitting=true;while(notFitting){if(m>i){imageWidth=i-200;imageHeight=a/b*imageWidth}else if(l>k){imageHeight=k-200;imageWidth=b/a*imageHeight}else notFitting=false;l=imageHeight;m=imageWidth}s(imageWidth,imageHeight)}return{width:Math.floor(imageWidth),height:Math.floor(imageHeight),containerHeight:Math.floor(l),containerWidth:Math.floor(m)+40,contentHeight:Math.floor(q),contentWidth:Math.floor(r),resized:hasBeenResized}}function s(b,c){b=parseFloat(b);c=parseFloat(c);$pp_details=d.find(".pp_details");$pp_details.width(b);detailsHeight=parseFloat($pp_details.css("marginTop"))+parseFloat($pp_details.css("marginBottom"));$pp_details=$pp_details.clone().appendTo(a("body")).css({position:"absolute",top:-1e4});detailsHeight+=$pp_details.height();detailsHeight=detailsHeight<=34?36:detailsHeight;if(a.browser.msie&&a.browser.version==7)detailsHeight+=8;$pp_details.remove();q=c+detailsHeight;r=b;l=q+g.height()+d.find(".pp_top").height()+d.find(".pp_bottom").height();m=b}function v(a){return a.match(/youtube\.com\/watch/i)?"youtube":a.match(/vimeo\.com/i)?"vimeo":a.indexOf(".mov")!=-1?"quicktime":a.indexOf(".swf")!=-1?"flash":a.indexOf("iframe")!=-1?"iframe":a.substr(0,1)=="#"?"inline":"image"}function p(){if(j){titleHeight=g.height();contentHeight=d.height();contentwidth=d.width();projectedTop=k/2+o.scrollTop-(contentHeight+titleHeight)/2;d.css({top:projectedTop,left:i/2+o.scrollLeft-contentwidth/2});g.css({top:projectedTop-titleHeight,left:i/2+o.scrollLeft-contentwidth/2+20})}}function x(){return self.pageYOffset?{scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset}:document.documentElement&&document.documentElement.scrollTop?{scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft}:document.body?{scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft}:void 0}function t(){k=a(window).height();i=a(window).width();n.css({height:a(document).height()})}function z(){a("body").append(c.markup);d=a(".pp_pic_holder");g=a(".ppt");n=a("div.pp_overlay");d.attr("class","pp_pic_holder "+c.theme);n.css({opacity:0,height:a(document).height()}).bind("click",function(){!c.modal&&a.prettyPhoto.close()});a("a.pp_close").bind("click",function(){a.prettyPhoto.close();return false});a("a.pp_expand").bind("click",function(){$this=a(this);if($this.hasClass("pp_expand")){$this.removeClass("pp_expand").addClass("pp_contract");j=false}else{$this.removeClass("pp_contract").addClass("pp_expand");j=true}w(function(){a.prettyPhoto.open(images,titles,descriptions)});d.find(".pp_fade").fadeOut(c.animationSpeed);return false});d.find(".pp_previous, .pp_arrow_previous").bind("click",function(){a.prettyPhoto.changePage("previous");return false});d.find(".pp_next, .pp_arrow_next").bind("click",function(){a.prettyPhoto.changePage("next");return false})}p()};function b(a,e){a=a.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var c="[\\?&]"+a+"=([^&#]*)",d=new RegExp(c),b=d.exec(e);return b==null?"":b[1]}})(jQuery);(function(a){a.fn.nivoSlider=function(d){var b=a.extend({},a.fn.nivoSlider.defaults,d);return this.each(function(){var e={currentSlide:0,currentImage:"",totalSlides:0,randAnim:"",running:false,paused:false,stop:false},d=a(this);d.data("nivo:vars",e);d.css("position","relative");d.width("1px");d.height("1px");d.addClass("nivoSlider");var f=d.children();f.each(function(){var b=a(this);if(!b.is("img")){b.is("a")&&b.addClass("nivo-imageLink");b=b.find("img:first")}var f=b.width();if(f==0)f=b.attr("width");var c=b.height();if(c==0)c=b.attr("height");f>d.width()&&d.width(f);c>d.height()&&d.height(c);b.css("display","none");e.totalSlides++});if(b.startSlide>0){if(b.startSlide>=e.totalSlides)b.startSlide=e.totalSlides-1;e.currentSlide=b.startSlide}if(a(f[e.currentSlide]).is("img"))e.currentImage=a(f[e.currentSlide]);else e.currentImage=a(f[e.currentSlide]).find("img:first");a(f[e.currentSlide]).is("a")&&a(f[e.currentSlide]).css("display","block");d.css("background","url("+e.currentImage.attr("src")+") no-repeat");for(var h=0;h<b.slices;h++){var i=Math.round(d.width()/b.slices);if(h==b.slices-1)d.append(a('<div class="nivo-slice"></div>').css({left:i*h+"px",width:d.width()-i*h+"px"}));else d.append(a('<div class="nivo-slice"></div>').css({left:i*h+"px",width:i+"px"}))}d.append(a('<div class="nivo-caption"><p></p></div>').css({display:"none",opacity:b.captionOpacity}));if(e.currentImage.attr("title")!=""){a(".nivo-caption p",d).html(e.currentImage.attr("title"));a(".nivo-caption",d).fadeIn(b.animSpeed)}var g=0;if(!b.manualAdvance)g=setInterval(function(){c(d,f,b,false)},b.pauseTime);if(b.directionNav){d.append('<div class="nivo-directionNav"><a class="nivo-prevNav">Prev</a><a class="nivo-nextNav">Next</a></div>');if(b.directionNavHide){a(".nivo-directionNav",d).hide();d.hover(function(){a(".nivo-directionNav",d).show()},function(){a(".nivo-directionNav",d).hide()})}a("a.nivo-prevNav",d).live("click",function(){if(e.running)return false;clearInterval(g);g="";e.currentSlide-=2;c(d,f,b,"prev")});a("a.nivo-nextNav",d).live("click",function(){if(e.running)return false;clearInterval(g);g="";c(d,f,b,"next")})}if(b.controlNav){var k=a('<div class="nivo-controlNav"></div>');d.append(k);for(var h=0;h<f.length;h++)if(b.controlNavThumbs){var j=f.eq(h);if(!j.is("img"))j=j.find("img:first");k.append('<a class="nivo-control" rel="'+h+'"><img src="'+j.attr("src").replace(b.controlNavThumbsSearch,b.controlNavThumbsReplace)+'"></a>')}else k.append('<a class="nivo-control" rel="'+h+'">'+h+"</a>");a(".nivo-controlNav a:eq("+e.currentSlide+")",d).addClass("active");a(".nivo-controlNav a",d).live("click",function(){if(e.running)return false;if(a(this).hasClass("active"))return false;clearInterval(g);g="";d.css("background","url("+e.currentImage.attr("src")+") no-repeat");e.currentSlide=a(this).attr("rel")-1;c(d,f,b,"control")})}b.keyboardNav&&a(window).keypress(function(a){if(a.keyCode=="37"){if(e.running)return false;clearInterval(g);g="";e.currentSlide-=2;c(d,f,b,"prev")}if(a.keyCode=="39"){if(e.running)return false;clearInterval(g);g="";c(d,f,b,"next")}});b.pauseOnHover&&d.hover(function(){e.paused=true;clearInterval(g);g=""},function(){e.paused=false;if(g==""&&!b.manualAdvance)g=setInterval(function(){c(d,f,b,false)},b.pauseTime)});d.bind("nivo:animFinished",function(){e.running=false;a(f).each(function(){a(this).is("a")&&a(this).css("display","none")});a(f[e.currentSlide]).is("a")&&a(f[e.currentSlide]).css("display","block");if(g==""&&!e.paused&&!b.manualAdvance)g=setInterval(function(){c(d,f,b,false)},b.pauseTime);b.afterChange.call(this)})});function c(d,i,b,h){var c=d.data("nivo:vars");if((!c||c.stop)&&!h)return false;b.beforeChange.call(this);if(!h)d.css("background","url("+c.currentImage.attr("src")+") no-repeat");else{h=="prev"&&d.css("background","url("+c.currentImage.attr("src")+") no-repeat");h=="next"&&d.css("background","url("+c.currentImage.attr("src")+") no-repeat")}c.currentSlide++;if(c.currentSlide==c.totalSlides){c.currentSlide=0;b.slideshowEnd.call(this)}if(c.currentSlide<0)c.currentSlide=c.totalSlides-1;if(a(i[c.currentSlide]).is("img"))c.currentImage=a(i[c.currentSlide]);else c.currentImage=a(i[c.currentSlide]).find("img:first");if(b.controlNav){a(".nivo-controlNav a",d).removeClass("active");a(".nivo-controlNav a:eq("+c.currentSlide+")",d).addClass("active")}if(c.currentImage.attr("title")!=""){if(a(".nivo-caption",d).css("display")=="block")a(".nivo-caption p",d).fadeOut(b.animSpeed,function(){a(this).html(c.currentImage.attr("title"));a(this).fadeIn(b.animSpeed)});else a(".nivo-caption p",d).html(c.currentImage.attr("title"));a(".nivo-caption",d).fadeIn(b.animSpeed)}else a(".nivo-caption",d).fadeOut(b.animSpeed);var e=0;a(".nivo-slice",d).each(function(){var f=Math.round(d.width()/b.slices);a(this).css({height:"0px",opacity:"0",background:"url("+c.currentImage.attr("src")+") no-repeat -"+(f+e*f-f)+"px 0%"});e++});if(b.effect=="random"){var j=["sliceDownRight","sliceDownLeft","sliceUpRight","sliceUpLeft","sliceUpDown","sliceUpDownLeft","fold","fade"];c.randAnim=j[Math.floor(Math.random()*(j.length+1))];if(c.randAnim==undefined)c.randAnim="fade"}c.running=true;if(b.effect=="sliceDown"||b.effect=="sliceDownRight"||c.randAnim=="sliceDownRight"||b.effect=="sliceDownLeft"||c.randAnim=="sliceDownLeft"){var f=0,e=0,g=a(".nivo-slice",d);if(b.effect=="sliceDownLeft"||c.randAnim=="sliceDownLeft")g=a(".nivo-slice",d).reverse();g.each(function(){var c=a(this);c.css("top","0px");if(e==b.slices-1)setTimeout(function(){c.animate({height:"100%",opacity:"1.0"},b.animSpeed,"",function(){d.trigger("nivo:animFinished")})},100+f);else setTimeout(function(){c.animate({height:"100%",opacity:"1.0"},b.animSpeed)},100+f);f+=50;e++})}else if(b.effect=="sliceUp"||b.effect=="sliceUpRight"||c.randAnim=="sliceUpRight"||b.effect=="sliceUpLeft"||c.randAnim=="sliceUpLeft"){var f=0,e=0,g=a(".nivo-slice",d);if(b.effect=="sliceUpLeft"||c.randAnim=="sliceUpLeft")g=a(".nivo-slice",d).reverse();g.each(function(){var c=a(this);c.css("bottom","0px");if(e==b.slices-1)setTimeout(function(){c.animate({height:"100%",opacity:"1.0"},b.animSpeed,"",function(){d.trigger("nivo:animFinished")})},100+f);else setTimeout(function(){c.animate({height:"100%",opacity:"1.0"},b.animSpeed)},100+f);f+=50;e++})}else if(b.effect=="sliceUpDown"||b.effect=="sliceUpDownRight"||c.randAnim=="sliceUpDown"||b.effect=="sliceUpDownLeft"||c.randAnim=="sliceUpDownLeft"){var f=0,e=0,k=0,g=a(".nivo-slice",d);if(b.effect=="sliceUpDownLeft"||c.randAnim=="sliceUpDownLeft")g=a(".nivo-slice",d).reverse();g.each(function(){var c=a(this);if(e==0){c.css("top","0px");e++}else{c.css("bottom","0px");e=0}if(k==b.slices-1)setTimeout(function(){c.animate({height:"100%",opacity:"1.0"},b.animSpeed,"",function(){d.trigger("nivo:animFinished")})},100+f);else setTimeout(function(){c.animate({height:"100%",opacity:"1.0"},b.animSpeed)},100+f);f+=50;k++})}else if(b.effect=="fold"||c.randAnim=="fold"){var f=0,e=0;a(".nivo-slice",d).each(function(){var c=a(this),g=c.width();c.css({top:"0px",height:"100%",width:"0px"});if(e==b.slices-1)setTimeout(function(){c.animate({width:g,opacity:"1.0"},b.animSpeed,"",function(){d.trigger("nivo:animFinished")})},100+f);else setTimeout(function(){c.animate({width:g,opacity:"1.0"},b.animSpeed)},100+f);f+=50;e++})}else if(b.effect=="fade"||c.randAnim=="fade"){var e=0;a(".nivo-slice",d).each(function(){a(this).css("height","100%");if(e==b.slices-1)a(this).animate({opacity:"1.0"},b.animSpeed*2,"",function(){d.trigger("nivo:animFinished")});else a(this).animate({opacity:"1.0"},b.animSpeed*2);e++})}}};a.fn.nivoSlider.defaults={effect:"random",slices:15,animSpeed:500,pauseTime:3e3,startSlide:0,directionNav:true,directionNavHide:true,controlNav:true,controlNavThumbs:false,controlNavThumbsSearch:".jpg",controlNavThumbsReplace:"_thumb.jpg",keyboardNav:true,pauseOnHover:true,manualAdvance:false,captionOpacity:.8,beforeChange:function(){},afterChange:function(){},slideshowEnd:function(){}};a.fn.reverse=[].reverse})(jQuery);(function(){$(function(){$("#newsletter-sub-form").submit(function(){var a=$("#newsletter-widget"),b=$("#success",a),c=$("#error",a);$.post("../AJAX/Subscribe",{emailAddress:$("#newsletter-sub-email-field",a).val()},function(d){if(d.success==="true"){$("form",a).remove();b.show();c.hide()}else{b.hide();c.show()}});return false})})})()
