//   /fileadmin/scripts/jquery-1.4.2.min.js

/*!
 
//   /fileadmin/scripts/jquery.resize.js
/*
 * jQuery resize event - v1.1 - 3/14/2010
 * http://benalman.com/projects/jquery-resize-plugin/
 * 
 * Copyright (c) 2010 "Cowboy" Ben Alman
 * Dual licensed under the MIT and GPL licenses.
 * http://benalman.com/about/license/
 */
(function($,h,c){var a=$([]),e=$.resize=$.extend($.resize,{}),i,k="setTimeout",j="resize",d=j+"-special-event",b="delay",f="throttleWindow";e[b]=250;e[f]=true;$.event.special[j]={setup:function(){if(!e[f]&&this[k]){return false}var l=$(this);a=a.add(l);$.data(this,d,{w:l.width(),h:l.height()});if(a.length===1){g()}},teardown:function(){if(!e[f]&&this[k]){return false}var l=$(this);a=a.not(l);l.removeData(d);if(!a.length){clearTimeout(i)}},add:function(l){if(!e[f]&&this[k]){return false}var n;function m(s,o,p){var q=$(this),r=$.data(this,d);r.w=o!==c?o:q.width();r.h=p!==c?p:q.height();n.apply(this,arguments)}if($.isFunction(l)){n=l;return m}else{n=l.handler;l.handler=m}}};function g(){i=h[k](function(){a.each(function(){var n=$(this),m=n.width(),l=n.height(),o=$.data(this,d);if(m!==o.w||l!==o.h){n.trigger(j,[o.w=m,o.h=l])}});g()},e[b])}})(jQuery,this);


/*!
 * jQuery UI 1.8.4
 *
 * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI
 */
(function(c,j){function k(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.4",plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&b[e][1].apply(a.element,d)}},contains:function(a,
b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&c.ui.isOverAxis(b,e,i)},keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,
CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable",
"off").css("MozUserSelect","")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none")},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,
"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"));if(!isNaN(b)&&b!=0)return b}a=a.parent()}}return 0}});c.each(["Width","Height"],function(a,b){function d(f,g,l,m){c.each(e,function(){g-=
parseFloat(c.curCSS(f,"padding"+this,true))||0;if(l)g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0;if(m)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c.style(this,h,d(this,f)+"px")})};c.fn["outer"+
b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c.style(this,h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");if("area"===b){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&k(a)}return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==
b?a.href||!isNaN(d):!isNaN(d))&&k(a)},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}})}})(jQuery);
;/*
 * jQuery UI Datepicker 1.8.4
 *
 * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Datepicker
 *
 * Depends:
 *	jquery.ui.core.js
 */
(function(d,G){function L(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._inDialog=this._datepickerShowing=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass=
"ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su",
"Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",
minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false};d.extend(this._defaults,this.regional[""]);this.dpDiv=d('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible"></div>')}function E(a,b){d.extend(a,
b);for(var c in b)if(b[c]==null||b[c]==G)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.4"}});var y=(new Date).getTime();d.extend(L.prototype,{markerClassName:"hasDatepicker",log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){E(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=
f}}}e=a.nodeName.toLowerCase();f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_])/g,"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:d('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')}},
_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&&
b.append.remove();if(c){b.append=d('<span class="'+this._appendClass+'">'+c+"</span>");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c=="focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("<img/>").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('<button type="button"></button>').addClass(this._triggerClass).html(f==
""?c:d("<img/>").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker():d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;g<f.length;g++)if(f[g].length>h){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a,
c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b),
true);this._updateDatepicker(b);this._updateAlternate(b)}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+=1;this._dialogInput=d('<input type="text" id="'+("dp"+this.uuid)+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}E(a.settings,e||{});b=b&&b.constructor==
Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);
d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}},
_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().removeClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=
d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().addClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false;
for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return true;return false},_getInst:function(a){try{return d.data(a,"datepicker")}catch(b){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(a,b,c){var e=this._getInst(a);if(arguments.length==2&&typeof b=="string")return b=="defaults"?d.extend({},d.datepicker._defaults):e?b=="all"?d.extend({},e.settings):this._get(e,b):null;var f=b||{};if(typeof b=="string"){f={};f[b]=c}if(e){this._curInst==e&&
this._hideDatepicker();var h=this._getDateDatepicker(a,true);E(e.settings,f);this._attachments(d(a),e);this._autoSize(e);this._setDateDatepicker(a,h);this._updateDatepicker(e)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){(a=this._getInst(a))&&this._updateDatepicker(a)},_setDateDatepicker:function(a,b){if(a=this._getInst(a)){this._setDate(a,b);this._updateDatepicker(a);this._updateAlternate(a)}},_getDateDatepicker:function(a,b){(a=this._getInst(a))&&
!a.inline&&this._setDateFromField(a,b);return a?this._getDate(a):null},_doKeyDown:function(a){var b=d.datepicker._getInst(a.target),c=true,e=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=true;if(d.datepicker._datepickerShowing)switch(a.keyCode){case 9:d.datepicker._hideDatepicker();c=false;break;case 13:c=d("td."+d.datepicker._dayOverClass,b.dpDiv).add(d("td."+d.datepicker._currentClass,b.dpDiv));c[0]?d.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,c[0]):d.datepicker._hideDatepicker();
return false;case 27:d.datepicker._hideDatepicker();break;case 33:d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 34:d.datepicker._adjustDate(a.target,a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 35:if(a.ctrlKey||a.metaKey)d.datepicker._clearDate(a.target);c=a.ctrlKey||a.metaKey;break;case 36:if(a.ctrlKey||a.metaKey)d.datepicker._gotoToday(a.target);c=a.ctrlKey||
a.metaKey;break;case 37:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?+1:-1,"D");c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,a.ctrlKey?-d.datepicker._get(b,"stepBigMonths"):-d.datepicker._get(b,"stepMonths"),"M");break;case 38:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,-7,"D");c=a.ctrlKey||a.metaKey;break;case 39:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,e?-1:+1,"D");c=a.ctrlKey||a.metaKey;if(a.originalEvent.altKey)d.datepicker._adjustDate(a.target,
a.ctrlKey?+d.datepicker._get(b,"stepBigMonths"):+d.datepicker._get(b,"stepMonths"),"M");break;case 40:if(a.ctrlKey||a.metaKey)d.datepicker._adjustDate(a.target,+7,"D");c=a.ctrlKey||a.metaKey;break;default:c=false}else if(a.keyCode==36&&a.ctrlKey)d.datepicker._showDatepicker(this);else c=false;if(c){a.preventDefault();a.stopPropagation()}},_doKeyPress:function(a){var b=d.datepicker._getInst(a.target);if(d.datepicker._get(b,"constrainInput")){b=d.datepicker._possibleChars(d.datepicker._get(b,"dateFormat"));
var c=String.fromCharCode(a.charCode==G?a.keyCode:a.charCode);return a.ctrlKey||c<" "||!b||b.indexOf(c)>-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},_showDatepicker:function(a){a=a.target||
a;if(a.nodeName.toLowerCase()!="input")a=d("input",a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);d.datepicker._curInst&&d.datepicker._curInst!=b&&d.datepicker._curInst.dpDiv.stop(true,true);var c=d.datepicker._get(b,"beforeShow");E(b.settings,c?c.apply(a,[a,b]):{});b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value="";if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a);
d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&
d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){d.datepicker._datepickerShowing=true;var i=d.datepicker._getBorders(b.dpDiv);b.dpDiv.find("iframe.ui-datepicker-cover").css({left:-i[0],top:-i[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})};b.dpDiv.zIndex(d(a).zIndex()+1);d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,
h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this,c=d.datepicker._getBorders(a.dpDiv);a.dpDiv.empty().append(this._generateHTML(a)).find("iframe.ui-datepicker-cover").css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}).end().find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){d(this).removeClass("ui-state-hover");
this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).removeClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&d(this).removeClass("ui-datepicker-next-hover")}).bind("mouseover",function(){if(!b._isDisabledDatepicker(a.inline?a.dpDiv.parent()[0]:a.input[0])){d(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");d(this).addClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).addClass("ui-datepicker-prev-hover");
this.className.indexOf("ui-datepicker-next")!=-1&&d(this).addClass("ui-datepicker-next-hover")}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();c=this._getNumberOfMonths(a);var e=c[1];e>1?a.dpDiv.addClass("ui-datepicker-multi-"+e).css("width",17*e+"em"):a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");a.dpDiv[(c[0]!=1||c[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");
a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input.focus()},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),
k=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>k&&k>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b=this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1);)a=a[b?"previousSibling":"nextSibling"];
a=d(a).offset();return[a.left,a.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b);this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();if(a=this._get(b,"onClose"))a.apply(b.input?b.input[0]:null,[b.input?b.input.val():
"",b]);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&
!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;
b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e._selectingMonthYear=false;e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_clickMonthYear:function(a){var b=
this._getInst(d(a)[0]);b.input&&b._selectingMonthYear&&setTimeout(function(){b.input.focus()},0);b._selectingMonthYear=!b._selectingMonthYear},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=
d(a);this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,
"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b==
"object"?b.toString():b+"";if(b=="")return null;for(var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff,f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,k=c=-1,l=-1,u=-1,j=false,o=function(p){(p=z+1<a.length&&a.charAt(z+1)==p)&&z++;return p},m=function(p){o(p);p=new RegExp("^\\d{1,"+(p=="@"?14:p=="!"?20:p=="y"?4:p=="o"?
3:2)+"}");p=b.substring(s).match(p);if(!p)throw"Missing number at position "+s;s+=p[0].length;return parseInt(p[0],10)},n=function(p,w,H){p=o(p)?H:w;for(w=0;w<p.length;w++)if(b.substr(s,p[w].length)==p[w]){s+=p[w].length;return w+1}throw"Unknown name at position "+s;},r=function(){if(b.charAt(s)!=a.charAt(z))throw"Unexpected literal at position "+s;s++},s=0,z=0;z<a.length;z++)if(j)if(a.charAt(z)=="'"&&!o("'"))j=false;else r();else switch(a.charAt(z)){case "d":l=m("d");break;case "D":n("D",f,h);break;
case "o":u=m("o");break;case "m":k=m("m");break;case "M":k=n("M",i,g);break;case "y":c=m("y");break;case "@":var v=new Date(m("@"));c=v.getFullYear();k=v.getMonth()+1;l=v.getDate();break;case "!":v=new Date((m("!")-this._ticksTo1970)/1E4);c=v.getFullYear();k=v.getMonth()+1;l=v.getDate();break;case "'":if(o("'"))r();else j=true;break;default:r()}if(c==-1)c=(new Date).getFullYear();else if(c<100)c+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c<=e?0:-100);if(u>-1){k=1;l=u;do{e=this._getDaysInMonth(c,
k-1);if(l<=e)break;k++;l-=e}while(1)}v=this._daylightSavingAdjust(new Date(c,k-1,l));if(v.getFullYear()!=c||v.getMonth()+1!=k||v.getDate()!=l)throw"Invalid date";return v},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,b,c){if(!b)return"";
var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:null)||this._defaults.monthNames;var i=function(o){(o=j+1<a.length&&a.charAt(j+1)==o)&&j++;return o},g=function(o,m,n){m=""+m;if(i(o))for(;m.length<n;)m="0"+m;return m},k=function(o,m,n,r){return i(o)?r[m]:n[m]},l="",u=false;if(b)for(var j=0;j<a.length;j++)if(u)if(a.charAt(j)=="'"&&!i("'"))u=false;else l+=a.charAt(j);
else switch(a.charAt(j)){case "d":l+=g("d",b.getDate(),2);break;case "D":l+=k("D",b.getDay(),e,f);break;case "o":l+=g("o",(b.getTime()-(new Date(b.getFullYear(),0,0)).getTime())/864E5,3);break;case "m":l+=g("m",b.getMonth()+1,2);break;case "M":l+=k("M",b.getMonth(),h,c);break;case "y":l+=i("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case "@":l+=b.getTime();break;case "!":l+=b.getTime()*1E4+this._ticksTo1970;break;case "'":if(i("'"))l+="'";else u=true;break;default:l+=a.charAt(j)}return l},
_possibleChars:function(a){for(var b="",c=false,e=function(h){(h=f+1<a.length&&a.charAt(f+1)==h)&&f++;return h},f=0;f<a.length;f++)if(c)if(a.charAt(f)=="'"&&!e("'"))c=false;else b+=a.charAt(f);else switch(a.charAt(f)){case "d":case "m":case "y":case "@":b+="0123456789";break;case "D":case "M":return null;case "'":if(e("'"))b+="'";else c=true;break;default:b+=a.charAt(f)}return b},_get:function(a,b){return a.settings[b]!==G?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()!=
a.lastVal){var c=this._get(a,"dateFormat"),e=a.lastVal=a.input?a.input.val():null,f,h;f=h=this._getDefaultDate(a);var i=this._getFormatConfig(a);try{f=this.parseDate(c,e,i)||h}catch(g){this.log(g);e=b?"":e}a.selectedDay=f.getDate();a.drawMonth=a.selectedMonth=f.getMonth();a.drawYear=a.selectedYear=f.getFullYear();a.currentDay=e?f.getDate():0;a.currentMonth=e?f.getMonth():0;a.currentYear=e?f.getFullYear():0;this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,
this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var e=function(h){var i=new Date;i.setDate(i.getDate()+h);return i},f=function(h){try{return d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),h,d.datepicker._getFormatConfig(a))}catch(i){}var g=(h.toLowerCase().match(/^c/)?d.datepicker._getDate(a):null)||new Date,k=g.getFullYear(),l=g.getMonth();g=g.getDate();for(var u=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,j=u.exec(h);j;){switch(j[2]||"d"){case "d":case "D":g+=parseInt(j[1],
10);break;case "w":case "W":g+=parseInt(j[1],10)*7;break;case "m":case "M":l+=parseInt(j[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(k,l));break;case "y":case "Y":k+=parseInt(j[1],10);g=Math.min(g,d.datepicker._getDaysInMonth(k,l));break}j=u.exec(h)}return new Date(k,l,g)};if(b=(b=b==null?c:typeof b=="string"?f(b):typeof b=="number"?isNaN(b)?c:e(b):b)&&b.toString()=="Invalid Date"?c:b){b.setHours(0);b.setMinutes(0);b.setSeconds(0);b.setMilliseconds(0)}return this._daylightSavingAdjust(b)},_daylightSavingAdjust:function(a){if(!a)return null;
a.setHours(a.getHours()>12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||
a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),k=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay?
new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),j=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n=this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=j&&n<j?j:n;this._daylightSavingAdjust(new Date(m,g,1))>n;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-k,1)),this._getFormatConfig(a));
n=this._canAdjustMonth(a,-1,m,g)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+y+".datepicker._adjustDate('#"+a.id+"', -"+k+", 'M');\" title=\""+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>":f?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+n+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+n+"</span></a>";var r=this._get(a,"nextText");r=!h?r:this.formatDate(r,this._daylightSavingAdjust(new Date(m,
g+k,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+y+".datepicker._adjustDate('#"+a.id+"', +"+k+", 'M');\" title=\""+r+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+r+"</span></a>":f?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+r+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+r+"</span></a>";k=this._get(a,"currentText");r=this._get(a,"gotoCurrent")&&
a.currentDay?u:b;k=!h?k:this.formatDate(k,r,this._getFormatConfig(a));h=!a.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+y+'.datepicker._hideDatepicker();">'+this._get(a,"closeText")+"</button>":"";e=e?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?h:"")+(this._isInRange(a,r)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+
y+".datepicker._gotoToday('#"+a.id+"');\">"+k+"</button>":"")+(c?"":h)+"</div>":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;k=this._get(a,"showWeek");r=this._get(a,"dayNames");this._get(a,"dayNamesShort");var s=this._get(a,"dayNamesMin"),z=this._get(a,"monthNames"),v=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),w=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var M=this._getDefaultDate(a),I="",C=0;C<i[0];C++){for(var N=
"",D=0;D<i[1];D++){var J=this._daylightSavingAdjust(new Date(m,g,a.selectedDay)),t=" ui-corner-all",x="";if(l){x+='<div class="ui-datepicker-group';if(i[1]>1)switch(D){case 0:x+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]-1:x+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:x+=" ui-datepicker-group-middle";t="";break}x+='">'}x+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+t+'">'+(/all|left/.test(t)&&C==0?c?
f:n:"")+(/all|right/.test(t)&&C==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,j,o,C>0||D>0,z,v)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var A=k?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(t=0;t<7;t++){var q=(t+h)%7;A+="<th"+((t+h+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+r[q]+'">'+s[q]+"</span></th>"}x+=A+"</tr></thead><tbody>";A=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay,
A);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;A=l?6:Math.ceil((t+A)/7);q=this._daylightSavingAdjust(new Date(m,g,1-t));for(var O=0;O<A;O++){x+="<tr>";var P=!k?"":'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(q)+"</td>";for(t=0;t<7;t++){var F=p?p.apply(a.input?a.input[0]:null,[q]):[true,""],B=q.getMonth()!=g,K=B&&!H||!F[0]||j&&q<j||o&&q>o;P+='<td class="'+((t+h+6)%7>=5?" ui-datepicker-week-end":"")+(B?" ui-datepicker-other-month":"")+(q.getTime()==J.getTime()&&g==a.selectedMonth&&
a._keyEvent||M.getTime()==q.getTime()&&M.getTime()==J.getTime()?" "+this._dayOverClass:"")+(K?" "+this._unselectableClass+" ui-state-disabled":"")+(B&&!w?"":" "+F[1]+(q.getTime()==u.getTime()?" "+this._currentClass:"")+(q.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!B||w)&&F[2]?' title="'+F[2]+'"':"")+(K?"":' onclick="DP_jQuery_'+y+".datepicker._selectDay('#"+a.id+"',"+q.getMonth()+","+q.getFullYear()+', this);return false;"')+">"+(B&&!w?"&#xa0;":K?'<span class="ui-state-default">'+q.getDate()+
"</span>":'<a class="ui-state-default'+(q.getTime()==b.getTime()?" ui-state-highlight":"")+(q.getTime()==J.getTime()?" ui-state-active":"")+(B?" ui-priority-secondary":"")+'" href="#">'+q.getDate()+"</a>")+"</td>";q.setDate(q.getDate()+1);q=this._daylightSavingAdjust(q)}x+=P+"</tr>"}g++;if(g>11){g=0;m++}x+="</tbody></table>"+(l?"</div>"+(i[0]>0&&D==i[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");N+=x}I+=N}I+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':
"");a._keyEvent=false;return I},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var k=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),j='<div class="ui-datepicker-title">',o="";if(h||!k)o+='<span class="ui-datepicker-month">'+i[b]+"</span>";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+y+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" onclick=\"DP_jQuery_"+y+".datepicker._clickMonthYear('#"+
a.id+"');\">";for(var n=0;n<12;n++)if((!i||n>=e.getMonth())&&(!m||n<=f.getMonth()))o+='<option value="'+n+'"'+(n==b?' selected="selected"':"")+">"+g[n]+"</option>";o+="</select>"}u||(j+=o+(h||!(k&&l)?"&#xa0;":""));if(h||!l)j+='<span class="ui-datepicker-year">'+c+"</span>";else{g=this._get(a,"yearRange").split(":");var r=(new Date).getFullYear();i=function(s){s=s.match(/c[+-].*/)?c+parseInt(s.substring(1),10):s.match(/[+-].*/)?r+parseInt(s,10):parseInt(s,10);return isNaN(s)?r:s};b=i(g[0]);g=Math.max(b,
i(g[1]||""));b=e?Math.max(b,e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(j+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+y+".datepicker._selectMonthYear('#"+a.id+"', this, 'Y');\" onclick=\"DP_jQuery_"+y+".datepicker._clickMonthYear('#"+a.id+"');\">";b<=g;b++)j+='<option value="'+b+'"'+(b==c?' selected="selected"':"")+">"+b+"</option>";j+="</select>"}j+=this._get(a,"yearSuffix");if(u)j+=(h||!(k&&l)?"&#xa0;":"")+o;j+="</div>";return j},_adjustInstDate:function(a,b,c){var e=
a.drawYear+(c=="Y"?b:0),f=a.drawMonth+(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&b<c?c:b;return b=a&&b>a?a:b},_notifyChange:function(a){var b=this._get(a,
"onChangeMonthYear");if(b)b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a);
c=this._daylightSavingAdjust(new Date(c,e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,
"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker=
function(a){if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));
return this.each(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new L;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.4";window["DP_jQuery_"+y]=d})(jQuery);
;


//   /fileadmin/scripts/nivoslider/jquery.nivo.slider.pack.js
/*
 * jQuery Nivo Slider v1.9
 * http://nivo.dev7studios.com
 *
 * Copyright 2010, Gilbert Pellegrom
 * Free to use and abuse under the MIT license.
 * http://www.opensource.org/licenses/mit-license.php
 * 
 * April 2010 - controlNavThumbs option added by Jamie Thompson (http://jamiethompson.co.uk)
 * March 2010 - manualAdvance option added by HelloPablo (http://hellopablo.co.uk)
 */
/*
 * jQuery Nivo Slider v1.9
 * http://nivo.dev7studios.com
 *
 * Copyright 2010, Gilbert Pellegrom
 * Free to use and abuse under the MIT license.
 * http://www.opensource.org/licenses/mit-license.php
 * 
 * April 2010 - controlNavThumbs option added by Jamie Thompson (http://jamiethompson.co.uk)
 * March 2010 - manualAdvance option added by HelloPablo (http://hellopablo.co.uk)
 */

eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(9($){$.1h.1i=9(1T){b 4=$.2b({},$.1h.1i.21,1T);K g.F(9(){b 3={e:0,n:\'\',T:0,u:\'\',H:l,1f:l,1O:l};b 5=$(g);5.1Q(\'7:3\',3);5.f(\'2h\',\'2i\');5.w(\'1X\');5.x(\'1X\');5.1c(\'1i\');b d=5.2f();d.F(9(){b o=$(g);6(!o.J(\'D\')){6(o.J(\'a\')){o.1c(\'7-2e\')}o=o.1n(\'D:1m\')}b 13=o.w();6(13==0)13=o.t(\'w\');b 18=o.x();6(18==0)18=o.t(\'x\');6(13>5.w()){5.w(13)}6(18>5.x()){5.x(18)}o.f(\'S\',\'1z\');3.T++});6(4.16>0){6(4.16>=3.T)4.16=3.T-1;3.e=4.16}6($(d[3.e]).J(\'D\')){3.n=$(d[3.e])}k{3.n=$(d[3.e]).1n(\'D:1m\')}6($(d[3.e]).J(\'a\')){$(d[3.e]).f(\'S\',\'1v\')}5.f(\'Y\',\'W(\'+3.n.t(\'M\')+\') Q-R\');23(b i=0;i<4.h;i++){b E=1d.2a(5.w()/4.h);6(i==4.h-1){5.P($(\'<A B="7-c"></A>\').f({29:(E*i)+\'12\',w:(5.w()-(E*i))+\'12\'}))}k{5.P($(\'<A B="7-c"></A>\').f({29:(E*i)+\'12\',w:E+\'12\'}))}}5.P($(\'<A B="7-L"><p></p></A>\').f({S:\'1z\',y:4.20}));6(3.n.t(\'1a\')!=\'\'){$(\'.7-L p\',5).1B(3.n.t(\'1a\'));$(\'.7-L\',5).1y(4.q)}b j=0;6(!4.1g){j=1o(9(){C(5,d,4,l)},4.1j)}6(4.V){5.P(\'<A B="7-V"><a B="7-25">2d</a><a B="7-27">2k</a></A>\');6(4.1N){$(\'.7-V\',5).24();5.1W(9(){$(\'.7-V\',5).2c()},9(){$(\'.7-V\',5).24()})}$(\'a.7-25\',5).1s(\'1u\',9(){6(3.H)K l;X(j);j=\'\';3.e-=2;C(5,d,4,\'1r\')});$(\'a.7-27\',5).1s(\'1u\',9(){6(3.H)K l;X(j);j=\'\';C(5,d,4,\'1q\')})}6(4.G){b 1l=$(\'<A B="7-G"></A>\');5.P(1l);23(b i=0;i<d.22;i++){6(4.1L){b o=d.1w(i);6(!o.J(\'D\')){o=o.1n(\'D:1m\')}1l.P(\'<a B="7-1t" 1x="\'+i+\'"><D M="\'+o.t(\'M\').2g(4.1R,4.1S)+\'"></a>\')}k{1l.P(\'<a B="7-1t" 1x="\'+i+\'">\'+i+\'</a>\')}}$(\'.7-G a:1w(\'+3.e+\')\',5).1c(\'1b\');$(\'.7-G a\',5).1s(\'1u\',9(){6(3.H)K l;6($(g).2j(\'1b\'))K l;X(j);j=\'\';5.f(\'Y\',\'W(\'+3.n.t(\'M\')+\') Q-R\');3.e=$(g).t(\'1x\')-1;C(5,d,4,\'1t\')})}6(4.1Z){$(2m).2z(9(1A){6(1A.1V==\'2w\'){6(3.H)K l;X(j);j=\'\';3.e-=2;C(5,d,4,\'1r\')}6(1A.1V==\'2y\'){6(3.H)K l;X(j);j=\'\';C(5,d,4,\'1q\')}})}6(4.1U){5.1W(9(){3.1f=N;X(j);j=\'\'},9(){3.1f=l;6(j==\'\'&&!4.1g){j=1o(9(){C(5,d,4,l)},4.1j)}})}5.2A(\'7:U\',9(){3.H=l;$(d).F(9(){6($(g).J(\'a\')){$(g).f(\'S\',\'1z\')}});6($(d[3.e]).J(\'a\')){$(d[3.e]).f(\'S\',\'1v\')}6(j==\'\'&&!3.1f&&!4.1g){j=1o(9(){C(5,d,4,l)},4.1j)}4.1M.1p(g)})});9 C(5,d,4,14){b 3=5.1Q(\'7:3\');6((!3||3.1O)&&!14)K l;4.1K.1p(g);6(!14){5.f(\'Y\',\'W(\'+3.n.t(\'M\')+\') Q-R\')}k{6(14==\'1r\'){5.f(\'Y\',\'W(\'+3.n.t(\'M\')+\') Q-R\')}6(14==\'1q\'){5.f(\'Y\',\'W(\'+3.n.t(\'M\')+\') Q-R\')}}3.e++;6(3.e==3.T){3.e=0;4.1P.1p(g)}6(3.e<0)3.e=(3.T-1);6($(d[3.e]).J(\'D\')){3.n=$(d[3.e])}k{3.n=$(d[3.e]).1n(\'D:1m\')}6(4.G){$(\'.7-G a\',5).2B(\'1b\');$(\'.7-G a:1w(\'+3.e+\')\',5).1c(\'1b\')}6(3.n.t(\'1a\')!=\'\'){6($(\'.7-L\',5).f(\'S\')==\'1v\'){$(\'.7-L p\',5).28(4.q,9(){$(g).1B(3.n.t(\'1a\'));$(g).1y(4.q)})}k{$(\'.7-L p\',5).1B(3.n.t(\'1a\'))}$(\'.7-L\',5).1y(4.q)}k{$(\'.7-L\',5).28(4.q)}b i=0;$(\'.7-c\',5).F(9(){b E=1d.2a(5.w()/4.h);$(g).f({x:\'O\',y:\'0\',Y:\'W(\'+3.n.t(\'M\')+\') Q-R -\'+((E+(i*E))-E)+\'12 0%\'});i++});6(4.m==\'1G\'){b 1J=2x 2u("1H","10","1I","19","1C","Z","1D","1k");3.u=1J[1d.2l(1d.1G()*(1J.22+1))];6(3.u==2n)3.u=\'1k\'}3.H=N;6(4.m==\'2v\'||4.m==\'1H\'||3.u==\'1H\'||4.m==\'10\'||3.u==\'10\'){b r=0;b i=0;b h=$(\'.7-c\',5);6(4.m==\'10\'||3.u==\'10\')h=$(\'.7-c\',5).17();h.F(9(){b c=$(g);c.f(\'1E\',\'O\');6(i==4.h-1){I(9(){c.z({x:\'s%\',y:\'1.0\'},4.q,\'\',9(){5.11(\'7:U\')})},(s+r))}k{I(9(){c.z({x:\'s%\',y:\'1.0\'},4.q)},(s+r))}r+=1e;i++})}k 6(4.m==\'2p\'||4.m==\'1I\'||3.u==\'1I\'||4.m==\'19\'||3.u==\'19\'){b r=0;b i=0;b h=$(\'.7-c\',5);6(4.m==\'19\'||3.u==\'19\')h=$(\'.7-c\',5).17();h.F(9(){b c=$(g);c.f(\'26\',\'O\');6(i==4.h-1){I(9(){c.z({x:\'s%\',y:\'1.0\'},4.q,\'\',9(){5.11(\'7:U\')})},(s+r))}k{I(9(){c.z({x:\'s%\',y:\'1.0\'},4.q)},(s+r))}r+=1e;i++})}k 6(4.m==\'1C\'||4.m==\'2q\'||3.u==\'1C\'||4.m==\'Z\'||3.u==\'Z\'){b r=0;b i=0;b v=0;b h=$(\'.7-c\',5);6(4.m==\'Z\'||3.u==\'Z\')h=$(\'.7-c\',5).17();h.F(9(){b c=$(g);6(i==0){c.f(\'1E\',\'O\');i++}k{c.f(\'26\',\'O\');i=0}6(v==4.h-1){I(9(){c.z({x:\'s%\',y:\'1.0\'},4.q,\'\',9(){5.11(\'7:U\')})},(s+r))}k{I(9(){c.z({x:\'s%\',y:\'1.0\'},4.q)},(s+r))}r+=1e;v++})}k 6(4.m==\'1D\'||3.u==\'1D\'){b r=0;b i=0;$(\'.7-c\',5).F(9(){b c=$(g);b 1F=c.w();c.f({1E:\'O\',x:\'s%\',w:\'O\'});6(i==4.h-1){I(9(){c.z({w:1F,y:\'1.0\'},4.q,\'\',9(){5.11(\'7:U\')})},(s+r))}k{I(9(){c.z({w:1F,y:\'1.0\'},4.q)},(s+r))}r+=1e;i++})}k 6(4.m==\'1k\'||3.u==\'1k\'){b i=0;$(\'.7-c\',5).F(9(){$(g).f(\'x\',\'s%\');6(i==4.h-1){$(g).z({y:\'1.0\'},(4.q*2),\'\',9(){5.11(\'7:U\')})}k{$(g).z({y:\'1.0\'},(4.q*2))}i++})}}};$.1h.1i.21={m:\'1G\',h:15,q:2t,1j:2s,16:0,V:N,1N:N,G:N,1L:l,1R:\'.1Y\',1S:\'2r.1Y\',1Z:N,1U:N,1g:l,20:0.8,1K:9(){},1M:9(){},1P:9(){}};$.1h.17=[].17})(2o);',62,162,'|||vars|settings|slider|if|nivo||function||var|slice|kids|currentSlide|css|this|slices||timer|else|false|effect|currentImage|child||animSpeed|timeBuff|100|attr|randAnim||width|height|opacity|animate|div|class|nivoRun|img|sliceWidth|each|controlNav|running|setTimeout|is|return|caption|src|true|0px|append|no|repeat|display|totalSlides|animFinished|directionNav|url|clearInterval|background|sliceUpDownLeft|sliceDownLeft|trigger|px|childWidth|nudge||startSlide|reverse|childHeight|sliceUpLeft|title|active|addClass|Math|50|paused|manualAdvance|fn|nivoSlider|pauseTime|fade|nivoControl|first|find|setInterval|call|next|prev|live|control|click|block|eq|rel|fadeIn|none|event|html|sliceUpDown|fold|top|origWidth|random|sliceDownRight|sliceUpRight|anims|beforeChange|controlNavThumbs|afterChange|directionNavHide|stop|slideshowEnd|data|controlNavThumbsSearch|controlNavThumbsReplace|options|pauseOnHover|keyCode|hover|1px|jpg|keyboardNav|captionOpacity|defaults|length|for|hide|prevNav|bottom|nextNav|fadeOut|left|round|extend|show|Prev|imageLink|children|replace|position|relative|hasClass|Next|floor|window|undefined|jQuery|sliceUp|sliceUpDownRight|_thumb|3000|500|Array|sliceDown|37|new|39|keypress|bind|removeClass'.split('|'),0,{}))



//   /fileadmin/scripts/codaslider/jquery.easing.1.3.js
/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *
 * Uses the built in easing capabilities added In jQuery 1.1
 * to offer multiple easing options
 *
 * TERMS OF USE - jQuery Easing
 * 
 * Open source under the BSD License. 
 * 
 * Copyright © 2008 George McGinley Smith
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
*/

// t: current time, b: begInnIng value, c: change In value, d: duration
jQuery.easing['jswing'] = jQuery.easing['swing'];

jQuery.extend( jQuery.easing,
{
	def: 'easeOutQuad',
	swing: function (x, t, b, c, d) {
		//alert(jQuery.easing.default);
		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
	},
	easeInQuad: function (x, t, b, c, d) {
		return c*(t/=d)*t + b;
	},
	easeOutQuad: function (x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
	},
	easeInOutQuad: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t + b;
		return -c/2 * ((--t)*(t-2) - 1) + b;
	},
	easeInCubic: function (x, t, b, c, d) {
		return c*(t/=d)*t*t + b;
	},
	easeOutCubic: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t + 1) + b;
	},
	easeInOutCubic: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t + b;
		return c/2*((t-=2)*t*t + 2) + b;
	},
	easeInQuart: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t + b;
	},
	easeOutQuart: function (x, t, b, c, d) {
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
	},
	easeInOutQuart: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
		return -c/2 * ((t-=2)*t*t*t - 2) + b;
	},
	easeInQuint: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t*t + b;
	},
	easeOutQuint: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t*t*t + 1) + b;
	},
	easeInOutQuint: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
		return c/2*((t-=2)*t*t*t*t + 2) + b;
	},
	easeInSine: function (x, t, b, c, d) {
		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
	},
	easeOutSine: function (x, t, b, c, d) {
		return c * Math.sin(t/d * (Math.PI/2)) + b;
	},
	easeInOutSine: function (x, t, b, c, d) {
		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
	},
	easeInExpo: function (x, t, b, c, d) {
		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
	},
	easeOutExpo: function (x, t, b, c, d) {
		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
	},
	easeInOutExpo: function (x, t, b, c, d) {
		if (t==0) return b;
		if (t==d) return b+c;
		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
	},
	easeInCirc: function (x, t, b, c, d) {
		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
	},
	easeOutCirc: function (x, t, b, c, d) {
		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
	},
	easeInOutCirc: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
	},
	easeInElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	},
	easeOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
	},
	easeInOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
	},
	easeInBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*(t/=d)*t*((s+1)*t - s) + b;
	},
	easeOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
	},
	easeInOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158; 
		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
	},
	easeInBounce: function (x, t, b, c, d) {
		return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
	},
	easeOutBounce: function (x, t, b, c, d) {
		if ((t/=d) < (1/2.75)) {
			return c*(7.5625*t*t) + b;
		} else if (t < (2/2.75)) {
			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
		} else if (t < (2.5/2.75)) {
			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
		} else {
			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
		}
	},
	easeInOutBounce: function (x, t, b, c, d) {
		if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
		return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
	}
});



//   /fileadmin/scripts/codaslider/jquery.codaslider.2.0.js
/*
	jQuery Coda-Slider v2.0 - http://www.ndoherty.biz/coda-slider
	Copyright (c) 2009 Niall Doherty
	This plugin available for use in all personal or commercial projects under both MIT and GPL licenses.
*/

$(function(){
	// Remove the coda-slider-no-js class from the body
	$("body").removeClass("coda-slider-no-js");
	// Preloader
	$(".coda-slider").children('.panel').hide().end().prepend('<p class="loading"> </p>');
});

var sliderCount = 1;

$.fn.codaSlider = function(settings) {

	settings = $.extend({
		autoHeight: true,
		autoHeightEaseDuration: 600,
		autoHeightEaseFunction: "easeInOutExpo",
		autoSlide: false,
		autoSlideInterval: 7000,
		autoSlideStopWhenClicked: true,
		crossLinking: true,
		dynamicArrows: true,
		dynamicArrowLeftText: "&#171; left",
		dynamicArrowRightText: "right &#187;",
		dynamicTabs: true,
		dynamicTabsAlign: "center",
		dynamicTabsPosition: "top",
		externalTriggerSelector: "a.xtrig",
		firstPanelToLoad: 1,
		panelTitleSelector: "h2.title",
		slideEaseDuration: 600,
		slideEaseFunction: "easeInOutExpo"
	}, settings);
	
	return this.each(function(){
		
		// Uncomment the line below to test your preloader
		// alert("Testing preloader");
		
		var slider = $(this);
		
		// If we need arrows
		if (settings.dynamicArrows) {
			slider.parent().addClass("arrows");
			slider.before('<div class="coda-nav-left" id="coda-nav-left-' + sliderCount + '"><a href="#">' + settings.dynamicArrowLeftText + '</a></div>');
			slider.after('<div class="coda-nav-right" id="coda-nav-right-' + sliderCount + '"><a href="#">' + settings.dynamicArrowRightText + '</a></div>');
		};
		
		var panelWidth = slider.find(".panel").width();
		var panelCount = slider.find(".panel").size();
		var panelContainerWidth = panelWidth*panelCount;
		var navClicks = 0; // Used if autoSlideStopWhenClicked = true
		
		// Surround the collection of panel divs with a container div (wide enough for all panels to be lined up end-to-end)
		$('.panel', slider).wrapAll('<div class="panel-container"></div>');
		// Specify the width of the container div (wide enough for all panels to be lined up end-to-end)
		$(".panel-container", slider).css({ width: panelContainerWidth });
		
		// Specify the current panel.
		// If the loaded URL has a hash (cross-linking), we're going to use that hash to give the slider a specific starting position...
		if (settings.crossLinking && location.hash && parseInt(location.hash.slice(1)) <= panelCount) {
			var currentPanel = parseInt(location.hash.slice(1));
			var offset = - (panelWidth*(currentPanel - 1));
			$('.panel-container', slider).css({ marginLeft: offset });
		// If that's not the case, check to see if we're supposed to load a panel other than Panel 1 initially...
		} else if (settings.firstPanelToLoad != 1 && settings.firstPanelToLoad <= panelCount) { 
			var currentPanel = settings.firstPanelToLoad;
			var offset = - (panelWidth*(currentPanel - 1));
			$('.panel-container', slider).css({ marginLeft: offset });
		// Otherwise, we'll just set the current panel to 1...
		} else { 
			var currentPanel = 1;
		};
			
		// Left arrow click
		$("#coda-nav-left-" + sliderCount + " a").click(function(){
			navClicks++;
			if (currentPanel == 1) {
				offset = - (panelWidth*(panelCount - 1));
				alterPanelHeight(panelCount - 1);
				currentPanel = panelCount;
				slider.siblings('.coda-nav').find('a.current').removeClass('current').parents('ul').find('li:last a').addClass('current');
			} else {
				currentPanel -= 1;
				alterPanelHeight(currentPanel - 1);
				offset = - (panelWidth*(currentPanel - 1));
				slider.siblings('.coda-nav').find('a.current').removeClass('current').parent().prev().find('a').addClass('current');
			};
			$('.panel-container', slider).animate({ marginLeft: offset }, settings.slideEaseDuration, settings.slideEaseFunction);
			if (settings.crossLinking) { location.hash = currentPanel }; // Change the URL hash (cross-linking)
			return false;
		});
			
		// Right arrow click
		$('#coda-nav-right-' + sliderCount + ' a').click(function(){
			navClicks++;
			if (currentPanel == panelCount) {
				offset = 0;
				currentPanel = 1;
				alterPanelHeight(0);
				slider.siblings('.coda-nav').find('a.current').removeClass('current').parents('ul').find('a:eq(0)').addClass('current');
			} else {
				offset = - (panelWidth*currentPanel);
				alterPanelHeight(currentPanel);
				currentPanel += 1;
				slider.siblings('.coda-nav').find('a.current').removeClass('current').parent().next().find('a').addClass('current');
			};
			$('.panel-container', slider).animate({ marginLeft: offset }, settings.slideEaseDuration, settings.slideEaseFunction);
			if (settings.crossLinking) { location.hash = currentPanel }; // Change the URL hash (cross-linking)
			return false;
		});
		
		// If we need a dynamic menu
		if (settings.dynamicTabs) {
			var dynamicTabs = '<div class="coda-nav" id="coda-nav-' + sliderCount + '"><ul></ul></div>';
			switch (settings.dynamicTabsPosition) {
				case "bottom":
					slider.parent().append(dynamicTabs);
					break;
				default:
					slider.parent().prepend(dynamicTabs);
					break;
			};
			ul = $('#coda-nav-' + sliderCount + ' ul');
			// Create the nav items
			$('.panel', slider).each(function(n) {
				ul.append('<li class="tab' + (n+1) + '"><a href="#' + (n+1) + '">' + $(this).find(settings.panelTitleSelector).text() + '</a></li>');												
			});
			navContainerWidth = slider.width() + slider.siblings('.coda-nav-left').width() + slider.siblings('.coda-nav-right').width();
			ul.parent().css({ width: navContainerWidth });
			switch (settings.dynamicTabsAlign) {
				case "center":
					ul.css({ width: ($("li", ul).width() + 2) * panelCount });
					break;
				case "right":
					ul.css({ float: 'right' });
					break;
			};
		};
			
		// If we need a tabbed nav
		$('#coda-nav-' + sliderCount + ' a').each(function(z) {
			// What happens when a nav link is clicked
			$(this).bind("click", function() {
				navClicks++;
				$(this).addClass('current').parents('ul').find('a').not($(this)).removeClass('current');
				offset = - (panelWidth*z);
				alterPanelHeight(z);
				currentPanel = z + 1;
				$('.panel-container', slider).animate({ marginLeft: offset }, settings.slideEaseDuration, settings.slideEaseFunction);
				if (!settings.crossLinking) { return false }; // Don't change the URL hash unless cross-linking is specified
			});
		});
		
		// External triggers (anywhere on the page)
		$(settings.externalTriggerSelector).each(function() {
			// Make sure this only affects the targeted slider
			if (sliderCount == parseInt($(this).attr("rel").slice(12))) {
				$(this).bind("click", function() {
					navClicks++;
					targetPanel = parseInt($(this).attr("href").slice(1));
					offset = - (panelWidth*(targetPanel - 1));
					alterPanelHeight(targetPanel - 1);
					currentPanel = targetPanel;
					// Switch the current tab:
					slider.siblings('.coda-nav').find('a').removeClass('current').parents('ul').find('li:eq(' + (targetPanel - 1) + ') a').addClass('current');
					// Slide
					$('.panel-container', slider).animate({ marginLeft: offset }, settings.slideEaseDuration, settings.slideEaseFunction);
					if (!settings.crossLinking) { return false }; // Don't change the URL hash unless cross-linking is specified
				});
			};
		});
			
		// Specify which tab is initially set to "current". Depends on if the loaded URL had a hash or not (cross-linking).
		if (settings.crossLinking && location.hash && parseInt(location.hash.slice(1)) <= panelCount) {
			$("#coda-nav-" + sliderCount + " a:eq(" + (location.hash.slice(1) - 1) + ")").addClass("current");
		// If there's no cross-linking, check to see if we're supposed to load a panel other than Panel 1 initially...
		} else if (settings.firstPanelToLoad != 1 && settings.firstPanelToLoad <= panelCount) {
			$("#coda-nav-" + sliderCount + " a:eq(" + (settings.firstPanelToLoad - 1) + ")").addClass("current");
		// Otherwise we must be loading Panel 1, so make the first tab the current one.
		} else {
			$("#coda-nav-" + sliderCount + " a:eq(0)").addClass("current");
		};
		
		// Set the height of the first panel
		if (settings.autoHeight) {
			panelHeight = $('.panel:eq(' + (currentPanel - 1) + ')', slider).height();
			slider.css({ height: panelHeight });
		};
		
		// Trigger autoSlide
		if (settings.autoSlide) {
			slider.ready(function() {
				setTimeout(autoSlide,settings.autoSlideInterval);
			});
		};
		
		function alterPanelHeight(x) {
			if (settings.autoHeight) {
				panelHeight = $('.panel:eq(' + x + ')', slider).height()
				slider.animate({ height: panelHeight }, settings.autoHeightEaseDuration, settings.autoHeightEaseFunction);
			};
		};
		
		function autoSlide() {
			if (navClicks == 0 || !settings.autoSlideStopWhenClicked) {
				if (currentPanel == panelCount) {
					var offset = 0;
					currentPanel = 1;
				} else {
					var offset = - (panelWidth*currentPanel);
					currentPanel += 1;
				};
				alterPanelHeight(currentPanel - 1);
				// Switch the current tab:
				slider.siblings('.coda-nav').find('a').removeClass('current').parents('ul').find('li:eq(' + (currentPanel - 1) + ') a').addClass('current');
				// Slide:
				$('.panel-container', slider).animate({ marginLeft: offset }, settings.slideEaseDuration, settings.slideEaseFunction);
				setTimeout(autoSlide,settings.autoSlideInterval);
			};
		};
		
		// Kill the preloader
		$('.panel', slider).show().end().find("p.loading").remove();
		slider.removeClass("preload");
		
		sliderCount++;
		
	});
};



//   /fileadmin/scripts/jquery.quicksand.js
/*

Quicksand 1.2.1

Reorder and filter items with a nice shuffling animation.

Copyright (c) 2010 Jacek Galanciak (razorjack.net) and agilope.com
Big thanks for Piotr Petrus (riddle.pl) for deep code review and wonderful docs & demos.

Dual licensed under the MIT and GPL version 2 licenses.
http://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt
http://github.com/jquery/jquery/blob/master/GPL-LICENSE.txt

Project site: http://razorjack.net/quicksand
Github site: http://github.com/razorjack/quicksand

*/

(function ($) {
    $.fn.quicksand = function (collection, customOptions) {     
        var options = {
            duration: 750,
            easing: 'swing',
            attribute: 'data-id', // attribute to recognize same items within source and dest
            adjustHeight: 'auto', // 'dynamic' animates height during shuffling (slow), 'auto' adjusts it before or after the animation, false leaves height constant
            useScaling: true, // disable it if you're not using scaling effect or want to improve performance
            enhancement: function(c) {}, // Visual enhacement (eg. font replacement) function for cloned elements
            selector: '> *'
        };
        $.extend(options, customOptions);
        
        if ($.browser.msie || (typeof($.fn.scale) == 'undefined')) {
            // Got IE and want scaling effect? Kiss my ass.
            options.useScaling = false;
        }
        
        var callbackFunction;
        if (typeof(arguments[1]) == 'function') {
            var callbackFunction = arguments[1];
        } else if (typeof(arguments[2] == 'function')) {
            var callbackFunction = arguments[2];
        }
    
        
        return this.each(function (i) {
            var val;
            var animationQueue = []; // used to store all the animation params before starting the animation; solves initial animation slowdowns
            var $collection = $(collection).clone(); // destination (target) collection
            var $sourceParent = $(this); // source, the visible container of source collection
            var sourceHeight = $(this).css('height'); // used to keep height and document flow during the animation
            
            var destHeight;
            var adjustHeightOnCallback = false;
            
            var offset = $($sourceParent).offset(); // offset of visible container, used in animation calculations
            var offsets = []; // coordinates of every source collection item            
            
            var $source = $(this).find(options.selector); // source collection items
            
            // Replace the collection and quit if IE6
            if ($.browser.msie && $.browser.version.substr(0,1)<7) {
                $sourceParent.html('').append($collection);
                return;
            }

            // Gets called when any animation is finished
            var postCallbackPerformed = 0; // prevents the function from being called more than one time
            var postCallback = function () {
                if (!postCallbackPerformed) {
                    $sourceParent.html($dest.html()); // put target HTML into visible source container        
                    if (typeof callbackFunction == 'function') {
                        callbackFunction.call(this);
                    }
                    if (adjustHeightOnCallback) {
                        $sourceParent.css('height', destHeight);
                    }
                    options.enhancement($sourceParent); // Perform custom visual enhancements on a newly replaced collection
                    postCallbackPerformed = 1;
                }
            };
            
            // Position: relative situations
            var $correctionParent = $sourceParent.offsetParent();
            var correctionOffset = $correctionParent.offset();
            
            if ($correctionParent.css('position') == 'relative') {
            	if ($correctionParent.get(0).nodeName.toLowerCase() == 'body') {

                } else {
                	correctionOffset.top += parseFloat($correctionParent.css('border-top-width'));
                    correctionOffset.left += parseFloat($correctionParent.css('border-left-width'));
                }
            } else {
                correctionOffset.top -= parseFloat($correctionParent.css('border-top-width'));
                correctionOffset.left -= parseFloat($correctionParent.css('border-left-width'));
                correctionOffset.top -= parseFloat($correctionParent.css('margin-top'));
                correctionOffset.left -= parseFloat($correctionParent.css('margin-left'));
            }


            // keeps nodes after source container, holding their position
            $sourceParent.css('height', $(this).height());
            
            // get positions of source collections
            $source.each(function (i) {
                offsets[i] = $(this).offset();
            });
            
            // stops previous animations on source container
            $(this).stop(); 
            $source.each(function (i) {
                $(this).stop(); // stop animation of collection items
                var rawObj = $(this).get(0);

                rawObj.style.position = 'absolute';
                rawObj.style.margin = '0';



                rawObj.style.top = (offsets[i].top - parseFloat(rawObj.style.marginTop) - correctionOffset.top) + 'px';
                rawObj.style.left = (offsets[i].left - parseFloat(rawObj.style.marginLeft) - correctionOffset.left) + 'px';
            });
                    
            // create temporary container with destination collection
            var $dest = $($sourceParent).clone();
            var rawDest = $dest.get(0);
            rawDest.innerHTML = '';
            rawDest.setAttribute('id', '');
            rawDest.style.height = 'auto';
            rawDest.style.width = $sourceParent.width() + 'px';
            $dest.append($collection);      
            // insert node into HTML
            // Note that the node is under visible source container in the exactly same position
            // The browser render all the items without showing them (opacity: 0.0)
            // No offset calculations are needed, the browser just extracts position from underlayered destination items
            // and sets animation to destination positions.
            $dest.insertBefore($sourceParent);
            $dest.css('opacity', 0.0);
            rawDest.style.zIndex = -1;
            
            rawDest.style.margin = '0';
            rawDest.style.position = 'absolute';
            rawDest.style.top = offset.top - correctionOffset.top + 'px';
            rawDest.style.left = offset.left - correctionOffset.left + 'px';
            
            
    
            

            if (options.adjustHeight === 'dynamic') {
                // If destination container has different height than source container
                // the height can be animated, adjusting it to destination height
                $sourceParent.animate({height: $dest.height()}, options.duration, options.easing);
            } else if (options.adjustHeight === 'auto') {
                destHeight = $dest.height();
                if (parseFloat(sourceHeight) < parseFloat(destHeight)) {
                    // Adjust the height now so that the items don't move out of the container
                    $sourceParent.css('height', destHeight);
                } else {
                    //  Adjust later, on callback
                    adjustHeightOnCallback = true;
                }
            }
                
            // Now it's time to do shuffling animation
            // First of all, we need to identify same elements within source and destination collections    
            $source.each(function (i) {
                var destElement = [];
                if (typeof(options.attribute) == 'function') {
                    
                    val = options.attribute($(this));
                    $collection.each(function() {
                        if (options.attribute(this) == val) {
                            destElement = $(this);
                            return false;
                        }
                    });
                } else {
                    destElement = $collection.filter('[' + options.attribute + '=' + $(this).attr(options.attribute) + ']');
                }
                if (destElement.length) {
                    // The item is both in source and destination collections
                    // It it's under different position, let's move it
                    if (!options.useScaling) {
                        animationQueue.push(
                                            {
                                                element: $(this), 
                                                animation: 
                                                    {top: destElement.offset().top - correctionOffset.top, 
                                                     left: destElement.offset().left - correctionOffset.left, 
                                                     opacity: 1.0
                                                    }
                                            });

                    } else {
                        animationQueue.push({
                                            element: $(this), 
                                            animation: {top: destElement.offset().top - correctionOffset.top, 
                                                        left: destElement.offset().left - correctionOffset.left, 
                                                        opacity: 1.0, 
                                                        scale: '1.0'
                                                       }
                                            });

                    }
                } else {
                    // The item from source collection is not present in destination collections
                    // Let's remove it
                    if (!options.useScaling) {
                        animationQueue.push({element: $(this), 
                                             animation: {opacity: '0.0'}});
                    } else {
                        animationQueue.push({element: $(this), animation: {opacity: '0.0', 
                                         scale: '0.0'}});
                    }
                }
            });
            
            $collection.each(function (i) {
                // Grab all items from target collection not present in visible source collection
                
                var sourceElement = [];
                var destElement = [];
                if (typeof(options.attribute) == 'function') {
                    val = options.attribute($(this));
                    $source.each(function() {
                        if (options.attribute(this) == val) {
                            sourceElement = $(this);
                            return false;
                        }
                    });                 

                    $collection.each(function() {
                        if (options.attribute(this) == val) {
                            destElement = $(this);
                            return false;
                        }
                    });
                } else {
                    sourceElement = $source.filter('[' + options.attribute + '=' + $(this).attr(options.attribute) + ']');
                    destElement = $collection.filter('[' + options.attribute + '=' + $(this).attr(options.attribute) + ']');
                }
                
                var animationOptions;
                if (sourceElement.length === 0) {
                    // No such element in source collection...
                    if (!options.useScaling) {
                        animationOptions = {
                            opacity: '1.0'
                        };
                    } else {
                        animationOptions = {
                            opacity: '1.0',
                            scale: '1.0'
                        };
                    }
                    // Let's create it
                    d = destElement.clone();
                    var rawDestElement = d.get(0);
                    rawDestElement.style.position = 'absolute';
                    rawDestElement.style.margin = '0';
                    rawDestElement.style.top = destElement.offset().top - correctionOffset.top + 'px';
                    rawDestElement.style.left = destElement.offset().left - correctionOffset.left + 'px';
                    d.css('opacity', 0.0); // IE
                    if (options.useScaling) {
                        d.css('transform', 'scale(0.0)');
                    }
                    d.appendTo($sourceParent);
                    
                    animationQueue.push({element: $(d), 
                                         animation: animationOptions});
                }
            });
            
            $dest.remove();
            options.enhancement($sourceParent); // Perform custom visual enhancements during the animation
            for (i = 0; i < animationQueue.length; i++) {
                animationQueue[i].element.animate(animationQueue[i].animation, options.duration, options.easing, postCallback);
            }
        });
    };
})(jQuery);



//   /fileadmin/scripts/uniform/jquery.uniform.min.js
(function(a){a.uniform={options:{selectClass:"selector",radioClass:"radio",checkboxClass:"checker",fileClass:"uploader",filenameClass:"filename",fileBtnClass:"action",fileDefaultText:"No file selected",fileBtnText:"Choose File",checkedClass:"checked",focusClass:"focus",disabledClass:"disabled",activeClass:"active",hoverClass:"hover",useID:true,idPrefix:"uniform",resetSelector:false},elements:[]};if(a.browser.msie&&a.browser.version<7){a.support.selectOpacity=false}else{a.support.selectOpacity=true}a.fn.uniform=function(c){c=a.extend(a.uniform.options,c);var e=this;if(c.resetSelector!=false){a(c.resetSelector).mouseup(function(){function i(){a.uniform.update(e)}setTimeout(i,10)})}function b(k){var l=a("<div />"),i=a("<span />");l.addClass(c.selectClass);if(c.useID){l.attr("id",c.idPrefix+"-"+k.attr("id"))}var j=k.find(":selected:first");if(j.length==0){j=k.find("option:first")}i.html(j.text());k.css("opacity",0);k.wrap(l);k.before(i);l=k.parent("div");i=k.siblings("span");k.change(function(){i.text(k.find(":selected").text());l.removeClass(c.activeClass)}).focus(function(){l.addClass(c.focusClass)}).blur(function(){l.removeClass(c.focusClass);l.removeClass(c.activeClass)}).mousedown(function(){l.addClass(c.activeClass)}).mouseup(function(){l.removeClass(c.activeClass)}).click(function(){l.removeClass(c.activeClass)}).hover(function(){l.addClass(c.hoverClass)},function(){l.removeClass(c.hoverClass)}).keyup(function(){i.text(k.find(":selected").text())});if(a(k).attr("disabled")){l.addClass(c.disabledClass)}a.uniform.noSelect(i);h(k)}function d(j){var k=a("<div />"),i=a("<span />");k.addClass(c.checkboxClass);if(c.useID){k.attr("id",c.idPrefix+"-"+j.attr("id"))}a(j).wrap(k);a(j).wrap(i);i=j.parent();k=i.parent();a(j).css("opacity",0).focus(function(){k.addClass(c.focusClass)}).blur(function(){k.removeClass(c.focusClass)}).click(function(){if(!a(j).attr("checked")){i.removeClass(c.checkedClass)}else{i.addClass(c.checkedClass)}}).mousedown(function(){k.addClass(c.activeClass)}).mouseup(function(){k.removeClass(c.activeClass)}).hover(function(){k.addClass(c.hoverClass)},function(){k.removeClass(c.hoverClass)});if(a(j).attr("checked")){i.addClass(c.checkedClass)}if(a(j).attr("disabled")){k.addClass(c.disabledClass)}h(j)}function f(j){var k=a("<div />"),i=a("<span />");k.addClass(c.radioClass);if(c.useID){k.attr("id",c.idPrefix+"-"+j.attr("id"))}a(j).wrap(k);a(j).wrap(i);i=j.parent();k=i.parent();a(j).css("opacity",0).focus(function(){k.addClass(c.focusClass)}).blur(function(){k.removeClass(c.focusClass)}).click(function(){if(!a(j).attr("checked")){i.removeClass(c.checkedClass)}else{a("."+c.radioClass+" span."+c.checkedClass+":has([name='"+a(j).attr("name")+"'])").removeClass(c.checkedClass);i.addClass(c.checkedClass)}}).mousedown(function(){if(!a(j).is(":disabled")){k.addClass(c.activeClass)}}).mouseup(function(){k.removeClass(c.activeClass)}).hover(function(){k.addClass(c.hoverClass)},function(){k.removeClass(c.hoverClass)});if(a(j).attr("checked")){i.addClass(c.checkedClass)}if(a(j).attr("disabled")){k.addClass(c.disabledClass)}h(j)}function g(l){$el=a(l);var m=a("<div />"),k=a("<span>"+c.fileDefaultText+"</span>"),j=a("<span>"+c.fileBtnText+"</span>");m.addClass(c.fileClass);k.addClass(c.filenameClass);j.addClass(c.fileBtnClass);if(c.useID){m.attr("id",c.idPrefix+"-"+$el.attr("id"))}$el.wrap(m);$el.after(j);$el.after(k);m=$el.closest("div");k=$el.siblings("."+c.filenameClass);j=$el.siblings("."+c.fileBtnClass);if(!$el.attr("size")){var i=m.width();$el.attr("size",i/10)}$el.css("opacity",0).focus(function(){m.addClass(c.focusClass)}).blur(function(){m.removeClass(c.focusClass)}).change(function(){var n=a(this).val();n=n.split(/[\/\\]+/);n=n[(n.length-1)];k.text(n)}).mousedown(function(){if(!a(l).is(":disabled")){m.addClass(c.activeClass)}}).mouseup(function(){m.removeClass(c.activeClass)}).hover(function(){m.addClass(c.hoverClass)},function(){m.removeClass(c.hoverClass)});if($el.attr("disabled")){m.addClass(c.disabledClass)}a.uniform.noSelect(k);a.uniform.noSelect(j);h(l)}function h(i){i=a(i).get();if(i.length>1){a.each(i,function(j,k){a.uniform.elements.push(k)})}else{a.uniform.elements.push(i)}}a.uniform.noSelect=function(i){function j(){return false}a(i).each(function(){this.onselectstart=this.ondragstart=j;a(this).mousedown(j).css({MozUserSelect:"none"})})};a.uniform.update=function(i){if(i==undefined){i=a(a.uniform.elements)}i=a(i);i.each(function(){$e=a(this);if($e.is("select")){spanTag=$e.siblings("span");divTag=$e.parent("div");divTag.removeClass(c.hoverClass+" "+c.focusClass+" "+c.activeClass);spanTag.html($e.find(":selected").text());if($e.is(":disabled")){divTag.addClass(c.disabledClass)}else{divTag.removeClass(c.disabledClass)}}else{if($e.is(":checkbox")){spanTag=$e.closest("span");divTag=$e.closest("div");divTag.removeClass(c.hoverClass+" "+c.focusClass+" "+c.activeClass);spanTag.removeClass(c.checkedClass);if($e.is(":checked")){spanTag.addClass(c.checkedClass)}if($e.is(":disabled")){divTag.addClass(c.disabledClass)}else{divTag.removeClass(c.disabledClass)}}else{if($e.is(":radio")){spanTag=$e.closest("span");divTag=$e.closest("div");divTag.removeClass(c.hoverClass+" "+c.focusClass+" "+c.activeClass);spanTag.removeClass(c.checkedClass);if($e.is(":checked")){spanTag.addClass(c.checkedClass)}if($e.is(":disabled")){divTag.addClass(c.disabledClass)}else{divTag.removeClass(c.disabledClass)}}else{if($e.is(":file")){divTag=$e.parent("div");filenameTag=$e.siblings(c.filenameClass);btnTag=$e.siblings(c.fileBtnClass);divTag.removeClass(c.hoverClass+" "+c.focusClass+" "+c.activeClass);filenameTag.text($e.val());if($e.is(":disabled")){divTag.addClass(c.disabledClass)}else{divTag.removeClass(c.disabledClass)}}}}}})};return this.each(function(){if(a.support.selectOpacity){var i=a(this);if(i.is("select")){if(i.attr("multiple")!=true){b(i)}}else{if(i.is(":checkbox")){d(i)}else{if(i.is(":radio")){f(i)}else{if(i.is(":file")){g(i)}}}}}})}})(jQuery);



//   /fileadmin/scripts/livevalidation_standalone.compressed.js

// LiveValidation 1.4 (standalone version)
// Copyright (c) 2007-2010 Alec Hill (www.livevalidation.com)
// LiveValidation is licensed under the terms of the MIT License

/*********************************************** LiveValidation class ***********************************/

/**
 *	validates a form field in real-time based on validations you assign to it
 *	
 *	@param element {mixed} - either a dom element reference or the string id of the element to validate
 *	@param optionsObj {Object} - general options, see below for details
 *
 *	optionsObj properties:
 *							validMessage {String} 	- the message to show when the field passes validation (set to '' or false to not insert any message)
 *													  (DEFAULT: "Thankyou!")
 *                          beforeValidation {Function} - function to execute directly before validation is performed
 *													  (DEFAULT: function(){})
 *                          afterValidation {Function} - function to execute directly after validation is performed
 *													  (DEFAULT: function(){})
 *                          beforeValid {Function} - function to execute directly before the onValid function is executed
 *													  (DEFAULT: function(){})
 *							onValid {Function} 		- function to execute when field passes validation
 *													  (DEFAULT: function(){ this.insertMessage(this.createMessageSpan()); this.addFieldClass(); } )	
 *                          afterValid {Function} - function to execute directly after the onValid function is executed
 *													  (DEFAULT: function(){})
 *                          beforeInvalid {Function} - function to execute directly before the onInvalid function is executed
 *													  (DEFAULT: function(){})
 *							onInvalid {Function} 	- function to execute when field fails validation
 *													  (DEFAULT: function(){ this.insertMessage(this.createMessageSpan()); this.addFieldClass(); })
 *                          aterInvalid {Function} - function to execute directly after the onInvalid function is executed
 *													  (DEFAULT: function(){})
 *							insertAfterWhatNode {Int} 	- position to insert default message
 *													  (DEFAULT: the field that is being validated)	
 *              onlyOnBlur {Boolean} - whether you want it to validate as you type or only on blur
 *                            (DEFAULT: false)
 *              wait {Integer} - the time you want it to pause from the last keystroke before it validates (ms)
 *                            (DEFAULT: 0)
 *              onlyOnSubmit {Boolean} - whether should be validated only when the form it belongs to is submitted
 *                            (DEFAULT: false)						
 */
var LiveValidation = function(element, optionsObj){
  	this.initialize(element, optionsObj);
}

LiveValidation.VERSION = '1.4 standalone';

/** element types constants ****/

LiveValidation.TEXTAREA = 1;
LiveValidation.TEXT     = 2;
LiveValidation.PASSWORD = 3;
LiveValidation.CHECKBOX = 4;
LiveValidation.SELECT   = 5;
LiveValidation.FILE     = 6;

/****** Static methods *******/

/**
 *	pass an array of LiveValidation objects and it will validate all of them
 *	
 *	@param validations {Array} - an array of LiveValidation objects
 *	@return {Bool} - true if all passed validation, false if any fail						
 */
LiveValidation.massValidate = function(validations){
  var returnValue = true;
	for(var i = 0, len = validations.length; i < len; ++i ){
		var valid = validations[i].validate();
		if(returnValue) returnValue = valid;
	}
	return returnValue;
}

/****** prototype ******/

LiveValidation.prototype = {

    validClass: 'LV_valid',
    invalidClass: 'LV_invalid',
    messageClass: 'LV_validation_message',
    validFieldClass: 'LV_valid_field',
    invalidFieldClass: 'LV_invalid_field',
    
    /**
     *	initialises all of the properties and events
     *
     * @param - Same as constructor above
     */
    initialize: function(element, optionsObj){
      var self = this;
      if(!element) throw new Error("LiveValidation::initialize - No element reference or element id has been provided!");
      this.element = element.nodeName ? element : document.getElementById(element);
      if(!this.element) throw new Error("LiveValidation::initialize - No element with reference or id of '" + element + "' exists!");
      // default properties that could not be initialised above
      this.validations = [];
      this.elementType = this.getElementType();
      this.form = this.element.form;
      // options
      var options = optionsObj || {};
      this.validMessage = options.validMessage || 'Thankyou!';
      var node = options.insertAfterWhatNode || this.element;
	  this.insertAfterWhatNode = node.nodeType ? node : document.getElementById(node);
      this.onlyOnBlur =  options.onlyOnBlur || false;
      this.wait = options.wait || 0;
      this.onlyOnSubmit = options.onlyOnSubmit || false;
	  // hooks
	  this.beforeValidation = options.beforeValidation || function(){};
	  this.beforeValid = options.beforeValid || function(){};
      this.onValid = options.onValid || function(){ this.insertMessage(this.createMessageSpan()); this.addFieldClass(); };
	  this.afterValid = options.afterValid || function(){};
	  this.beforeInvalid = options.beforeInvalid || function(){};
      this.onInvalid = options.onInvalid || function(){ this.insertMessage(this.createMessageSpan()); this.addFieldClass(); };	
	  this.afterInvalid = options.afterInvalid || function(){};	
	  this.afterValidation = options.afterValidation || function(){};
      // add to form if it has been provided
      if(this.form){
        this.formObj = LiveValidationForm.getInstance(this.form);
        this.formObj.addField(this);
      }
      // events
      // collect old events
      this.oldOnFocus = this.element.onfocus || function(){};
      this.oldOnBlur = this.element.onblur || function(){};
      this.oldOnClick = this.element.onclick || function(){};
      this.oldOnChange = this.element.onchange || function(){};
      this.oldOnKeyup = this.element.onkeyup || function(){};
      this.element.onfocus = function(e){ self.doOnFocus(e); return self.oldOnFocus.call(this, e); }
      if(!this.onlyOnSubmit){
        switch(this.elementType){
          case LiveValidation.CHECKBOX:
            this.element.onclick = function(e){ self.validate(); return self.oldOnClick.call(this, e); }
          // let it run into the next to add a change event too
          case LiveValidation.SELECT:
          case LiveValidation.FILE:
            this.element.onchange = function(e){ self.validate(); return self.oldOnChange.call(this, e); }
            break;
          default:
            if(!this.onlyOnBlur) this.element.onkeyup = function(e){ self.deferValidation(); return self.oldOnKeyup.call(this, e); }
      	    this.element.onblur = function(e){ self.doOnBlur(e); return self.oldOnBlur.call(this, e); }
        }
      }
    },
	
	/**
     *	destroys the instance's events (restoring previous ones) and removes it from any LiveValidationForms
     */
    destroy: function(){
  	  if(this.formObj){
		// remove the field from the LiveValidationForm
		this.formObj.removeField(this);
		// destroy the LiveValidationForm if no LiveValidation fields left in it
		this.formObj.destroy();
	  }
      // remove events - set them back to the previous events
	  this.element.onfocus = this.oldOnFocus;
      if(!this.onlyOnSubmit){
        switch(this.elementType){
          case LiveValidation.CHECKBOX:
            this.element.onclick = this.oldOnClick;
          // let it run into the next to add a change event too
          case LiveValidation.SELECT:
          case LiveValidation.FILE:
            this.element.onchange = this.oldOnChange;
            break;
          default:
            if(!this.onlyOnBlur) this.element.onkeyup = this.oldOnKeyup;
      	    this.element.onblur = this.oldOnBlur;
        }
      }
      this.validations = [];
	  this.removeMessageAndFieldClass();
    },
    
    /**
     *	adds a validation to perform to a LiveValidation object
     *
     *	@param validationFunction {Function} - validation function to be used (ie Validate.Presence )
     *	@param validationParamsObj {Object} - parameters for doing the validation, if wanted or necessary
     * @return {Object} - the LiveValidation object itself so that calls can be chained
     */
    add: function(validationFunction, validationParamsObj){
      this.validations.push( {type: validationFunction, params: validationParamsObj || {} } );
      return this;
    },
    
	/**
     *	removes a validation from a LiveValidation object - must have exactly the same arguments as used to add it 
     *
     *	@param validationFunction {Function} - validation function to be used (ie Validate.Presence )
     *	@param validationParamsObj {Object} - parameters for doing the validation, if wanted or necessary
     *  @return {Object} - the LiveValidation object itself so that calls can be chained
     */
    remove: function(validationFunction, validationParamsObj){
  	  var victimless = [];
  	  for( var i = 0, len = this.validations.length; i < len; i++){
	       var v = this.validations[i];
	       if(v.type != validationFunction && v.params != validationParamsObj) victimless.push(v);
	  }
	  this.validations = victimless;
      return this;
    },
    
	
    /**
     * makes the validation wait the alotted time from the last keystroke 
     */
    deferValidation: function(e){
      if(this.wait >= 300) this.removeMessageAndFieldClass();
      var self = this;
      if(this.timeout) clearTimeout(self.timeout);
      this.timeout = setTimeout( function(){ self.validate() }, self.wait); 
    },
        
    /**
     * sets the focused flag to false when field loses focus 
     */
    doOnBlur: function(e){
      this.focused = false;
      this.validate(e);
    },
        
    /**
     * sets the focused flag to true when field gains focus 
     */
    doOnFocus: function(e){
      this.focused = true;
      this.removeMessageAndFieldClass();
    },
    
    /**
     *	gets the type of element, to check whether it is compatible
     *
     *	@param validationFunction {Function} - validation function to be used (ie Validate.Presence )
     *	@param validationParamsObj {Object} - parameters for doing the validation, if wanted or necessary
     */
    getElementType: function(){
		var nn = this.element.nodeName.toUpperCase();
		var nt = this.element.type.toUpperCase();
	    switch(true){
	      case (nn == 'TEXTAREA'):
	        return LiveValidation.TEXTAREA;
	      case (nn == 'INPUT' && nt == 'TEXT'):
	        return LiveValidation.TEXT;
	      case (nn == 'INPUT' && nt == 'PASSWORD'):
	        return LiveValidation.PASSWORD;
	      case (nn == 'INPUT' && nt == 'CHECKBOX'):
	        return LiveValidation.CHECKBOX;
	      case (nn == 'INPUT' && nt == 'FILE'):
	        return LiveValidation.FILE;
	      case (nn == 'SELECT'):
	        return LiveValidation.SELECT;
	      case (nn == 'INPUT'):
	        throw new Error('LiveValidation::getElementType - Cannot use LiveValidation on an ' + nt.toLowerCase() + ' input!');
	      default:
	        throw new Error('LiveValidation::getElementType - Element must be an input, select, or textarea - ' + nn.toLowerCase() + ' was given!');
	    }
	  },
    
    /**
     *	loops through all the validations added to the LiveValidation object and checks them one by one
     *
     *	@param validationFunction {Function} - validation function to be used (ie Validate.Presence )
     *	@param validationParamsObj {Object} - parameters for doing the validation, if wanted or necessary
     *  @return {Boolean} - whether the all the validations passed or if one failed
     */
    doValidations: function(){
      	this.validationFailed = false;
      	for(var i = 0, len = this.validations.length; i < len; ++i){
			this.validationFailed = !this.validateElement(this.validations[i].type, this.validations[i].params);
    		if(this.validationFailed) return false;	
    	}
    	this.message = this.validMessage;
    	return true;
    },
    
    /**
     *	performs validation on the element and handles any error (validation or otherwise) it throws up
     *
     *	@param validationFunction {Function} - validation function to be used (ie Validate.Presence )
     *	@param validationParamsObj {Object} - parameters for doing the validation, if wanted or necessary
     *  @return {Boolean} - whether the validation has passed or failed
     */
    validateElement: function(validationFunction, validationParamsObj){
		// check whether we should display the message when empty
		switch(validationFunction){
    		case Validate.Presence:
            case Validate.Confirmation:
            case Validate.Acceptance:
    			this.displayMessageWhenEmpty = true;
    			break;
			case Validate.Custom:
				if(validationParamsObj.displayMessageWhenEmpty) this.displayMessageWhenEmpty = true;
				break;
    	}
		// select and checkbox elements values are handled differently
		var value = (this.elementType == LiveValidation.SELECT) ? this.element.options[this.element.selectedIndex].value : this.element.value; 
        if(validationFunction == Validate.Acceptance){
    	    if(this.elementType != LiveValidation.CHECKBOX) throw new Error('LiveValidation::validateElement - Element to validate acceptance must be a checkbox!');
    		value = this.element.checked;
    	}
		// now validate
        var isValid = true;
      	try{    
    		validationFunction(value, validationParamsObj);
    	} catch(error) {
    	  	if(error instanceof Validate.Error){
    			if( value !== '' || (value === '' && this.displayMessageWhenEmpty) ){
    				this.validationFailed = true;
					// Opera 10 adds stacktrace after newline
    				this.message = error.message.split('\n')[0];
    				isValid = false;
    			}
    		}else{
    		  	throw error;
    		}
    	}finally{
    	    return isValid;
        }
    },
    
    /**
     *	makes it do the all the validations and fires off the various callbacks
     *
     *  @return {Boolean} - whether the all the validations passed or if one failed
     */
    validate: function(){
      if(!this.element.disabled){
		this.beforeValidation();
		var isValid = this.doValidations();
		if(isValid){
			this.beforeValid();
			this.onValid();
			this.afterValid();
			return true;
		}else {
			this.beforeInvalid();
			this.onInvalid();
			this.afterInvalid();
			return false;
		}
		this.afterValidation();
	  }else{
      	return true;
      }
    },
	
 /**
   *  enables the field
   *
   *  @return {LiveValidation} - the LiveValidation object for chaining
   */
  enable: function(){
  	this.element.disabled = false;
	return this;
  },
  
  /**
   *  disables the field and removes any message and styles associated with the field
   *
   *  @return {LiveValidation} - the LiveValidation object for chaining
   */
  disable: function(){
  	this.element.disabled = true;
	this.removeMessageAndFieldClass();
	return this;
  },
    
    /** Message insertion methods ****************************
     * 
     * These are only used in the onValid and onInvalid callback functions and so if you overide the default callbacks,
     * you must either impliment your own functions to do whatever you want, or call some of these from them if you 
     * want to keep some of the functionality
     */
    
    /**
     *	makes a span containg the passed or failed message
     *
     * @return {HTMLSpanObject} - a span element with the message in it
     */
    createMessageSpan: function(){
        var span = document.createElement('span');
    	var textNode = document.createTextNode(this.message);
      	span.appendChild(textNode);
        return span;
    },
    
    /**
     *	inserts the element containing the message in place of the element that already exists (if it does)
     *
     * @param elementToIsert {HTMLElementObject} - an element node to insert
     */
    insertMessage: function(elementToInsert){
      	this.removeMessage();
		if(!this.validationFailed && !this.validMessage) return; // dont insert anything if vaalidMesssage has been set to false or empty string
      	if( (this.displayMessageWhenEmpty 
	      && (this.elementType == LiveValidation.CHECKBOX || this.element.value == ''))
    	  || this.element.value != '' ){
            var className = this.validationFailed ? this.invalidClass : this.validClass;
    	  	elementToInsert.className += ' ' + this.messageClass + ' ' + className;
			var parent = this.insertAfterWhatNode.parentNode;
            if(this.insertAfterWhatNode.nextSibling){
    		  	parent.insertBefore(elementToInsert, this.insertAfterWhatNode.nextSibling);
    		}else{
    	        parent.appendChild(elementToInsert);
    	    }
    	}
    },
    
    
    /**
     *	changes the class of the field based on whether it is valid or not
     */
    addFieldClass: function(){
        this.removeFieldClass();
        if(!this.validationFailed){
            if(this.displayMessageWhenEmpty || this.element.value != ''){
                if(this.element.className.indexOf(this.validFieldClass) == -1) this.element.className += ' ' + this.validFieldClass;
            }
        }else{
            if(this.element.className.indexOf(this.invalidFieldClass) == -1) this.element.className += ' ' + this.invalidFieldClass;
        }
    },
    
    /**
     *	removes the message element if it exists, so that the new message will replace it
     */
    removeMessage: function(){
    	var nextEl;
    	var el = this.insertAfterWhatNode;
    	while(el.nextSibling){
    	    if(el.nextSibling.nodeType === 1){
    		  	nextEl = el.nextSibling;
    		  	break;
    		}
    		el = el.nextSibling;
    	}
      	if(nextEl && nextEl.className.indexOf(this.messageClass) != -1) this.insertAfterWhatNode.parentNode.removeChild(nextEl);
    },
    
    /**
     *	removes the class that has been applied to the field to indicte if valid or not
     */
    removeFieldClass: function(){
	  var cn = this.element.className;
      if(cn.indexOf(this.invalidFieldClass) != -1) this.element.className = cn.split(this.invalidFieldClass).join('');
      if(cn.indexOf(this.validFieldClass) != -1) this.element.className = cn.split(this.validFieldClass).join(' ');
    },
        
    /**
     *	removes the message and the field class
     */
    removeMessageAndFieldClass: function(){
      this.removeMessage();
      this.removeFieldClass();
    }

} 

/*************************************** LiveValidationForm class ****************************************/
/**
 * This class is used internally by LiveValidation class to associate a LiveValidation field with a form it is icontained in one
 * 
 * It will therefore not really ever be needed to be used directly by the developer, unless they want to associate a LiveValidation 
 * field with a form that it is not a child of, or add some extra functionality via the hooks (access through a LiveValidation object's formObj property)
 */

/**
   *	handles validation of LiveValidation fields belonging to this form on its submittal
   *	
   *	@param element {HTMLFormElement} - a dom element reference to the form to turn into a LiveValidationForm
   */
var LiveValidationForm = function(element){
  this.initialize(element);
}

/**
 * namespace to hold instances
 */
LiveValidationForm.instances = {};

/**
   *	gets the instance of the LiveValidationForm if it has already been made or creates it if it doesnt exist
   *	
   *	@param element {mixed} - a dom element reference to or id of a form
   */
LiveValidationForm.getInstance = function(element){
  if(!element) throw new Error("LiveValidationForm::getInstance - No element reference or element id has been provided!");
  var el = element.nodeName ? element : document.getElementById(element);
  var rand = Math.random() * Math.random();
  if(!el.id) el.id = 'formId_' + rand.toString().replace(/\./, '') + new Date().valueOf();
  if(!LiveValidationForm.instances[el.id]) LiveValidationForm.instances[el.id] = new LiveValidationForm(el);
  return LiveValidationForm.instances[el.id];
}

LiveValidationForm.prototype = {
  
  beforeValidation: function(){},
  onValid: function(){},
  onInvalid: function(){},
  afterValidation: function(){},
  
  /**
   *	constructor for LiveValidationForm - handles validation of LiveValidation fields belonging to this form on its submittal
   *	
   *	@param element {HTMLFormElement} - a dom element reference to the form to turn into a LiveValidationForm
   */
  initialize: function(element){
  	this.name = element.id;
    this.element = element;
    this.fields = [];
    // preserve the old onsubmit event
	this.oldOnSubmit = this.element.onsubmit || function(){};
    var self = this;
    this.element.onsubmit = function(e){
      var ret = false;
      self.beforeValidation(),
      self.valid = LiveValidation.massValidate(self.fields);
      self.valid ? self.onValid() : self.onInvalid();
      self.afterValidation();
	  if(self.valid) ret = self.oldOnSubmit.call(this, e || window.event) !== false;
	  if(!ret) return ret;
    }
  },
  
  /**
   *	adds a LiveValidation field to the forms fields array
   *	
   *	@param element {LiveValidation} - a LiveValidation object
   */
  addField: function(newField){
    this.fields.push(newField);
  },
  
  /**
   *	removes a LiveValidation field from the forms fields array
   *	
   *	@param victim {LiveValidation} - a LiveValidation object
   */
  removeField: function(victim){
  	var victimless = [];
  	for( var i = 0, len = this.fields.length; i < len; i++){
		if(this.fields[i] !== victim) victimless.push(this.fields[i]);
	}
    this.fields = victimless;
  },
  
  /**
   *	destroy this instance and its events
   *
   * @param force {Boolean} - whether to force the detruction even if there are fields still associated
   */
  destroy: function(force){
  	// only destroy if has no fields and not being forced
  	if (this.fields.length != 0 && !force) return false;
	// remove events - set back to previous events
	this.element.onsubmit = this.oldOnSubmit;
	// remove from the instances namespace
	LiveValidationForm.instances[this.name] = null;
	return true;
  }
   
}

/*************************************** Validate class ****************************************/
/**
 * This class contains all the methods needed for doing the actual validation itself
 *
 * All methods are static so that they can be used outside the context of a form field
 * as they could be useful for validating stuff anywhere you want really
 *
 * All of them will return true if the validation is successful, but will raise a ValidationError if
 * they fail, so that this can be caught and the message explaining the error can be accessed ( as just 
 * returning false would leave you a bit in the dark as to why it failed )
 *
 * Can use validation methods alone and wrap in a try..catch statement yourself if you want to access the failure
 * message and handle the error, or use the Validate::now method if you just want true or false
 */

var Validate = {

    /**
     *	validates that the field has been filled in
     *
     *	@param value {mixed} - value to be checked
     *	@param paramsObj {Object} - parameters for this particular validation, see below for details
     *
     *	paramsObj properties:
     *							failureMessage {String} - the message to show when the field fails validation 
     *													  (DEFAULT: "Can't be empty!")
     */
    Presence: function(value, paramsObj){
      	var paramsObj = paramsObj || {};
    	var message = paramsObj.failureMessage || "Can't be empty!";
    	if(value === '' || value === null || value === undefined) Validate.fail(message);
    	return true;
    },
    
    /**
     *	validates that the value is numeric, does not fall within a given range of numbers
     *	
     *	@param value {mixed} - value to be checked
     *	@param paramsObj {Object} - parameters for this particular validation, see below for details
     *
     *	paramsObj properties:
     *							notANumberMessage {String} - the message to show when the validation fails when value is not a number
     *													  	  (DEFAULT: "Must be a number!")
     *							notAnIntegerMessage {String} - the message to show when the validation fails when value is not an integer
     *													  	  (DEFAULT: "Must be a number!")
     *							wrongNumberMessage {String} - the message to show when the validation fails when is param is used
     *													  	  (DEFAULT: "Must be {is}!")
     *							tooLowMessage {String} 		- the message to show when the validation fails when minimum param is used
     *													  	  (DEFAULT: "Must not be less than {minimum}!")
     *							tooHighMessage {String} 	- the message to show when the validation fails when maximum param is used
     *													  	  (DEFAULT: "Must not be more than {maximum}!")
     *							is {Int} 					- the length must be this long 
     *							minimum {Int} 				- the minimum length allowed
     *							maximum {Int} 				- the maximum length allowed
     *                         onlyInteger {Boolean} - if true will only allow integers to be valid
     *                                                             (DEFAULT: false)
     *
     *  NB. can be checked if it is within a range by specifying both a minimum and a maximum
     *  NB. will evaluate numbers represented in scientific form (ie 2e10) correctly as numbers				
     */
    Numericality: function(value, paramsObj){
        var suppliedValue = value;
        var value = Number(value);
    	var paramsObj = paramsObj || {};
        var minimum = ((paramsObj.minimum) || (paramsObj.minimum == 0)) ? paramsObj.minimum : null;;
        var maximum = ((paramsObj.maximum) || (paramsObj.maximum == 0)) ? paramsObj.maximum : null;
    	var is = ((paramsObj.is) || (paramsObj.is == 0)) ? paramsObj.is : null;
        var notANumberMessage = paramsObj.notANumberMessage || "Must be a number!";
        var notAnIntegerMessage = paramsObj.notAnIntegerMessage || "Must be an integer!";
    	var wrongNumberMessage = paramsObj.wrongNumberMessage || "Must be " + is + "!";
    	var tooLowMessage = paramsObj.tooLowMessage || "Must not be less than " + minimum + "!";
    	var tooHighMessage = paramsObj.tooHighMessage || "Must not be more than " + maximum + "!";
        if (!isFinite(value)) Validate.fail(notANumberMessage);
        if (paramsObj.onlyInteger && (/\.0+$|\.$/.test(String(suppliedValue))  || value != parseInt(value)) ) Validate.fail(notAnIntegerMessage);
    	switch(true){
    	  	case (is !== null):
    	  		if( value != Number(is) ) Validate.fail(wrongNumberMessage);
    			break;
    	  	case (minimum !== null && maximum !== null):
    	  		Validate.Numericality(value, {tooLowMessage: tooLowMessage, minimum: minimum});
    	  		Validate.Numericality(value, {tooHighMessage: tooHighMessage, maximum: maximum});
    	  		break;
    	  	case (minimum !== null):
    	  		if( value < Number(minimum) ) Validate.fail(tooLowMessage);
    			break;
    	  	case (maximum !== null):
    	  		if( value > Number(maximum) ) Validate.fail(tooHighMessage);
    			break;
    	}
    	return true;
    },
    
    /**
     *	validates against a RegExp pattern
     *	
     *	@param value {mixed} - value to be checked
     *	@param paramsObj {Object} - parameters for this particular validation, see below for details
     *
     *	paramsObj properties:
     *							failureMessage {String} - the message to show when the field fails validation
     *													  (DEFAULT: "Not valid!")
     *							pattern {RegExp} 		- the regular expression pattern
     *													  (DEFAULT: /./)
     *             negate {Boolean} - if set to true, will validate true if the pattern is not matched
   *                           (DEFAULT: false)
     *
     *  NB. will return true for an empty string, to allow for non-required, empty fields to validate.
     *		If you do not want this to be the case then you must either add a LiveValidation.PRESENCE validation
     *		or build it into the regular expression pattern
     */
    Format: function(value, paramsObj){
      var value = String(value);
      var paramsObj = paramsObj || {};
      var message = paramsObj.failureMessage || "Not valid!";
      var pattern = paramsObj.pattern || /./;
      var negate = paramsObj.negate || false;
      if(!negate && !pattern.test(value)) Validate.fail(message); // normal
      if(negate && pattern.test(value)) Validate.fail(message); // negated
      return true;
    },
    
    /**
     *	validates that the field contains a valid email address
     *	
     *	@param value {mixed} - value to be checked
     *	@param paramsObj {Object} - parameters for this particular validation, see below for details
     *
     *	paramsObj properties:
     *							failureMessage {String} - the message to show when the field fails validation
     *													  (DEFAULT: "Must be a number!" or "Must be an integer!")
     */
    Email: function(value, paramsObj){
    	var paramsObj = paramsObj || {};
    	var message = paramsObj.failureMessage || "Must be a valid email address!";
    	Validate.Format(value, { failureMessage: message, pattern: /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i } );
    	return true;
    },
    
    /**
     *	validates the length of the value
     *	
     *	@param value {mixed} - value to be checked
     *	@param paramsObj {Object} - parameters for this particular validation, see below for details
     *
     *	paramsObj properties:
     *							wrongLengthMessage {String} - the message to show when the fails when is param is used
     *													  	  (DEFAULT: "Must be {is} characters long!")
     *							tooShortMessage {String} 	- the message to show when the fails when minimum param is used
     *													  	  (DEFAULT: "Must not be less than {minimum} characters long!")
     *							tooLongMessage {String} 	- the message to show when the fails when maximum param is used
     *													  	  (DEFAULT: "Must not be more than {maximum} characters long!")
     *							is {Int} 					- the length must be this long 
     *							minimum {Int} 				- the minimum length allowed
     *							maximum {Int} 				- the maximum length allowed
     *
     *  NB. can be checked if it is within a range by specifying both a minimum and a maximum				
     */
    Length: function(value, paramsObj){
    	var value = String(value);
    	var paramsObj = paramsObj || {};
        var minimum = ((paramsObj.minimum) || (paramsObj.minimum == 0)) ? paramsObj.minimum : null;
    	var maximum = ((paramsObj.maximum) || (paramsObj.maximum == 0)) ? paramsObj.maximum : null;
    	var is = ((paramsObj.is) || (paramsObj.is == 0)) ? paramsObj.is : null;
        var wrongLengthMessage = paramsObj.wrongLengthMessage || "Must be " + is + " characters long!";
    	var tooShortMessage = paramsObj.tooShortMessage || "Must not be less than " + minimum + " characters long!";
    	var tooLongMessage = paramsObj.tooLongMessage || "Must not be more than " + maximum + " characters long!";
    	switch(true){
    	  	case (is !== null):
    	  		if( value.length != Number(is) ) Validate.fail(wrongLengthMessage);
    			break;
    	  	case (minimum !== null && maximum !== null):
    	  		Validate.Length(value, {tooShortMessage: tooShortMessage, minimum: minimum});
    	  		Validate.Length(value, {tooLongMessage: tooLongMessage, maximum: maximum});
    	  		break;
    	  	case (minimum !== null):
    	  		if( value.length < Number(minimum) ) Validate.fail(tooShortMessage);
    			break;
    	  	case (maximum !== null):
    	  		if( value.length > Number(maximum) ) Validate.fail(tooLongMessage);
    			break;
    		default:
    			throw new Error("Validate::Length - Length(s) to validate against must be provided!");
    	}
    	return true;
    },
    
    /**
     *	validates that the value falls within a given set of values
     *	
     *	@param value {mixed} - value to be checked
     *	@param paramsObj {Object} - parameters for this particular validation, see below for details
     *
     *	paramsObj properties:
     *							failureMessage {String} - the message to show when the field fails validation
     *													  (DEFAULT: "Must be included in the list!")
     *							within {Array} 			- an array of values that the value should fall in 
     *													  (DEFAULT: [])	
     *							allowNull {Bool} 		- if true, and a null value is passed in, validates as true
     *													  (DEFAULT: false)
     *             partialMatch {Bool} 	- if true, will not only validate against the whole value to check but also if it is a substring of the value 
     *													  (DEFAULT: false)
     *             caseSensitive {Bool} - if false will compare strings case insensitively
     *                          (DEFAULT: true)
     *             negate {Bool} 		- if true, will validate that the value is not within the given set of values
     *													  (DEFAULT: false)			
     */
    Inclusion: function(value, paramsObj){
    	var paramsObj = paramsObj || {};
    	var message = paramsObj.failureMessage || "Must be included in the list!";
      var caseSensitive = (paramsObj.caseSensitive === false) ? false : true;
    	if(paramsObj.allowNull && value == null) return true;
      if(!paramsObj.allowNull && value == null) Validate.fail(message);
    	var within = paramsObj.within || [];
      //if case insensitive, make all strings in the array lowercase, and the value too
      if(!caseSensitive){ 
        var lowerWithin = [];
        for(var j = 0, length = within.length; j < length; ++j){
        	var item = within[j];
          if(typeof item == 'string') item = item.toLowerCase();
          lowerWithin.push(item);
        }
        within = lowerWithin;
        if(typeof value == 'string') value = value.toLowerCase();
      }
    	var found = false;
    	for(var i = 0, length = within.length; i < length; ++i){
    	  if(within[i] == value) found = true;
        if(paramsObj.partialMatch){ 
          if(value.indexOf(within[i]) != -1) found = true;
        }
    	}
    	if( (!paramsObj.negate && !found) || (paramsObj.negate && found) ) Validate.fail(message);
    	return true;
    },
    
    /**
     *	validates that the value does not fall within a given set of values
     *	
     *	@param value {mixed} - value to be checked
     *	@param paramsObj {Object} - parameters for this particular validation, see below for details
     *
     *	paramsObj properties:
     *							failureMessage {String} - the message to show when the field fails validation
     *													  (DEFAULT: "Must not be included in the list!")
     *							within {Array} 			- an array of values that the value should not fall in 
     *													  (DEFAULT: [])
     *							allowNull {Bool} 		- if true, and a null value is passed in, validates as true
     *													  (DEFAULT: false)
     *             partialMatch {Bool} 	- if true, will not only validate against the whole value to check but also if it is a substring of the value 
     *													  (DEFAULT: false)
     *             caseSensitive {Bool} - if false will compare strings case insensitively
     *                          (DEFAULT: true)			
     */
    Exclusion: function(value, paramsObj){
      var paramsObj = paramsObj || {};
      paramsObj.failureMessage = paramsObj.failureMessage || "Must not be included in the list!";
      paramsObj.negate = true;
      Validate.Inclusion(value, paramsObj);
      return true;
    },
    
    /**
     *	validates that the value matches that in another field
     *	
     *	@param value {mixed} - value to be checked
     *	@param paramsObj {Object} - parameters for this particular validation, see below for details
     *
     *	paramsObj properties:
     *							failureMessage {String} - the message to show when the field fails validation
     *													  (DEFAULT: "Does not match!")
     *							match {String} 			- id of the field that this one should match						
     */
    Confirmation: function(value, paramsObj){
      	if(!paramsObj.match) throw new Error("Validate::Confirmation - Error validating confirmation: Id of element to match must be provided!");
    	var paramsObj = paramsObj || {};
    	var message = paramsObj.failureMessage || "Does not match!";
    	var match = paramsObj.match.nodeName ? paramsObj.match : document.getElementById(paramsObj.match);
    	if(!match) throw new Error("Validate::Confirmation - There is no reference with name of, or element with id of '" + paramsObj.match + "'!");
    	if(value != match.value) Validate.fail(message);
    	return true;
    },
    
    /**
     *	validates that the value is true (for use primarily in detemining if a checkbox has been checked)
     *	
     *	@param value {mixed} - value to be checked if true or not (usually a boolean from the checked value of a checkbox)
     *	@param paramsObj {Object} - parameters for this particular validation, see below for details
     *
     *	paramsObj properties:
     *							failureMessage {String} - the message to show when the field fails validation 
     *													  (DEFAULT: "Must be accepted!")
     */
    Acceptance: function(value, paramsObj){
      	var paramsObj = paramsObj || {};
    	var message = paramsObj.failureMessage || "Must be accepted!";
    	if(!value) Validate.fail(message);
    	return true;
    },
    
	 /**
     *	validates against a custom function that returns true or false (or throws a Validate.Error) when passed the value
     *	
     *	@param value {mixed} - value to be checked
     *	@param paramsObj {Object} - parameters for this particular validation, see below for details
     *
     *	paramsObj properties:
     *							failureMessage {String} - the message to show when the field fails validation
     *													  (DEFAULT: "Not valid!")
     *							against {Function} 			- a function that will take the value and object of arguments and return true or false 
     *													  (DEFAULT: function(value, argsObj){ return true; })
     *							args {Object} 		- an object of named arguments that will be passed to the custom function so are accessible through this object within it 
     *													  (DEFAULT: {})
     */
	Custom: function(value, paramsObj){
		var paramsObj = paramsObj || {};
		var against = paramsObj.against || function(){ return true; };
		var args = paramsObj.args || {};
		var message = paramsObj.failureMessage || "Not valid!";
	    if(!against(value, args)) Validate.fail(message);
	    return true;
	  },
	
    /**
     *	validates whatever it is you pass in, and handles the validation error for you so it gives a nice true or false reply
     *
     *	@param validationFunction {Function} - validation function to be used (ie Validation.validatePresence )
     *	@param value {mixed} - value to be checked if true or not (usually a boolean from the checked value of a checkbox)
     *	@param validationParamsObj {Object} - parameters for doing the validation, if wanted or necessary
     */
    now: function(validationFunction, value, validationParamsObj){
      	if(!validationFunction) throw new Error("Validate::now - Validation function must be provided!");
    	var isValid = true;
        try{    
    		validationFunction(value, validationParamsObj || {});
    	} catch(error) {
    		if(error instanceof Validate.Error){
    			isValid =  false;
    		}else{
    		 	throw error;
    		}
    	}finally{ 
            return isValid 
        }
    },
    
    /**
     *  shortcut for failing throwing a validation error
     *
     *	@param errorMessage {String} - message to display
     */
    fail: function(errorMessage){
            throw new Validate.Error(errorMessage);
    },
    
    Error: function(errorMessage){
    	this.message = errorMessage;
    	this.name = 'ValidationError';
    }

}



//   /fileadmin/scripts/swfobject.js
/*	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
*/
var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();



//   /fileadmin/scripts/scripts.js
/*****************************************************************************
/* Define some vars
******************************************************************************/
var PresenceMessage         = 'Dieses Feld ist ein Pflichtfeld';
var messagetooShortMessage  = 'Bitte mindestens 2 Zeichen';
var nametooShortMessage     = 'mindestens 2, max. 100 Stellen';
var emailFailureMessage     = 'Bitte eine E-Mail-Adresse eingeben.';
var FirmatooShortMessage    = messagetooShortMessage;


/*****************************************************************************
/* ActivateFormValidators()
/* Kontakt- & Callbackform validieren
/* requires jQuery, Livevalidation (standalone)
******************************************************************************/
function ActivateFormValidators(formularid) {
  if(formularid == '#contactform') {
    //country
    var country = new LiveValidation( "country", {
      validMessage:        ' ',
      onlyOnBlur:          true
    });
    country.add(Validate.Presence, {
      failureMessage:     PresenceMessage
    });
    country.add(Validate.Length, {
      minimum:            2,
      maximum:            100,
      tooShortMessage:    nametooShortMessage,
      tooLongMessage:     ' ',
      wrongLengthMessage: ' '
    });
    
    //message
    var message = new LiveValidation( "message", {
      validMessage:       ' ',
      onlyOnBlur:         true
    });
    message.add(Validate.Presence, {
      failureMessage:     PresenceMessage
    });
    message.add(Validate.Length, {
      minimum:            2,
      maximum:            1000,
      tooShortMessage:    nametooShortMessage,
      tooLongMessage:     ' ',
      wrongLengthMessage: ' '
    });
    
    // resort
    var resort = new LiveValidation( "resort", {
      validMessage:       ' ',
      onlyOnBlur:         true
    });
    resort.add(Validate.Exclusion, {
      within: [ 0 ],
      allowNull: false,
      partialMatch: false
    });
    
     // anrede
    var salutation = new LiveValidation( "salutation", {
      validMessage:       ' ',
      onlyOnBlur:         true
    });
    salutation.add(Validate.Exclusion, {
      within: [ 0 ],
      allowNull: false,
      partialMatch: false
    });
    
    //firstname
    var firstname = new LiveValidation( "firstname", {
      validMessage:        ' ',
      onlyOnBlur:          true
    });
    firstname.add(Validate.Presence, {
      failureMessage:     PresenceMessage
    });
    firstname.add(Validate.Length, {
      minimum:            2,
      maximum:            100,
      tooShortMessage:    nametooShortMessage,
      tooLongMessage:     ' ',
      wrongLengthMessage: ' '
    });
    
    //lastname
    var lastname = new LiveValidation( "lastname", {
      validMessage:        ' ',
      onlyOnBlur:          true
    });
    lastname.add(Validate.Presence, {
      failureMessage:     PresenceMessage
    });
    lastname.add(Validate.Length, {
      minimum:            2,
      maximum:            100,
      tooShortMessage:    nametooShortMessage,
      tooLongMessage:     ' ',
      wrongLengthMessage: ' '
    });
    
    //email
    var email = new LiveValidation( "email", {
     validMessage:          ' ',
     onlyOnBlur:            true
    });
    email.add(Validate.Presence, {
     failureMessage:        PresenceMessage
    });
    email.add(Validate.Email, {
     failureMessage:        emailFailureMessage
    });
   
    //telephone
    var telephone = new LiveValidation( "telephone", {
     validMessage:          ' ',
     onlyOnBlur:            true
    });
    telephone.add(Validate.Presence, {
     failureMessage:        PresenceMessage
    });
    telephone.add(Validate.Length, {
      minimum:            2,
      maximum:            100,
      tooShortMessage:    nametooShortMessage,
      tooLongMessage:     ' ',
      wrongLengthMessage: ' '
    });
    
    //confirm
    var confirm = new LiveValidation( "confirm", {
      validMessage:          ' ',
      onlyOnBlur:            true
    });
    confirm.add(Validate.Acceptance, {
      failureMessage:        PresenceMessage
    });
  }
  
  if(formularid == '#arrangementform') {
	    //country
	    var country = new LiveValidation( "country", {
	      validMessage:        ' ',
	      onlyOnBlur:          true
	    });
	    country.add(Validate.Presence, {
	      failureMessage:     PresenceMessage
	    });
	    country.add(Validate.Length, {
	      minimum:            2,
	      maximum:            100,
	      tooShortMessage:    nametooShortMessage,
	      tooLongMessage:     ' ',
	      wrongLengthMessage: ' '
	    });
	    
	    //arrivaldate
	    var arrivaldate = new LiveValidation( "date", {
	      validMessage:        ' ',
	      onlyOnBlur:          true
	    });
	    arrivaldate.add(Validate.Presence, {
	      failureMessage:     PresenceMessage
	    });
	    
	    //message
	    var message = new LiveValidation( "message", {
	      validMessage:       ' ',
	      onlyOnBlur:         true
	    });
	    message.add(Validate.Presence, {
	      failureMessage:     PresenceMessage
	    });
	    message.add(Validate.Length, {
	      minimum:            2,
	      maximum:            1000,
	      tooShortMessage:    nametooShortMessage,
	      tooLongMessage:     ' ',
	      wrongLengthMessage: ' '
	    });
	    
	     // anrede
	    var salutation = new LiveValidation( "salutation", {
	      validMessage:       ' ',
	      onlyOnBlur:         true
	    });
	    salutation.add(Validate.Exclusion, {
	      within: [ 0 ],
	      allowNull: false,
	      partialMatch: false
	    });
	    
	    //firstname
	    var firstname = new LiveValidation( "firstname", {
	      validMessage:        ' ',
	      onlyOnBlur:          true
	    });
	    firstname.add(Validate.Presence, {
	      failureMessage:     PresenceMessage
	    });
	    firstname.add(Validate.Length, {
	      minimum:            2,
	      maximum:            100,
	      tooShortMessage:    nametooShortMessage,
	      tooLongMessage:     ' ',
	      wrongLengthMessage: ' '
	    });
	    
	    //lastname
	    var lastname = new LiveValidation( "lastname", {
	      validMessage:        ' ',
	      onlyOnBlur:          true
	    });
	    lastname.add(Validate.Presence, {
	      failureMessage:     PresenceMessage
	    });
	    lastname.add(Validate.Length, {
	      minimum:            2,
	      maximum:            100,
	      tooShortMessage:    nametooShortMessage,
	      tooLongMessage:     ' ',
	      wrongLengthMessage: ' '
	    });
	    
	    //email
	    var email = new LiveValidation( "email", {
	     validMessage:          ' ',
	     onlyOnBlur:            true
	    });
	    email.add(Validate.Presence, {
	     failureMessage:        PresenceMessage
	    });
	    email.add(Validate.Email, {
	     failureMessage:        emailFailureMessage
	    });
	   
	    //telephone
	    var telephone = new LiveValidation( "telephone", {
	     validMessage:          ' ',
	     onlyOnBlur:            true
	    });
	    telephone.add(Validate.Presence, {
	     failureMessage:        PresenceMessage
	    });
	    telephone.add(Validate.Length, {
	      minimum:            2,
	      maximum:            100,
	      tooShortMessage:    nametooShortMessage,
	      tooLongMessage:     ' ',
	      wrongLengthMessage: ' '
	    });
	    
	    //confirm
	    var confirm = new LiveValidation( "confirm", {
	      validMessage:          ' ',
	      onlyOnBlur:            true
	    });
	    confirm.add(Validate.Acceptance, {
	      failureMessage:        PresenceMessage
	    });
	  }
  
  if(formularid == '#callbackform') {
    //message
    var message = new LiveValidation( "message", {
      validMessage:       ' ',
      onlyOnBlur:         true
    });
    message.add(Validate.Presence, {
      failureMessage:     PresenceMessage
    });
    message.add(Validate.Length, {
      minimum:            2,
      maximum:            1000,
      tooShortMessage:    nametooShortMessage,
      tooLongMessage:     ' ',
      wrongLengthMessage: ' '
    });
    
    // resort
    var resort = new LiveValidation( "resort", {
      validMessage:       ' ',
      onlyOnBlur:         true
    });
    resort.add(Validate.Exclusion, {
      within: [ 0 ],
      allowNull: false,
      partialMatch: false
    });
    
     // anrede
    var salutation = new LiveValidation( "salutation", {
      validMessage:       ' ',
      onlyOnBlur:         true
    });
    salutation.add(Validate.Exclusion, {
      within: [ 0 ],
      allowNull: false,
      partialMatch: false
    });
    
    //firstname
    var firstname = new LiveValidation( "firstname", {
      validMessage:        ' ',
      onlyOnBlur:          true
    });
    firstname.add(Validate.Presence, {
      failureMessage:     PresenceMessage
    });
    firstname.add(Validate.Length, {
      minimum:            2,
      maximum:            100,
      tooShortMessage:    nametooShortMessage,
      tooLongMessage:     ' ',
      wrongLengthMessage: ' '
    });
    
    //lastname
    var lastname = new LiveValidation( "lastname", {
      validMessage:        ' ',
      onlyOnBlur:          true
    });
    lastname.add(Validate.Presence, {
      failureMessage:     PresenceMessage
    });
    lastname.add(Validate.Length, {
      minimum:            2,
      maximum:            100,
      tooShortMessage:    nametooShortMessage,
      tooLongMessage:     ' ',
      wrongLengthMessage: ' '
    });
    
    //email
    var email = new LiveValidation( "email", {
     validMessage:          ' ',
     onlyOnBlur:            true
    });
    email.add(Validate.Presence, {
     failureMessage:        PresenceMessage
    });
    email.add(Validate.Email, {
     failureMessage:        emailFailureMessage
    });
   
    //telephone
    var telephone = new LiveValidation( "telephone", {
     validMessage:          ' ',
     onlyOnBlur:            true
    });
    telephone.add(Validate.Presence, {
     failureMessage:        PresenceMessage
    });
    telephone.add(Validate.Length, {
      minimum:            2,
      maximum:            100,
      tooShortMessage:    nametooShortMessage,
      tooLongMessage:     ' ',
      wrongLengthMessage: ' '
    });
    
    //confirm
    var confirm = new LiveValidation( "confirm", {
      validMessage:          ' ',
      onlyOnBlur:            true
    });
    confirm.add(Validate.Acceptance, {
      failureMessage:        PresenceMessage
    });
  }
  
  if(formularid == '#kommentarform') {
    
    //message
    var txGuestbookText = new LiveValidation( "txGuestbookText", {
      validMessage:       ' ',
      onlyOnBlur:         true
    });
    txGuestbookText.add(Validate.Presence, {
      failureMessage:     PresenceMessage
    });
    txGuestbookText.add(Validate.Length, {
      minimum:            2,
      maximum:            1000,
      tooShortMessage:    nametooShortMessage,
      tooLongMessage:     ' ',
      wrongLengthMessage: ' '
    });
    
    //firstname
    var firstname = new LiveValidation( "firstname", {
      validMessage:        ' ',
      onlyOnBlur:          true
    });
    firstname.add(Validate.Presence, {
      failureMessage:     PresenceMessage
    });
    firstname.add(Validate.Length, {
      minimum:            2,
      maximum:            100,
      tooShortMessage:    nametooShortMessage,
      tooLongMessage:     ' ',
      wrongLengthMessage: ' '
    });
    
    //surname
    var surname = new LiveValidation( "surname", {
      validMessage:        ' ',
      onlyOnBlur:          true
    });
    surname.add(Validate.Presence, {
      failureMessage:     PresenceMessage
    });
    surname.add(Validate.Length, {
      minimum:            2,
      maximum:            100,
      tooShortMessage:    nametooShortMessage,
      tooLongMessage:     ' ',
      wrongLengthMessage: ' '
    });
  }
  
  if(formularid == '#pinboardform') {
    
    //message
    var message = new LiveValidation( "message", {
      validMessage:       ' ',
      onlyOnBlur:         true
    });
    message.add(Validate.Presence, {
      failureMessage:     PresenceMessage
    });
    message.add(Validate.Length, {
      minimum:            2,
      maximum:            1000,
      tooShortMessage:    nametooShortMessage,
      tooLongMessage:     ' ',
      wrongLengthMessage: ' '
    });
    
    //firstname
    var titel = new LiveValidation( "titel", {
      validMessage:        ' ',
      onlyOnBlur:          true
    });
    titel.add(Validate.Presence, {
      failureMessage:     PresenceMessage
    });
    titel.add(Validate.Length, {
      minimum:            2,
      maximum:            100,
      tooShortMessage:    nametooShortMessage,
      tooLongMessage:     ' ',
      wrongLengthMessage: ' '
    });
  }
  
  if(formularid == '#catalogueform') {
    //country
    var country = new LiveValidation( "country", {
      validMessage:        ' ',
      onlyOnBlur:          true
    });
    country.add(Validate.Presence, {
      failureMessage:     PresenceMessage
    });
    country.add(Validate.Length, {
      minimum:            2,
      maximum:            100,
      tooShortMessage:    nametooShortMessage,
      tooLongMessage:     ' ',
      wrongLengthMessage: ' '
    });
    
    // anrede
    var salutation = new LiveValidation( "salutation", {
      validMessage:       ' ',
      onlyOnBlur:         true
    });
    salutation.add(Validate.Exclusion, {
      within: [ 0 ],
      allowNull: false,
      partialMatch: false
    });
    
    //firstname
    var firstname = new LiveValidation( "firstname", {
      validMessage:        ' ',
      onlyOnBlur:          true
    });
    firstname.add(Validate.Presence, {
      failureMessage:     PresenceMessage
    });
    firstname.add(Validate.Length, {
      minimum:            2,
      maximum:            100,
      tooShortMessage:    nametooShortMessage,
      tooLongMessage:     ' ',
      wrongLengthMessage: ' '
    });
    
    //lastname
    var lastname = new LiveValidation( "lastname", {
      validMessage:        ' ',
      onlyOnBlur:          true
    });
    lastname.add(Validate.Presence, {
      failureMessage:     PresenceMessage
    });
    lastname.add(Validate.Length, {
      minimum:            2,
      maximum:            100,
      tooShortMessage:    nametooShortMessage,
      tooLongMessage:     ' ',
      wrongLengthMessage: ' '
    });
    
    //email
    var email = new LiveValidation( "email", {
     validMessage:          ' ',
     onlyOnBlur:            true
    });
    email.add(Validate.Presence, {
     failureMessage:        PresenceMessage
    });
    email.add(Validate.Email, {
     failureMessage:        emailFailureMessage
    });
   
    //telephone
    var telephone = new LiveValidation( "telephone", {
     validMessage:          ' ',
     onlyOnBlur:            true
    });
    telephone.add(Validate.Presence, {
     failureMessage:        PresenceMessage
    });
    telephone.add(Validate.Length, {
      minimum:            2,
      maximum:            100,
      tooShortMessage:    nametooShortMessage,
      tooLongMessage:     ' ',
      wrongLengthMessage: ' '
    });
    
    //caalogs
    var catalog = new LiveValidation( "katalogcheck", {
        validMessage:          ' ',
        onlyOnBlur:            true
       });
       catalog.add(Validate.catalogs, {
        failureMessage:        PresenceMessage
       });
    
    //confirm
    var confirm = new LiveValidation( "confirm", {
      validMessage:          ' ',
      onlyOnBlur:            true
    });
    confirm.add(Validate.Acceptance, {
      failureMessage:        PresenceMessage
    });
  }
  
  if(formularid == '#newsletterform') {
    // anrede
    var salutation = new LiveValidation( "salutation", {
      validMessage:       ' ',
      onlyOnBlur:         true
    });
    salutation.add(Validate.Exclusion, {
      within: [ 0 ],
      allowNull: false,
      partialMatch: false
    });
    
    //firstname
    var firstname = new LiveValidation( "firstname", {
      validMessage:        ' ',
      onlyOnBlur:          true
    });
    firstname.add(Validate.Presence, {
      failureMessage:     PresenceMessage
    });
    firstname.add(Validate.Length, {
      minimum:            2,
      maximum:            100,
      tooShortMessage:    nametooShortMessage,
      tooLongMessage:     ' ',
      wrongLengthMessage: ' '
    });
    
    //lastname
    var lastname = new LiveValidation( "lastname", {
      validMessage:        ' ',
      onlyOnBlur:          true
    });
    lastname.add(Validate.Presence, {
      failureMessage:     PresenceMessage
    });
    lastname.add(Validate.Length, {
      minimum:            2,
      maximum:            100,
      tooShortMessage:    nametooShortMessage,
      tooLongMessage:     ' ',
      wrongLengthMessage: ' '
    });
    
    //email
    var email = new LiveValidation( "email", {
     validMessage:          ' ',
     onlyOnBlur:            true
    });
    email.add(Validate.Presence, {
     failureMessage:        PresenceMessage
    });
    email.add(Validate.Email, {
     failureMessage:        emailFailureMessage
    });
   
    //telephone
    var telephone = new LiveValidation( "telephone", {
     validMessage:          ' ',
     onlyOnBlur:            true
    });
    telephone.add(Validate.Presence, {
     failureMessage:        PresenceMessage
    });
    telephone.add(Validate.Length, {
      minimum:            2,
      maximum:            100,
      tooShortMessage:    nametooShortMessage,
      tooLongMessage:     ' ',
      wrongLengthMessage: ' '
    });
    
    //confirm
    var confirm = new LiveValidation( "confirm", {
      validMessage:          ' ',
      onlyOnBlur:            true
    });
    confirm.add(Validate.Acceptance, {
      failureMessage:        PresenceMessage
    });
  }
}


Validate.catalogs = function(value, paramsObj) { 
	if($('.katalogcheckbox:checked').length == 0) {
     $('#katalogError').slideDown('fast');
     var message = paramsObj.failureMessage || "";
     Validate.fail(message);
  } else {
    $('#katalogError').slideUp('fast');
  }
  return true;
}


/*****************************************************************************
/* buildMediaboxLinks()
/* Bestimmte Class-Attribute auf Seite in array sammeln und mit Event belegen
/* requires jQuery
******************************************************************************/
var buildMediaboxLinks = function() {
  var button = $("a.buttonlink");         // Array erstellen
  button.fancybox({                       // Element mit Klasse belegen
    'titleShow'		    : false,
    'width'				    : 1010,
    'height'			    : 600,
    'speedIn'         : 600, 
    'speedOut'        : 200, 
    'overlayOpacity'  : 0.75,
    'overlayColor'    : '#000',
    'transitionIn'		: 'elastic',
    'transitionOut'		: 'none',
    'type'				    : 'iframe'
  });
   
  button.click(function(c) {              // Klick abhorchen
    c.preventDefault();                     // eigentlichen Href abbrechen
  });
}

// 680
// 590


/*****************************************************************************
/* buildMediaboxContentLinks()
/* Bestimmte Class-Attribute auf Seite in array sammeln und mit Event belegen
/* requires jQuery
******************************************************************************/
var buildMediaboxContentLinks = function() {
  var button = $("p.mediabox a");         // Array erstellen
  button.fancybox({                       // Element mit Klasse belegen
    'titleShow'		    : false,
    'width'				    : 1010,
    'height'			    : 750,
    'speedIn'         : 600, 
    'speedOut'        : 200, 
    'overlayOpacity'  : 0.75,
    'overlayColor'    : '#000',
    'transitionIn'		: 'elastic',
    'transitionOut'		: 'none',
    'type'				    : 'iframe'
  });
   
  button.click(function(e) {              // Klick abhorchen
    e.preventDefault();                     // eigentlichen Href abbrechen
  });
}


/*****************************************************************************
/* buildMediaboxFormLinks()
/* Bestimmte Class-Attribute auf Seite in array sammeln und mit Event belegen
/* requires jQuery
******************************************************************************/
var buildMediaboxFormLinks = function() {
  var button = $("a.mboxlink");            // wich elements to select?
  
  button.each(function(i) {
    
    //Falls wir eine andere Größe brauchen, können wir die Buttons anhand der Texte unterscheiden
    if($(this).text() == 'Katalogbestellung' || $(this).text() == 'Order catalogue') {
      var hoehe      = 680;                   // Fenster höher als der Standard
      var breite     = 700;
      var scrolling  = 'auto';
      var dimensions = true;
    } else {
      var hoehe      = 510;                   // Fenster 510 px hoch
      var breite     = 690;
      var scrolling  = 'no';
      var dimensions = false;
    }
    
    $(this).fancybox({                       // Element mit Klasse belegen
      'titleShow'		    : false,
      'width'				    : breite,
      'height'			    : hoehe,
      'autoDimensions'  : dimensions,
      'speedIn'         : 600, 
      'speedOut'        : 200, 
      'overlayOpacity'  : 0.75,
      'scrolling'       : scrolling,
      'overlayColor'    : '#000',
      'transitionIn'		: 'elastic',
      'transitionOut'		: 'none',
      'type'				    : 'iframe'
    });
    $(this).click(function(c) {               // Klick abhorchen
      c.preventDefault();                     // eigentlichen Href abbrechen
    });
    
  }); // end each
}



/*****************************************************************************
/* showLogin()
/* Loginformular ein-/ausblenden mit aufpoppen des Formulares
/* requires jQuery
******************************************************************************/
var showLogin = function(){
  var button = $(".signincontrols a");  // Der Button
  var lf     = $(".loginform");         // Das Formular
  var frame  = $(".signin");            // Das Drumherum
  button.click(function(e) {            // Bei Klick auf Button
    e.preventDefault();                   // erst mal den normalen Link abbrechen
    if(lf.is(':visible')) {               // wenn Formular sichtbar
      lf.hide();                            // --> ausblenden
      button.removeClass('active');         // Stati entfernen
      frame.removeClass('active');          // s.o.
    } else {                              // wenn Formular NICHT sichtbar
      lf.show();                            // anzeigen
      button.addClass('active');            // Stati hinzufügen
      frame.addClass('active');             // s.o.
    }
  });
}


/*****************************************************************************
/* showModalLogin()
/* Loginformular ein-/ausblenden mit Modal Fenster
/* requires jQuery & fancybox
******************************************************************************/
var showModalLogin = function(){
  var button = $(".signincontrols a");  // Der Button

  button.click(function(e) {            // Bei Klick auf Button
    e.preventDefault();                   // erst mal den normalen Link abbrechen
  });
  button.fancybox({                     // Fancybox ansprechen
    'titleShow'       : false,
    'speedIn'         : 200, 
    'speedOut'        : 200, 
    'overlayOpacity'  : 0.75,
    'overlayColor'    : '#000',
    'transitionIn'		: 'elastic',
    'transitionOut'		: 'elastic',
    'onComplete'      : function() {
      $("#user").focus();
    }
  });
}


/*****************************************************************************
/* closeMediaBox()
/* Mediabox nach Klick auf Link schließen
/* requires jQuery & fancybox
******************************************************************************/
var closeMediaBox = function(e) {
  e.preventDefault();
  $.fancybox.close();
}


/*****************************************************************************
/* headerClick()
/* holt den Link aus dem Logo und stellt ihn als JS dem Flashlayer als Event
/* zur Verfügung
******************************************************************************/
var headerClick = function(e) {
  var headerflash = $(".header_flash");
  var link        = $("#header a").attr("href");
  headerflash.click(function(e) {            // Bei Klick auf Button
    window.location = link;                // erst mal den normalen Link abbrechen
  });
}


/*****************************************************************************
/*****************************************************************************
/** 
/**           Aktionen onLoad ausführen
/**
******************************************************************************
******************************************************************************/
$(window).load(function() {
  // Klick auf Logo überwachen (für alle no-Flash-Browser
  if($('.header_flash').length) {
    headerClick();
  }
  
  //Live-Validierung für das Kontaktformular
  if($('#callbackform').length) {
    ActivateFormValidators('#callbackform'); // Eingaben überwachen
  }
  
  //Live-Validierung für das Callbackformulars
  if($('#contactform').length) {
    ActivateFormValidators('#contactform'); // Eingaben überwachen
  }
  
  //Live-Validierung für das Arrangementformulars
  if($('#arrangementform').length) {
    ActivateFormValidators('#arrangementform'); // Eingaben überwachen
  }
  
  //Live-Validierung für das Kommentarformulars
  if($('#kommentarform').length) {
    ActivateFormValidators('#kommentarform'); // Eingaben überwachen
  }
  
  //Live-Validierung für das Kommentarformulars
  if($('#catalogueform').length) {
    ActivateFormValidators('#catalogueform'); // Eingaben überwachen
  }
  
  //Live-Validierung für das Newsletterbestellformulars
  if($('#newsletterform').length) {
    ActivateFormValidators('#newsletterform'); // Eingaben überwachen
  }
  
  //Live-Validierung für die Pinnboard-Antwort
  if($('#pinboardform').length) {
    ActivateFormValidators('#pinboardform'); // Eingaben überwachen
  }
  
  // To-Top-Link
  $('.totoplink').click(function(e){
    e.preventDefault();
    $('html, body').animate({scrollTop:0}, 'slow');
  });
  
  $('a.closebutton').click(function(e){ // Abbruch der Anmeldung
    closeMediaBox(e);
  });
  
  $('p.closelink a').click(function(e){ // Schließen der Mediabox
    closeMediaBox();
  });
  
  // Mediabox-Forms vorbereiten
  buildMediaboxFormLinks();
  
  // Mediabox-Links vorbereiten
  buildMediaboxLinks();         // aus FCE
  buildMediaboxContentLinks();  // aus dem RTE
               
  // Login-Form Sichtbarkeitsschalter
  showModalLogin();
               
  // Config des Bildsliders im head
  if ($('#slider img').length > 1) {
  	$('#slider').nivoSlider({
  		effect: 'fade',
  		slices: 15,
  		animSpeed: 300,
  		pauseTime: 6000,
  		startSlide: 0, //Set starting Slide (0 index)
				directionNav: false, //Next & Prev
				directionNavHide: true, //Only show on hover
				controlNav: true, //1,2,3...
				controlNavThumbs: false, //Use thumbnails for Control Nav
				controlNavThumbsSearch: '.jpg', //Replace this with...
				controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
				keyboardNav: false, //Use left & right arrows
				pauseOnHover: true, //Stop animation while hovering
				manualAdvance: false, //Force manual transitions
				captionOpacity: 0.0, //Universal caption opacity
				startSlide:$('#slider img').length-1,
				beforeChange: function(){
				},
				afterChange: function(){
				},
				slideshowEnd: function(){
				} //Triggers after all slides have been shown
			});
		}
  
  //Config der Tab navigation
  $('.coda-slider').codaSlider({
	  crossLinking: false,
	  dynamicArrows: false
  });
  
  // Config der Toggle Container
  $('.toggle').each(function(){
	  $('.toggle_content', this).hide();
	  $('.toggle_head', this).addClass('collapse');
	  $('.toggle_head', this).toggle(
		  function(){
			  $(this).removeClass('collapse');
			  $(this).addClass('expand');
			  $('.toggle_content', $(this).parent()).stop(true, true);
			  $('.toggle_content', $(this).parent()).slideDown();
		  },
	      function(){
			  $(this).removeClass('expand');
			  $(this).addClass('collapse');
			  $('.toggle_content', $(this).parent()).stop(true, true);
			  $('.toggle_content', $(this).parent()).slideUp();
		  }
	  );
	  if($('.toggle_content', this).hasClass('expandOnStart')) {
		  $('.toggle_head', this).trigger('click');
	  }
  });
  
  // Config der Toggle Container
  var toggleTermine = function() {
	  $('.toggle_termin').each(function(){
		  $('.toggle_content', this).hide();
		  if ($('.toggle_content', this).text().replace (/^\s+/, '').replace (/\s+$/, '').length>=1) {
			 $('.toggle_head', this).addClass('collapse'); 
		  	$('.toggle_head', this).toggle(
				  function(){
					  var parentThis = $(this);
					  $(parentThis).removeClass('collapse');
					  $(parentThis).addClass('expand');
					  $('.toggle_content', $(parentThis).parent()).stop(true, true);
					  $('.eventLink', parentThis).stop(true, true);
					  $('.eventLink', parentThis).animate({'right': '+=40px'});
					  $('.toggle_content', $(parentThis).parent()).slideDown();
				  },
			      function(){
					  var parentThis = $(this);
					  $(parentThis).removeClass('expand');
					  $(parentThis).addClass('collapse');
					  $('.toggle_content', $(parentThis).parent()).stop(true, true);
					  $('.eventLink', parentThis).stop(true, true);
					  $('.eventLink', parentThis).animate({'right': '-=40px'});
					  $('.toggle_content', $(parentThis).parent()).slideUp();
				  }
			  );
	  	  }
	  });
  }
  toggleTermine();
  
  // Config der Toggle Container
  var toggleArrangements = function() {
	  $('.toggle_arrangement').each(function(){
		  $('.toggle_content', this).hide();
		  if ($('.toggle_content', this).text().replace (/^\s+/, '').replace (/\s+$/, '').length>=1) {
			 $('.toggle_head', this).addClass('collapse'); 
		  	$('.toggle_head', this).toggle(
				  function(){
					  $(this).removeClass('collapse');
					  $(this).addClass('expand');
					  $('.toggle_content', $(this).parent()).stop(true, true);
					  $('.eventLink', this).stop(true, true);
					  $('.eventLink', this).animate({'right': '+=40px'});
					  $('.toggle_content', $(this).parent()).slideDown();
				  },
			      function(){
					  $(this).removeClass('expand');
					  $(this).addClass('collapse');
					  $('.toggle_content', $(this).parent()).stop(true, true);
					  $('.eventLink', this).stop(true, true);
					  $('.eventLink', this).animate({'right': '-=40px'});
					  $('.toggle_content', $(this).parent()).slideUp();
				  }
			  );
	  	  }
	  });
  }
  toggleArrangements();
  
  // Sortierte Termine anlegen
  $("#uniformTermin").uniform();
  $("#uniformTermin").val('all');
  $("#uniformTermin").change(function(event) {
	  event.preventDefault(); 
	  switch($(this).val()) {
	  case 'all':
		  $('ul#termine li').fadeIn('fast');
		  break;
	  case 'kiz':
		  $('ul#termine li.terminLocation2').fadeIn('slow');
		  $('ul#termine li:not(.terminLocation2)').fadeOut('slow');
		  break;
	  case 'syl':
		  $('ul#termine li.terminLocation1').fadeIn('slow');
		  $('ul#termine li:not(.terminLocation1)').fadeOut('slow');
	  break;
	  case 'tra':
		  $('ul#termine li.terminLocation3').fadeIn('slow');
		  $('ul#termine li:not(.terminLocation3)').fadeOut('slow');
	  break;
	  case 'sch':
		  $('ul#termine li.terminLocation4').fadeIn('slow');
		  $('ul#termine li:not(.terminLocation4)').fadeOut('slow');
		  break;
  }
  });
  
  // Sortierte Arrangements anlegen
  $("#uniformArrengements").uniform();
  $("#uniformArrengements").val('all');
  $("#uniformArrengements").change(function(event) {
	  event.preventDefault(); 
	  switch($(this).val()) {
	  case 'all':
		  $('ul#arrangements_all > div > li').fadeIn('slow');
		  break;
	  case 'kiz':
		  $('ul#arrangements_all > div > li.kiz').fadeIn('slow');
		  $('ul#arrangements_all > div > li:not(.kiz)').fadeOut('slow');
		  break;
	  case 'syl':
		  $('ul#arrangements_all > div > li.syl').fadeIn('slow');
		  $('ul#arrangements_all > div > li:not(.syl)').fadeOut('slow');
	  break;
	  case 'tra':
		  $('ul#arrangements_all > div > li.tra').fadeIn('slow');
		  $('ul#arrangements_all > div > li:not(.tra)').fadeOut('slow');
	  break;
	  case 'sch':
		  $('ul#arrangements_all > div > li.sch').fadeIn('slow');
		  $('ul#arrangements_all > div > li:not(.sch)').fadeOut('slow');
		  break;
  }
  });
  
  //Config des textcounters für Textareas
  $('#txGuestbookText').textlimit('#txGuestbookTextCount',1000);
  
  //Config des Quicksand Filters (Golfpätze)
  
  
  // Sortierte Liste anlegen
  var sortElements = {};
  $('#golfcourts_all li').each(function(){
	  var cssClass = $(this).attr('class');
	  
	  if (!($('#golfcourts_all_ref').length > 0)) {
		  $('#golfcourts_all').after('<ul style="display:none" id="golfcourts_all_ref"></ul>');
	  }
	  if (!($('#golfcourts_'+cssClass).length > 0)) {
		  $('#golfcourts_all').after('<ul style="display:none" id="golfcourts_'+cssClass+'"></ul>');
	  }
	  $('#golfcourts_'+cssClass).append($(this).clone());
	  $('#golfcourts_all_ref').append($(this).clone());
  });
  
  $("#uniformTest").uniform();
  $("#uniformTest").val('all');
  $("#uniformTest").change(function(event) {
	  event.preventDefault(); 
	  switch($(this).val()) {
	  case 'all':
		  $('#golfcourts_all').quicksand($('#golfcourts_all_ref li'),{
			  attribute    : 'id',
			  useScaling   : false,
			  adjustHeight : false //'dynamic'
		  }, animateTeaser);
		  break;
	  case 'kiz':
		  $('#golfcourts_all').quicksand($('#golfcourts_kiz li'),{
			  attribute    : 'id',
			  useScaling   : false,
			  adjustHeight : false //'dynamic'
		  }, animateTeaser);
		  break;
	  case 'syl':
		  $('#golfcourts_all').quicksand($('#golfcourts_syl li'),{
			  attribute    : 'id',
			  useScaling   : false,
			  adjustHeight : false //'dynamic'
		  }, animateTeaser);
	  break;
	  case 'tra':
		  $('#golfcourts_all').quicksand($('#golfcourts_tra li'),{
			  attribute    : 'id',
			  useScaling   : false,
			  adjustHeight : false //'dynamic'
		  }, animateTeaser);
	  break;
	  case 'sch':
		  $('#golfcourts_all').quicksand($('#golfcourts_sch li'),{
			  attribute    : 'id',
			  useScaling   : false,
			  adjustHeight : false //'dynamic'
		  }, animateTeaser);
		  break;
  }
  });
  
  if ($.browser.msie) {
	  $('.teaser_caption').css('filter', 'progid:DXImageTransform.Microsoft.gradient(startColorstr=#66000000,endColorstr=#66000000);');
  }
  // Hoverefekt für golfplatzteaser
  var animateTeaser = function() {
	  var doAlert = true;
	  $('.golfteaser').each(function(){
		  $('.moretext', this).hide();
		  $('a', this).hover(
				  function(){
					  $('.moretext', this).slideDown('fast');  
					  if ($.browser.msie) {
						  //$('.teaser_caption', this).css('filter', 'progid:DXImageTransform.Microsoft.gradient(startColorstr=#B3000000,endColorstr=#B3000000);');
						  $('.teaser_caption', this).animate({
							  IEAlphaBackgroundFade: 'progid:DXImageTransform.Microsoft.gradient(startColorstr=#B3000000,endColorstr=#B3000000);'
						  }, 'fast');
					  } else {
						  $('.teaser_caption', this).animate({
							  backgroundColor: 'rgba(0,0,0,0.7)'
						  }, 'fast');
					  }
				  },
				  function(){
					  $('.moretext', this).slideUp('fast');  
					  if ($.browser.msie) {
						  //$('.teaser_caption', this).css('filter', 'progid:DXImageTransform.Microsoft.gradient(startColorstr=#66000000,endColorstr=#66000000);');
						  $('.teaser_caption', this).animate({
							  IEAlphaBackgroundFade: 'progid:DXImageTransform.Microsoft.gradient(startColorstr=#66000000,endColorstr=#66000000);'
						  }, 'fast');
					  } else {
						  $('.teaser_caption', this).animate({
							  backgroundColor: 'rgba(0,0,0,0.4)'
						  }, 'fast'); 
					  }
				  }
		  );
		  
	  });
  }
  animateTeaser();
  
  //Dynaform für Pinnwand
  switch ($('#kontaktpinboard').val()) {
  case 'email': $('#telefon_container').hide(); break;
  case 'telefon': $('#email_container').hide(); break;
  }
  $('#kontaktpinboard').change(function(){
	  switch ($(this).val()) {
	  case 'email': $('#telefon_container').fadeOut('slow', function(){
		  $('#email_container').fadeIn('slow'); 
	  });  break;
	  case 'telefon': $('#email_container').fadeOut('slow', function(){
		  $('#telefon_container').fadeIn('slow'); 
	  });  break;
	  }
  });
  
  
  $('table.scoreboard tr:not(.break)').hover(
		  function() {$(this).addClass('hover');},
		  function() { $(this).removeClass('hover');}
  );
  

});



/*
 * TextLimit - jQuery plugin for counting and limiting characters for input and textarea fields
 * 
 * pass '-1' as speed if you don't want the char-deletion effect. (don't just put 0)
 * Example: jQuery("Textarea").textlimit('span.counter',256)
 *
 * $Version: 2009.07.25 +r2
 * Copyright (c) 2009 Yair Even-Or
 * vsync.design@gmail.com
*/

(function(jQuery) {
	jQuery.fn.textlimit=function(counter_el, thelimit, speed) {
		var charDelSpeed = speed || 15;
		var toggleCharDel = speed != -1;
		var toggleTrim = true;
		var that = this[0];
		var isCtrl = false; 
		updateCounter();
		
		function updateCounter(){
			if(typeof that == "object")
				jQuery(counter_el).text(thelimit - that.value.length);
		};
		
		this.keydown (function(e){ 
			if(e.which == 17) isCtrl = true;
			var ctrl_a = (e.which == 65 && isCtrl == true) ? true : false; // detect and allow CTRL + A selects all.
			var ctrl_v = (e.which == 86 && isCtrl == true) ? true : false; // detect and allow CTRL + V paste.
			// 8 is 'backspace' and 46 is 'delete'
			if( this.value.length >= thelimit && e.which != '8' && e.which != '46' && ctrl_a == false && ctrl_v == false)
				e.preventDefault();
		})
		.keyup (function(e){
			updateCounter();
			if(e.which == 17)
				isCtrl=false;

			if( this.value.length >= thelimit && toggleTrim ){
				if(toggleCharDel){
					// first, trim the text a bit so the char trimming won't take forever
					// Also check if there are more than 10 extra chars, then trim. just in case.
					if ( (this.value.length - thelimit) > 10 )
						that.value = that.value.substr(0,thelimit+100);
					var init = setInterval
						( 
							function(){ 
								if( that.value.length <= thelimit ){
									init = clearInterval(init); updateCounter() 
								}
								else{
									// deleting extra chars (one by one)
									that.value = that.value.substring(0,that.value.length-1); jQuery(counter_el).text(''+(thelimit - that.value.length));
								}
							} ,charDelSpeed 
						);
				}
				else this.value = that.value.substr(0,thelimit);
			}
		});
		
	};
})(jQuery);

/*
 * jQuery Color Animations
 * Copyright 2007 John Resig
 * Released under the MIT and GPL licenses.
 * 
 * Modifications for rgbA by Philipp Schumann.
 * begin with / *BEGIN MOD* /
 * end with / *END MOD* /
 */

(function(jQuery){

	// We override the animation for all of these color styles
	jQuery.each(['IEAlphaBackgroundFade', 'backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){
		jQuery.fx.step[attr] = function(fx){
			if ( fx.state == 0 ) {
				fx.start = getColor( fx.elem, attr );
				fx.end = getRGB( fx.end );
			}
			

			/*BEGIN MOD*/
			if ((!fx.end) && (fx.start))
				fx.end = fx.start;
			else if ((!fx.start) && (fx.end))
				fx.start = fx.end;
			if (!fx.start)
				fx.start = [0, 0, 0];
			if (!fx.end)
				fx.end = [0, 0, 0];

			if(attr == 'IEAlphaBackgroundFade') {
				var ColorCode = '';
				ColorCode = ColorCode+stringInt(Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0), 16, 2);
				ColorCode = ColorCode+stringInt(Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0), 16, 2);
				ColorCode = ColorCode+stringInt(Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0), 16, 2);
				ColorCode = ColorCode+stringInt(Math.max(Math.min( parseInt((fx.pos * (fx.end[3] - fx.start[3])) + fx.start[3]), 255), 0), 16, 2);
				fx.elem.style['filter'] = 'progid:DXImageTransform.Microsoft.gradient(startColorstr=#'+ColorCode+',endColorstr=#'+ColorCode;
			} else if ((fx.start.length > 3) || (fx.end.length > 3)) {
				fx.elem.style[attr] = "rgba(" + [
				                				Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0),
				                				Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0),
				                				Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0),
				                				Math.max(Math.min( parseFloat((parseFloat(fx.pos) * ((fx.end[3] || 0.0) - (fx.start[3] || 0.0))) + (fx.start[3] || 0.0)), 1.0), 0)
				                			].join(",") + ")";
			

			} else {
				/*END MOD*/
				fx.elem.style[attr] = "rgb(" + [
				                				Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0),
				                				Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0),
				                				Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0)
				                			].join(",") + ")";
			}
		}
	});

	// Color Conversion functions from highlightFade
	// By Blair Mitchelmore
	// http://jquery.offput.ca/highlightFade/

	// Parse strings looking for color tuples [255,255,255]
	function getRGB(color) {
		var result;

		// Check if we're already dealing with an array of colors
		if ( color && color.constructor == Array && /*BEGIN MOD*/ (color.length == 4 || /*END MOD*/ color.length == 3 /*BEGIN MOD*/ ) /*END MOD*/ )
			return color;

		// Look for rgb(num,num,num)
		if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
			return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])];

		// Look for rgb(num%,num%,num%)
		if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
			return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];

		/*BEGIN MOD*/

		// Look for rgba(num,num,num,0.num)
		if (result = /rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\,\s*(0.[0-9]{1,})\s*\)/.exec(color)) {
			return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3]), parseFloat(result[4])];
		}

		// Look for rgba(num%,num%,num%,0.num)
		if (result = /rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\,\s*(0.[0-9]{1,})\s*\)/.exec(color))
			return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55, parseFloat(result[4])];

		//progid:DXImageTransform.Microsoft.gradient(startColorstr=#B3000000,endColorstr=#B3000000
		if (result = /Microsoft\.gradient\(startColorstr=#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
			return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16), parseInt(result[4],16)];

		
		/*END MOD*/

		// Look for #a0b1c2
		if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
			return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];

		// Look for #fff
		if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
			return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];

		// Otherwise, we're most likely dealing with a named color
		return colors[jQuery.trim(color).toLowerCase()];
	}
	
	function getColor(elem, attr) {
		var color;

		do {
			if(attr == 'IEAlphaBackgroundFade') {
				color = jQuery.curCSS(elem, 'filter');
			} else {
				color = jQuery.curCSS(elem, attr);
			}
			// Keep going until we find an element that has color, or we hit the body
			if ( color != '' && color != 'transparent' || jQuery.nodeName(elem, "body") )
				break; 

			attr = "backgroundColor";
		} while ( elem = elem.parentNode );

		return getRGB(color);
	};
	
	// Some named colors to work with
	// From Interface by Stefan Petre
	// http://interface.eyecon.ro/

	var colors = {
		aqua:[0,255,255],
		azure:[240,255,255],
		beige:[245,245,220],
		black:[0,0,0],
		blue:[0,0,255],
		brown:[165,42,42],
		cyan:[0,255,255],
		darkblue:[0,0,139],
		darkcyan:[0,139,139],
		darkgrey:[169,169,169],
		darkgreen:[0,100,0],
		darkkhaki:[189,183,107],
		darkmagenta:[139,0,139],
		darkolivegreen:[85,107,47],
		darkorange:[255,140,0],
		darkorchid:[153,50,204],
		darkred:[139,0,0],
		darksalmon:[233,150,122],
		darkviolet:[148,0,211],
		fuchsia:[255,0,255],
		gold:[255,215,0],
		green:[0,128,0],
		indigo:[75,0,130],
		khaki:[240,230,140],
		lightblue:[173,216,230],
		lightcyan:[224,255,255],
		lightgreen:[144,238,144],
		lightgrey:[211,211,211],
		lightpink:[255,182,193],
		lightyellow:[255,255,224],
		lime:[0,255,0],
		magenta:[255,0,255],
		maroon:[128,0,0],
		navy:[0,0,128],
		olive:[128,128,0],
		orange:[255,165,0],
		pink:[255,192,203],
		purple:[128,0,128],
		violet:[128,0,128],
		red:[255,0,0],
		silver:[192,192,192],
		white:[255,255,255],
		yellow:[255,255,0]
	};
	
})(jQuery);

//'Ermittle Nachkommaanteil 131203'
function getFrac(num) { num=""+num; return parseFloat("0."+num.substring(num.length-((num.indexOf(".")>=0)?num.length-num.indexOf(".")-1:0),num.length)); }
// 'Zahlenumwandlung 131203' (benoetigt getFrac())
function stringInt(num,base,size) { var i, q, sign, result="", baseTable="0123456789ABCDEF"; num=parseInt(num); sign=(num<0)?"-":""; base=parseInt(base); size=(size)?size:0; if(!base || base<=1 || base>baseTable.length) { base=10; } while(true) { q=num/base; result=baseTable.charAt(parseInt(getFrac(q)*base))+result; num=parseInt(q); if(num==0) { break; } } q=""; size-=result.length; for(i=0;i<size;i++) { q+="0"; } return sign+q+result; }

/**
 * jQuery.ScrollTo - Easy element scrolling using jQuery.
 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 5/25/2009
 * @author Ariel Flesler
 * @version 1.4.2
 *
 * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
 */
;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);

(function($){

	var methods = {
		init: function(options){
		this.each(function() {
			var id = '';
			var thumbs = [];
			var images = [];
			var captions = [];

			// lese alle notwendigen informationen aus
			id = $(this).attr('id');
				var imageElements = $('.imageElement', this);
				for (i=0; i < imageElements.length; i++) {
					thumbs[i] = $('img.thumbnail', imageElements[i]).attr('src');
					images[i] = $('img.full', imageElements[i]).attr('src');
					captions[i] = $('h3', imageElements[i]).text();
					if (captions[i].length == 0) {
						captions[i] = $('p', imageElements[i]).text();
					}
				}
				// Leere das Konstrukt, wir bauen das völlig neu auf
				$(this).empty();
				$(this).addClass('jsGallery');
				
				var container = $('<div>').attr('class', 'thumb_container').attr('id', 'container_'+id);
				for (i in thumbs) {
					var link = $('<a>').attr('href', images[i]).attr('title', jQuery.trim(captions[i])).attr('rel', 'gallery_'+id);
					var image = $('<img>').attr('src', thumbs[i]).attr('id', 'thumb_'+i+'_'+id).attr('title', jQuery.trim(captions[i]));
					link.append(image);
					link.fancybox({
						'transitionIn'	:	'elastic',
						'transitionOut'	:	'elastic',
						'overlayShow'	:	false,
						'href'          :   images[i]
					});
					container.append(link);
				}
				var myviewport = $('<div>').attr('class', 'thumb_viewport');
				$(this).append(myviewport.append(container)); 
				var scrollLeft = function(event) {
					$(event.data).scrollTo( '+='+event.data.width()+'px', 500, {onAfter: function(event, scrollObject) {
						var thumbs = $('.thumb_container a', this);
						var length = 0;
						for (i=0; i<thumbs.length; i++) {
							length = length+$(thumbs[i]).width()-1;
						}
						length = length-$(this).width();
						if (length <= $(this).scrollLeft()) {
							$('a.next', $(this).parent()).addClass('dnd');
							$('a.previous', $(this).parent()).removeClass('dnd');
						} else {
							$('a.next', $(this).parent()).removeClass('dnd');
							$('a.previous', $(this).parent()).removeClass('dnd');
						}
					}});
				}
				var scrollRight = function(event) {
					$(event.data).scrollTo( '-='+event.data.width()+'px', 500, {onAfter: function(event, e2) {
						if ($(this).scrollLeft() == 0) {
							$('a.previous', $(this).parent()).addClass('dnd');
							$('a.next', $(this).parent()).removeClass('dnd');
						} else {
							$('a.previous', $(this).parent()).removeClass('dnd');
							$('a.next', $(this).parent()).removeClass('dnd');
						}
					}});
				}
				
				var thumb_list = $('.thumb_container a', this);
				var length = 0;
				for (i=0; i<thumb_list.length; i++) {
					length = length+$(thumb_list[i]).width()-1;
				}
				$(this).append($('<a>').attr('class', 'next').text('next').click(myviewport, scrollLeft)); 
				$(this).append($('<a>').attr('class', 'previous dnd').text('previous').click(myviewport, scrollRight)); 
			});
		}
	};

	$.fn.golfGallery = function( method ) {
		if ( methods[method] ) {
			return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 ));
		} else if ( typeof method === 'object' || ! method ) {
			return methods.init.apply( this, arguments );
		} else {
			$.error( 'Method ' +  method + ' does not exist on jQuery.golfGallery' );
		}    
	};
	
})(jQuery);

$(window).load(function() { 
	$('.myGallery').golfGallery();
});




