var O={init:function(){DOMAssistant.DOMReady(O.onDOMReady);
/*@cc_on
		@if (@_jscript_version < 5.7)
			try {
				document.execCommand("BackgroundImageCache", false, true);
				this.isIE6 = true;
			} catch (e) {}
		@end @*/
var html=document.getElementsByTagName("html")[0];html.className+=html.className.length===0?"javascript":" javascript"},onDOMReady:function(){},addOnDOMReady:function(A){DOMAssistant.DOMReady(A)},getClassNameValue:function(B,C){var A=new RegExp(".*"+C+"-(.*?)(?:\\s|$).*").exec(B.className);if(A){return A[1]}return null},getAnchoredElement:function(A){return $$(A.href.replace(/.*\#(.*)/,"$1"))},getActualWidth:function(A){A=$(A);var B=O.stripPx(A.getStyle("margin-left"))+O.stripPx(A.getStyle("margin-right"));return A.offsetWidth+B},getActualHeight:function(A){A=$(A);var B=O.stripPx(A.getStyle("margin-bottom"))+O.stripPx(A.getStyle("margin-top"));return A.offsetHeight+B},getActualOffset:function(B){var C=0,A=0;while(B.offsetParent){A+=B.offsetLeft;C+=B.offsetTop;B=B.offsetParent}return{x:A,y:C}},getPosition:function(B,A){var C={x:0,y:0};while(B.offsetParent&&B!=A){C.x+=B.offsetLeft;C.y+=B.offsetTop;B=B.offsetParent}return C},scrollTo:function(B){var A=O.getPosition(B);window.scrollTo(A.x,Math.max(A.y-20,0))},stripPx:function(B){var A=parseInt(B.substring(0,B.length-2));if(isNaN(A)){return 0}return A},isVisible:function(A){while(A.parentNode){if($(A).getStyle("display")=="none"||$(A).getStyle("visibility")=="hidden"){return false}A=A.parentNode}return true},trim:function(A){return A.replace(/^\s+|\s+$/g,"")},numericStrip:function(A){return A.replace(/ |-|\/|\.|\+/gi,"")},addParameter:function(B,A,C){return B+(B.indexOf("?")<0?"?":"&")+A+"="+C},getFirstNode:function(A){return A.firstChild.nodeType==3?A.childNodes[1]:A.firstChild},debug:function(A){if(A!==null){A=A+"";if(!$$("debug")){$(document.body).create("div",{id:"debug",style:"position: absolute; right: 0; top: 50px; font: 11px verdana; background: white; padding: 10px; background: white; opacity: .5; filter: alpha(opacity = 50); z-index: 99999999;"},true)}A=A.replace(">","&gt;");A=A.replace("<","&lt;");$$("debug").create("div",null,true,A)}},readCookie:function(B){var D=document.cookie.split(";");for(var C=0,A=D.length;C<A;C++){var E=D[C];while(E.charAt(0)==" "){E=E.substring(1,E.length)}if(E.indexOf(B+"=")==0){return unescape(E.substring((B+"=").length,E.length))}}return null},writeCookie:function(C,D,E){var A="";if(E){var B=new Date();B.setTime(B.getTime()+(E*24*60*60*1000));var A="; expires="+B.toGMTString()}document.cookie=C+"="+escape(D)+"; expires="+A+"; path=/";return D}};O.eventHandler=function(){var B=[];var D=function(J){J=J||event;var I=B[J.type];if(I){var H=J.eventTarget;if(!H){H=J.target||J.srcElement||document}if(H!=null){if(J.type=="click"){if((J.which&&J.which!=1)||(J.button&&J.button!==0)){return true}}for(var G=I.length-1;G>=0;G--){var F=C(H,I[G].selector);if(F!==null){if(J.type=="click"&&(J.which||J.button)&&H.nodeName=="A"){H.blur()}var E=I[G].fn.call(F,J);if(typeof E==="undefined"){E=false}if(!E){DOMAssistant.preventDefault(J);return false}}}if(J.type=="mouseover"||J.type=="mouseout"){return false}}return true}};var C=function(I,F){var K=null;var J=F.length-1;var E=false;for(var H=J;H>=0;H--){E=false;while(!E&&I&&I.parentNode){var G=true;if(F[H].tag&&F[H].tag!=I.tagName){G=false}else{if(F[H].id&&F[H].id!=I.id){G=false}else{if(F[H].className&&!F[H].className.test(I.className)){G=false}}}if(K===null&&G){K=I}E=G;I=I.parentNode}}if(!E){K=null}return K};var A=function(E){var L=[];var G=[];var I="tag";var K="";var J;for(var H=0,F=E.length;H<F;H++){J=E.charAt(H);if(H==E.length-1){K+=J;J=" "}if(J==" "){G[I]=K;if(G.tag){G.tag=G.tag.toUpperCase()}if(G.className){G.className=new RegExp("(^|\\s)"+G.className+"(\\s|$)")}L.push(G);G=[];I="tag";K=""}else{if(J=="#"){G[I]=K;I="id";K=""}else{if(J=="."){G[I]=K;I="className";K=""}else{K+=J}}}}return L};return{register:function(F,E,H){if(E.constructor==Array){for(var G=0,I=E.length;G<I;G++){O.eventHandler.register(F,E[G],H)}return }if((F=="focus"||F=="blur")&&!document.addEventListener){F=(F=="focus")?"focusin":"focusout"}var J=B[F];if(!J){J=[];B[F]=J;if(F=="focus"||F=="blur"){document.addEventListener(F,D,true)}else{$(document).addEvent(F,D)}}J.push({selector:A(E),fn:H})}}}();O.slider=function(elem,duration,easing){this.duration=duration||500;this.easing=easing||O.easing.expoOut;this.elem=$(elem);this.wrapper=$(document.createElement("div"));this.wrapper.style.position="relative";this.wrapper.style.overflow="hidden";this.wrapper.style.height="0";this.elem.style.display="block";this.elemWidth=O.getActualWidth(this.elem);this.elemHeight=O.getActualHeight(this.elem);this.elem.parentNode.insertBefore(this.wrapper,this.elem);this.wrapper.appendChild(this.elem);this.elem.style.position="absolute";this.elem.style.left="0px";this.elem.style.bottom="0px";this.elemWidthPadding=O.stripPx(elem.getStyle("padding-left"))+O.stripPx(elem.getStyle("padding-right"));this.isVisible=this.elem.hasClass("display");this.wrapper.style.width=(this.elemWidth)+"px";this.wrapper.style.height=(this.isVisible?this.elemHeight:0)+"px";this.elem.style.width=(this.elemWidth-this.elemWidthPadding)+"px";this.fullWidth="auto";
/*@cc_on
		this.fullWidth = (this.elemWidth - this.elemWidthPadding) + "px";
	@*/
};O.slider.prototype.open=function(A){var A=A?A:{};var D=A.duration||this.duration;var F=A.easing||this.easing;var E=A.callback||null;var C=A.force||false;if(!this.isInTransition||C){this.isInTransition=true;this.elemWidth=O.getActualWidth(this.elem);this.elemHeight=O.getActualHeight(this.elem);var B=this;this.wrapper.animate({height:this.elemHeight},{duration:D,callback:function(){B.isVisible=true;B.isInTransition=false;B.elem.style.position="relative";B.elem.style.width=B.fullWidth;this.style.height="100%";this.style.width="100%";if(E){E()}}})}};O.slider.prototype.close=function(A){var A=A?A:{};var D=A.duration||this.duration;var F=A.easing||this.easing;var E=A.callback||null;var C=A.force||false;if(!this.isInTransition||C){this.isInTransition=true;this.elemWidth=O.getActualWidth(this.elem);this.elemHeight=O.getActualHeight(this.elem);this.elem.style.position="absolute";this.wrapper.style.width=this.elemWidth+"px";this.wrapper.style.height=O.getActualHeight(this.elem)+"px";this.elem.style.width=(this.elemWidth-this.elemWidthPadding)+"px";var B=this;this.wrapper.animate({height:0},{duration:D,callback:function(){B.isVisible=false;B.isInTransition=false;if(E){E()}}})}};O.slider.prototype.toggle=function(A,B){if(this.isVisible){this.close(A,B)}else{this.open(A,B)}};O.fixQuotes=function(){return{DOMReady:function(){$("q").each(function(){var B=document.createTextNode("\u201d");var A=document.createTextNode("\u201d");this.insertBefore(B,this.firstChild);this.appendChild(A)})}}}();O.easing=function(){return{expoOut:function(A,B,D,C){return(A==C)?B+D:D*(-Math.pow(2,-10*A/C)+1)+B}}}();O.form=function(){var B=false;var D=function(){B=true;O.eventHandler.register("keyup",".has-error",function(){C(this)})};var C=function(E){E=$(E);if(E.hasClass("required")&&(O.trim(E.value)=="")){E.form.missing.push(E);E.form.hasErrors=true}else{if(E.hasClass("accept-conditions")&&!E.checked){E.form.unaccepted.push(E);E.form.hasErrors=true}else{if(E.hasClass("email")&&O.trim(E.value)!=""&&E.value.search(/(\w|\.|\-)+\@(\w|\.|\-)+\.[a-z]{2,6}$/)){E.form.erronous.push(E);E.form.hasErrors=true}else{if(E.hasClass("numeric")&&(/\D/).test(O.numericStrip(E.value))){E.form.erronous.push(E);E.form.hasErrors=true}else{E.removeClass("has-error")}}}}};var A=function(F){var H="";if(!F.alertBox){F.alertBox=$(F).create("div",{className:"alert-box",style:DOMEffects.getOpacityRule(0)},false)}H='<span class="alert-box-heading">Vi kunde tyv&auml;rr inte skicka in formul&auml;ret</span><ul>';for(var G=0,E=F.erronous.length;G<E;G++){F.erronous[G].addClass("has-error");H+="<li>Kontrollera att "+F.erronous[G].title+" &auml;r korrekt"}for(var G=0,E=F.missing.length;G<E;G++){F.missing[G].addClass("has-error");H+="<li>Du verkar ha gl&ouml;mt "+F.missing[G].title}for(var G=0,E=F.unaccepted.length;G<E;G++){H+="<li>Du m&aring;ste godk&auml;nna "+F.unaccepted[G].title}H+="</ul>";F.alertBox.innerHTML=H;F.insertBefore(F.alertBox,F.firstChild);O.scrollTo(F);F.alertBox.show()};return{validate:function(E){if(!B){D()}if(!E){E=this}E.erronous=new Array();E.missing=new Array();E.unaccepted=new Array();E.hasErrors=false;E.cssSelect("input, textarea").each(function(){if(O.isVisible(E)){C(E)}});if(E.hasErrors){A(E);return false}else{return true}}}}();O.AJAXForm=function(A){A=$(A);A.isAJAXForm=true;A.beforeSubmissionHandler=function(){return true};A.addEvent("submit",O.AJAXForm.sendForm);A.setBeforeSubmissionHandler=function(B){this.beforeSubmissionHandler=B};A.setResponseHandler=function(B){this.responseHandler=B};return A};O.AJAXForm.sendForm=function(){if(this.beforeSubmissionHandler.call(this)!==false){var A=this.elements;var E="";for(var C=0,B=A.length,G,D,F;C<B;C++){G=A[C];D=G.getAttribute("type");F=/select/i.test(G.nodeName);if(G.getAttribute("name")&&(/text|hidden|password|submit|image/i.test(D)||F||(/radio|checkbox/i.test(D)&&G.checked)||/textarea/i.test(G.nodeName))){E+=G.getAttribute("name")+"="+encodeURIComponent(((F)?G.options[G.selectedIndex].value:G.value))+"&"}}E+="mode=ajax";this.ajax({url:this.getAttribute("action"),method:"POST",params:E.replace(/&*$/g,""),callback:this.responseHandler,headers:this.headers||{}})}return false};O.QueryString=function(){var A=null;var C=new RegExp("([^?=&]+)(=([^&]*))?","g");var B=function(){A=[];window.location.search.replace(C,function(D,G,F,E){A[G]=E})};return{get:function(D){if(A==null){B()}return A[D]}}}();O.init();
