/* IE Clear type fix */
(function ($) {
    $.fn.customFadeIn = function (speed, callback) {
        $(this).fadeIn(speed, function () {
            if (jQuery.browser.msie) $(this).get(0).style.removeAttribute('filter');
            if (callback != undefined) callback();
        });
    };
    $.fn.customFadeOut = function (speed, callback) {
        $(this).fadeOut(speed, function () {
            if (jQuery.browser.msie) $(this).get(0).style.removeAttribute('filter');
            if (callback != undefined) callback();
        });
    };
    $.fn.customFadeTo = function (speed, callback) {
        $(this).fadeTo(speed, function () {
            if (jQuery.browser.msie) $(this).get(0).style.removeAttribute('filter');
            if (callback != undefined) callback();
        });
    };
    $.fn.customToggle = function (speed, callback) {
        $(this).toggle(speed, function () {
            if (jQuery.browser.msie) $(this).get(0).style.removeAttribute('filter');
            if (callback != undefined) callback();
        });
    };

})(jQuery);
(function($){
        $.datepicker.regional['de'] = {clearText: 'löschen', clearStatus: 'aktuelles Datum löschen',
                closeText: 'schließen', closeStatus: 'ohne Änderungen schließen',
                prevText: '<zurück', prevStatus: 'letzten Monat zeigen',
                nextText: 'Vor>', nextStatus: 'nächsten Monat zeigen',
                currentText: 'heute', currentStatus: '',
                monthNames: ['Januar','Februar','März','April','Mai','Juni',
                'Juli','August','September','Oktober','November','Dezember'],
                monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun',
                'Jul','Aug','Sep','Okt','Nov','Dez'],
                monthStatus: 'anderen Monat anzeigen', yearStatus: 'anderes Jahr anzeigen',
                weekHeader: 'Wo', weekStatus: 'Woche des Monats',
                dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
                dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
                dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],
                dayStatus: 'Setze DD als ersten Wochentag', dateStatus: 'Wähle D, M d',
                dateFormat: 'dd.mm.yy', firstDay: 1,
                initStatus: 'Wähle ein Datum', isRTL: false};
        $.datepicker.setDefaults($.datepicker.regional['de']);
})(jQuery);
$(document).ready(function() {
/* Live Search */
  $("#inputString").keyup(function() {
	  var inpstr = $(this).val();
	  if (inpstr.length > 3) {
		  $.ajax({
			  type: "post",
			  url: SITEURL + "/ajax/livesearch.php",
			  data: "liveSearch=" + inpstr,
			  cache: false,
			  success: function (res) {
				  $("#suggestions").customFadeIn();
				  $("#suggestions").html(res);
			  }
		  });
  
		  $("input").blur(function () {
			  $('#suggestions').customFadeOut();
		  });
	  }
  });
});
/* Disable autocomplete */
var flag = 1;
   function disAutoComplete(obj){
        if(flag){
      	obj.setAttribute("autocomplete","off");
            flag = 0;
      }
        obj.focus();
}

/**
* PK Accordium
*/
var openFirst = false;

(function($) {
	$.fn.pk_accordium = function(options) {
		var defaults = {
			openFirst: openFirst,
			speedIn: 800,
			speedOut: 800
		};
	
		var settings = $.extend({}, defaults, options);
	
		return this.each(function () {
			var root = $(this);
			var items = $(".pk_post", root);
			var tot_items = items.length;
			var current = 0;
			var is_animation = false;
			var work = undefined;
			var tops = [];
			
			$(".pk_caption_link", root).show();
			$(".pk_caption", root).show();
			$(".pk_entry", root).hide();
			
			function createNavigation(item) {
				item.append('<span class="pk_button_square pk_button_close pk_button_close_work"/>');
				$(".pk_button_close_work").hide().fadeIn(settings.speedIn / 2);
				$(".pk_button_close_work").click(function() {
					closeAll();
				});

				if(tot_items <= 1) {
					return true;
				}

				item.append('<span class="pk_button_square pk_button_up"/><span class="pk_button_square pk_button_down"/>');
				$(".pk_button_up, .pk_button_down").hide().fadeIn(settings.speedIn / 2);
				$(".pk_button_up").click(function() {
					(current - 1 < 0) ? current = tot_items - 1 : current--;
					$(".pk_caption", items).filter(":eq(" + current + ")").trigger("click", [true]);
				});
				$(".pk_button_down").click(function() {
					(current + 1 > (tot_items - 1)) ? current = 0 : current++;
					$(".pk_caption", items).filter(":eq(" + current + ")").trigger("click", [true]);
				});
			}
			
			function closeAll(current) {
				items.each(function(i) {
					if($(this).hasClass("pk_selected_item")) {
						$(".pk_caption", this).css("margin-top" , -($(".pk_caption", this).outerHeight()) + "px");
					}
					
					$(this).removeClass("pk_selected_item");
					
					$(".pk_button_close_work, .pk_button_up, .pk_button_down", this).fadeOut(200, function() { $(this).remove(); });
					$(".pk_caption", this).stop().animate({ "margin-top" : "0px" }, settings.speedOut, "easeInOutExpo").show();
					$(".pk_entry", this).stop().slideUp(settings.speedOut, "easeInOutExpo", function() {
						if($(".pk_gallery", this).length >= 1) {
							var call = $(".pk_gallery", this).data("call");
							call.resetGallery();
						}
						if(i != current) {
							$(this).hide();
						}
					});
				});
			}
			
			items.each(function(i) {
				tops[i] = $(this).offset().top;
				$(this).css({ "overflow" : "hidden" });
				$(".pk_caption .pk_info", this).css({ 
					"margin-left" : $(".pk_caption .pk_featured_image", this).width() + 30 + "px",
					"margin-right" : "60px"	
				});
				
				if($(".pk_caption .pk_featured_image", this).length >= 1) {
					$(".pk_caption .pk_featured_image", this).addClass("pk_preloader").pk_preloader({
						afterLoading: function() {
							$(this).removeClass("pk_preloader");
							if(settings.openFirst == true && i == 0) {
								setTimeout(function() {
									items.filter(":eq(0)").find(".pk_caption").trigger("click", [true]);
								}, 200);
							}
						},
						delay:(100 * i) + 100
					});
				} else {
					if(settings.openFirst == true && i == 0) {
						setTimeout(function() {
							items.filter(":eq(0)").find(".pk_caption").trigger("click", [true]);
						}, 200);
					}
				}
				
				$(".pk_caption", this).click(function() {
					if(is_animation) {
						return true;
					}
					
					is_animation = true;
					work = items.filter(":eq(" + i + ")");
					current = i;
					
					closeAll(i);
					
					work.addClass("pk_selected_item");
					$(this).stop().animate({ "margin-top" : -($(this).outerHeight()) + "px" }, settings.speedIn, "easeInOutExpo", function(){ $(this).hide(); });
					$(".pk_entry", work).slideDown(settings.speedIn, "easeInOutExpo", function() {
						if($(".pk_gallery", this).length >= 1) {
							$(".pk_gallery_navigation_button", work).filter(":eq(0)").trigger("click", [true]);
						}

						createNavigation(work);
						is_animation = false;

						setTimeout(function() {
								//$("html").scrollTo(tops[current], settings.speedIn, "easeOutExpo");
						}, settings.speedIn / 2);							
					});
				});
			});
		});
	};
})(jQuery);

/**
* PK Preloader
*/

(function($) {
	$.fn.pk_preloader = function(options) {
		var defaults = {
			delay:400,
			speedIn:800,
			beforeLoading: function(){},
			afterLoading: function(width, height){}
		};

		var settings = $.extend({}, defaults, options);

		return this.each(function() {
			var root = $(this);
			var images = $("img", root);
			var url = $("img", root).attr("src");
			
			settings.beforeLoading.call(this);

			function showImage(image, width, height) {
				if(settings.delay <= 0) {
					image.stop().css({ "visibility" : "visible" }).animate({ "opacity" : 1 }, settings.speedIn, "easeOutExpo", function() {
						settings.afterLoading.call(this, width, height);
					});
				} else {
					setTimeout(function() {
						image.stop().css({ "visibility" : "visible" }).animate({ "opacity" : 1 }, settings.speedIn, "easeOutExpo", function() {
							settings.afterLoading.call(this, width, height);
						});
					}, settings.delay);
				}
			}

			images.each(function() {
				if(this.complete == true) {
					var image = $(this);
					var width = ($.browser.msie) ? image.width() : this.height;
					var height = ($.browser.msie) ? image.height() : this.height;

					image.css({ "opacity" : 0 , "visibility" : "hidden" });
					
					showImage(image, width, height);
				} else {
					var new_image = new Image();
				
					$(this).remove();
					$(new_image).load(function() {
						var image = $(this);
							root.append(image);

						var width = ($.browser.msie) ? image.width() : this.height;
						var height = ($.browser.msie) ? image.height() : this.height;

						image.css({ "opacity" : 0 , "visibility" : "hidden" });
						showImage(image, width, height);
					}).attr("src", url);
				}
			});
		});
	};
})(jQuery);
	
/* Voting System */
function updateVoteUp(id) {
    var the_id = $('#vote_up-' + id).attr('value');
    $("span#votes_count" + id).fadeOut("fast");
    var pars = 'voting=1&action=vote_up' + '&id=' + id;
    $.ajax({
        type: "POST",
        url: SITEURL + "/ajax/rating.php",
        data: pars,
        success: function (msg) {
            $("span#votes_count" + id).html(msg).fadeIn();
            $("span#vote_buttons" + id).remove();
			//location.reload(true);
        }
    });
}

function updateVoteDown(id) {
    var the_id = $('#vote_down-' + id).attr('value');
    var pars = 'action=vote_down' + '&id=' + id;
    $.ajax({
        type: "POST",
        url: SITEURL + "/ajax/rating.php",
        data: pars,
        success: function (msg) {
            $("span#votes_count" + id).fadeOut().html(msg).fadeIn();
            $("span#vote_buttons" + id).remove();
        }
    });
}
	
  $(window).resize(function() {
	  //$("#pk_wrapper").css("min-height" , $(window).height() + "px");
	  //($("#pk_navigation").height() + 60 < $(window).height()) ? $("#pk_navigation").addClass("pk_fixed") : $("#pk_navigation").removeClass("pk_fixed");
	  if($(window).width() < 980) {
		  $("body").css({ "background-attachment" : "scroll" });
	  } else {
		  $("body").css({ "background-attachment" : "scroll" });
	  }
  });
  
/*
 * jQuery Form Plugin
 */
(function(b){b.fn.ajaxSubmit=function(t){if(!this.length){a("ajaxSubmit: skipping submit process - no element selected");return this}if(typeof t=="function"){t={success:t}}var h=this.attr("action");var d=(typeof h==="string")?b.trim(h):"";if(d){d=(d.match(/^([^#]+)/)||[])[1]}d=d||window.location.href||"";t=b.extend(true,{url:d,type:this[0].getAttribute("method")||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},t);var u={};this.trigger("form-pre-serialize",[this,t,u]);if(u.veto){a("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}if(t.beforeSerialize&&t.beforeSerialize(this,t)===false){a("ajaxSubmit: submit aborted via beforeSerialize callback");return this}var f,p,m=this.formToArray(t.semantic);if(t.data){t.extraData=t.data;for(f in t.data){if(t.data[f] instanceof Array){for(var i in t.data[f]){m.push({name:f,value:t.data[f][i]})}}else{p=t.data[f];p=b.isFunction(p)?p():p;m.push({name:f,value:p})}}}if(t.beforeSubmit&&t.beforeSubmit(m,this,t)===false){a("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[m,this,t,u]);if(u.veto){a("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}var c=b.param(m);if(t.type.toUpperCase()=="GET"){t.url+=(t.url.indexOf("?")>=0?"&":"?")+c;t.data=null}else{t.data=c}var s=this,l=[];if(t.resetForm){l.push(function(){s.resetForm()})}if(t.clearForm){l.push(function(){s.clearForm()})}if(!t.dataType&&t.target){var r=t.success||function(){};l.push(function(n){var k=t.replaceTarget?"replaceWith":"html";b(t.target)[k](n).each(r,arguments)})}else{if(t.success){l.push(t.success)}}t.success=function(w,n,x){var v=t.context||t;for(var q=0,k=l.length;q<k;q++){l[q].apply(v,[w,n,x||s,s])}};var g=b("input:file",this).length>0;var e="multipart/form-data";var j=(s.attr("enctype")==e||s.attr("encoding")==e);if(t.iframe!==false&&(g||t.iframe||j)){if(t.closeKeepAlive){b.get(t.closeKeepAlive,o)}else{o()}}else{b.ajax(t)}this.trigger("form-submit-notify",[this,t]);return this;function o(){var v=s[0];if(b(":input[name=submit],:input[id=submit]",v).length){alert('Error: Form elements must not have name or id of "submit".');return}var B=b.extend(true,{},b.ajaxSettings,t);B.context=B.context||B;var E="jqFormIO"+(new Date().getTime()),z="_"+E;var w=b('<iframe id="'+E+'" name="'+E+'" src="'+B.iframeSrc+'" />');var A=w[0];w.css({position:"absolute",top:"-1000px",left:"-1000px"});var x={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(){this.aborted=1;w.attr("src",B.iframeSrc)}};var I=B.global;if(I&&!b.active++){b.event.trigger("ajaxStart")}if(I){b.event.trigger("ajaxSend",[x,B])}if(B.beforeSend&&B.beforeSend.call(B.context,x,B)===false){if(B.global){b.active--}return}if(x.aborted){return}var H=0;var y=v.clk;if(y){var F=y.name;if(F&&!y.disabled){B.extraData=B.extraData||{};B.extraData[F]=y.value;if(y.type=="image"){B.extraData[F+".x"]=v.clk_x;B.extraData[F+".y"]=v.clk_y}}}function G(){var O=s.attr("target"),M=s.attr("action");v.setAttribute("target",E);if(v.getAttribute("method")!="POST"){v.setAttribute("method","POST")}if(v.getAttribute("action")!=B.url){v.setAttribute("action",B.url)}if(!B.skipEncodingOverride){s.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"})}if(B.timeout){setTimeout(function(){H=true;D()},B.timeout)}var N=[];try{if(B.extraData){for(var P in B.extraData){N.push(b('<input type="hidden" name="'+P+'" value="'+B.extraData[P]+'" />').appendTo(v)[0])}}w.appendTo("body");A.attachEvent?A.attachEvent("onload",D):A.addEventListener("load",D,false);v.submit()}finally{v.setAttribute("action",M);if(O){v.setAttribute("target",O)}else{s.removeAttr("target")}b(N).remove()}}if(B.forceSync){G()}else{setTimeout(G,10)}var K,L,J=50;function D(){L=A.contentWindow?A.contentWindow.document:A.contentDocument?A.contentDocument:A.document;if(!L||L.location.href==B.iframeSrc){return}A.detachEvent?A.detachEvent("onload",D):A.removeEventListener("load",D,false);var N=true;try{if(H){throw"timeout"}var R=B.dataType=="xml"||L.XMLDocument||b.isXMLDoc(L);a("isXml="+R);if(!R&&window.opera&&(L.body==null||L.body.innerHTML=="")){if(--J){a("requeing onLoad callback, DOM not available");setTimeout(D,250);return}}x.responseText=L.body?L.body.innerHTML:L.documentElement?L.documentElement.innerHTML:null;x.responseXML=L.XMLDocument?L.XMLDocument:L;x.getResponseHeader=function(T){var S={"content-type":B.dataType};return S[T]};var Q=/(json|script)/.test(B.dataType);if(Q||B.textarea){var M=L.getElementsByTagName("textarea")[0];if(M){x.responseText=M.value}else{if(Q){var P=L.getElementsByTagName("pre")[0];var n=L.getElementsByTagName("body")[0];if(P){x.responseText=P.textContent}else{if(n){x.responseText=n.innerHTML}}}}}else{if(B.dataType=="xml"&&!x.responseXML&&x.responseText!=null){x.responseXML=C(x.responseText)}}K=k(x,B.dataType,B)}catch(O){a("error caught:",O);N=false;x.error=O;B.error.call(B.context,x,"error",O);I&&b.event.trigger("ajaxError",[x,B,O])}if(x.aborted){a("upload aborted");N=false}if(N){B.success.call(B.context,K,"success",x);I&&b.event.trigger("ajaxSuccess",[x,B])}I&&b.event.trigger("ajaxComplete",[x,B]);if(I&&!--b.active){b.event.trigger("ajaxStop")}B.complete&&B.complete.call(B.context,x,N?"success":"error");setTimeout(function(){w.removeData("form-plugin-onload");w.remove();x.responseXML=null},100)}var C=b.parseXML||function(n,M){if(window.ActiveXObject){M=new ActiveXObject("Microsoft.XMLDOM");M.async="false";M.loadXML(n)}else{M=(new DOMParser()).parseFromString(n,"text/xml")}return(M&&M.documentElement&&M.documentElement.nodeName!="parsererror")?M:null};var q=b.parseJSON||function(n){return window["eval"]("("+n+")")};var k=function(Q,O,N){var M=Q.getResponseHeader("content-type")||"",n=O==="xml"||!O&&M.indexOf("xml")>=0,P=n?Q.responseXML:Q.responseText;if(n&&P.documentElement.nodeName==="parsererror"){b.error&&b.error("parsererror")}if(N&&N.dataFilter){P=N.dataFilter(P,O)}if(typeof P==="string"){if(O==="json"||!O&&M.indexOf("json")>=0){P=q(P)}else{if(O==="script"||!O&&M.indexOf("javascript")>=0){b.globalEval(P)}}}return P}}};b.fn.ajaxForm=function(c){if(this.length===0){var d={s:this.selector,c:this.context};if(!b.isReady&&d.s){a("DOM not ready, queuing ajaxForm");b(function(){b(d.s,d.c).ajaxForm(c)});return this}a("terminating; zero elements found by selector"+(b.isReady?"":" (DOM not ready)"));return this}return this.ajaxFormUnbind().bind("submit.form-plugin",function(f){if(!f.isDefaultPrevented()){f.preventDefault();b(this).ajaxSubmit(c)}}).bind("click.form-plugin",function(j){var i=j.target;var g=b(i);if(!(g.is(":submit,input:image"))){var f=g.closest(":submit");if(f.length==0){return}i=f[0]}var h=this;h.clk=i;if(i.type=="image"){if(j.offsetX!=undefined){h.clk_x=j.offsetX;h.clk_y=j.offsetY}else{if(typeof b.fn.offset=="function"){var k=g.offset();h.clk_x=j.pageX-k.left;h.clk_y=j.pageY-k.top}else{h.clk_x=j.pageX-i.offsetLeft;h.clk_y=j.pageY-i.offsetTop}}}setTimeout(function(){h.clk=h.clk_x=h.clk_y=null},100)})};b.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")};b.fn.formToArray=function(q){var p=[];if(this.length===0){return p}var d=this[0];var g=q?d.getElementsByTagName("*"):d.elements;if(!g){return p}var k,h,f,r,e,m,c;for(k=0,m=g.length;k<m;k++){e=g[k];f=e.name;if(!f){continue}if(q&&d.clk&&e.type=="image"){if(!e.disabled&&d.clk==e){p.push({name:f,value:b(e).val()});p.push({name:f+".x",value:d.clk_x},{name:f+".y",value:d.clk_y})}continue}r=b.fieldValue(e,true);if(r&&r.constructor==Array){for(h=0,c=r.length;h<c;h++){p.push({name:f,value:r[h]})}}else{if(r!==null&&typeof r!="undefined"){p.push({name:f,value:r})}}}if(!q&&d.clk){var l=b(d.clk),o=l[0];f=o.name;if(f&&!o.disabled&&o.type=="image"){p.push({name:f,value:l.val()});p.push({name:f+".x",value:d.clk_x},{name:f+".y",value:d.clk_y})}}return p};b.fn.formSerialize=function(c){return b.param(this.formToArray(c))};b.fn.fieldSerialize=function(d){var c=[];this.each(function(){var h=this.name;if(!h){return}var f=b.fieldValue(this,d);if(f&&f.constructor==Array){for(var g=0,e=f.length;g<e;g++){c.push({name:h,value:f[g]})}}else{if(f!==null&&typeof f!="undefined"){c.push({name:this.name,value:f})}}});return b.param(c)};b.fn.fieldValue=function(h){for(var g=[],e=0,c=this.length;e<c;e++){var f=this[e];var d=b.fieldValue(f,h);if(d===null||typeof d=="undefined"||(d.constructor==Array&&!d.length)){continue}d.constructor==Array?b.merge(g,d):g.push(d)}return g};b.fieldValue=function(c,j){var e=c.name,p=c.type,q=c.tagName.toLowerCase();if(j===undefined){j=true}if(j&&(!e||c.disabled||p=="reset"||p=="button"||(p=="checkbox"||p=="radio")&&!c.checked||(p=="submit"||p=="image")&&c.form&&c.form.clk!=c||q=="select"&&c.selectedIndex==-1)){return null}if(q=="select"){var k=c.selectedIndex;if(k<0){return null}var m=[],d=c.options;var g=(p=="select-one");var l=(g?k+1:d.length);for(var f=(g?k:0);f<l;f++){var h=d[f];if(h.selected){var o=h.value;if(!o){o=(h.attributes&&h.attributes.value&&!(h.attributes.value.specified))?h.text:h.value}if(g){return o}m.push(o)}}return m}return b(c).val()};b.fn.clearForm=function(){return this.each(function(){b("input,select,textarea",this).clearFields()})};b.fn.clearFields=b.fn.clearInputs=function(){return this.each(function(){var d=this.type,c=this.tagName.toLowerCase();if(d=="text"||d=="password"||c=="textarea"){this.value=""}else{if(d=="checkbox"||d=="radio"){this.checked=false}else{if(c=="select"){this.selectedIndex=-1}}}})};b.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};b.fn.enable=function(c){if(c===undefined){c=true}return this.each(function(){this.disabled=!c})};b.fn.selected=function(c){if(c===undefined){c=true}return this.each(function(){var d=this.type;if(d=="checkbox"||d=="radio"){this.checked=c}else{if(this.tagName.toLowerCase()=="option"){var e=b(this).parent("select");if(c&&e[0]&&e[0].type=="select-one"){e.find("option").selected(false)}this.selected=c}}})};function a(){if(b.fn.ajaxSubmit.debug){var c="[jquery.form] "+Array.prototype.join.call(arguments,"");if(window.console&&window.console.log){window.console.log(c)}else{if(window.opera&&window.opera.postError){window.opera.postError(c)}}}}})(jQuery);

/*
	Watermark plugin for jQuery
*/
(function(a,h,y){var w="function",v="password",j="maxLength",n="type",b="",c=true,u="placeholder",i=false,t="watermark",g=t,f="watermarkClass",q="watermarkFocus",l="watermarkSubmit",o="watermarkMaxLength",e="watermarkPassword",d="watermarkText",k=/\r/g,s="input:data("+g+"),textarea:data("+g+")",m="input:text,input:password,input[type=search],input:not([type]),textarea",p=["Page_ClientValidate"],r=i,x=u in document.createElement("input");a.watermark=a.watermark||{version:"3.1.3",runOnce:c,options:{className:t,useNative:c,hideBeforeUnload:c},hide:function(b){a(b).filter(s).each(function(){a.watermark._hide(a(this))})},_hide:function(a,r){var p=a[0],q=(p.value||b).replace(k,b),l=a.data(d)||b,m=a.data(o)||0,i=a.data(f);if(l.length&&q==l){p.value=b;if(a.data(e))if((a.attr(n)||b)==="text"){var g=a.data(e)||[],c=a.parent()||[];if(g.length&&c.length){c[0].removeChild(a[0]);c[0].appendChild(g[0]);a=g}}if(m){a.attr(j,m);a.removeData(o)}if(r){a.attr("autocomplete","off");h.setTimeout(function(){a.select()},1)}}i&&a.removeClass(i)},show:function(b){a(b).filter(s).each(function(){a.watermark._show(a(this))})},_show:function(g){var p=g[0],u=(p.value||b).replace(k,b),h=g.data(d)||b,s=g.attr(n)||b,t=g.data(f);if((u.length==0||u==h)&&!g.data(q)){r=c;if(g.data(e))if(s===v){var m=g.data(e)||[],l=g.parent()||[];if(m.length&&l.length){l[0].removeChild(g[0]);l[0].appendChild(m[0]);g=m;g.attr(j,h.length);p=g[0]}}if(s==="text"||s==="search"){var i=g.attr(j)||0;if(i>0&&h.length>i){g.data(o,i);g.attr(j,h.length)}}t&&g.addClass(t);p.value=h}else a.watermark._hide(g)},hideAll:function(){if(r){a.watermark.hide(m);r=i}},showAll:function(){a.watermark.show(m)}};a.fn.watermark=a.fn.watermark||function(p,o){var t="string";if(!this.length)return this;var s=i,r=typeof p===t;if(r)p=p.replace(k,b);if(typeof o==="object"){s=typeof o.className===t;o=a.extend({},a.watermark.options,o)}else if(typeof o===t){s=c;o=a.extend({},a.watermark.options,{className:o})}else o=a.watermark.options;if(typeof o.useNative!==w)o.useNative=o.useNative?function(){return c}:function(){return i};return this.each(function(){var B="dragleave",A="dragenter",z=this,i=a(z);if(!i.is(m))return;if(i.data(g)){if(r||s){a.watermark._hide(i);r&&i.data(d,p);s&&i.data(f,o.className)}}else{if(x&&o.useNative.call(z,i)&&(i.attr("tagName")||b)!=="TEXTAREA"){r&&i.attr(u,p);return}i.data(d,r?p:b);i.data(f,o.className);i.data(g,1);if((i.attr(n)||b)===v){var C=i.wrap("<span>").parent(),t=a(C.html().replace(/type=["']?password["']?/i,'type="text"'));t.data(d,i.data(d));t.data(f,i.data(f));t.data(g,1);t.attr(j,p.length);t.focus(function(){a.watermark._hide(t,c)}).bind(A,function(){a.watermark._hide(t)}).bind("dragend",function(){h.setTimeout(function(){t.blur()},1)});i.blur(function(){a.watermark._show(i)}).bind(B,function(){a.watermark._show(i)});t.data(e,i);i.data(e,t)}else i.focus(function(){i.data(q,1);a.watermark._hide(i,c)}).blur(function(){i.data(q,0);a.watermark._show(i)}).bind(A,function(){a.watermark._hide(i)}).bind(B,function(){a.watermark._show(i)}).bind("dragend",function(){h.setTimeout(function(){a.watermark._show(i)},1)}).bind("drop",function(e){var c=i[0],a=e.originalEvent.dataTransfer.getData("Text");if((c.value||b).replace(k,b).replace(a,b)===i.data(d))c.value=a;i.focus()});if(z.form){var w=z.form,y=a(w);if(!y.data(l)){y.submit(a.watermark.hideAll);if(w.submit){y.data(l,w.submit);w.submit=function(c,b){return function(){var d=b.data(l);a.watermark.hideAll();if(d.apply)d.apply(c,Array.prototype.slice.call(arguments));else d()}}(w,y)}else{y.data(l,1);w.submit=function(b){return function(){a.watermark.hideAll();delete b.submit;b.submit()}}(w)}}}}a.watermark._show(i)})};if(a.watermark.runOnce){a.watermark.runOnce=i;a.extend(a.expr[":"],{data:function(c,d,b){return!!a.data(c,b[3])}});(function(c){a.fn.val=function(){var e=this;if(!e.length)return arguments.length?e:y;if(!arguments.length)if(e.data(g)){var f=(e[0].value||b).replace(k,b);return f===(e.data(d)||b)?b:f}else return c.apply(e,arguments);else{c.apply(e,arguments);a.watermark.show(e);return e}}})(a.fn.val);p.length&&a(function(){for(var b,c,d=p.length-1;d>=0;d--){b=p[d];c=h[b];if(typeof c===w)h[b]=function(b){return function(){a.watermark.hideAll();return b.apply(null,Array.prototype.slice.call(arguments))}}(c)}});a(h).bind("beforeunload",function(){a.watermark.options.hideBeforeUnload&&a.watermark.hideAll()})}})(jQuery,window);

/* Cookie Plugin 
* @author Klaus Hartl/klaus.hartl@stilbuero.de
*/
jQuery.cookie=function(d,e,b){if(arguments.length>1&&(e===null||typeof e!=="object")){b=jQuery.extend({},b);if(e===null){b.expires=-1}if(typeof b.expires==="number"){var g=b.expires,c=b.expires=new Date();c.setDate(c.getDate()+g)}return(document.cookie=[encodeURIComponent(d),"=",b.raw?String(e):encodeURIComponent(String(e)),b.expires?"; expires="+b.expires.toUTCString():"",b.path?"; path="+b.path:"",b.domain?"; domain="+b.domain:"",b.secure?"; secure":""].join(""))}b=e||{};var a,f=b.raw?function(h){return h}:decodeURIComponent;return(a=new RegExp("(?:^|; )"+encodeURIComponent(d)+"=([^;]*)").exec(document.cookie))?f(a[1]):null}; 

/* File Input Plugin */
(function($){$.fn.filestyle=function(options){var settings={width:250};if(options){$.extend(settings,options);};return this.each(function(){var self=this;var wrapper=$("<div>").css({"width":settings.imagewidth+"px","height":settings.imageheight+"px","background":"url("+settings.image+") 0 0 no-repeat","background-position":"right","display":"inline","position":"absolute","overflow":"hidden"});var filename=$('<input class="file">').addClass($(self).attr("class")).css({"display":"inline","width":settings.width+"px"});$(self).before(filename);$(self).wrap(wrapper);$(self).css({"position":"relative","height":settings.imageheight+"px","width":settings.width+"px","display":"inline","cursor":"pointer","opacity":"0.0"});if($.browser.mozilla){if(/Win/.test(navigator.platform)){$(self).css("margin-left","-142px");}else{$(self).css("margin-left","-168px");};}else{$(self).css("margin-left",settings.imagewidth-settings.width+"px");};$(self).bind("change",function(){filename.val($(self).val());});});};})(jQuery);

/*
 * Superfish v1.4.8 - jQuery menu widget
 */
(function(b){b.fn.superfish=function(k){var g=b.fn.superfish,j=g.c,f=b(['<span class="',j.arrowClass,'"> &#187;</span>'].join("")),i=function(){var c=b(this),l=d(c);clearTimeout(l.sfTimer);c.showSuperfishUl().siblings().hideSuperfishUl()},e=function(){var c=b(this),m=d(c),l=g.op;clearTimeout(m.sfTimer);m.sfTimer=setTimeout(function(){l.retainPath=(b.inArray(c[0],l.$path)>-1);c.hideSuperfishUl();if(l.$path.length&&c.parents(["li.",l.hoverClass].join("")).length<1){i.call(l.$path)}},l.delay)},d=function(c){var l=c.parents(["ul.",j.menuClass,":first"].join(""))[0];g.op=g.o[l.serial];return l},h=function(c){c.addClass(j.anchorClass).append(f.clone())};return this.each(function(){var c=this.serial=g.o.length;var m=b.extend({},g.defaults,k);m.$path=b("li."+m.pathClass,this).slice(0,m.pathLevels).each(function(){b(this).addClass([m.hoverClass,j.bcClass].join(" ")).filter("li:has(ul)").removeClass(m.pathClass)});g.o[c]=g.op=m;b("li:has(ul)",this)[(b.fn.hoverIntent&&!m.disableHI)?"hoverIntent":"hover"](i,e).each(function(){if(m.autoArrows){h(b(">a:first-child",this))}}).not("."+j.bcClass).hideSuperfishUl();var l=b("a",this);l.each(function(n){var o=l.eq(n).parents("li");l.eq(n).focus(function(){i.call(o)}).blur(function(){e.call(o)})});m.onInit.call(this)}).each(function(){var c=[j.menuClass];if(g.op.dropShadows&&!(b.browser.msie&&b.browser.version<7)){c.push(j.shadowClass)}b(this).addClass(c.join(" "))})};var a=b.fn.superfish;a.o=[];a.op={};a.IE7fix=function(){var c=a.op;if(b.browser.msie&&b.browser.version>6&&c.dropShadows&&c.animation.opacity!=undefined){this.toggleClass(a.c.shadowClass+"-off")}};a.c={bcClass:"sf-breadcrumb",menuClass:"sf-js-enabled",anchorClass:"sf-with-ul",arrowClass:"sf-sub-indicator",shadowClass:"sf-shadow"};a.defaults={hoverClass:"sfHover",pathClass:"overideThisToUse",pathLevels:1,delay:800,animation:{opacity:"show"},speed:"normal",autoArrows:true,dropShadows:true,disableHI:false,onInit:function(){},onBeforeShow:function(){},onShow:function(){},onHide:function(){}};b.fn.extend({hideSuperfishUl:function(){var e=a.op,d=(e.retainPath===true)?e.$path:"";e.retainPath=false;var c=b(["li.",e.hoverClass].join(""),this).add(this).not(d).removeClass(e.hoverClass).find(">ul").hide().css("visibility","hidden");e.onHide.call(c);return this},showSuperfishUl:function(){var e=a.op,d=a.c.shadowClass+"-off",c=this.addClass(e.hoverClass).find(">ul:hidden").css("visibility","visible");a.IE7fix.call(c);e.onBeforeShow.call(c);c.animate(e.animation,e.speed,function(){a.IE7fix.call(c);e.onShow.call(c)});return this}})})(jQuery);
/**
 * A jQuery plugin to style all form elements
 */
var plum=plum||{};String.prototype.plum=Number.prototype.plum=jQuery.fn.plum=function(d,b){var c=d.split("."),a;d=c[0];if(c.length>1){a=b;b=c[1]}return typeof plum[d]==="function"?plum[d].call(this,b,a):this};(function(){$.each(["html","append"],function(b,a){b=$.fn[a];$.fn[a]=function(){var c=b.apply(this,arguments);this.trigger("plum",[c]);return c}})}(jQuery));(function(c){var a=c.browser.msie&&parseFloat(c.browser.version)<8;c.support.file=window.File&&window.FileList;c.support.filexhr=window.XMLHttpRequestUpload;c.expr[":"].plum=function(d){return !!c(d).data("plum-form-options")};c.expr[":"].invalid=function(d){return !!c(d).data("invalid")};if((!c.support.file||!c.support.filexhr)&&!c('iframe[name="plum-form"]').length){var b;c(function(){b=c('<iframe name="plum-form">').attr("src","about:blank").css({border:0,left:"-9999em",height:0,position:"absolute",top:"-9999em",width:0}).appendTo("body")})}plum.form=function(g,h){var f=plum.form.prototype,d=this.selector,e=c();if(typeof g==="string"){return this.each(function(){if(typeof f.modules[g]==="function"){var i=c(this);i.selector=d;f.modules[g].call(i,h)}});return}this.each(function(){var k=c(this),j=this.nodeName.toLowerCase()==="form",i=c(":input:not(:hidden)",this);if(j){j=k}else{j=k.closest("form");j=j.length?j:k.find("form")}f.add(j,k.is(":input")?k:i,g);e=e.add(j)});e.each(f.init());f.selectors[this.selector]=g;f.listen(this.selector);return this};plum.form.fields={checkbox:function(){var f=this.data("plum-form-options").classes,e=this.closest("form"),d=this.bind("click",function(){var g,h=d.hasClass("check-all")&&d.attr("class").match(/group-([^\s]+)/)[1];if(!h){this.wrapper.toggleClass(f.checked);plum.form.prototype.checkboxes.call(d,this.name)}else{e.data("plum-form").filter(function(){return this.type==="checkbox"&&!this.disabled&&(this.name===h||c(this).hasClass("group-"+h))}).each(function(){if(d[0].checked||this.wrapper.hasClass(f.mixed)){this.checked=true;this.wrapper.removeClass(f.mixed).addClass(f.checked)}else{this.checked=false;this.wrapper.removeClass(f.checked+" "+f.mixed)}})}}).css({left:"50%",marginLeft:-this[0].offsetWidth/2,marginTop:-this[0].offsetHeight/2,opacity:0,position:"absolute",top:"50%"});this[0].wrapper.css({verticalAlign:""})},file:function(){var p=this.data("plum-form-options"),n=p.ajax,m=p.classes,j=p.file,d=this.closest("form"),g={size:function(f){f={B:f};f.K=f.B/1024;f.M=f.K/1024;f.G=f.M/1024;return f.G>1?Math.round(f.G)+" GB":f.M>1?Math.round(f.M)+" MB":f.K>1?Math.round(f.K)+" KB":f.B>0?f.B+" bytes":""},add:function(){var q=d.data("plum-form-queue"),f=c("<li>",{"class":(this.error?m.error:m.waiting)+" plum-upload-"+(k-1),css:{display:"none"},html:j.html.replace(/\{filename\}/g,this.name).replace(/\{filesize\}/g,g.size(this.size)).replace(/\{filetype\}/g,this.type)+this.error+'<div style="clear:both"></div>'}).appendTo(i).fadeIn(300);c("."+m.remove,f).bind("click",function(){var s=f.attr("class").match(/(?:(?:.+\s+)?)?plum-upload-([\d]+)/)[1],r=c(":file.plum-upload-"+s);f.fadeOut(300,function(){f.remove()});if(typeof q[s]!=="undefined"){q.splice(s,1);d.data("plum-form-queue",q)}!c.support.file&&r.remove()});if(this.error||!c.support.filexhr){c("."+m.progress,f).remove()}else{c("."+m.progress,f).children().css({width:0})}},change:function(){var r=0,q,u=c(this),f=d.data("plum-form-queue"),t,s={name:this.value,size:"",type:"",error:""};if(c.support.file){if(!p.ajax){f=[];i.children().remove()}for(q=this.files.length;r<q;r++){if(j.files&&f.length===j.files){break}t=this.files[r];s.name=t.name||t.fileName;s.size=t.size||t.fileSize;s.type=t.type||t.fileType;if(j.types.length&&c.inArray(s.type,j.types)<0){s.error="<div>"+j.errortype+"</div>"}else{if(j.size&&s.size>j.size){s.error="<div>"+j.errorsize+"</div>"}}if(!s.error){k++;f.push(t)}d.data("plum-form-queue",f);g.add.call(s)}}else{if(j.files&&f.length===j.files){return false}else{k++;f.push(s.name);d.data("plum-form-queue",f);g.add.call(s);u=u.css({zIndex:-998}).unbind("change",g.change).after(u.clone().val("")).next().data("plum",true).removeClass("plum-upload-"+(k-1)).addClass("plum-upload-"+k).css({zIndex:998}).bind("mousedown mouseup",function(){c(this).parent().toggleClass(m.active)}).bind("change",g.change)}}}},k=0,o=g.size(j.size),i=c("<ul>",{"class":m.filelist}).insertAfter(this),l,h=c('<button type="button">'+j.button+"</button>").appendTo("body"),e=c(this).attr("multiple",true).addClass("plum-upload-"+k).css({opacity:0,position:"absolute",width:50}).wrap(c("<div>",{"class":"plum-form "+m.input+" "+m.button,css:{cssFloat:c(this).css("float"),display:"inline-block",overflow:"hidden",position:"relative",verticalAlign:"top",width:a?h.css("width"):"",zoom:a?1:""}})).before(h).unbind("mousedown mouseup").bind({change:g.change,mousedown:function(){l=true;this.wrapper.addClass(m.active)},mouseup:function(){l=false;this.wrapper.removeClass(m.active)},focus:function(){this.wrapper.removeClass(m.focus);c(this).parent().addClass(m.focus)},blur:function(){this.wrapper.removeClass(m.focus);c(this).parent().removeClass(m.focus)}});e.parent().bind({mouseover:function(){c(this).toggleClass(m.hover);if(l){c(this).addClass(m.active)}},mouseout:function(){c(this).toggleClass(m.hover).removeClass(m.active)},mousemove:function(r){var q=c(this),f=c(":file",this).eq(-1);f.css({left:-f.outerWidth(),marginLeft:r.pageX-q.offset().left+25,top:r.pageY-q.offset().top-10})}})},input:function(){var d=this.data("plum-form-options").classes;switch(this[0].type){case"textarea":return this.css({resize:"none",verticalAlign:"bottom"});case"button":case"submit":return this.attr("formnovalidate",true);default:return this.css("verticalAlign","bottom").each(function(){this.wrapper.addClass(d.text)})}},radio:function(){var f=this.data("plum-form-options").classes,e=this.closest("form"),d=this.bind("click",function(){e.data("plum-form").filter(function(){return this.type==="radio"&&this.name===d[0].name}).each(function(){this.wrapper.removeClass(f.checked)});this.wrapper.addClass(f.checked)}).css({left:"50%",marginLeft:-this[0].offsetWidth/2,marginTop:-this[0].offsetHeight/2,opacity:0,position:"absolute",top:"50%"});this[0].wrapper.css({verticalAlign:""})},reset:function(){this.bind("click",function(d){d.preventDefault();plum.form.prototype.reset.call(c(this).closest("form"))})},select:function(){var A=this,C=this.data("plum-form-options").classes,j=0,z=0,g=this[0].wrapper,f=false,B=this[0].multiple,r=this[0].size||(B?5:10),p=!!B,h=false,e=!B,o,n="",k=false,t={click:function(i){z=y.index(this);i&&i.preventDefault();if(B){A.trigger("focus");t[i.shiftKey?"shift":i.ctrlKey?"ctrl":"one"](this)}else{t.one(this)}if((e||(B&&!i.shiftKey))&&j!==z){j=z;A.trigger("change")}},close:function(){if(B||h){return}h=true;if(!k&&j!==z){j=z;A.trigger("change")}else{t.click.call(y.eq(j))}e=true;p=false;k=false;A.trigger("close");return d.stop(true,true).slideUp(150,function(){h=false;g.css("zIndex","").addClass(C.closed).removeClass(C.open);d.css("marginTop",0)})},open:function(){p=true;e=false;A.trigger("focus").trigger("open");var i=c(document).height(),E=g.offset().top,F=-w.outerHeight(true)-parseInt(A[0].wrapper.css("borderTopWidth"),10);if(E+q+50>i){F=i-(E+q)-50}if(F*-1>E+25){F=-E+25}g.css({zIndex:9999}).addClass(C.open).removeClass(C.closed);d.stop(true,true).animate({marginTop:F},150).slideDown(150,function(){d.scrollTop(j*u/r)})},keydown:function(i){switch(i.which){case 8:i.preventDefault();n=!n?"":n.substring(0,n.length-1);t.search(i);break;case 9:n="";if(!B){t.close()}break;case 27:n="";if(!B){k=true;t.close()}break;case 38:case 40:i.ctrlKey=false;z=i.which===38?(z-1<0?0:z-1):(z+1>=y.length?y.length-1:z+1);t.click.call(y.eq(z)[0],i);break;default:break}},keypress:function(G){var F=0,E;if(!G.which){n="";return this}if(G.which===13){n="";if(!B){t[g.hasClass(C.open)?"close":"open"]()}return this}G.preventDefault();n+=String.fromCharCode(G.which);t.search(G)},ctrl:function(){x[z].selected=!x[z].selected;y.eq(z).toggleClass(C.selected)},search:function(F){var E=0,i=m.length;for(;E<i;E++){if(m[E].substring(0,n.length)===n){return t.click.call(y.eq(E)[0],F)}}},shift:function(){var i=j>z?z:j,E=j>z?j:z;x.each(function(){this.selected=false});y.removeClass(C.selected);for(;i<=E;){x[i].selected=true;y.eq(i++).addClass(C.selected)}},one:function(i){x.each(function(){this.selected=false})[z].selected=true;y.removeClass(C.selected).eq(z).addClass(C.selected);s.text(c(i).text());d.scrollTop(z*u/r)},rebuild:function(){o="";n="";m=[];f=A[0].disabled;A.children().each(l);d.show().html(o).css({minWidth:A.width(),width:""});u=c("li."+C.option+":eq(0)",d).outerHeight(true)*r;d.css({display:B?"block":"none",maxHeight:u});q=d.outerHeight(true);x=c("option:not(:disabled)",A);y=d.find("li."+C.option+":not(."+C.disabled+")").bind("click",t.click).each(function(){m.push(c(this).text().toLowerCase())});if(!B&&!s.text()){s.text(A.find("option[selected]").text()||A.find("option:eq(0)").text())}g[f?"addClass":"removeClass"](C.disabled).css({width:d.outerWidth(true)});return true}},D=c("<div>",{"class":C.wrapper}).prependTo(g),w=B?c():c("<div>",{"class":C.value,css:{position:"relative"},html:'<div></div><div class="'+C.arrow+'"></div>'}).appendTo(D).css({verticalAlign:"bottom"}),s=w.children("div:first-child"),q=0,v=A[0].offsetWidth,u=0,d=c("<ul>",{"class":C.container,css:{overflowX:"hidden",overflowY:"scroll",position:"relative",whiteSpace:"nowrap",width:v}}).appendTo(D),x=null,y=null,m=[],l=function(){var i=this.nodeName.toLowerCase(),E=this.label||this.textContent||this.innerText;o+='<li class="'+C[i]+" "+(this.disabled&&C.disabled||"")+" "+(this.selected&&C.selected||"")+'">';if(i==="option"){o+=E;if(this.selected){s.text(E)}}else{o+="<label>"+E+"</label><ul>";c(this).children().each(l);o+="</ul>"}o+="</li>"};this.css({opacity:0,position:"absolute",top:0,zIndex:-999}).bind({change:t.close,keydown:t.keydown,keypress:t.keypress,rebuild:t.rebuild});g.addClass(B?C.multiple+" "+C.open:C.single+" "+C.closed).bind("mousedown",false);this.trigger("rebuild");!f&&y.each(function(i){if(c(this).hasClass(C.selected)){j=z;z=i;return false}});if(B){return}d.css({position:"absolute"});c(document).bind("click",function(i){i=c(i.target);if(i.closest("div.plum-form."+C.select)[0]!==g[0]){p&&t.close();return this}if(f||i.hasClass(C.disabled)||i.is("label")){return this}t[p?"close":"open"]()})}};plum.form.prototype={selectors:{},defaults:{action:null,ajax:false,complete:function(){},classes:{active:"active",arrow:"select-arrow",button:"button",checkbox:"checkbox",checked:"checked",closed:"closed",color:"color",container:"select-container",date:"date",datetime:"datetime",disabled:"disabled",file:"file",filelist:"filelist",focus:"focus",email:"email",error:"error",hover:"hover",info:"info",input:"input",label:"label",loading:"loading",mixed:"mixed",month:"month",multiple:"multiple",number:"number",open:"open",optgroup:"optgroup",option:"option",password:"password",progress:"progress",radio:"radio",range:"range",remove:"remove",reset:"reset",submit:"submit",text:"text",textarea:"textarea",select:"select",search:"search",selected:"selected",single:"single",success:"success",tel:"tel",url:"url",value:"select-value",waiting:"waiting",week:"week",wrapper:"select-wrapper"},file:{button:"Choose a file...",complete:function(){},errorsize:"Please choose a file smaller than {filesize}.",errortype:"This file type is not allowed.",files:0,html:'<span class="filename">{filename}</span><span class="remove">&times;</span><span class="filesize">{filesize}</span><div class="progress"><div></div></div>',progress:function(d){d.progressbar.children().stop(true,true).animate({width:d.percent+"%"},150)},size:0,start:function(){},types:[]},json:false,labels:false,reset:false,shake:true,submit:function(){}},add:function(f,d,e){var g=this.defaults;if(f.length){if(!f.data("plum-form")){f.data("plum-form",c())}d.each(function(){var h=c(this),i;if(!h.data("plum-form-options")){i=c.extend(true,{},g,e);h.data("plum-form-options",i);f.data("plum-form",f.data("plum-form").add(this)).data("plum-form-queue",[]).data("plum-form-options",i)}})}},init:function(){var d=this;return function(){var g=c(this),h=true,f=0,e=g.data("events")||{};c.each(e,function(j,k){c.each(k,function(l,m){if(m.handler===d.submit){h=false}})});!h&&g.bind("submit",d.submit);g.data("plum-form").each(function(){var i=c(this),q=i.data("plum-form-options");if(i.data("plum-form")||!q){return}var m=q.classes,l=i.css("display"),o=i.css("position"),j=this.nodeName.toLowerCase(),n=(i.attr("type")||this.type||this.nodeName).toLowerCase(),p=i.parent().is("label")?i.parent():c('label[for="'+this.id+'"]'),k;g[0].action=q.action||g[0].action||window.location.href;this.wrapper=i.data("plum-form",true).css({position:"relative",overflow:"visible"}).wrap(c("<div>",{"class":"plum-form "+(m[n]||"")+" "+(m[j]||"")+" "+(this.disabled&&m.disabled||"")+" "+(this.checked&&m.checked||""),title:this.title,dir:this.dir,css:{cssFloat:i.css("float"),display:l==="inline"&&!a?"inline-block":l,position:o==="static"?"relative":o,verticalAlign:"top",width:a||/^(?:button|checkbox|file|submit|reset|radio)$/.test(n)?"":i.outerWidth(),zoom:a?1:""}})).bind("focus blur",function(r){this.wrapper[r==="focus"?"addClass":"removeClass"](m.focus)}).parent().bind({mousedown:function(){k=true;c(this).addClass(m.active)},mouseup:function(){k=false;c(this).removeClass(m.active)},mouseenter:function(){k&&c(this).addClass(m.active)},mouseleave:function(){c(this).removeClass(m.active)}});!/^(?:button|reset|submit|select-one|select-multiple)$/.test(n)&&this.wrapper.css({width:parseInt(this.wrapper.css("width"),10)-parseInt(this.wrapper.css("borderLeftWidth"),10)-parseInt(this.wrapper.css("borderRightWidth"),10)});i.css({width:this.wrapper.css("width")});plum.form.fields[typeof plum.form.fields[n]==="function"?n:typeof plum.form.fields[j]==="function"?j:"input"].call(i);p.length&&d.labels.call(this,p);f++});f&&d.checkboxes.call(g)}},checkboxes:function(e){var f=this.data("plum-form-options").classes,d=this.closest("form");d.data("plum-form").filter(function(){return this.type==="checkbox"&&!this.disabled&&c(this).hasClass("check-all")&&(!e||c(this).hasClass("group-"+e))}).each(function(){var i=c(this),k=i.parent(),j=i.attr("class").match(/(?:(?:.+\s+)+)?group-([^\s]+)/)[1],g=d.data("plum-form").filter(function(){return this.type==="checkbox"&&!this.disabled&&this.name===j&&!c(this).hasClass("check-all")}),h=g.filter(function(){return this.checked});if(h.length===0){this.checked=false;k.removeClass(f.checked+" "+f.mixed)}else{this.checked=true;if(h.length===g.length){k.removeClass(f.mixed).addClass(f.checked)}else{k.addClass(f.checked+" "+f.mixed)}}})},labels:function(f){var g=c(this),e=g.data("plum-form-options"),d;f.bind("mouseover mouseout",function(){g[0].wrapper.toggleClass(e.classes.hover)});if(!e.labels||/^(?:button|checkbox|file|select-one|select-multiple|submit|radio|reset)$/.test(this.type.toLowerCase()||this.nodeName.toLowerCase())){return}d=c("<label>",{"class":e.classes.label,css:{display:"block",height:this.clientHeight,left:-parseInt(g.css("borderLeftWidth"),10)+parseInt(g.css("paddingLeft"),10),overflow:"hidden",position:"absolute",top:-parseInt(g.css("borderTopWidth"),10),whiteSpace:this.nodeName.toLowerCase()==="textarea"?"normal":"nowrap",maxWidth:this.clientWidth-parseInt(g.css("borderRightWidth"),10)-parseInt(g.css("paddingRight"),10)},text:f.text()}).appendTo(g.parent()).bind("mousedown",function(){g.trigger("focus");return false});if(g.parent().parent().is("label")){this.wrapper.insertAfter(f)}f.remove();this.value&&d.hide().css({opacity:0});g.bind("focus blur",function(h){if(!this.value){d.show().stop().animate({opacity:h.type==="focus"?0.3:1},250)}else{d.hide().css({opacity:0})}}).bind("keypress",function(h){if(h.which){d.hide().css({opacity:0})}})},listen:function(d){var f,e=this;c("body").bind("plum",function(h,g){c(":input",g[0]).each(function(){var i=c(this);if(i.closest(d).length&&!i.data("plum-form")){f=i.closest("form");e.add(f,i,e.selectors[d])}});f&&e.init().call(f)})},submit:function(k){var i=c(this),f=plum.form.prototype,d=i.data("plum-form-options"),h=c(":file:plum",this).parent().parent(),g=h.find("li"),j,l=d.classes;i.data("plum-form").trigger("blur");j=c(":input:plum:invalid",this);if(j.length||d.submit.call(this)===false){d.shake&&j.plum("form.shake");return false}if(!d.ajax){return this}c(":submit",this).attr("disabled",true);if(c.support.filexhr){k.preventDefault();h=h.find(":file").data("plum-form-options");f.upload.call(i,h,g,function(){c.ajax(i[0].action,{type:i[0].method||"GET",data:i.serialize(),dataType:d.json?"json":"html",success:function(m){c(":submit",i).attr("disabled",false);d.reset&&f.reset.call(i);d.complete.call(i[0],m)}})});return this}this.target="plum-form";g.filter(function(){return !c(this).hasClass(l.error)}).toggleClass(l.waiting+" "+l.loading);b.one("load",function(){c(":submit",i).attr("disabled",false);d.reset&&f.reset.call(i);d.complete.call(i[0],c(this).contents().find("body").html());h.each(function(){c(":file",this).slice(0,-1).remove();c("ul."+l.filelist+" li",this).fadeOut(300,function(){c(this).remove()})})});return this},reset:function(){var d=this.data("plum-form-options").classes;this[0].reset();this.data("plum-form-queue",[]);this.data("plum-form").each(function(){var h=c(this),f=h.parent(),g,i;switch(this.type){case"checkbox":case"radio":if(this.checked){f.addClass(d.checked)}else{f.removeClass(d.checked+" "+d.mixed)}break;case"file":g=f.find(":file");g.each(function(e){if(e<g.length-1){c(this).remove()}});c("li",f.next()).each(function(){var e=c(this).fadeOut(300,function(){e.remove()})});break;case"reset":break;case"select-multiple":case"select-one":i=f.find("li."+d.option).removeClass(d.selected);c("option",this).each(function(j){var k=c(this),e=i.eq(j);if(this.selected){e.addClass(d.selected);if(h[0].type==="select-one"){k.closest("div.plum-form").find("div."+d.value+" div:first-child").text(k.text())}}});break;default:h.trigger("blur");break}f.children("div."+d.info).removeClass(d.error+" "+d.success)});plum.form.prototype.checkboxes.call(this)},upload:function(m,h,k){if(!h.length){return k()}var d=this,i=m.classes,j=h.eq(0),g=d.data("plum-form-queue"),e=g.shift(),f=c("."+i.progress,j).slideDown(300),l=new XMLHttpRequest();d.data("plum-form-queue",g);l.upload.addEventListener("loadstart",function(n){j.toggleClass(i.waiting+" "+i.loading);m.file.start.call(j,c.extend(n,{progressbar:f,percent:n.loaded/n.total*100}))},false);l.upload.addEventListener("progress",function(n){m.file.progress.call(j,c.extend(n,{progressbar:f,percent:n.loaded/n.total*100}))},false);l.onreadystatechange=function(n){if(l.readyState===4){m.file.complete.call(j,c.extend(n,{progressbar:f,percent:100}),m.json?c.parseJSON(l.responseText):l.responseText);j.fadeOut(300,function(){if(g.length){plum.form.prototype.upload.call(d,m,h.slice(1),k)}else{k()}})}};l.open("POST",d[0].action,true);l.setRequestHeader("Content-Type",e.type);l.setRequestHeader("X-File-Name",e.name);l.setRequestHeader("X-Requested-With","XMLHttpRequest");l.send(e)},modules:{methods:{email:/^(?:"[\w!#$%&'\*+\.\-\/=?\^_`{|}~]+"|[\w!#$%&'\*+\.\-\/=?\^_`{|}~]+)@(?:\w(?:\-?[\w]+)?\.)*?\w+(?:\.[a-z]{2})?\.[a-z]{2,6}$/,tel:/^(?:(?:\+?1\s*(?:[\.\-]\s*)?)?(?:\(\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\s*\)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\s*(?:[\.\-]\s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\s*(?:[\.\-]\s*)?([0-9]{4})(?:\s*(?:#|x\.?|ext\.?|extension)\s*(\d+))?$/,url:/^(?:https?:\/\/)?(?:[\w](?:\-?[\w]+)?\.)*?[\w]+(?:\.[a-z]{2})?\.[a-z]{2,4}(\/.+)?$/},shake:function(){var e=this[0].wrapper,d=0;if(typeof e.data("plum-form-shaking")!=="undefined"){e.css("left",e.data("plum-form-shaking")).removeData("plum-form-shaking")}e.data("plum-form-shaking",e.css("left")).stop(true);for(;d<5;d++){e.animate({left:"-=15"},50).animate({left:"+=15"},50)}},verify:function(e){var d=plum.form.prototype.modules,f=this,h=this.data("plum-form-options"),i,g;if(!h){return}i=this.data("plum-form-options").classes;g=c('<div class="'+i.info+'">').insertAfter(this);this.bind("blur",function(){var j=true;if(typeof e==="string"){j=this.value===e}else{if(typeof e==="function"){j=!!e.call(this)}else{"min" in e&&(j=j&&this.value.length>=e.min);"max" in e&&(j=j&&this.value.length<=e.max);"method" in e&&(j="min" in e&&!e.min&&!this.value?true:j&&d.methods[e.method].test(this.value))}}f.data("invalid",!j);g.removeClass(j?i.error:i.success).addClass(j?i.success:i.error)})}}}}(jQuery));

/*!
* Step Process
*
*/
(function(d){function a(g){var l=g.data.options;g.preventDefault();var j=null;if(d(this).attr("href")!=undefined&&d(this).attr("href").substr(0,1)!="#"&&d(this).attr("href")!=""){j=d("#"+d(this).attr("href").split("#")[1])}else{j=d(d(this).attr("href"))}var m=d("#"+g.data.panelId).children("[href]").index(d(this));if(false===l.onOpen(g,d(this),j,m+1)){d(this).trigger("mouseout");return}d(this).unbind("mouseout",b);if(d(this).attr("href")!=undefined&&d(this).attr("href").substr(0,1)!="#"&&d(this).attr("href")!=""){var h=d(this).attr("href").split("#")[0];var f=d(this).attr("href").split("#")[1];d(g.data.contentsSelector+":not(#"+f+")").css("display","none");var k=d(this);d.ajax({url:h,type:"post",async:false,success:function(n){d("#"+f).css({opacity:0,display:"block"}).html(n).animate({opacity:1},l.fadeSpeed,function(){if(jQuery.browser.msie){this.style.removeAttribute("filter")}})}})}else{d(g.data.contentsSelector+":not("+d(this).attr("href")+")").css("display","none");d(d(this).attr("href")).css({opacity:0,display:"block"}).animate({opacity:1},l.fadeSpeed,function(){if(jQuery.browser.msie){this.style.removeAttribute("filter")}})}if(!l.chooseAgain){d(this).unbind(l.event,a);d(this).bind(l.event,function(n){n.preventDefault()})}if(g.data.options.kind=="stepByStep"){if(d(this).next().attr("href")!=undefined&&d.data(d(this).next().get(0),"events")==null){d(this).next().bind(l.event,{options:l,hoverBg:g.data.hoverBg,hoverColor:g.data.hoverColor,stepBg:g.data.stepBg,stepColor:g.data.stepColor,panelId:g.data.panelId,contentsSelector:g.data.contentsSelector},a);d(this).next().bind("mouseover",{options:l,hoverBg:g.data.hoverBg,hoverColor:g.data.hoverColor},c);d(this).next().bind("mouseout",{options:l,stepBg:g.data.stepBg,stepColor:g.data.stepColor},b)}}if(l.nextPrevButtons){var e=null;var i=null;if(d(this).next().length&&d(this).next().attr("href")!=undefined){i=d(this).next().attr("href")}if(d(this).prev().attr("href")!=undefined&&(l.chooseAgain||l.kind=="freeChoice")){e=d(this).prev().attr("href")}if(d(this).next().length&&(d.data(d(this).next().get(0),"events")==null||d.data(d(this).next().get(0),"events")[l.event]==null)){i=null}if(d.data(d(this).prev().get(0),"events")==null||d.data(d(this).prev().get(0),"events")[l.event]==null){e=null}d("#"+g.data.panelId+" .nextPrevButtons").remove();if(l.nextPrevButtonsPosition=="top"){d("#"+g.data.panelId).prepend("<div class='nextPrevButtons clearfix'><a class='button "+(e!=null?"activeButton-"+l.style:"inactiveButton")+"' title='"+l.prevButtonTitle+"' "+(e!=null?"xref='"+e+"'":"xref='#'")+">"+l.prevButtonTitle+"</a><a class='button "+(i!=null?"activeButton-"+l.style:"inactiveButton")+"' title='"+l.nextButtonTitle+"' "+(i!=null?"xref='"+i+"'":"xref='#'")+">"+l.nextButtonTitle+"</a></div>")}else{d("#"+g.data.panelId).append("<div class='nextPrevButtons clearfix'><a class='button "+(e!=null?"activeButton-"+l.style:"inactiveButton")+"' title='"+l.prevButtonTitle+"' "+(e!=null?"xref='"+e+"'":"xref='#'")+">"+l.prevButtonTitle+"</a><a class='button "+(i!=null?"activeButton-"+l.style:"inactiveButton")+"' title='"+l.nextButtonTitle+"' "+(i!=null?"xref='"+i+"'":"xref='#'")+">"+l.nextButtonTitle+"</a></div>")}}l.afterOpen(g,d(this),j,m)}function c(f){var e=d("#"+f.data.panelId).children("[href]").index(d(this));if(false===f.data.options.onHoverIn(f,d(this),e)){return}if(d(this).get(0)===d("#"+f.data.panelId).children("[href]").first().get(0)){d("#"+f.data.panelId+" .boxStart").css("background-position","-10px "+f.data.hoverBg.split(" ")[1])}d(this).css({"background-position":parseInt(d(this).backgroundPosition().split(" ")[0])+"px "+f.data.hoverBg.split(" ")[1],color:f.data.hoverColor,cursor:"pointer"})}function b(f){var e=d("#"+f.data.panelId).children("[href]").index(d(this));if(false===f.data.options.onHoverOut(f,d(this),e)){return}if(d(this).get(0)===d("#"+f.data.panelId).children("[href]").first().get(0)){d("#"+f.data.panelId+" .boxStart").css("background-position","-10px "+f.data.stepBg.split(" ")[1])}d(this).css({"background-position":parseInt(d(this).backgroundPosition().split(" ")[0])+"px "+f.data.stepBg.split(" ")[1],color:f.data.stepColor})}jQuery.fn.backgroundPosition=function(){var e=d(this).css("background-position");if(typeof(e)==="undefined"||(d.browser.msie&&parseInt(d.browser.version)==9)){return d(this).css("background-position-x")+" "+d(this).css("background-position-y")}else{return e.replace(/%/g,"px")}};jQuery.fn.processPanel=function(e){var f={kind:"stepByStep",style:"green-blue",firstSelected:true,icons:true,imgFolder:"img",chooseAgain:true,nextPrevButtons:true,nextPrevButtonsPosition:"bottom",nextButtonTitle:"Next step",prevButtonTitle:"Previous step",fadeSpeed:1000,event:"click",beforeLoad:function(){},onLoad:function(){},onOpen:function(){},afterOpen:function(){},onOpenPopup:function(){},onClosePopup:function(){},onHoverIn:function(){},onHoverOut:function(){}};var e=d.extend(f,e);this.getOptions=function(){return e};this.each(function(){e.beforeLoad();var m=d(this).attr("id");var q=d(this).children("[href]").length;var n=new Array();var j="";d(this).children("[href]").each(function(){if(d(this).attr("href").substr(0,1)!="#"){n.push(d(this).attr("href").split("#")[1]);j+="#"+d(this).attr("href").split("#")[1]+","}else{n.push(d(this).attr("href").substr(1));j+=d(this).attr("href")+","}});j=j.substr(0,j.length-1);d(this).children("[href]").first().before("<div class='boxStart boxStart-"+e.style+"'>&nbsp;</div>");var l,o,p,k,r,i;d(j).each(function(){d(this).addClass("content")});d(this).children("[href]").each(function(s){d(this).addClass("step step-"+e.style+" step"+(s+1));if(s==0){d(this).addClass("step"+(s+1)+"-"+e.style)}if(!e.icons){d(this).css("background-image","url('"+e.imgFolder+"/sprite_without_icons.png')")}if(s>0){d(this).css("padding-left",parseInt(d(this).css("padding-left"))+20+"px")}var t;if(s+1==q){t=-551+parseInt(d(this).css("width"))-580+parseInt(d(this).css("padding-left"))+"px "+d(this).backgroundPosition().split(" ")[1]}else{t=-551+parseInt(d(this).css("width"))-10+parseInt(d(this).css("padding-left"))+"px "+d(this).backgroundPosition().split(" ")[1]}d(this).css({"z-index":q-s,"background-position":t});if(s==0){r=d(this);l=d(this).backgroundPosition();o=d(this).css("color");d(this).css("margin-left","0px")}else{if(s==1){i=d(this);p=d(this).backgroundPosition();k=d(this).css("color")}}if(d(this).attr("label")!=undefined){d(this).append("<span class='stepLabel"+(s+1==q?"Last":"")+"'>"+d(this).attr("label")+"</span>")}});if(!e.firstSelected){r.css({"background-position":parseInt(r.backgroundPosition().split(" ")[0])+"px "+p.split(" ")[1],color:k});d("#"+m+" .boxStart").css("background-position","-10px "+p.split(" ")[1])}else{r.css("cursor","pointer")}if(e.kind=="stepByStep"){if(!e.firstSelected||e.chooseAgain){r.bind(e.event,{options:e,hoverBg:l,hoverColor:o,stepBg:p,stepColor:k,panelId:m,contentsSelector:j},a)}else{r.bind(e.event,function(s){s.preventDefault()})}if(!e.firstSelected){r.bind("mouseover",{options:e,hoverBg:l,hoverColor:o,panelId:m},c);r.bind("mouseout",{options:e,stepBg:p,stepColor:k,panelId:m},b)}else{i.bind("mouseover",{options:e,hoverBg:l,hoverColor:o},c);i.bind("mouseout",{options:e,stepBg:p,stepColor:k},b);i.bind(e.event,{options:e,hoverBg:l,hoverColor:o,stepBg:p,stepColor:k,panelId:m,contentsSelector:j},a)}}else{d(this).children("[href]").each(function(s){if(s>0||!e.firstSelected){d(this).bind("mouseover",{options:e,hoverBg:l,hoverColor:o,panelId:m},c);d(this).bind("mouseout",{options:e,stepBg:p,stepColor:k,panelId:m},b);d(this).bind(e.event,{options:e,panelId:m,contentsSelector:j},a)}else{if(!e.firstSelected||e.chooseAgain){d(this).bind(e.event,{options:e,panelId:m,contentsSelector:j},a)}else{d(this).bind(e.event,function(t){t.preventDefault()})}}})}d(j).each(function(s){if(!e.firstSelected||d(this).attr("id")!=n[0]){d(this).css("display","none")}else{if(d(this).attr("id")==n[0]&&e.nextPrevButtons){if(e.nextPrevButtonsPosition=="top"){d("#"+m).prepend("<div class='nextPrevButtons clearfix'><a xref='#' class='button inactiveButton' title='"+e.prevButtonTitle+"'>"+e.prevButtonTitle+"</a><a xref='"+i.attr("href")+"' class='button activeButton-"+e.style+"' title='"+e.nextButtonTitle+"'>"+e.nextButtonTitle+"</a></div>")}else{d("#"+m).append("<div class='nextPrevButtons clearfix'><a xref='#' class='button inactiveButton' title='"+e.prevButtonTitle+"'>"+e.prevButtonTitle+"</a><a xref='"+i.attr("href")+"' class='button activeButton-"+e.style+"' title='"+e.nextButtonTitle+"'>"+e.nextButtonTitle+"</a></div>")}}}});if(e.firstSelected&&r.attr("href")!=undefined&&r.attr("href").substr(0,1)!="#"&&r.attr("href")!=""){var h=r.attr("href").split("#")[0];var g=r.attr("href").split("#")[1];d.ajax({url:h,type:"post",async:false,success:function(s){d("#"+g).html(s)}})}d("#"+m+" .button[xref!='#']").live("click",function(s){s.preventDefault();d("#"+m+" [href="+d(this).attr("xref")+"]:not(.button)").trigger("mouseover").trigger("click")});d("[href=#"+m+"-popup]").click(function(u){var t=d(this).attr("href").substr(0,d(this).attr("href").length-6);if(false===e.onOpenPopup(u,d(this),d(t))){return}u.preventDefault();d(this).after("<div class='overlay'></div>");d(t).css({width:d(t).width()+"px","z-index":"101"});d(t).css("top",(d(window).height()-d(t).height())/2+d(window).scrollTop()+"px");d(t).css("left",(d(window).width()-d(t).width())/2+d(window).scrollLeft()+"px");d(t).css("display","block");d(".overlay").css({width:d(window).width()+"px",height:d(document).height()+300+"px",opacity:"0.7"});var v;var s=d(t).children("a").length;d(t).children("[href]").each(function(w){if(w+1==s){v=-551+parseInt(d(this).css("width"))-580+parseInt(d(this).css("padding-left"))+"px "+d(this).backgroundPosition().split(" ")[1]}else{v=-551+parseInt(d(this).css("width"))-10+parseInt(d(this).css("padding-left"))+"px "+d(this).backgroundPosition().split(" ")[1]}d(this).css("background-position",v)});d(t).css("opacity","0");d(t).animate({opacity:1},500,function(){if(jQuery.browser.msie){this.style.removeAttribute("filter")}});d(".overlay").click(function(w){if(false===e.onClosePopup(w,d(t))){return}d(t).animate({opacity:0},500,function(){d(this).css("display","none")});d(this).remove()});d(window).resize(function(){d(".overlay").css("height",d(document).height()+"px")})});e.onLoad()});return this};d(".inactiveButton").live("click",function(e){e.preventDefault()})})(jQuery);

/*
 * Poshy Tip jQuery plugin v1.1
 * http://vadikom.com/tools/poshy-tip-jquery-plugin-for-stylish-tooltips/
 * Copyright 2010-2011, Vasil Dinkov, http://vadikom.com/
 */
(function(e){var a=[],d=/^url\(["']?([^"'\)]*)["']?\);?$/i,c=/\.png$/i,b=e.browser.msie&&e.browser.version==6;function f(){e.each(a,function(){this.refresh(true)})}e(window).resize(f);e.Poshytip=function(h,g){this.$elm=e(h);this.opts=e.extend({},e.fn.poshytip.defaults,g);this.$tip=e(['<div class="',this.opts.className,'">','<div class="tip-inner tip-bg-image"></div>','<div class="tip-arrow tip-arrow-top tip-arrow-right tip-arrow-bottom tip-arrow-left"></div>',"</div>"].join("")).appendTo(document.body);this.$arrow=this.$tip.find("div.tip-arrow");this.$inner=this.$tip.find("div.tip-inner");this.disabled=false;this.content=null;this.init()};e.Poshytip.prototype={init:function(){a.push(this);var g=this.$elm.attr("title");this.$elm.data("title.poshytip",g!==undefined?g:null).data("poshytip",this);if(this.opts.showOn!="none"){this.$elm.bind({"mouseenter.poshytip":e.proxy(this.mouseenter,this),"mouseleave.poshytip":e.proxy(this.mouseleave,this)});switch(this.opts.showOn){case"hover":if(this.opts.alignTo=="cursor"){this.$elm.bind("mousemove.poshytip",e.proxy(this.mousemove,this))}if(this.opts.allowTipHover){this.$tip.hover(e.proxy(this.clearTimeouts,this),e.proxy(this.mouseleave,this))}break;case"focus":this.$elm.bind({"focus.poshytip":e.proxy(this.show,this),"blur.poshytip":e.proxy(this.hide,this)});break}}},mouseenter:function(g){if(this.disabled){return true}this.$elm.attr("title","");if(this.opts.showOn=="focus"){return true}this.clearTimeouts();this.showTimeout=setTimeout(e.proxy(this.show,this),this.opts.showTimeout)},mouseleave:function(g){if(this.disabled||this.asyncAnimating&&(this.$tip[0]===g.relatedTarget||jQuery.contains(this.$tip[0],g.relatedTarget))){return true}var h=this.$elm.data("title.poshytip");if(h!==null){this.$elm.attr("title",h)}if(this.opts.showOn=="focus"){return true}this.clearTimeouts();this.hideTimeout=setTimeout(e.proxy(this.hide,this),this.opts.hideTimeout)},mousemove:function(g){if(this.disabled){return true}this.eventX=g.pageX;this.eventY=g.pageY;if(this.opts.followCursor&&this.$tip.data("active")){this.calcPos();this.$tip.css({left:this.pos.l,top:this.pos.t});if(this.pos.arrow){this.$arrow[0].className="tip-arrow tip-arrow-"+this.pos.arrow}}},show:function(){if(this.disabled||this.$tip.data("active")){return}this.reset();this.update();this.display();if(this.opts.timeOnScreen){setTimeout(e.proxy(this.hide,this),this.opts.timeOnScreen)}},hide:function(){if(this.disabled||!this.$tip.data("active")){return}this.display(true)},reset:function(){this.$tip.queue([]).detach().css("visibility","hidden").data("active",false);this.$inner.find("*").poshytip("hide");if(this.opts.fade){this.$tip.css("opacity",this.opacity)}this.$arrow[0].className="tip-arrow tip-arrow-top tip-arrow-right tip-arrow-bottom tip-arrow-left";this.asyncAnimating=false},update:function(j,k){if(this.disabled){return}var i=j!==undefined;if(i){if(!k){this.opts.content=j}if(!this.$tip.data("active")){return}}else{j=this.opts.content}var h=this,g=typeof j=="function"?j.call(this.$elm[0],function(l){h.update(l)}):j=="[title]"?this.$elm.data("title.poshytip"):j;if(this.content!==g){this.$inner.empty().append(g);this.content=g}this.refresh(i)},refresh:function(h){if(this.disabled){return}if(h){if(!this.$tip.data("active")){return}var k={left:this.$tip.css("left"),top:this.$tip.css("top")}}this.$tip.css({left:0,top:0}).appendTo(document.body);if(this.opacity===undefined){this.opacity=this.$tip.css("opacity")}var l=this.$tip.css("background-image").match(d),m=this.$arrow.css("background-image").match(d);if(l){var i=c.test(l[1]);if(b&&i){this.$tip.css("background-image","none");this.$inner.css({margin:0,border:0,padding:0});l=i=false}else{this.$tip.prepend('<table border="0" cellpadding="0" cellspacing="0"><tr><td class="tip-top tip-bg-image" colspan="2"><span></span></td><td class="tip-right tip-bg-image" rowspan="2"><span></span></td></tr><tr><td class="tip-left tip-bg-image" rowspan="2"><span></span></td><td></td></tr><tr><td class="tip-bottom tip-bg-image" colspan="2"><span></span></td></tr></table>').css({border:0,padding:0,"background-image":"none","background-color":"transparent"}).find(".tip-bg-image").css("background-image",'url("'+l[1]+'")').end().find("td").eq(3).append(this.$inner)}if(i&&!e.support.opacity){this.opts.fade=false}}if(m&&!e.support.opacity){if(b&&c.test(m[1])){m=false;this.$arrow.css("background-image","none")}this.opts.fade=false}var o=this.$tip.find("table");if(b){this.$tip[0].style.width="";o.width("auto").find("td").eq(3).width("auto");var n=this.$tip.width(),j=parseInt(this.$tip.css("min-width")),g=parseInt(this.$tip.css("max-width"));if(!isNaN(j)&&n<j){n=j}else{if(!isNaN(g)&&n>g){n=g}}this.$tip.add(o).width(n).eq(0).find("td").eq(3).width("100%")}else{if(o[0]){o.width("auto").find("td").eq(3).width("auto").end().end().width(document.defaultView&&document.defaultView.getComputedStyle&&parseFloat(document.defaultView.getComputedStyle(this.$tip[0],null).width)||this.$tip.width()).find("td").eq(3).width("100%")}}this.tipOuterW=this.$tip.outerWidth();this.tipOuterH=this.$tip.outerHeight();this.calcPos();if(m&&this.pos.arrow){this.$arrow[0].className="tip-arrow tip-arrow-"+this.pos.arrow;this.$arrow.css("visibility","inherit")}if(h){this.asyncAnimating=true;var p=this;this.$tip.css(k).animate({left:this.pos.l,top:this.pos.t},200,function(){p.asyncAnimating=false})}else{this.$tip.css({left:this.pos.l,top:this.pos.t})}},display:function(h){var i=this.$tip.data("active");if(i&&!h||!i&&h){return}this.$tip.stop();if((this.opts.slide&&this.pos.arrow||this.opts.fade)&&(h&&this.opts.hideAniDuration||!h&&this.opts.showAniDuration)){var m={},l={};if(this.opts.slide&&this.pos.arrow){var k,g;if(this.pos.arrow=="bottom"||this.pos.arrow=="top"){k="top";g="bottom"}else{k="left";g="right"}var j=parseInt(this.$tip.css(k));m[k]=j+(h?0:(this.pos.arrow==g?-this.opts.slideOffset:this.opts.slideOffset));l[k]=j+(h?(this.pos.arrow==g?this.opts.slideOffset:-this.opts.slideOffset):0)+"px"}if(this.opts.fade){m.opacity=h?this.$tip.css("opacity"):0;l.opacity=h?0:this.opacity}this.$tip.css(m).animate(l,this.opts[h?"hideAniDuration":"showAniDuration"])}h?this.$tip.queue(e.proxy(this.reset,this)):this.$tip.css("visibility","inherit");this.$tip.data("active",!i)},disable:function(){this.reset();this.disabled=true},enable:function(){this.disabled=false},destroy:function(){this.reset();this.$tip.remove();delete this.$tip;this.content=null;this.$elm.unbind(".poshytip").removeData("title.poshytip").removeData("poshytip");a.splice(e.inArray(this,a),1)},clearTimeouts:function(){if(this.showTimeout){clearTimeout(this.showTimeout);this.showTimeout=0}if(this.hideTimeout){clearTimeout(this.hideTimeout);this.hideTimeout=0}},calcPos:function(){var n={l:0,t:0,arrow:""},h=e(window),k={l:h.scrollLeft(),t:h.scrollTop(),w:h.width(),h:h.height()},p,j,m,i,q,g;if(this.opts.alignTo=="cursor"){p=j=m=this.eventX;i=q=g=this.eventY}else{var o=this.$elm.offset(),l={l:o.left,t:o.top,w:this.$elm.outerWidth(),h:this.$elm.outerHeight()};p=l.l+(this.opts.alignX!="inner-right"?0:l.w);j=p+Math.floor(l.w/2);m=p+(this.opts.alignX!="inner-left"?l.w:0);i=l.t+(this.opts.alignY!="inner-bottom"?0:l.h);q=i+Math.floor(l.h/2);g=i+(this.opts.alignY!="inner-top"?l.h:0)}switch(this.opts.alignX){case"right":case"inner-left":n.l=m+this.opts.offsetX;if(n.l+this.tipOuterW>k.l+k.w){n.l=k.l+k.w-this.tipOuterW}if(this.opts.alignX=="right"||this.opts.alignY=="center"){n.arrow="left"}break;case"center":n.l=j-Math.floor(this.tipOuterW/2);if(n.l+this.tipOuterW>k.l+k.w){n.l=k.l+k.w-this.tipOuterW}else{if(n.l<k.l){n.l=k.l}}break;default:n.l=p-this.tipOuterW-this.opts.offsetX;if(n.l<k.l){n.l=k.l}if(this.opts.alignX=="left"||this.opts.alignY=="center"){n.arrow="right"}}switch(this.opts.alignY){case"bottom":case"inner-top":n.t=g+this.opts.offsetY;if(!n.arrow||this.opts.alignTo=="cursor"){n.arrow="top"}if(n.t+this.tipOuterH>k.t+k.h){n.t=i-this.tipOuterH-this.opts.offsetY;if(n.arrow=="top"){n.arrow="bottom"}}break;case"center":n.t=q-Math.floor(this.tipOuterH/2);if(n.t+this.tipOuterH>k.t+k.h){n.t=k.t+k.h-this.tipOuterH}else{if(n.t<k.t){n.t=k.t}}break;default:n.t=i-this.tipOuterH-this.opts.offsetY;if(!n.arrow||this.opts.alignTo=="cursor"){n.arrow="bottom"}if(n.t<k.t){n.t=g+this.opts.offsetY;if(n.arrow=="bottom"){n.arrow="top"}}}this.pos=n}};e.fn.poshytip=function(h){if(typeof h=="string"){var g=arguments,k=h;Array.prototype.shift.call(g);if(k=="destroy"){this.die("mouseenter.poshytip").die("focus.poshytip")}return this.each(function(){var l=e(this).data("poshytip");if(l&&l[k]){l[k].apply(l,g)}})}var i=e.extend({},e.fn.poshytip.defaults,h);if(!e("#poshytip-css-"+i.className)[0]){e(['<style id="poshytip-css-',i.className,'" type="text/css">',"div.",i.className,"{visibility:hidden;position:absolute;top:0;left:0;}","div.",i.className," table, div.",i.className," td{margin:0;font-family:inherit;font-size:inherit;font-weight:inherit;font-style:inherit;font-variant:inherit;}","div.",i.className," td.tip-bg-image span{display:block;font:1px/1px sans-serif;height:",i.bgImageFrameSize,"px;width:",i.bgImageFrameSize,"px;overflow:hidden;}","div.",i.className," td.tip-right{background-position:100% 0;}","div.",i.className," td.tip-bottom{background-position:100% 100%;}","div.",i.className," td.tip-left{background-position:0 100%;}","div.",i.className," div.tip-inner{background-position:-",i.bgImageFrameSize,"px -",i.bgImageFrameSize,"px;}","div.",i.className," div.tip-arrow{visibility:hidden;position:absolute;overflow:hidden;font:1px/1px sans-serif;}","</style>"].join("")).appendTo("head")}if(i.liveEvents&&i.showOn!="none"){var j=e.extend({},i,{liveEvents:false});switch(i.showOn){case"hover":this.live("mouseenter.poshytip",function(){var l=e(this);if(!l.data("poshytip")){l.poshytip(j).poshytip("mouseenter")}});break;case"focus":this.live("focus.poshytip",function(){var l=e(this);if(!l.data("poshytip")){l.poshytip(j).poshytip("show")}});break}return this}return this.each(function(){new e.Poshytip(this,i)})};e.fn.poshytip.defaults={content:"[title]",className:"tip-yellow",bgImageFrameSize:10,showTimeout:100,hideTimeout:0,timeOnScreen:0,showOn:"hover",liveEvents:true,alignTo:"cursor",alignX:"right",alignY:"top",offsetX:-22,offsetY:18,allowTipHover:true,followCursor:false,fade:true,slide:false,slideOffset:8,showAniDuration:100,hideAniDuration:100}})(jQuery);$(function(){$('.tooltip').poshytip({className:'tip-yellowsimple'});});

/*!
 * jQuery Cycle Plugin (with Transition Definitions)
 * Examples and documentation at: http://jquery.malsup.com/cycle/
 * Copyright (c) 2007-2010 M. Alsup
 * Version: 2.9999 (13-NOV-2011)
 * Dual licensed under the MIT and GPL licenses.
 * http://jquery.malsup.com/license.html
 * Requires: jQuery v1.3.2 or later
 */
(function(c,d){var b="2.9999";if(c.support==d){c.support={opacity:!(c.browser.msie)}}function g(t){c.fn.cycle.debug&&f(t)}function f(){window.console&&console.log&&console.log("[cycle] "+Array.prototype.join.call(arguments," "))}c.expr[":"].paused=function(t){return t.cyclePause};c.fn.cycle=function(u,t){var v={s:this.selector,c:this.context};if(this.length===0&&u!="stop"){if(!c.isReady&&v.s){f("DOM not ready, queuing slideshow");c(function(){c(v.s,v.c).cycle(u,t)});return this}f("terminating; zero elements found by selector"+(c.isReady?"":" (DOM not ready)"));return this}return this.each(function(){var z=l(this,u,t);if(z===false){return}z.updateActivePagerLink=z.updateActivePagerLink||c.fn.cycle.updateActivePagerLink;if(this.cycleTimeout){clearTimeout(this.cycleTimeout)}this.cycleTimeout=this.cyclePause=0;var A=c(this);var B=z.slideExpr?c(z.slideExpr,this):A.children();var x=B.get();var w=r(A,B,x,z,v);if(w===false){return}if(x.length<2){f("terminating; too few slides: "+x.length);return}var y=w.continuous?10:m(x[w.currSlide],x[w.nextSlide],w,!w.backwards);if(y){y+=(w.delay||0);if(y<10){y=10}g("first timeout: "+y);this.cycleTimeout=setTimeout(function(){n(x,w,0,!z.backwards)},y)}})};function k(t,w,v){var x=c(t).data("cycle.opts");var u=!!t.cyclePause;if(u&&x.paused){x.paused(t,x,w,v)}else{if(!u&&x.resumed){x.resumed(t,x,w,v)}}}function l(t,w,u){if(t.cycleStop==d){t.cycleStop=0}if(w===d||w===null){w={}}if(w.constructor==String){switch(w){case"destroy":case"stop":var y=c(t).data("cycle.opts");if(!y){return false}t.cycleStop++;if(t.cycleTimeout){clearTimeout(t.cycleTimeout)}t.cycleTimeout=0;y.elements&&c(y.elements).stop();c(t).removeData("cycle.opts");if(w=="destroy"){s(y)}return false;case"toggle":t.cyclePause=(t.cyclePause===1)?0:1;x(t.cyclePause,u,t);k(t);return false;case"pause":t.cyclePause=1;k(t);return false;case"resume":t.cyclePause=0;x(false,u,t);k(t);return false;case"prev":case"next":var y=c(t).data("cycle.opts");if(!y){f('options not found, "prev/next" ignored');return false}c.fn.cycle[w](y);return false;default:w={fx:w}}return w}else{if(w.constructor==Number){var v=w;w=c(t).data("cycle.opts");if(!w){f("options not found, can not advance slide");return false}if(v<0||v>=w.elements.length){f("invalid slide index: "+v);return false}w.nextSlide=v;if(t.cycleTimeout){clearTimeout(t.cycleTimeout);t.cycleTimeout=0}if(typeof u=="string"){w.oneTimeFx=u}n(w.elements,w,1,v>=w.currSlide);return false}}return w;function x(A,B,z){if(!A&&B===true){var C=c(z).data("cycle.opts");if(!C){f("options not found, can not resume");return false}if(z.cycleTimeout){clearTimeout(z.cycleTimeout);z.cycleTimeout=0}n(C.elements,C,1,!C.backwards)}}}function e(t,u){if(!c.support.opacity&&u.cleartype&&t.style.filter){try{t.style.removeAttribute("filter")}catch(v){}}}function s(t){if(t.next){c(t.next).unbind(t.prevNextEvent)}if(t.prev){c(t.prev).unbind(t.prevNextEvent)}if(t.pager||t.pagerAnchorBuilder){c.each(t.pagerAnchors||[],function(){this.unbind().remove()})}t.pagerAnchors=null;if(t.destroy){t.destroy(t)}}function r(D,R,A,z,K){var t;var I=c.extend({},c.fn.cycle.defaults,z||{},c.metadata?D.metadata():c.meta?D.data():{});var G=c.isFunction(D.data)?D.data(I.metaAttr):null;if(G){I=c.extend(I,G)}if(I.autostop){I.countdown=I.autostopCount||A.length}var v=D[0];D.data("cycle.opts",I);I.$cont=D;I.stopCount=v.cycleStop;I.elements=A;I.before=I.before?[I.before]:[];I.after=I.after?[I.after]:[];if(!c.support.opacity&&I.cleartype){I.after.push(function(){e(this,I)})}if(I.continuous){I.after.push(function(){n(A,I,0,!I.backwards)})}i(I);if(!c.support.opacity&&I.cleartype&&!I.cleartypeNoBg){a(R)}if(D.css("position")=="static"){D.css("position","relative")}if(I.width){D.width(I.width)}if(I.height&&I.height!="auto"){D.height(I.height)}if(I.startingSlide!=d){I.startingSlide=parseInt(I.startingSlide,10);if(I.startingSlide>=A.length||I.startSlide<0){I.startingSlide=0}else{t=true}}else{if(I.backwards){I.startingSlide=A.length-1}else{I.startingSlide=0}}if(I.random){I.randomMap=[];for(var P=0;P<A.length;P++){I.randomMap.push(P)}I.randomMap.sort(function(T,w){return Math.random()-0.5});if(t){for(var N=0;N<A.length;N++){if(I.startingSlide==I.randomMap[N]){I.randomIndex=N}}}else{I.randomIndex=1;I.startingSlide=I.randomMap[1]}}else{if(I.startingSlide>=A.length){I.startingSlide=0}}I.currSlide=I.startingSlide||0;var C=I.startingSlide;R.css({position:"absolute",top:0,left:0}).hide().each(function(w){var T;if(I.backwards){T=C?w<=C?A.length+(w-C):C-w:A.length-w}else{T=C?w>=C?A.length-(w-C):C-w:A.length-w}c(this).css("z-index",T)});c(A[C]).css("opacity",1).show();e(A[C],I);if(I.fit){if(!I.aspect){if(I.width){R.width(I.width)}if(I.height&&I.height!="auto"){R.height(I.height)}}else{R.each(function(){var T=c(this);var w=(I.aspect===true)?T.width()/T.height():I.aspect;if(I.width&&T.width()!=I.width){T.width(I.width);T.height(I.width/w)}if(I.height&&T.height()<I.height){T.height(I.height);T.width(I.height*w)}})}}if(I.center&&((!I.fit)||I.aspect)){R.each(function(){var w=c(this);w.css({"margin-left":I.width?((I.width-w.width())/2)+"px":0,"margin-top":I.height?((I.height-w.height())/2)+"px":0})})}if(I.center&&!I.fit&&!I.slideResize){R.each(function(){var w=c(this);w.css({"margin-left":I.width?((I.width-w.width())/2)+"px":0,"margin-top":I.height?((I.height-w.height())/2)+"px":0})})}var J=I.containerResize&&!D.innerHeight();if(J){var B=0,H=0;for(var M=0;M<A.length;M++){var u=c(A[M]),S=u[0],F=u.outerWidth(),Q=u.outerHeight();if(!F){F=S.offsetWidth||S.width||u.attr("width")}if(!Q){Q=S.offsetHeight||S.height||u.attr("height")}B=F>B?F:B;H=Q>H?Q:H}if(B>0&&H>0){D.css({width:B+"px",height:H+"px"})}}var y=false;if(I.pause){D.hover(function(){y=true;this.cyclePause++;k(v,true)},function(){y&&this.cyclePause--;k(v,true)})}if(o(I)===false){return false}var x=false;z.requeueAttempts=z.requeueAttempts||0;R.each(function(){var V=c(this);this.cycleH=(I.fit&&I.height)?I.height:(V.height()||this.offsetHeight||this.height||V.attr("height")||0);this.cycleW=(I.fit&&I.width)?I.width:(V.width()||this.offsetWidth||this.width||V.attr("width")||0);if(V.is("img")){var T=(c.browser.msie&&this.cycleW==28&&this.cycleH==30&&!this.complete);var W=(c.browser.mozilla&&this.cycleW==34&&this.cycleH==19&&!this.complete);var U=(c.browser.opera&&((this.cycleW==42&&this.cycleH==19)||(this.cycleW==37&&this.cycleH==17))&&!this.complete);var w=(this.cycleH==0&&this.cycleW==0&&!this.complete);if(T||W||U||w){if(K.s&&I.requeueOnImageNotLoaded&&++z.requeueAttempts<100){f(z.requeueAttempts," - img slide not loaded, requeuing slideshow: ",this.src,this.cycleW,this.cycleH);setTimeout(function(){c(K.s,K.c).cycle(z)},I.requeueTimeout);x=true;return false}else{f("could not determine size of image: "+this.src,this.cycleW,this.cycleH)}}}return true});if(x){return false}I.cssBefore=I.cssBefore||{};I.cssAfter=I.cssAfter||{};I.cssFirst=I.cssFirst||{};I.animIn=I.animIn||{};I.animOut=I.animOut||{};R.not(":eq("+C+")").css(I.cssBefore);c(R[C]).css(I.cssFirst);if(I.timeout){I.timeout=parseInt(I.timeout,10);if(I.speed.constructor==String){I.speed=c.fx.speeds[I.speed]||parseInt(I.speed,10)}if(!I.sync){I.speed=I.speed/2}var L=I.fx=="none"?0:I.fx=="shuffle"?500:250;while((I.timeout-I.speed)<L){I.timeout+=I.speed}}if(I.easing){I.easeIn=I.easeOut=I.easing}if(!I.speedIn){I.speedIn=I.speed}if(!I.speedOut){I.speedOut=I.speed}I.slideCount=A.length;I.currSlide=I.lastSlide=C;if(I.random){if(++I.randomIndex==A.length){I.randomIndex=0}I.nextSlide=I.randomMap[I.randomIndex]}else{if(I.backwards){I.nextSlide=I.startingSlide==0?(A.length-1):I.startingSlide-1}else{I.nextSlide=I.startingSlide>=(A.length-1)?0:I.startingSlide+1}}if(!I.multiFx){var O=c.fn.cycle.transitions[I.fx];if(c.isFunction(O)){O(D,R,I)}else{if(I.fx!="custom"&&!I.multiFx){f("unknown transition: "+I.fx,"; slideshow terminating");return false}}}var E=R[C];if(!I.skipInitializationCallbacks){if(I.before.length){I.before[0].apply(E,[E,E,I,true])}if(I.after.length){I.after[0].apply(E,[E,E,I,true])}}if(I.next){c(I.next).bind(I.prevNextEvent,function(){return h(I,1)})}if(I.prev){c(I.prev).bind(I.prevNextEvent,function(){return h(I,0)})}if(I.pager||I.pagerAnchorBuilder){q(A,I)}j(I,A);return I}function i(t){t.original={before:[],after:[]};t.original.cssBefore=c.extend({},t.cssBefore);t.original.cssAfter=c.extend({},t.cssAfter);t.original.animIn=c.extend({},t.animIn);t.original.animOut=c.extend({},t.animOut);c.each(t.before,function(){t.original.before.push(this)});c.each(t.after,function(){t.original.after.push(this)})}function o(z){var x,v,u=c.fn.cycle.transitions;if(z.fx.indexOf(",")>0){z.multiFx=true;z.fxs=z.fx.replace(/\s*/g,"").split(",");for(x=0;x<z.fxs.length;x++){var y=z.fxs[x];v=u[y];if(!v||!u.hasOwnProperty(y)||!c.isFunction(v)){f("discarding unknown transition: ",y);z.fxs.splice(x,1);x--}}if(!z.fxs.length){f("No valid transitions named; slideshow terminating.");return false}}else{if(z.fx=="all"){z.multiFx=true;z.fxs=[];for(p in u){v=u[p];if(u.hasOwnProperty(p)&&c.isFunction(v)){z.fxs.push(p)}}}}if(z.multiFx&&z.randomizeEffects){var w=Math.floor(Math.random()*20)+30;for(x=0;x<w;x++){var t=Math.floor(Math.random()*z.fxs.length);z.fxs.push(z.fxs.splice(t,1)[0])}g("randomized fx sequence: ",z.fxs)}return true}function j(u,t){u.addSlide=function(w,x){var v=c(w),y=v[0];if(!u.autostopCount){u.countdown++}t[x?"unshift":"push"](y);if(u.els){u.els[x?"unshift":"push"](y)}u.slideCount=t.length;if(u.random){u.randomMap.push(u.slideCount-1);u.randomMap.sort(function(A,z){return Math.random()-0.5})}v.css("position","absolute");v[x?"prependTo":"appendTo"](u.$cont);if(x){u.currSlide++;u.nextSlide++}if(!c.support.opacity&&u.cleartype&&!u.cleartypeNoBg){a(v)}if(u.fit&&u.width){v.width(u.width)}if(u.fit&&u.height&&u.height!="auto"){v.height(u.height)}y.cycleH=(u.fit&&u.height)?u.height:v.height();y.cycleW=(u.fit&&u.width)?u.width:v.width();v.css(u.cssBefore);if(u.pager||u.pagerAnchorBuilder){c.fn.cycle.createPagerAnchor(t.length-1,y,c(u.pager),t,u)}if(c.isFunction(u.onAddSlide)){u.onAddSlide(v)}else{v.hide()}}}c.fn.cycle.resetState=function(u,t){t=t||u.fx;u.before=[];u.after=[];u.cssBefore=c.extend({},u.original.cssBefore);u.cssAfter=c.extend({},u.original.cssAfter);u.animIn=c.extend({},u.original.animIn);u.animOut=c.extend({},u.original.animOut);u.fxFn=null;c.each(u.original.before,function(){u.before.push(this)});c.each(u.original.after,function(){u.after.push(this)});var v=c.fn.cycle.transitions[t];if(c.isFunction(v)){v(u.$cont,c(u.elements),u)}};function n(z,t,y,B){if(y&&t.busy&&t.manualTrump){g("manualTrump in go(), stopping active transition");c(z).stop(true,true);t.busy=0}if(t.busy){g("transition active, ignoring new tx request");return}var w=t.$cont[0],E=z[t.currSlide],C=z[t.nextSlide];if(w.cycleStop!=t.stopCount||w.cycleTimeout===0&&!y){return}if(!y&&!w.cyclePause&&!t.bounce&&((t.autostop&&(--t.countdown<=0))||(t.nowrap&&!t.random&&t.nextSlide<t.currSlide))){if(t.end){t.end(t)}return}var A=false;if((y||!w.cyclePause)&&(t.nextSlide!=t.currSlide)){A=true;var x=t.fx;E.cycleH=E.cycleH||c(E).height();E.cycleW=E.cycleW||c(E).width();C.cycleH=C.cycleH||c(C).height();C.cycleW=C.cycleW||c(C).width();if(t.multiFx){if(B&&(t.lastFx==d||++t.lastFx>=t.fxs.length)){t.lastFx=0}else{if(!B&&(t.lastFx==d||--t.lastFx<0)){t.lastFx=t.fxs.length-1}}x=t.fxs[t.lastFx]}if(t.oneTimeFx){x=t.oneTimeFx;t.oneTimeFx=null}c.fn.cycle.resetState(t,x);if(t.before.length){c.each(t.before,function(F,G){if(w.cycleStop!=t.stopCount){return}G.apply(C,[E,C,t,B])})}var u=function(){t.busy=0;c.each(t.after,function(F,G){if(w.cycleStop!=t.stopCount){return}G.apply(C,[E,C,t,B])});if(!w.cycleStop){D()}};g("tx firing("+x+"); currSlide: "+t.currSlide+"; nextSlide: "+t.nextSlide);t.busy=1;if(t.fxFn){t.fxFn(E,C,t,u,B,y&&t.fastOnEvent)}else{if(c.isFunction(c.fn.cycle[t.fx])){c.fn.cycle[t.fx](E,C,t,u,B,y&&t.fastOnEvent)}else{c.fn.cycle.custom(E,C,t,u,B,y&&t.fastOnEvent)}}}else{D()}if(A||t.nextSlide==t.currSlide){t.lastSlide=t.currSlide;if(t.random){t.currSlide=t.nextSlide;if(++t.randomIndex==z.length){t.randomIndex=0;t.randomMap.sort(function(G,F){return Math.random()-0.5})}t.nextSlide=t.randomMap[t.randomIndex];if(t.nextSlide==t.currSlide){t.nextSlide=(t.currSlide==t.slideCount-1)?0:t.currSlide+1}}else{if(t.backwards){var v=(t.nextSlide-1)<0;if(v&&t.bounce){t.backwards=!t.backwards;t.nextSlide=1;t.currSlide=0}else{t.nextSlide=v?(z.length-1):t.nextSlide-1;t.currSlide=v?0:t.nextSlide+1}}else{var v=(t.nextSlide+1)==z.length;if(v&&t.bounce){t.backwards=!t.backwards;t.nextSlide=z.length-2;t.currSlide=z.length-1}else{t.nextSlide=v?0:t.nextSlide+1;t.currSlide=v?z.length-1:t.nextSlide-1}}}}if(A&&t.pager){t.updateActivePagerLink(t.pager,t.currSlide,t.activePagerClass)}function D(){var F=0,G=t.timeout;if(t.timeout&&!t.continuous){F=m(z[t.currSlide],z[t.nextSlide],t,B);if(t.fx=="shuffle"){F-=t.speedOut}}else{if(t.continuous&&w.cyclePause){F=10}}if(F>0){w.cycleTimeout=setTimeout(function(){n(z,t,0,!t.backwards)},F)}}}c.fn.cycle.updateActivePagerLink=function(t,v,u){c(t).each(function(){c(this).children().removeClass(u).eq(v).addClass(u)})};function m(y,w,x,v){if(x.timeoutFn){var u=x.timeoutFn.call(y,y,w,x,v);while(x.fx!="none"&&(u-x.speed)<250){u+=x.speed}g("calculated timeout: "+u+"; speed: "+x.speed);if(u!==false){return u}}return x.timeout}c.fn.cycle.next=function(t){h(t,1)};c.fn.cycle.prev=function(t){h(t,0)};function h(w,v){var z=v?1:-1;var u=w.elements;var y=w.$cont[0],x=y.cycleTimeout;if(x){clearTimeout(x);y.cycleTimeout=0}if(w.random&&z<0){w.randomIndex--;if(--w.randomIndex==-2){w.randomIndex=u.length-2}else{if(w.randomIndex==-1){w.randomIndex=u.length-1}}w.nextSlide=w.randomMap[w.randomIndex]}else{if(w.random){w.nextSlide=w.randomMap[w.randomIndex]}else{w.nextSlide=w.currSlide+z;if(w.nextSlide<0){if(w.nowrap){return false}w.nextSlide=u.length-1}else{if(w.nextSlide>=u.length){if(w.nowrap){return false}w.nextSlide=0}}}}var t=w.onPrevNextEvent||w.prevNextClick;if(c.isFunction(t)){t(z>0,w.nextSlide,u[w.nextSlide])}n(u,w,1,v);return false}function q(u,v){var t=c(v.pager);c.each(u,function(w,x){c.fn.cycle.createPagerAnchor(w,x,t,u,v)});v.updateActivePagerLink(v.pager,v.startingSlide,v.activePagerClass)}c.fn.cycle.createPagerAnchor=function(y,v,A,x,u){var B;if(c.isFunction(u.pagerAnchorBuilder)){B=u.pagerAnchorBuilder(y,v);g("pagerAnchorBuilder("+y+", el) returned: "+B)}else{B='<a href="#">'+(y+1)+"</a>"}if(!B){return}var w=c(B);if(w.parents("body").length===0){var z=[];if(A.length>1){A.each(function(){var E=w.clone(true);c(this).append(E);z.push(E[0])});w=c(z)}else{w.appendTo(A)}}u.pagerAnchors=u.pagerAnchors||[];u.pagerAnchors.push(w);var C=function(H){H.preventDefault();u.nextSlide=y;var G=u.$cont[0],F=G.cycleTimeout;if(F){clearTimeout(F);G.cycleTimeout=0}var E=u.onPagerEvent||u.pagerClick;if(c.isFunction(E)){E(u.nextSlide,x[u.nextSlide])}n(x,u,1,u.currSlide<y)};if(/mouseenter|mouseover/i.test(u.pagerEvent)){w.hover(C,function(){})}else{w.bind(u.pagerEvent,C)}if(!/^click/.test(u.pagerEvent)&&!u.allowPagerClickBubble){w.bind("click.cycle",function(){return false})}var D=u.$cont[0];var t=false;if(u.pauseOnPagerHover){w.hover(function(){t=true;D.cyclePause++;k(D,true,true)},function(){t&&D.cyclePause--;k(D,true,true)})}};c.fn.cycle.hopsFromLast=function(w,v){var u,t=w.lastSlide,x=w.currSlide;if(v){u=x>t?x-t:w.slideCount-t}else{u=x<t?t-x:t+w.slideCount-x}return u};function a(v){g("applying clearType background-color hack");function u(w){w=parseInt(w,10).toString(16);return w.length<2?"0"+w:w}function t(y){for(;y&&y.nodeName.toLowerCase()!="html";y=y.parentNode){var w=c.css(y,"background-color");if(w&&w.indexOf("rgb")>=0){var x=w.match(/\d+/g);return"#"+u(x[0])+u(x[1])+u(x[2])}if(w&&w!="transparent"){return w}}return"#ffffff"}v.each(function(){c(this).css("background-color",t(this))})}c.fn.cycle.commonReset=function(z,x,y,u,v,t){c(y.elements).not(z).hide();if(typeof y.cssBefore.opacity=="undefined"){y.cssBefore.opacity=1}y.cssBefore.display="block";if(y.slideResize&&u!==false&&x.cycleW>0){y.cssBefore.width=x.cycleW}if(y.slideResize&&v!==false&&x.cycleH>0){y.cssBefore.height=x.cycleH}y.cssAfter=y.cssAfter||{};y.cssAfter.display="none";c(z).css("zIndex",y.slideCount+(t===true?1:0));c(x).css("zIndex",y.slideCount+(t===true?0:1))};c.fn.cycle.custom=function(F,z,t,w,y,u){var E=c(F),A=c(z);var v=t.speedIn,D=t.speedOut,x=t.easeIn,C=t.easeOut;A.css(t.cssBefore);if(u){if(typeof u=="number"){v=D=u}else{v=D=1}x=C=null}var B=function(){A.animate(t.animIn,v,x,function(){w()})};E.animate(t.animOut,D,C,function(){E.css(t.cssAfter);if(!t.sync){B()}});if(t.sync){B()}};c.fn.cycle.transitions={fade:function(u,v,t){v.not(":eq("+t.currSlide+")").css("opacity",0);t.before.push(function(y,w,x){c.fn.cycle.commonReset(y,w,x);x.cssBefore.opacity=0});t.animIn={opacity:1};t.animOut={opacity:0};t.cssBefore={top:0,left:0}}};c.fn.cycle.ver=function(){return b};c.fn.cycle.defaults={activePagerClass:"activeSlide",after:null,allowPagerClickBubble:false,animIn:null,animOut:null,aspect:false,autostop:0,autostopCount:0,backwards:false,before:null,center:null,cleartype:!c.support.opacity,cleartypeNoBg:false,containerResize:1,continuous:0,cssAfter:null,cssBefore:null,delay:0,easeIn:null,easeOut:null,easing:null,end:null,fastOnEvent:0,fit:0,fx:"fade",fxFn:null,height:"auto",manualTrump:true,metaAttr:"cycle",next:null,nowrap:0,onPagerEvent:null,onPrevNextEvent:null,pager:null,pagerAnchorBuilder:null,pagerEvent:"click.cycle",pause:0,pauseOnPagerHover:0,prev:null,prevNextEvent:"click.cycle",random:0,randomizeEffects:1,requeueOnImageNotLoaded:true,requeueTimeout:250,rev:0,shuffle:null,skipInitializationCallbacks:false,slideExpr:null,slideResize:1,speed:1000,speedIn:null,speedOut:null,startingSlide:d,sync:1,timeout:4000,timeoutFn:null,updateActivePagerLink:null,width:null}})(jQuery);
/*!
 * jQuery Cycle Plugin Transition Definitions
 * This script is a plugin for the jQuery Cycle Plugin
 * Examples and documentation at: http://malsup.com/jquery/cycle/
 * Copyright (c) 2007-2010 M. Alsup
 * Version:	 2.73
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 */
(function(a){a.fn.cycle.transitions.none=function(c,d,b){b.fxFn=function(g,e,f,h){a(e).show();a(g).hide();h()}};a.fn.cycle.transitions.fadeout=function(c,d,b){d.not(":eq("+b.currSlide+")").css({display:"block",opacity:1});b.before.push(function(k,i,j,f,g,e){a(k).css("zIndex",j.slideCount+(!e===true?1:0));a(i).css("zIndex",j.slideCount+(!e===true?0:1))});b.animIn.opacity=1;b.animOut.opacity=0;b.cssBefore.opacity=1;b.cssBefore.display="block";b.cssAfter.zIndex=0};a.fn.cycle.transitions.scrollUp=function(d,e,c){d.css("overflow","hidden");c.before.push(a.fn.cycle.commonReset);var b=d.height();c.cssBefore.top=b;c.cssBefore.left=0;c.cssFirst.top=0;c.animIn.top=0;c.animOut.top=-b};a.fn.cycle.transitions.scrollDown=function(d,e,c){d.css("overflow","hidden");c.before.push(a.fn.cycle.commonReset);var b=d.height();c.cssFirst.top=0;c.cssBefore.top=-b;c.cssBefore.left=0;c.animIn.top=0;c.animOut.top=b};a.fn.cycle.transitions.scrollLeft=function(d,e,c){d.css("overflow","hidden");c.before.push(a.fn.cycle.commonReset);var b=d.width();c.cssFirst.left=0;c.cssBefore.left=b;c.cssBefore.top=0;c.animIn.left=0;c.animOut.left=0-b};a.fn.cycle.transitions.scrollRight=function(d,e,c){d.css("overflow","hidden");c.before.push(a.fn.cycle.commonReset);var b=d.width();c.cssFirst.left=0;c.cssBefore.left=-b;c.cssBefore.top=0;c.animIn.left=0;c.animOut.left=b};a.fn.cycle.transitions.scrollHorz=function(c,d,b){c.css("overflow","hidden").width();b.before.push(function(h,f,g,e){if(g.rev){e=!e}a.fn.cycle.commonReset(h,f,g);g.cssBefore.left=e?(f.cycleW-1):(1-f.cycleW);g.animOut.left=e?-h.cycleW:h.cycleW});b.cssFirst.left=0;b.cssBefore.top=0;b.animIn.left=0;b.animOut.top=0};a.fn.cycle.transitions.scrollVert=function(c,d,b){c.css("overflow","hidden");b.before.push(function(h,f,g,e){if(g.rev){e=!e}a.fn.cycle.commonReset(h,f,g);g.cssBefore.top=e?(1-f.cycleH):(f.cycleH-1);g.animOut.top=e?h.cycleH:-h.cycleH});b.cssFirst.top=0;b.cssBefore.left=0;b.animIn.top=0;b.animOut.left=0};a.fn.cycle.transitions.slideX=function(c,d,b){b.before.push(function(g,e,f){a(f.elements).not(g).hide();a.fn.cycle.commonReset(g,e,f,false,true);f.animIn.width=e.cycleW});b.cssBefore.left=0;b.cssBefore.top=0;b.cssBefore.width=0;b.animIn.width="show";b.animOut.width=0};a.fn.cycle.transitions.slideY=function(c,d,b){b.before.push(function(g,e,f){a(f.elements).not(g).hide();a.fn.cycle.commonReset(g,e,f,true,false);f.animIn.height=e.cycleH});b.cssBefore.left=0;b.cssBefore.top=0;b.cssBefore.height=0;b.animIn.height="show";b.animOut.height=0};a.fn.cycle.transitions.shuffle=function(e,f,d){var c,b=e.css("overflow","visible").width();f.css({left:0,top:0});d.before.push(function(i,g,h){a.fn.cycle.commonReset(i,g,h,true,true,true)});if(!d.speedAdjusted){d.speed=d.speed/2;d.speedAdjusted=true}d.random=0;d.shuffle=d.shuffle||{left:-b,top:15};d.els=[];for(c=0;c<f.length;c++){d.els.push(f[c])}for(c=0;c<d.currSlide;c++){d.els.push(d.els.shift())}d.fxFn=function(m,j,l,g,i){if(l.rev){i=!i}var h=i?a(m):a(j);a(j).css(l.cssBefore);var k=l.slideCount;h.animate(l.shuffle,l.speedIn,l.easeIn,function(){var o=a.fn.cycle.hopsFromLast(l,i);for(var q=0;q<o;q++){i?l.els.push(l.els.shift()):l.els.unshift(l.els.pop())}if(i){for(var r=0,n=l.els.length;r<n;r++){a(l.els[r]).css("z-index",n-r+k)}}else{var s=a(m).css("z-index");h.css("z-index",parseInt(s,10)+1+k)}h.animate({left:0,top:0},l.speedOut,l.easeOut,function(){a(i?this:m).hide();if(g){g()}})})};a.extend(d.cssBefore,{display:"block",opacity:1,top:0,left:0})};a.fn.cycle.transitions.turnUp=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,true,false);f.cssBefore.top=e.cycleH;f.animIn.height=e.cycleH;f.animOut.width=e.cycleW});b.cssFirst.top=0;b.cssBefore.left=0;b.cssBefore.height=0;b.animIn.top=0;b.animOut.height=0};a.fn.cycle.transitions.turnDown=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,true,false);f.animIn.height=e.cycleH;f.animOut.top=g.cycleH});b.cssFirst.top=0;b.cssBefore.left=0;b.cssBefore.top=0;b.cssBefore.height=0;b.animOut.height=0};a.fn.cycle.transitions.turnLeft=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,false,true);f.cssBefore.left=e.cycleW;f.animIn.width=e.cycleW});b.cssBefore.top=0;b.cssBefore.width=0;b.animIn.left=0;b.animOut.width=0};a.fn.cycle.transitions.turnRight=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,false,true);f.animIn.width=e.cycleW;f.animOut.left=g.cycleW});a.extend(b.cssBefore,{top:0,left:0,width:0});b.animIn.left=0;b.animOut.width=0};a.fn.cycle.transitions.zoom=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,false,false,true);f.cssBefore.top=e.cycleH/2;f.cssBefore.left=e.cycleW/2;a.extend(f.animIn,{top:0,left:0,width:e.cycleW,height:e.cycleH});a.extend(f.animOut,{width:0,height:0,top:g.cycleH/2,left:g.cycleW/2})});b.cssFirst.top=0;b.cssFirst.left=0;b.cssBefore.width=0;b.cssBefore.height=0};a.fn.cycle.transitions.fadeZoom=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,false,false);f.cssBefore.left=e.cycleW/2;f.cssBefore.top=e.cycleH/2;a.extend(f.animIn,{top:0,left:0,width:e.cycleW,height:e.cycleH})});b.cssBefore.width=0;b.cssBefore.height=0;b.animOut.opacity=0};a.fn.cycle.transitions.blindX=function(d,e,c){var b=d.css("overflow","hidden").width();c.before.push(function(h,f,g){a.fn.cycle.commonReset(h,f,g);g.animIn.width=f.cycleW;g.animOut.left=h.cycleW});c.cssBefore.left=b;c.cssBefore.top=0;c.animIn.left=0;c.animOut.left=b};a.fn.cycle.transitions.blindY=function(d,e,c){var b=d.css("overflow","hidden").height();c.before.push(function(h,f,g){a.fn.cycle.commonReset(h,f,g);g.animIn.height=f.cycleH;g.animOut.top=h.cycleH});c.cssBefore.top=b;c.cssBefore.left=0;c.animIn.top=0;c.animOut.top=b};a.fn.cycle.transitions.blindZ=function(e,f,d){var c=e.css("overflow","hidden").height();var b=e.width();d.before.push(function(i,g,h){a.fn.cycle.commonReset(i,g,h);h.animIn.height=g.cycleH;h.animOut.top=i.cycleH});d.cssBefore.top=c;d.cssBefore.left=b;d.animIn.top=0;d.animIn.left=0;d.animOut.top=c;d.animOut.left=b};a.fn.cycle.transitions.growX=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,false,true);f.cssBefore.left=this.cycleW/2;f.animIn.left=0;f.animIn.width=this.cycleW;f.animOut.left=0});b.cssBefore.top=0;b.cssBefore.width=0};a.fn.cycle.transitions.growY=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,true,false);f.cssBefore.top=this.cycleH/2;f.animIn.top=0;f.animIn.height=this.cycleH;f.animOut.top=0});b.cssBefore.height=0;b.cssBefore.left=0};a.fn.cycle.transitions.curtainX=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,false,true,true);f.cssBefore.left=e.cycleW/2;f.animIn.left=0;f.animIn.width=this.cycleW;f.animOut.left=g.cycleW/2;f.animOut.width=0});b.cssBefore.top=0;b.cssBefore.width=0};a.fn.cycle.transitions.curtainY=function(c,d,b){b.before.push(function(g,e,f){a.fn.cycle.commonReset(g,e,f,true,false,true);f.cssBefore.top=e.cycleH/2;f.animIn.top=0;f.animIn.height=e.cycleH;f.animOut.top=g.cycleH/2;f.animOut.height=0});b.cssBefore.height=0;b.cssBefore.left=0};a.fn.cycle.transitions.cover=function(f,g,e){var i=e.direction||"left";var b=f.css("overflow","hidden").width();var c=f.height();e.before.push(function(j,d,h){a.fn.cycle.commonReset(j,d,h);if(i=="right"){h.cssBefore.left=-b}else{if(i=="up"){h.cssBefore.top=c}else{if(i=="down"){h.cssBefore.top=-c}else{h.cssBefore.left=b}}}});e.animIn.left=0;e.animIn.top=0;e.cssBefore.top=0;e.cssBefore.left=0};a.fn.cycle.transitions.uncover=function(f,g,e){var i=e.direction||"left";var b=f.css("overflow","hidden").width();var c=f.height();e.before.push(function(j,d,h){a.fn.cycle.commonReset(j,d,h,true,true,true);if(i=="right"){h.animOut.left=b}else{if(i=="up"){h.animOut.top=-c}else{if(i=="down"){h.animOut.top=c}else{h.animOut.left=-b}}}});e.animIn.left=0;e.animIn.top=0;e.cssBefore.top=0;e.cssBefore.left=0};a.fn.cycle.transitions.toss=function(e,f,d){var b=e.css("overflow","visible").width();var c=e.height();d.before.push(function(i,g,h){a.fn.cycle.commonReset(i,g,h,true,true,true);if(!h.animOut.left&&!h.animOut.top){a.extend(h.animOut,{left:b*2,top:-c/2,opacity:0})}else{h.animOut.opacity=0}});d.cssBefore.left=0;d.cssBefore.top=0;d.animIn.left=0};a.fn.cycle.transitions.wipe=function(s,m,e){var q=s.css("overflow","hidden").width();var j=s.height();e.cssBefore=e.cssBefore||{};var g;if(e.clip){if(/l2r/.test(e.clip)){g="rect(0px 0px "+j+"px 0px)"}else{if(/r2l/.test(e.clip)){g="rect(0px "+q+"px "+j+"px "+q+"px)"}else{if(/t2b/.test(e.clip)){g="rect(0px "+q+"px 0px 0px)"}else{if(/b2t/.test(e.clip)){g="rect("+j+"px "+q+"px "+j+"px 0px)"}else{if(/zoom/.test(e.clip)){var o=parseInt(j/2,10);var f=parseInt(q/2,10);g="rect("+o+"px "+f+"px "+o+"px "+f+"px)"}}}}}}e.cssBefore.clip=e.cssBefore.clip||g||"rect(0px 0px 0px 0px)";var k=e.cssBefore.clip.match(/(\d+)/g);var u=parseInt(k[0],10),c=parseInt(k[1],10),n=parseInt(k[2],10),i=parseInt(k[3],10);e.before.push(function(w,h,t){if(w==h){return}var d=a(w),b=a(h);a.fn.cycle.commonReset(w,h,t,true,true,false);t.cssAfter.display="block";var r=1,l=parseInt((t.speedIn/13),10)-1;(function v(){var y=u?u-parseInt(r*(u/l),10):0;var z=i?i-parseInt(r*(i/l),10):0;var A=n<j?n+parseInt(r*((j-n)/l||1),10):j;var x=c<q?c+parseInt(r*((q-c)/l||1),10):q;b.css({clip:"rect("+y+"px "+x+"px "+A+"px "+z+"px)"});(r++<=l)?setTimeout(v,13):d.css("display","none")})()});a.extend(e.cssBefore,{display:"block",opacity:1,top:0,left:0});e.animIn={left:0};e.animOut={left:0}}})(jQuery);

/*!
* Pirobox
*
*/
(function(a){a.fn.piroBox_ext=function(b){b=jQuery.extend({piro_speed:700,bg_alpha:0.9,piro_scroll:true},b);a.fn.piroFadeIn=function(i,x){a(this).fadeIn(i,function(){if(jQuery.browser.msie){a(this).get(0).style.removeAttribute("filter")}if(x!=undefined){x()}})};a.fn.piroFadeOut=function(i,x){a(this).fadeOut(i,function(){if(jQuery.browser.msie){a(this).get(0).style.removeAttribute("filter")}if(x!=undefined){x()}})};var D=a('a[class*="pirobox"]');var u=new Object();for(var C=0;C<D.length;C++){var f=a(D[C]);u["a."+f.attr("class").match(/^pirobox_gall\w*/)]=0}var n=new Array();for(var z in u){n.push(z)}for(var C=0;C<n.length;C++){a(n[C]+":first").addClass("first");a(n[C]+":last").addClass("last")}var k=a(D);a('a[class*="pirobox_gall"]').each(function(i){this.rev=i+0});var B=('<div class="piro_overlay"></div><table class="piro_html"  cellpadding="0" cellspacing="0"><tr><td class="h_t_l"></td><td class="h_t_c" title="drag me!!"></td><td class="h_t_r"></td></tr><tr><td class="h_c_l"></td><td class="h_c_c"><div class="piro_loader" title="close"><span></span></div><div class="resize"><div class="nav_container"><a href="#prev" class="piro_prev" title="previous"></a><a href="#next" class="piro_next" title="next"></a><div class="piro_prev_fake">prev</div><div class="piro_next_fake">next</div><div class="piro_close" title="close"></div></div><div class="caption"></div><div class="description"></div><div class="div_reg"></div></div></td><td class="h_c_r"></td></tr><tr><td class="h_b_l"></td><td class="h_b_c"></td><td class="h_b_r"></td></tr></table>');a("body").append(B);var g=a(".piro_html"),v=a(".caption"),z=a(".description"),d=a(".piro_overlay"),j=a(".piro_next"),h=a(".piro_prev"),A=a(".piro_next_fake"),r=a(".piro_prev_fake"),t=a(".piro_close"),c=a(".div_reg"),p=a(".piro_loader"),q=a(".resize"),s=a(".btn_info");var m=0.95;if(a.browser.msie){g.draggable({handle:".h_t_c,.h_b_c,.div_reg img"})}else{g.draggable({handle:".h_t_c,.h_b_c,.div_reg img",opacity:0.8})}var l=a(window).height();var o=a(window).width();a(".nav_container").hide();g.css({left:((o/2)-(250))+"px",top:parseInt(a(document).scrollTop())+(100)});a(g).add(v).add(d).hide();d.css({opacity:b.bg_alpha});a(h).add(j).bind("click",function(i){a(".nav_container").hide();i.preventDefault();j.add(h).hide();var x=parseInt(a('a[class*="pirobox_gall"]').filter(".item").attr("rev"));var y=a(this).is(".piro_prev")?a('a[class*="pirobox_gall"]').eq(x-1):a('a[class*="pirobox_gall"]').eq(x+1);y.click()});a("html").bind("keyup",function(i){if(i.keyCode==27){i.preventDefault();if(a(t).is(":visible")){w()}}});a("html").bind("keyup",function(i){if(a(".item").is(".first")){}else{if(i.keyCode==37){i.preventDefault();if(a(t).is(":visible")){h.click()}}}});a("html").bind("keyup",function(i){if(a(".item").is(".last")){}else{if(i.keyCode==39){i.preventDefault();if(a(t).is(":visible")){j.click()}}}});a(window).resize(function(){var y=a(window).height();var E=a(window).width();var x=g.height();var i=g.width();g.css({left:((E/2)-(i/2))+"px",top:parseInt(a(document).scrollTop())+(y-x)/2})});function e(){a(window).scroll(function(){var y=a(window).height();var E=a(window).width();var x=g.height();var i=g.width();g.css({left:((E/2)-(i/2))+"px",top:parseInt(a(document).scrollTop())+(y-x)/2})})}if(b.piro_scroll==true){e()}a(k).each(function(){var i=a(this).children().attr("alt");var x=a(this).attr("title");var y=a(this).attr("rel").split("-");var E=a(this).attr("href");a(this).unbind();a(this).bind("click",function(G){d.css({opacity:b.bg_alpha});G.preventDefault();j.add(h).hide().css("visibility","hidden");a(k).filter(".item").removeClass("item");a(this).addClass("item");F();if(a(this).is(".first")){h.hide();j.show();r.show().css({opacity:0.5,visibility:"hidden"})}else{j.add(h).show();A.add(r).hide()}if(a(this).is(".last")){h.show();A.show().css({opacity:0.5,visibility:"hidden"});j.hide()}if(a(this).is(".pirobox")){j.add(h).hide()}});function F(){g.add(d).add(c).add(p).show();function G(){if(y[1]=="full"&&y[2]=="full"){y[2]=a(window).height()-70;y[1]=a(window).width()-55}var J=a(window).height();var I=a(window).width();t.hide();c.add(q).animate({height:+(y[2])+"px",width:+(y[1])+"px"},b.piro_speed).css("visibility","visible");g.animate({height:+(y[2])+20+"px",width:+(y[1])+20+"px",left:((I/2)-((y[1])/2+10))+"px",top:parseInt(a(document).scrollTop())+(J-y[2])/2-10},b.piro_speed,function(){j.add(h).css({height:"20px",width:"20px"});j.add(h).add(r).add(A).css("visibility","visible");a(".nav_container").show();t.show()})}function H(){var I=new Image();I.onerror=function(){v.html("");z.html("");I.src=SITEURL+"/assets/pirobox/js/error.jpg"};I.onload=function(){v.add(s).hide();var M=a(window).height();var N=a(window).width();var L=I.height;var K=I.width;if(L+20>M||K+20>N){var J=(K+20)/N;var O=(L+20)/M;if(O>J){K=Math.round(I.width*(m/O));L=Math.round(I.height*(m/O))}else{K=Math.round(I.width*(m/J));L=Math.round(I.height*(m/J))}}else{L=I.height;K=I.width}var M=a(window).height();var N=a(window).width();a(I).height(L).width(K).hide();a(I).fadeOut(300,function(){});a(".div_reg img").remove();a(".div_reg").html("");c.append(I).show();a(I).addClass("immagine");c.add(q).animate({height:L+"px",width:K+"px"},b.piro_speed);g.animate({height:(L+20)+"px",width:(K+20)+"px",left:((N/2)-((K+20)/2))+"px",top:parseInt(a(document).scrollTop())+(M-L)/2-20},b.piro_speed,function(){var P=q.width();v.css({width:P+"px"});p.hide();a(I).fadeIn(300,function(){t.add(s).show();v.slideDown(200);j.add(h).css({height:"20px",width:"20px"});j.add(h).add(r).add(A).css("visibility","visible");a(".nav_container").show();q.resize(function(){NimgW=I.width;NimgH=I.heigh;v.css({width:(NimgW)+"px"})})})})};I.src=E;p.click(function(){I.src="about:blank"})}switch(y[0]){case"iframe":c.html("").css("overflow","hidden");q.css("overflow","hidden");t.add(s).add(v).hide();G();c.piroFadeIn(300,function(){c.append('<iframe id="my_frame" class="my_frame" src="'+E+'" frameborder="0" allowtransparency="true" scrolling="auto" align="top"></iframe>');a(".my_frame").css({height:+(y[2])+"px",width:+(y[1])+"px"});p.hide()});break;case"content":c.html("").css("overflow","auto");q.css("overflow","auto");a(".my_frame").remove();t.add(s).add(v).hide();G();c.piroFadeIn(300,function(){c.load(E);p.hide()});break;case"inline":c.html("").css("overflow","auto");q.css("overflow","auto");a(".my_frame").remove();t.add(s).add(v).hide();G();c.piroFadeIn(300,function(){a(E).clone(true).appendTo(c).piroFadeIn(300);p.hide()});break;case"gallery":c.css("overflow","hidden");q.css("overflow","hidden");a(".my_frame").remove();t.add(s).add(v).hide();if(i==""){v.html("")}else{v.html("<p>"+i+"</p>")}if(x==""){z.html("")}else{z.html("<p>"+x+"</p>")}H();break;case"single":t.add(s).add(v).hide();c.html("").css("overflow","hidden");q.css("overflow","hidden");a(".my_frame").remove();if(x==""){z.html("")}else{z.html("<p>"+x+"</p>")}H();break}}});a(".immagine").live("click",function(){v.slideToggle(200)});function w(){if(a(".piro_close").is(":visible")){a(".my_frame").remove();g.add(c).add(q).stop();var i=g;if(a.browser.msie){i=c.add(d);a(".div_reg img").remove()}else{i=g.add(d)}i.piroFadeOut(200,function(){c.html("");p.add(v).add(s).hide();a(".nav_container").hide();d.add(g).hide().css("visibility","visible")})}}t.add(p).add(d).bind("click",function(i){i.preventDefault();w()})}})(jQuery);

/*!
* Ajax Process
*
*/
jQuery.ajaxy=(function(){var b={base:"",homepage:"index.html",anchorFilter:function(){return !/.(pdf|jpe?g|gif|png|bmp|tif|txt)$/.test(this.href)},update:["#wrap","title","h1"],updateHandler:{"#wrap":function(j){jQuery(this).animate({height:"hide",opacity:0},function(){jQuery(this).html(j).animate({height:"show",opacity:1})})}},initialStyles:"h1{visibility:hidden;} #wrap{height:0;opacity:0;overflow:hidden;}",loader:{css:{position:"absolute",background:"#FFF url(img/loaders/2.gif) no-repeat center",MozBorderRadius:4,WebkitBorderRadius:4,padding:"5px",fontSize:".8em",opacity:0,top:jQuery("#menu").offset().top,right:15,height:16,width:16},html:"",attr:{},init:function(j){j.appendTo("#wrapper");jQuery(document).ready(function(){j.css({top:jQuery("#menu").position().top+7})})},show:function(j,k){j.stop(true).animate({opacity:1})},hide:function(j){j.animate({opacity:0})}},errorHandler:function(j){if(j.status===404){$("#wrap").html("<p><strong>404 Page Not Found</strong></p>");b.loader.hide(i.loader)}},autoInit:true,cache:false},a=false,g=jQuery("head")[0],d=document.body,e={isExternal:function(j){return !RegExp("^"+location.href.match(/.+?\/(?=[^\/])/)[0]+location.hostname).test(j)},hash:{bind:function(j){jQuery.historyInit(j)},load:function(j){return jQuery.historyLoad(j)}}};function c(j){arguments[0]="[AJAXY] "+j;return window.console&&console.log&&console.log.apply(console,arguments)}jQuery.extend({historyCurrentHash:undefined,historyCallback:undefined,historyIframeSrc:undefined,historyNeedIframe:jQuery.browser.msie&&(jQuery.browser.version<8||document.documentMode<8),historyInit:function(l,m){jQuery.historyCallback=l;if(m){jQuery.historyIframeSrc=m}var n=location.hash.replace(/\?.*$/,"");jQuery.historyCurrentHash=n;if(jQuery.historyNeedIframe){if(jQuery.historyCurrentHash==""){jQuery.historyCurrentHash="#"}jQuery("body").prepend('<iframe id="jQuery_history" style="display: none;" src="javascript:false;"></iframe>');var k=jQuery("#jQuery_history")[0];var j=k.contentWindow.document;j.open();j.close();j.location.hash=n}else{if(jQuery.browser.safari){jQuery.historyBackStack=[];jQuery.historyBackStack.length=history.length;jQuery.historyForwardStack=[];jQuery.lastHistoryLength=history.length;jQuery.isFirst=true}}if(n){jQuery.historyCallback(n.replace(/^#/,""))}setInterval(jQuery.historyCheck,100)},historyAddHistory:function(j){jQuery.historyBackStack.push(j);jQuery.historyForwardStack.length=0;this.isFirst=true},historyCheck:function(){if(jQuery.historyNeedIframe){var k=jQuery("#jQuery_history")[0];var n=k.contentDocument||k.contentWindow.document;var l=n.location.hash.replace(/\?.*$/,"");if(l!=jQuery.historyCurrentHash){location.hash=l;jQuery.historyCurrentHash=l;jQuery.historyCallback(l.replace(/^#/,""))}}else{if(jQuery.browser.safari){if(jQuery.lastHistoryLength==history.length&&jQuery.historyBackStack.length>jQuery.lastHistoryLength){jQuery.historyBackStack.shift()}if(!jQuery.dontCheck){var j=history.length-jQuery.historyBackStack.length;jQuery.lastHistoryLength=history.length;if(j){jQuery.isFirst=false;if(j<0){for(var o=0;o<Math.abs(j);o++){jQuery.historyForwardStack.unshift(jQuery.historyBackStack.pop())}}else{for(var o=0;o<j;o++){jQuery.historyBackStack.push(jQuery.historyForwardStack.shift())}}var m=jQuery.historyBackStack[jQuery.historyBackStack.length-1];if(m!=undefined){jQuery.historyCurrentHash=location.hash.replace(/\?.*$/,"");jQuery.historyCallback(m)}}else{if(jQuery.historyBackStack[jQuery.historyBackStack.length-1]==undefined&&!jQuery.isFirst){if(location.hash){var l=location.hash;jQuery.historyCallback(location.hash.replace(/^#/,""))}else{var l="";jQuery.historyCallback("")}jQuery.isFirst=true}}}}else{var l=location.hash.replace(/\?.*$/,"");if(l!=jQuery.historyCurrentHash){jQuery.historyCurrentHash=l;jQuery.historyCallback(l.replace(/^#/,""))}}}},historyLoad:function(m){var l;m=decodeURIComponent(m.replace(/\?.*$/,""));if(jQuery.browser.safari){l=m}else{l="#"+m;location.hash=l}jQuery.historyCurrentHash=l;if(jQuery.historyNeedIframe){var k=jQuery("#jQuery_history")[0];var n=k.contentWindow.document;n.open();n.close();n.location.hash=l;jQuery.lastHistoryLength=history.length;jQuery.historyCallback(m)}else{if(jQuery.browser.safari){jQuery.dontCheck=true;this.historyAddHistory(m);var j=function(){jQuery.dontCheck=false};window.setTimeout(j,200);jQuery.historyCallback(m);location.hash=l}else{jQuery.historyCallback(m)}}}});function h(j){c("Load called: ",j);if(i.requestInProgress){return}if(!i.loader){i.loader=jQuery("<div/>");i.loader.css(b.loader.css).html(b.loader.html).attr(b.loader.attr).appendTo(d);b.loader.init(i.loader)}b.loader.show(i.loader,j);i.requestInProgress=true;var k=/\//.test(j)?j.replace(/\/[^\/]+$/,"/"):"";j=j.replace(window.location.href.replace(/(:\/\/.+?\/).+/,"$1")+b.base,"");j=j.replace(b.base,"");jQuery.ajax({url:j,cache:b.cache,type:"GET",complete:function(n,m){c("XHR: "+m);if(m!=="success"&&m!=="notmodified"){return}i.requestInProgress=false;var p=n.responseText.replace(/<!DOCTYPE.+?>/,"").replace(/<(\/?)(body|head|html|title)(?=.*?>)/g,"<$1ajaxy$2").replace(/<script(.|\s)*?\/script>/g,"").replace(/((?:href|src|action)\s*=\s*)('|")((?:\S|\\\2)+?)(\2|\s)/g,function(s,r,u,q,t){if(!/^https?:\/\/|^\//.test(q)){return r+u+k+q+t}return s}),o=(function(){var r=p.match(/<ajaxy(body|head|html).*?>/ig),q={};if(r){jQuery.each(r,function(t,s){q[s.match(/<(.+?)(>|\s)/)[1].toLowerCase()]=s.replace(/^<ajaxy/g,"<")})}return q})(),l=$("<div/>").append(p);l.children().each(function(){if(/^(meta|style|link)$/i.test(this.nodeName)){jQuery(this).appendTo(g)}if(/^(script)$/i.test(this.nodeName)){jQuery(this).remove()}});b.update=jQuery(b.update[0].nodeName||(b.update instanceof jQuery)||jQuery.isArray(b.update)?b.update:[b.update]);b.update.each(function(s,t){c("Updating item: ",t);var r=jQuery(t),u=r.clone(true),q=r.selector.replace(/(^|\s)(body|html|head)$/,"$1ajaxy$2");if(q==="title"){document.title=jQuery("<div/>").append((p.match(/<ajaxytitle>(.+?)<\/ajaxytitle>/i)||["",""])[1]).text();return true}r.each(function(v){var w=l.find(q).eq(v);if(!w[0]){return true}if(/^ajaxy/i.test(w[0].nodeName)){w=jQuery(o[w[0].nodeName.toLowerCase()]).append(w[0].childNodes)}if(b.updateHandler&&b.updateHandler[q]){b.updateHandler[q].call(this,w.html(),w)}else{jQuery(this).replaceWith(w)}});return true});b.loader.hide(i.loader,j);if(i.headStyle){i.headStyle.remove()}},error:function(){i.requestInProgress=false;if(i.headStyle){i.headStyle.remove()}return b.errorHandler.apply(this,arguments)}})}function f(){var l=window.location;var j=b.base+b.homepage;if(l.pathname!==j&&l.pathname.indexOf(b.base)===0){var k=l.pathname.replace(b.base,"");if(k){window.location=b.base+b.homepage+"#"+k}}}function i(k){if(!a){f()}if(b.initialStyles&&window.location.hash){i.headStyle=i.headStyle||jQuery('<style type="text/css">'+b.initialStyles+"</style>").appendTo("head")}if(!document.body){var j=setInterval(function(){if(document.body){d=document.body;clearInterval(j);i(k)}},20);return}if(a){return}else{a=true}e.hash.bind(h,b.base);jQuery.extend(b,k);jQuery("a").live("click",function(n){var l=this.href,m=jQuery.isFunction(b.anchorFilter)?b.anchorFilter.call(this):jQuery(this).is(b.anchorFilter);if(!e.isExternal(l)&&m&&n.button===0){c("Matching anchor clicked: ",this.pathname);n.preventDefault();e.hash.load(this.pathname.replace(/^[^\/]/,"/$&").replace(b.base,""));return false}})}if(b.autoInit){i()}i.load=h;i.settings=b;return i})();
