var spring_site="test";var _cy_="undefined";if(!this.spring){var spring=function(){var F=_cy_;var D=spring_site;var O="tns-cs.net";var C=typeof spring_ms!=F?spring_ms:2048;var G=typeof spring_debug!=F?spring_debug:null;var E={"+":"%2B",",":"%2C",";":"%3B","=":"%3D","~":"%7E"};var K={};var N=null;var J={};function B(){if("https"==document.location.href.slice(0,5)){return"https://ssl-"}
return"http://"}
function P(S,Q){if(!Q){Q=S;S={r:document.referrer};J=Q}
var R=Q.s?Q.s:S.s;if(!R){R=Q.site?Q.site:(S.site?S.site:D)}
if(!K[R]){K[R]=[]}
K[R].push([S,Q]);N=1;return this}
function M(U){if(!N){P({})}
var S;for(s in K){var T=K[s];while(T.length>0){var R=",",Q=[];while(T.length>0){R=R+A(I(T.shift(),Q),Q);if(R.length>C){break}
if(T.length>0){R+="+"}}
S=L(R+";",s,U)}}
K={};return S}
function L(T,R,U){var S=B()+(R?R:D)+"."+O+"/j0="+T;var Q=S+"?lt="+(new Date()).getTime().toString(36)+"&x="+screen.width+"x"+screen.height+"x"+screen.colorDepth;if(!U){(new Image()).src=Q}else{if(U==1){document.write('<img src="'+Q+'"" width="1" height=""1">')}}
if(G){alert(Q)}
return S}
function A(Q,R){for(i in R){if(R[i]==Q){return"~"+i}}
R.push(Q);return Q}
function I(T,V){var R,U,S,Q,W=/[+&,;=~]/g,X;if(!V){V=[]}
switch(typeof T){case"string":return W.test(T)?escape(T).replace(W,function(Y){var Z=E[Y];if(Z){return Z}
return Y}):escape(T);case"number":return isFinite(T)?String(T):"null";case"boolean":case"null":return String(T);case"object":if(!T){return"null"}
R=[];if(typeof T.length==="number"&&!(T.propertyIsEnumerable("length"))){Q=T.length;for(U=0;U<Q;U+=1){R.push(A(I(T[U],V),V)||"null")}
return","+R.join("+")+";"}
for(S in T){if(typeof S==="string"){if(S!="site"){X=I(T[S],V);if(X){R.push(A(I(S,V)+"="+X,V))}}}}
return","+R.join("+")+";"}
return""}
function H(R,Q,S){P(R,Q);return M(S)}
return{a:P,add:P,c:H,commit:H}}()};(function($){$.fn.jqm=function(o){var p={overlay:50,overlayClass:'jqmOverlay',closeClass:'jqmClose',trigger:'.jqModal',ajax:F,ajaxText:'',target:F,modal:F,toTop:F,onShow:F,onHide:F,onLoad:F};return this.each(function(){if(this._jqm)return H[this._jqm].c=$.extend({},H[this._jqm].c,o);s++;this._jqm=s;H[s]={c:$.extend(p,$.jqm.params,o),a:F,w:$(this).addClass('jqmID'+s),s:s};if(p.trigger)$(this).jqmAddTrigger(p.trigger);});};$.fn.jqmAddClose=function(e){return hs(this,e,'jqmHide');};$.fn.jqmAddTrigger=function(e){return hs(this,e,'jqmShow');};$.fn.jqmShow=function(t){return this.each(function(){t=t||window.event;$.jqm.open(this._jqm,t);});};$.fn.jqmHide=function(t){return this.each(function(){t=t||window.event;$.jqm.close(this._jqm,t)});};$.jqm={hash:{},open:function(s,t){var h=H[s],c=h.c,cc='.'+c.closeClass,z=(parseInt(h.w.css('z-index'))),z=(z>0)?z:3000,o=$('<div></div>').css({height:'100%',width:'100%',position:'fixed',left:0,top:0,'z-index':z-1,opacity:c.overlay/100});if(h.a)return F;h.t=t;h.a=true;h.w.css('z-index',z);if(c.modal){if(!A[0])L('bind');A.push(s);}
else if(c.overlay>0)h.w.jqmAddClose(o);else o=F;h.o=(o)?o.addClass(c.overlayClass).prependTo('body'):F;if(ie6){$('html,body').css({height:'100%',width:'100%'});if(o){o=o.css({position:'absolute'})[0];for(var y in{Top:1,Left:1})o.style.setExpression(y.toLowerCase(),"(_=(document.documentElement.scroll"+y+" || document.body.scroll"+y+"))+'px'");}}
if(c.ajax){var r=c.target||h.w,u=c.ajax,r=(typeof r=='string')?$(r,h.w):$(r),u=(u.substr(0,1)=='@')?$(t).attr(u.substring(1)):u;r.html(c.ajaxText).load(u,function(){if(c.onLoad)c.onLoad.call(this,h);if(cc)h.w.jqmAddClose($(cc,h.w));e(h);});}
else if(cc)h.w.jqmAddClose($(cc,h.w));if(c.toTop&&h.o)h.w.before('<span id="jqmP'+h.w[0]._jqm+'"></span>').insertAfter(h.o);(c.onShow)?c.onShow(h):h.w.show();e(h);return F;},close:function(s){var h=H[s];if(!h.a)return F;h.a=F;if(A[0]){A.pop();if(!A[0])L('unbind');}
if(h.c.toTop&&h.o)$('#jqmP'+h.w[0]._jqm).after(h.w).remove();if(h.c.onHide)h.c.onHide(h);else{h.w.hide();if(h.o)h.o.remove();}return F;},params:{}};var s=0,H=$.jqm.hash,A=[],ie6=$.browser.msie&&($.browser.version=="6.0"),F=false,i=$('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({opacity:0}),e=function(h){if(ie6)if(h.o)h.o.html('<p style="width:100%;height:100%"/>').prepend(i);else if(!$('iframe.jqm',h.w)[0])h.w.prepend(i);f(h);},f=function(h){try{$(':input:visible',h.w)[0].focus();}catch(_){}},L=function(t){$()[t]("keypress",m)[t]("keydown",m)[t]("mousedown",m);},m=function(e){var h=H[A[A.length-1]],r=(!$(e.target).parents('.jqmID'+h.s)[0]);if(r)f(h);return!r;},hs=function(w,t,c){return w.each(function(){var s=this._jqm;$(t).each(function(){if(!this[c]){this[c]=[];$(this).click(function(){for(var i in{jqmShow:1,jqmHide:1})for(var s in this[i])if(H[this[i][s]])H[this[i][s]].w[i](this);return F;});}this[c].push(s);});});};})(jQuery);jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1;}
var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}
expires='; expires='+date.toUTCString();}
var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}
return cookieValue;}};jQuery.fn.submitWithAjax=function(){this.submit(function(){$.post(this.action,$(this).serialize(),null,"script");return false;});return this;};jQuery.fn.liveSearch=function(conf){var config=jQuery.extend({url:'/?module=SearchResults&q=',id:'jquery-live-search',afterUrl:'',duration:400,typeDelay:200,loadingClass:'loading',onSlideUp:function(){}},conf);var liveSearch=jQuery('#'+config.id);if(!liveSearch.length){liveSearch=jQuery('<div id="'+config.id+'"></div>').appendTo(document.body).hide().slideUp(0);jQuery(document.body).click(function(event){var clicked=jQuery(event.target);if(!(clicked.is('#'+config.id)||clicked.parents('#'+config.id).length||clicked.is('input'))){liveSearch.slideUp(config.duration,function(){config.onSlideUp();});}});}
return this.each(function(){var input=jQuery(this).attr('autocomplete','off');var resultsShit=parseInt(liveSearch.css('paddingLeft'),10)+parseInt(liveSearch.css('paddingRight'),10)+parseInt(liveSearch.css('borderLeftWidth'),10)+parseInt(liveSearch.css('borderRightWidth'),10);input.focus(function(){if(this.value!==''){if(liveSearch.html()==''){this.lastValue='';input.keyup();}
else{liveSearch.slideDown(config.duration);}}}).keyup(function(){if(this.value!=this.lastValue){input.addClass(config.loadingClass);var q=this.value;if(this.timer){clearTimeout(this.timer);}
this.timer=setTimeout(function(){jQuery.get(config.url+q+config.afterUrl,function(data){input.removeClass(config.loadingClass);if(data.length&&q.length){var tmpOffset=input.offset();var inputDim={left:tmpOffset.left,top:tmpOffset.top,width:input.outerWidth(),height:input.outerHeight()};inputDim.topNHeight=inputDim.top+inputDim.height;inputDim.widthNShit=inputDim.width-resultsShit;liveSearch.css({position:'absolute',left:inputDim.left+'px',top:inputDim.topNHeight+'px',width:inputDim.widthNShit+'px'});liveSearch.html(data).slideDown(config.duration);}
else{liveSearch.slideUp(config.duration,function(){config.onSlideUp();});}});},config.typeDelay);this.lastValue=this.value;}});});};jQuery.fn.liveUpdate=function(list,options){var opts=jQuery.extend({onHide:null,onShow:null},options)
list=jQuery(list);if(list.length){var rows=list,cache=rows.map(function(){return jQuery(this).text().toLowerCase()});this.keyup(filter).keyup().parents('form').submit(function(){return false;});}
return this;function filter(){var term=jQuery.trim(jQuery(this).val().toLowerCase()),scores=[];if(!term){opts.onShow==null?rows.show():jQuery.each(rows,function(i){opts.onShow(rows[i])})}else{opts.onHide==null?rows.hide():jQuery.each(rows,function(i){opts.onHide(rows[i])})
cache.each(function(i){var score=this.score(term);if(score>0){scores.push([score,i]);}});jQuery.each(scores.sort(function(a,b){return b[0]-a[0];}),function(){opts.onShow==null?jQuery(rows[this[1]]).show():opts.onShow(rows[this[1]])});}}};(function($){$.extend($.fn,{validate:function(options){if(!this.length){options&&options.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return;}
var validator=$.data(this[0],'validator');if(validator){return validator;}
validator=new $.validator(options,this[0]);$.data(this[0],'validator',validator);if(validator.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){validator.cancelSubmit=true;});if(validator.settings.submitHandler){this.find("input, button").filter(":submit").click(function(){validator.submitButton=this;});}
this.submit(function(event){if(validator.settings.debug)
event.preventDefault();function handle(){if(validator.settings.submitHandler){if(validator.submitButton){var hidden=$("<input type='hidden'/>").attr("name",validator.submitButton.name).val(validator.submitButton.value).appendTo(validator.currentForm);}
validator.settings.submitHandler.call(validator,validator.currentForm);if(validator.submitButton){hidden.remove();}
return false;}
return true;}
if(validator.cancelSubmit){validator.cancelSubmit=false;return handle();}
if(validator.form()){if(validator.pendingRequest){validator.formSubmitted=true;return false;}
return handle();}else{validator.focusInvalid();return false;}});}
return validator;},valid:function(){if($(this[0]).is('form')){return this.validate().form();}else{var valid=true;var validator=$(this[0].form).validate();this.each(function(){valid&=validator.element(this);});return valid;}},removeAttrs:function(attributes){var result={},$element=this;$.each(attributes.split(/\s/),function(index,value){result[value]=$element.attr(value);$element.removeAttr(value);});return result;},rules:function(command,argument){var element=this[0];if(command){var settings=$.data(element.form,'validator').settings;var staticRules=settings.rules;var existingRules=$.validator.staticRules(element);switch(command){case"add":$.extend(existingRules,$.validator.normalizeRule(argument));staticRules[element.name]=existingRules;if(argument.messages)
settings.messages[element.name]=$.extend(settings.messages[element.name],argument.messages);break;case"remove":if(!argument){delete staticRules[element.name];return existingRules;}
var filtered={};$.each(argument.split(/\s/),function(index,method){filtered[method]=existingRules[method];delete existingRules[method];});return filtered;}}
var data=$.validator.normalizeRules($.extend({},$.validator.metadataRules(element),$.validator.classRules(element),$.validator.attributeRules(element),$.validator.staticRules(element)),element);if(data.required){var param=data.required;delete data.required;data=$.extend({required:param},data);}
return data;}});$.extend($.expr[":"],{blank:function(a){return!$.trim(a.value);},filled:function(a){return!!$.trim(a.value);},unchecked:function(a){return!a.checked;}});$.validator=function(options,form){this.settings=$.extend({},$.validator.defaults,options);this.currentForm=form;this.init();};$.validator.format=function(source,params){if(arguments.length==1)
return function(){var args=$.makeArray(arguments);args.unshift(source);return $.validator.format.apply(this,args);};if(arguments.length>2&&params.constructor!=Array){params=$.makeArray(arguments).slice(1);}
if(params.constructor!=Array){params=[params];}
$.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"),n);});return source;};$.extend($.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:$([]),errorLabelContainer:$([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(element){this.lastActive=element;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,element,this.settings.errorClass,this.settings.validClass);this.errorsFor(element).hide();}},onfocusout:function(element){if(!this.checkable(element)&&(element.name in this.submitted||!this.optional(element))){this.element(element);}},onkeyup:function(element){if(element.name in this.submitted||element==this.lastElement){this.element(element);}},onclick:function(element){if(element.name in this.submitted)
this.element(element);},highlight:function(element,errorClass,validClass){$(element).addClass(errorClass).removeClass(validClass);},unhighlight:function(element,errorClass,validClass){$(element).removeClass(errorClass).addClass(validClass);}},setDefaults:function(settings){$.extend($.validator.defaults,settings);},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",dateDE:"Bitte geben Sie ein gültiges Datum ein.",number:"Please enter a valid number.",numberDE:"Bitte geben Sie eine Nummer ein.",digits:"Please enter only digits",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:$.validator.format("Please enter no more than {0} characters."),minlength:$.validator.format("Please enter at least {0} characters."),rangelength:$.validator.format("Please enter a value between {0} and {1} characters long."),range:$.validator.format("Please enter a value between {0} and {1}."),max:$.validator.format("Please enter a value less than or equal to {0}."),min:$.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=$(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||$(this.currentForm);this.containers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var groups=(this.groups={});$.each(this.settings.groups,function(key,value){$.each(value.split(/\s/),function(index,name){groups[name]=key;});});var rules=this.settings.rules;$.each(rules,function(key,value){rules[key]=$.validator.normalizeRule(value);});function delegate(event){var validator=$.data(this[0].form,"validator");validator.settings["on"+event.type]&&validator.settings["on"+event.type].call(validator,this[0]);}
$(this.currentForm).delegate("focusin focusout keyup",":text, :password, :file, select, textarea",delegate).delegate("click",":radio, :checkbox",delegate);if(this.settings.invalidHandler)
$(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler);},form:function(){this.checkForm();$.extend(this.submitted,this.errorMap);this.invalid=$.extend({},this.errorMap);if(!this.valid())
$(this.currentForm).triggerHandler("invalid-form",[this]);this.showErrors();return this.valid();},checkForm:function(){this.prepareForm();for(var i=0,elements=(this.currentElements=this.elements());elements[i];i++){this.check(elements[i]);}
return this.valid();},element:function(element){element=this.clean(element);this.lastElement=element;this.prepareElement(element);this.currentElements=$(element);var result=this.check(element);if(result){delete this.invalid[element.name];}else{this.invalid[element.name]=true;}
if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers);}
this.showErrors();return result;},showErrors:function(errors){if(errors){$.extend(this.errorMap,errors);this.errorList=[];for(var name in errors){this.errorList.push({message:errors[name],element:this.findByName(name)[0]});}
this.successList=$.grep(this.successList,function(element){return!(element.name in errors);});}
this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors();},resetForm:function(){if($.fn.resetForm)
$(this.currentForm).resetForm();this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass);},numberOfInvalids:function(){return this.objectLength(this.invalid);},objectLength:function(obj){var count=0;for(var i in obj)
count++;return count;},hideErrors:function(){this.addWrapper(this.toHide).hide();},valid:function(){return this.size()==0;},size:function(){return this.errorList.length;},focusInvalid:function(){if(this.settings.focusInvalid){try{$(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus();}catch(e){}}},findLastActive:function(){var lastActive=this.lastActive;return lastActive&&$.grep(this.errorList,function(n){return n.element.name==lastActive.name;}).length==1&&lastActive;},elements:function(){var validator=this,rulesCache={};return $([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&validator.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in rulesCache||!validator.objectLength($(this).rules()))
return false;rulesCache[this.name]=true;return true;});},clean:function(selector){return $(selector)[0];},errors:function(){return $(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext);},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=$([]);this.toHide=$([]);this.formSubmitted=false;this.currentElements=$([]);},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers);},prepareElement:function(element){this.reset();this.toHide=this.errorsFor(element);},check:function(element){element=this.clean(element);if(this.checkable(element)){element=this.findByName(element.name)[0];}
var rules=$(element).rules();var dependencyMismatch=false;for(method in rules){var rule={method:method,parameters:rules[method]};try{var result=$.validator.methods[method].call(this,element.value.replace(/\r/g,""),element,rule.parameters);if(result=="dependency-mismatch"){dependencyMismatch=true;continue;}
dependencyMismatch=false;if(result=="pending"){this.toHide=this.toHide.not(this.errorsFor(element));return;}
if(!result){this.formatAndAdd(element,rule);return false;}}catch(e){this.settings.debug&&window.console&&console.log("exception occured when checking element "+element.id
+", check the '"+rule.method+"' method");throw e;}}
if(dependencyMismatch)
return;if(this.objectLength(rules))
this.successList.push(element);return true;},customMetaMessage:function(element,method){if(!$.metadata)
return;var meta=this.settings.meta?$(element).metadata()[this.settings.meta]:$(element).metadata();return meta&&meta.messages&&meta.messages[method];},customMessage:function(name,method){var m=this.settings.messages[name];return m&&(m.constructor==String?m:m[method]);},findDefined:function(){for(var i=0;i<arguments.length;i++){if(arguments[i]!==undefined)
return arguments[i];}
return undefined;},defaultMessage:function(element,method){return this.findDefined(this.customMessage(element.name,method),this.customMetaMessage(element,method),!this.settings.ignoreTitle&&element.title||undefined,$.validator.messages[method],"<strong>Warning: No message defined for "+element.name+"</strong>");},formatAndAdd:function(element,rule){var message=this.defaultMessage(element,rule.method);if(typeof message=="function")
message=message.call(this,rule.parameters,element);this.errorList.push({message:message,element:element});this.errorMap[element.name]=message;this.submitted[element.name]=message;},addWrapper:function(toToggle){if(this.settings.wrapper)
toToggle=toToggle.add(toToggle.parent(this.settings.wrapper));return toToggle;},defaultShowErrors:function(){for(var i=0;this.errorList[i];i++){var error=this.errorList[i];this.settings.highlight&&this.settings.highlight.call(this,error.element,this.settings.errorClass,this.settings.validClass);this.showLabel(error.element,error.message);}
if(this.errorList.length){this.toShow=this.toShow.add(this.containers);}
if(this.settings.success){for(var i=0;this.successList[i];i++){this.showLabel(this.successList[i]);}}
if(this.settings.unhighlight){for(var i=0,elements=this.validElements();elements[i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorClass,this.settings.validClass);}}
this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show();},validElements:function(){return this.currentElements.not(this.invalidElements());},invalidElements:function(){return $(this.errorList).map(function(){return this.element;});},showLabel:function(element,message){var label=this.errorsFor(element);if(label.length){label.removeClass().addClass(this.settings.errorClass);label.attr("generated")&&label.html(message);}else{label=$("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(element),generated:true}).addClass(this.settings.errorClass).html(message||"");if(this.settings.wrapper){label=label.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();}
if(!this.labelContainer.append(label).length)
this.settings.errorPlacement?this.settings.errorPlacement(label,$(element)):label.insertAfter(element);}
if(!message&&this.settings.success){label.text("");typeof this.settings.success=="string"?label.addClass(this.settings.success):this.settings.success(label);}
this.toShow=this.toShow.add(label);},errorsFor:function(element){return this.errors().filter("[for='"+this.idOrName(element)+"']");},idOrName:function(element){return this.groups[element.name]||(this.checkable(element)?element.name:element.id||element.name);},checkable:function(element){return/radio|checkbox/i.test(element.type);},findByName:function(name){var form=this.currentForm;return $(document.getElementsByName(name)).map(function(index,element){return element.form==form&&element.name==name&&element||null;});},getLength:function(value,element){switch(element.nodeName.toLowerCase()){case'select':return $("option:selected",element).length;case'input':if(this.checkable(element))
return this.findByName(element.name).filter(':checked').length;}
return value.length;},depend:function(param,element){return this.dependTypes[typeof param]?this.dependTypes[typeof param](param,element):true;},dependTypes:{"boolean":function(param,element){return param;},"string":function(param,element){return!!$(param,element.form).length;},"function":function(param,element){return param(element);}},optional:function(element){return!$.validator.methods.required.call(this,$.trim(element.value),element)&&"dependency-mismatch";},startRequest:function(element){if(!this.pending[element.name]){this.pendingRequest++;this.pending[element.name]=true;}},stopRequest:function(element,valid){this.pendingRequest--;if(this.pendingRequest<0)
this.pendingRequest=0;delete this.pending[element.name];if(valid&&this.pendingRequest==0&&this.formSubmitted&&this.form()){$(this.currentForm).submit();}else if(!valid&&this.pendingRequest==0&&this.formSubmitted){$(this.currentForm).triggerHandler("invalid-form",[this]);}},previousValue:function(element){return $.data(element,"previousValue")||$.data(element,"previousValue",previous={old:null,valid:true,message:this.defaultMessage(element,"remote")});}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(className,rules){className.constructor==String?this.classRuleSettings[className]=rules:$.extend(this.classRuleSettings,className);},classRules:function(element){var rules={};var classes=$(element).attr('class');classes&&$.each(classes.split(' '),function(){if(this in $.validator.classRuleSettings){$.extend(rules,$.validator.classRuleSettings[this]);}});return rules;},attributeRules:function(element){var rules={};var $element=$(element);for(method in $.validator.methods){var value=$element.attr(method);if(value){rules[method]=value;}}
if(rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)){delete rules.maxlength;}
return rules;},metadataRules:function(element){if(!$.metadata)return{};var meta=$.data(element.form,'validator').settings.meta;return meta?$(element).metadata()[meta]:$(element).metadata();},staticRules:function(element){var rules={};var validator=$.data(element.form,'validator');if(validator.settings.rules){rules=$.validator.normalizeRule(validator.settings.rules[element.name])||{};}
return rules;},normalizeRules:function(rules,element){$.each(rules,function(prop,val){if(val===false){delete rules[prop];return;}
if(val.param||val.depends){var keepRule=true;switch(typeof val.depends){case"string":keepRule=!!$(val.depends,element.form).length;break;case"function":keepRule=val.depends.call(element,element);break;}
if(keepRule){rules[prop]=val.param!==undefined?val.param:true;}else{delete rules[prop];}}});$.each(rules,function(rule,parameter){rules[rule]=$.isFunction(parameter)?parameter(element):parameter;});$.each(['minlength','maxlength','min','max'],function(){if(rules[this]){rules[this]=Number(rules[this]);}});$.each(['rangelength','range'],function(){if(rules[this]){rules[this]=[Number(rules[this][0]),Number(rules[this][1])];}});if($.validator.autoCreateRanges){if(rules.min&&rules.max){rules.range=[rules.min,rules.max];delete rules.min;delete rules.max;}
if(rules.minlength&&rules.maxlength){rules.rangelength=[rules.minlength,rules.maxlength];delete rules.minlength;delete rules.maxlength;}}
if(rules.messages){delete rules.messages}
return rules;},normalizeRule:function(data){if(typeof data=="string"){var transformed={};$.each(data.split(/\s/),function(){transformed[this]=true;});data=transformed;}
return data;},addMethod:function(name,method,message){$.validator.methods[name]=method;$.validator.messages[name]=message||$.validator.messages[name];if(method.length<3){$.validator.addClassRules(name,$.validator.normalizeRule(name));}},methods:{required:function(value,element,param){if(!this.depend(param,element))
return"dependency-mismatch";switch(element.nodeName.toLowerCase()){case'select':var options=$("option:selected",element);return options.length>0&&(element.type=="select-multiple"||($.browser.msie&&!(options[0].attributes['value'].specified)?options[0].text:options[0].value).length>0);case'input':if(this.checkable(element))
return this.getLength(value,element)>0;default:return $.trim(value).length>0;}},remote:function(value,element,param){if(this.optional(element))
return"dependency-mismatch";var previous=this.previousValue(element);if(!this.settings.messages[element.name])
this.settings.messages[element.name]={};this.settings.messages[element.name].remote=typeof previous.message=="function"?previous.message(value):previous.message;param=typeof param=="string"&&{url:param}||param;if(previous.old!==value){previous.old=value;var validator=this;this.startRequest(element);var data={};data[element.name]=value;$.ajax($.extend(true,{url:param,mode:"abort",port:"validate"+element.name,dataType:"json",data:data,success:function(response){var valid=response===true;if(valid){var submitted=validator.formSubmitted;validator.prepareElement(element);validator.formSubmitted=submitted;validator.successList.push(element);validator.showErrors();}else{var errors={};errors[element.name]=previous.message=response||validator.defaultMessage(element,"remote");validator.showErrors(errors);}
previous.valid=valid;validator.stopRequest(element,valid);}},param));return"pending";}else if(this.pending[element.name]){return"pending";}
return previous.valid;},minlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)>=param;},maxlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)<=param;},rangelength:function(value,element,param){var length=this.getLength($.trim(value),element);return this.optional(element)||(length>=param[0]&&length<=param[1]);},min:function(value,element,param){return this.optional(element)||value>=param;},max:function(value,element,param){return this.optional(element)||value<=param;},range:function(value,element,param){return this.optional(element)||(value>=param[0]&&value<=param[1]);},email:function(value,element){return this.optional(element)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value);},url:function(value,element){return this.optional(element)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);},date:function(value,element){return this.optional(element)||!/Invalid|NaN/.test(new Date(value));},dateISO:function(value,element){return this.optional(element)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value);},dateDE:function(value,element){return this.optional(element)||/^\d\d?\.\d\d?\.\d\d\d?\d?$/.test(value);},number:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(value);},numberDE:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(value);},digits:function(value,element){return this.optional(element)||/^\d+$/.test(value);},creditcard:function(value,element){if(this.optional(element))
return"dependency-mismatch";if(/[^0-9-]+/.test(value))
return false;var nCheck=0,nDigit=0,bEven=false;value=value.replace(/\D/g,"");for(n=value.length-1;n>=0;n--){var cDigit=value.charAt(n);var nDigit=parseInt(cDigit,10);if(bEven){if((nDigit*=2)>9)
nDigit-=9;}
nCheck+=nDigit;bEven=!bEven;}
return(nCheck%10)==0;},accept:function(value,element,param){param=typeof param=="string"?param.replace(/,/g,'|'):"png|jpe?g|gif";return this.optional(element)||value.match(new RegExp(".("+param+")$","i"));},equalTo:function(value,element,param){return value==$(param).val();}}});$.format=$.validator.format;})(jQuery);;(function($){var ajax=$.ajax;var pendingRequests={};$.ajax=function(settings){settings=$.extend(settings,$.extend({},$.ajaxSettings,settings));var port=settings.port;if(settings.mode=="abort"){if(pendingRequests[port]){pendingRequests[port].abort();}
return(pendingRequests[port]=ajax.apply(this,arguments));}
return ajax.apply(this,arguments);};})(jQuery);;(function($){$.each({focus:'focusin',blur:'focusout'},function(original,fix){$.event.special[fix]={setup:function(){if($.browser.msie)return false;this.addEventListener(original,$.event.special[fix].handler,true);},teardown:function(){if($.browser.msie)return false;this.removeEventListener(original,$.event.special[fix].handler,true);},handler:function(e){arguments[0]=$.event.fix(e);arguments[0].type=fix;return $.event.handle.apply(this,arguments);}};});$.extend($.fn,{delegate:function(type,delegate,handler){return this.bind(type,function(event){var target=$(event.target);if(target.is(delegate)){return handler.apply(target,arguments);}});},triggerEvent:function(type,target){return this.triggerHandler(type,[$.event.fix({type:type,target:target})]);}})})(jQuery);jQuery.extend(jQuery.validator.messages,{required:"Dette feltet er obligatorisk.",maxlength:jQuery.validator.format("Maksimalt {0} tegn."),minlength:jQuery.validator.format("Minimum {0} tegn."),rangelength:jQuery.validator.format("Angi minimum {0} og maksimum {1} tegn."),email:"Oppgi en gyldig epostadresse.",url:"Angi en gyldig URL.",date:"Angi en gyldig dato.",dateISO:"Angi en gyldig dato (&ARING;&ARING;&ARING;&ARING;-MM-DD).",dateSE:"Angi en gyldig dato.",number:"Angi et gyldig nummer.",numberSE:"Angi et gyldig nummer.",digits:"Skriv kun tall.",equalTo:"Skriv samme verdi igjen.",range:jQuery.validator.format("Angi en verdi mellom {0} og {1}."),max:jQuery.validator.format("Angi en verdi som er st&oslash;rre eller lik {0}."),min:jQuery.validator.format("Angi en verdi som er mindre eller lik {0}."),creditcard:"Angi et gyldig kredittkortnummer."});if(typeof jQuery!='undefined'){jQuery(function($){$.fn.extend({loopedSlider:function(options){var settings=$.extend({},$.fn.loopedSlider.defaults,options);return this.each(function(){if($.fn.jquery<'1.3.2'){return;}
var $t=$(this);var o=$.metadata?$.extend({},settings,$t.metadata()):settings;var distance=0;var times=1;var slides=$(o.slides,$t).children().size();var width=$(o.slides,$t).children().outerWidth();var position=0;var active=false;var number=0;var interval=0;var restart=0;var pagination=$("."+o.pagination+" li a",$t);if(o.addPagination&&!$(pagination).length){var buttons=slides;$($t).append("<ul class="+o.pagination+">");$(o.slides,$t).children().each(function(){if(number<buttons){$("."+o.pagination,$t).append("<li><a rel="+(number+1)+" href=\"#\" >"+(number+1)+"</a></li>");number=number+1;}else{number=0;return false;}
$("."+o.pagination+" li a:eq(0)",$t).parent().addClass("active");});pagination=$("."+o.pagination+" li a",$t);}else{$(pagination,$t).each(function(){number=number+1;$(this).attr("rel",number);$(pagination.eq(0),$t).parent().addClass("active");});}
if(slides===1){$(o.slides,$t).children().css({position:"absolute",left:position,display:"block"});return;}
$(o.slides,$t).css({width:(slides*width)});$(o.slides,$t).children().each(function(){$(this).css({position:"absolute",left:position,display:"block"});position=position+width;});$(o.slides,$t).children(":eq("+(slides-1)+")").css({position:"absolute",left:-width});if(slides>3){$(o.slides,$t).children(":eq("+(slides-1)+")").css({position:"absolute",left:-width});}
if(o.autoHeight){autoHeight(times);}
$(".next",$t).click(function(){if(active===false){animate("next",true);if(o.autoStart){if(o.restart){autoStart();}
else{clearInterval(sliderIntervalID);}}}return false;});$(".previous",$t).click(function(){if(active===false){animate("prev",true);if(o.autoStart){if(o.restart){autoStart();}
else{clearInterval(sliderIntervalID);}}}return false;});if(o.containerClick){$(o.container,$t).click(function(){if(active===false){animate("next",true);if(o.autoStart){if(o.restart){autoStart();}
else{clearInterval(sliderIntervalID);}}}return false;});}
$(pagination,$t).click(function(){if($(this).parent().hasClass("active")){return false;}
else{times=$(this).attr("rel");$(pagination,$t).parent().siblings().removeClass("active");$(this).parent().addClass("active");animate("fade",times);if(o.autoStart){if(o.restart){autoStart();}
else{clearInterval(sliderIntervalID);}}}return false;});if(o.autoStart){sliderIntervalID=setInterval(function(){if(active===false){animate("next",true);}},o.autoStart);function autoStart(){if(o.restart){clearInterval(sliderIntervalID,interval);clearTimeout(restart);restart=setTimeout(function(){interval=setInterval(function(){animate("next",true);},o.autoStart);},o.restart);}else{sliderIntervalID=setInterval(function(){if(active===false){animate("next",true);}},o.autoStart);}};}
function current(times){if(times===slides+1){times=1;}
if(times===0){times=slides;}
$(pagination,$t).parent().siblings().removeClass("active");$(pagination+"[rel='"+(times)+"']",$t).parent().addClass("active");};function autoHeight(times){if(times===slides+1){times=1;}
if(times===0){times=slides;}
var getHeight=$(o.slides,$t).children(":eq("+(times-1)+")",$t).outerHeight();$(o.container,$t).animate({height:getHeight},o.autoHeight);};function animate(dir,clicked){active=true;switch(dir){case"next":times=times+1;distance=(-(times*width-width));current(times);if(o.autoHeight){autoHeight(times);}
if(slides<3){if(times===3){$(o.slides,$t).children(":eq(0)").css({left:(slides*width)});}
if(times===2){$(o.slides,$t).children(":eq("+(slides-1)+")").css({position:"absolute",left:width});}}
$(o.slides,$t).animate({left:distance},o.slidespeed,function(){if(times===slides+1){times=1;$(o.slides,$t).css({left:0},function(){$(o.slides,$t).animate({left:distance})});$(o.slides,$t).children(":eq(0)").css({left:0});$(o.slides,$t).children(":eq("+(slides-1)+")").css({position:"absolute",left:-width});}
if(times===slides)$(o.slides,$t).children(":eq(0)").css({left:(slides*width)});if(times===slides-1)$(o.slides,$t).children(":eq("+(slides-1)+")").css({left:(slides*width-width)});active=false;});break;case"prev":times=times-1;distance=(-(times*width-width));current(times);if(o.autoHeight){autoHeight(times);}
if(slides<3){if(times===0){$(o.slides,$t).children(":eq("+(slides-1)+")").css({position:"absolute",left:(-width)});}
if(times===1){$(o.slides,$t).children(":eq(0)").css({position:"absolute",left:0});}}
$(o.slides,$t).animate({left:distance},o.slidespeed,function(){if(times===0){times=slides;$(o.slides,$t).children(":eq("+(slides-1)+")").css({position:"absolute",left:(slides*width-width)});$(o.slides,$t).css({left:-(slides*width-width)});$(o.slides,$t).children(":eq(0)").css({left:(slides*width)});}
if(times===2)$(o.slides,$t).children(":eq(0)").css({position:"absolute",left:0});if(times===1)$(o.slides,$t).children(":eq("+(slides-1)+")").css({position:"absolute",left:-width});active=false;});break;case"fade":times=[times]*1;distance=(-(times*width-width));current(times);if(o.autoHeight){autoHeight(times);}
$(o.slides,$t).children().fadeOut(o.fadespeed,function(){$(o.slides,$t).css({left:distance});$(o.slides,$t).children(":eq("+(slides-1)+")").css({left:slides*width-width});$(o.slides,$t).children(":eq(0)").css({left:0});if(times===slides){$(o.slides,$t).children(":eq(0)").css({left:(slides*width)});}
if(times===1){$(o.slides,$t).children(":eq("+(slides-1)+")").css({position:"absolute",left:-width});}
$(o.slides,$t).children().fadeIn(o.fadespeed);active=false;});break;default:break;}};});}});$.fn.loopedSlider.defaults={container:".container",slides:".slides",pagination:"pagination",containerClick:true,autoStart:0,restart:0,slidespeed:300,fadespeed:200,autoHeight:0,addPagination:false};});}
(function($){$.extend($.expr[':'],{icontains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").toLowerCase().indexOf(m[3].toLowerCase())>=0;}});$.iterators={getText:function(){return $(this).text();},parseInt:function(v){return parseInt(v,10);}};$.extend({range:function(){if(!arguments.length){return[];}
var min,max,step;if(arguments.length==1){min=0;max=arguments[0]-1;step=1;}
else{min=arguments[0];max=arguments[1]-1;step=arguments[2]||1;}
if(step<0&&min>=max){step*=-1;var tmp=min;min=max;max=tmp;min+=((max-min)%step);}
var a=[];for(var i=min;i<=max;i+=step){a.push(i);}
return a;},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,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},keyIs:function(k,e){return parseInt($.keyCode[k.toUpperCase()],10)==parseInt((typeof(e)=='number')?e:e.keyCode,10);},keys:function(arr){var o=[];for(k in arr){o.push(k);}
return o;},redirect:function(url){window.location.href=url;return url;},stop:function(e,preventDefault,stopPropagation){if(preventDefault){e.preventDefault();}
if(stopPropagation){e.stopPropagation();}
return preventDefault&&false||true;},basename:function(path){var t=path.split('/');return t[t.length]===''&&s||t.slice(0,t.length).join('/');},filename:function(path){return path.split('/').pop();},filesizeformat:function(bytes,suffixes){var b=parseInt(bytes,10);var s=suffixes||['byte','bytes','KB','MB','GB'];if(isNaN(b)||b===0){return'0 '+s[0];}
if(b==1){return'1 '+s[0];}
if(b<1024){return b.toFixed(2)+' '+s[1];}
if(b<1048576){return(b/1024).toFixed(2)+' '+s[2];}
if(b<1073741824){return(b/1048576).toFixed(2)+' '+s[3];}
else{return(b/1073741824).toFixed(2)+' '+s[4];}},fileExtension:function(s){var tokens=s.split('.');return tokens[tokens.length-1]||false;},isString:function(o){return typeof(o)=='string'&&true||false;},isRegExp:function(o){return o&&o.constructor.toString().indexOf('RegExp()')!=-1||false;},isObject:function(o){return(typeof(o)=='object');},toCurrency:function(i){i=parseFloat(i,10).toFixed(2);return(i=='NaN')?'0.00':i;},pxToEm:function(i,settings){settings=jQuery.extend({scope:'body',reverse:false},settings);var pxVal=(i==='')?0:parseFloat(i);var scopeVal;var getWindowWidth=function(){var de=document.documentElement;return self.innerWidth||(de&&de.clientWidth)||document.body.clientWidth;};if(settings.scope=='body'&&$.browser.msie&&(parseFloat($('body').css('font-size'))/getWindowWidth()).toFixed(1)>0.0){var calcFontSize=function(){return(parseFloat($('body').css('font-size'))/getWindowWidth()).toFixed(3)*16;};scopeVal=calcFontSize();}
else{scopeVal=parseFloat(jQuery(settings.scope).css("font-size"));}
var result=(settings.reverse===true)?(pxVal*scopeVal).toFixed(2)+'px':(pxVal/scopeVal).toFixed(2)+'em';return result;}});$.extend($.fn,{type:function(){try{return $(this).get(0).nodeName.toLowerCase();}
catch(e){return false;}},selectRange:function(start,end){if($(this).get(0).createTextRange){var range=$(this).get(0).createTextRange();range.collapse(true);range.moveEnd('character',end);range.moveStart('character',start);range.select();}
else if($(this).get(0).setSelectionRange){$(this).bind('focus',function(e){e.preventDefault();}).get(0).setSelectionRange(start,end);}
return $(this);},equalHeights:function(px){$(this).each(function(){var currentTallest=0;$(this).children().each(function(i){if($(this).height()>currentTallest){currentTallest=$(this).height();}});if(!px||!$.pxToEm){currentTallest=$.pxToEm(currentTallest);}
if($.browser.msie&&$.browser.version==6.0){$(this).children().css({'height':currentTallest});}
$(this).children().css({'min-height':currentTallest});});return this;},delay:function(time,callback){jQuery.fx.step.delay=function(){};return this.animate({delay:1},time,callback);}});})(jQuery);(function($){var strings={strConversion:{__repr:function(i){switch(this.__getType(i)){case'array':case'date':case'number':return i.toString();case'object':var o=[];var l=i.length;for(var x=0;x<l;x++){o.push(x+': '+this.__repr(i[x]));}
return o.join(', ');case'string':return i;default:return i;}},__getType:function(i){if(!i||!i.constructor){return typeof(i);}
var match=i.constructor.toString().match(/Array|Number|String|Object|Date/);return match&&match[0].toLowerCase()||typeof(i);},__pad:function(str,l,s,t){var p=s||' ';var o=str;if(l-str.length>0){o=new Array(Math.ceil(l/p.length)).join(p).substr(0,t=!t?l:t==1?0:Math.ceil(l/2))+str+p.substr(0,l-t);}
return o;},__getInput:function(arg,args){var key=arg.getKey();switch(this.__getType(args)){case'object':var keys=key.split('.');var obj=args;for(var subkey=0;subkey<keys.length;subkey++){obj=obj[keys[subkey]];}
if(typeof(obj)!='undefined'){if(strings.strConversion.__getType(obj)=='array'){return arg.getFormat().match(/\.\*/)&&obj[1]||obj;}
return obj;}
else{}
break;case'array':key=parseInt(key,10);if(arg.getFormat().match(/\.\*/)&&typeof args[key+1]!='undefined'){return args[key+1];}
else if(typeof args[key]!='undefined'){return args[key];}
else{return key;}
break;}
return'{'+key+'}';},__formatToken:function(token,args){var arg=new Argument(token,args);return strings.strConversion[arg.getFormat().slice(-1)](this.__getInput(arg,args),arg);},d:function(input,arg){var o=parseInt(input,10);var p=arg.getPaddingLength();if(p){return this.__pad(o.toString(),p,arg.getPaddingString(),0);}
else{return o;}},i:function(input,args){return this.d(input,args);},o:function(input,arg){var o=input.toString(8);if(arg.isAlternate()){o=this.__pad(o,o.length+1,'0',0);}
return this.__pad(o,arg.getPaddingLength(),arg.getPaddingString(),0);},u:function(input,args){return Math.abs(this.d(input,args));},x:function(input,arg){var o=parseInt(input,10).toString(16);o=this.__pad(o,arg.getPaddingLength(),arg.getPaddingString(),0);return arg.isAlternate()?'0x'+o:o;},X:function(input,arg){return this.x(input,arg).toUpperCase();},e:function(input,arg){return parseFloat(input,10).toExponential(arg.getPrecision());},E:function(input,arg){return this.e(input,arg).toUpperCase();},f:function(input,arg){return this.__pad(parseFloat(input,10).toFixed(arg.getPrecision()),arg.getPaddingLength(),arg.getPaddingString(),0);},F:function(input,args){return this.f(input,args);},g:function(input,arg){var o=parseFloat(input,10);return(o.toString().length>6)?Math.round(o.toExponential(arg.getPrecision())):o;},G:function(input,args){return this.g(input,args);},c:function(input,args){var match=input.match(/\w|\d/);return match&&match[0]||'';},r:function(input,args){return this.__repr(input);},s:function(input,args){return input.toString&&input.toString()||''+input;}},format:function(str,args){var end=0;var start=0;var match=false;var buffer=[];var token='';var tmp=(str||'').split('');for(start=0;start<tmp.length;start++){if(tmp[start]=='{'&&tmp[start+1]!='{'){end=str.indexOf('}',start);token=tmp.slice(start+1,end).join('');if(tmp[start-1]!='{'&&tmp[end+1]!='}'){var tokenArgs=(typeof arguments[1]!='object')?arguments2Array(arguments,2):args||[];buffer.push(strings.strConversion.__formatToken(token,tokenArgs));}
else{buffer.push(token);}}
else if(start>end||buffer.length<1){buffer.push(tmp[start]);}}
return(buffer.length>1)?buffer.join(''):buffer[0];},calc:function(str,args){return eval(format(str,args));},repeat:function(s,n){return new Array(n+1).join(s);},UTF8encode:function(s){return unescape(encodeURIComponent(s));},UTF8decode:function(s){return decodeURIComponent(escape(s));},tpl:function(){var out='';var render=true;if(arguments.length==2&&$.isArray(arguments[1])){this[arguments[0]]=arguments[1].join('');return $(this[arguments[0]]);}
if(arguments.length==2&&$.isString(arguments[1])){this[arguments[0]]=arguments[1];return $(this[arguments[0]]);}
if(arguments.length==1){return $(this[arguments[0]]);}
if(arguments.length==2&&arguments[1]==false){return this[arguments[0]];}
if(arguments.length==2&&$.isObject(arguments[1])){return $($.format(this[arguments[0]],arguments[1]));}
if(arguments.length==3&&$.isObject(arguments[1])){return(arguments[2]==true)?$.format(this[arguments[0]],arguments[1]):$($.format(this[arguments[0]],arguments[1]));}}};var Argument=function(arg,args){this.__arg=arg;this.__args=args;this.__max_precision=parseFloat('1.'+(new Array(32)).join('1'),10).toString().length-3;this.__def_precision=6;this.getString=function(){return this.__arg;};this.getKey=function(){return this.__arg.split(':')[0];};this.getFormat=function(){var match=this.getString().split(':');return(match&&match[1])?match[1]:'s';};this.getPrecision=function(){var match=this.getFormat().match(/\.(\d+|\*)/g);if(!match){return this.__def_precision;}
else{match=match[0].slice(1);if(match!='*'){return parseInt(match,10);}
else if(strings.strConversion.__getType(this.__args)=='array'){return this.__args[1]&&this.__args[0]||this.__def_precision;}
else if(strings.strConversion.__getType(this.__args)=='object'){return this.__args[this.getKey()]&&this.__args[this.getKey()][0]||this.__def_precision;}
else{return this.__def_precision;}}};this.getPaddingLength=function(){var match=false;if(this.isAlternate()){match=this.getString().match(/0?#0?(\d+)/);if(match&&match[1]){return parseInt(match[1],10);}}
match=this.getString().match(/(0|\.)(\d+|\*)/g);return match&&parseInt(match[0].slice(1),10)||0;};this.getPaddingString=function(){var o='';if(this.isAlternate()){o=' ';}
if(this.getFormat().match(/#0|0#|^0|\.\d+/)){o='0';}
return o;};this.getFlags=function(){var match=this.getString().matc(/^(0|\#|\-|\+|\s)+/);return match&&match[0].split('')||[];};this.isAlternate=function(){return!!this.getFormat().match(/^0?#/);};};var arguments2Array=function(args,shift){var o=[];for(l=args.length,x=(shift||0)-1;x<l;x++){o.push(args[x]);}
return o;};$.extend(strings);})(jQuery);(function($){$.tpl('timepickr.menu','<div class="ui-helper-reset ui-timepickr ui-widget" />');$.tpl('timepickr.row','<ol class="ui-timepickr-row ui-helper-clearfix" />');$.tpl('timepickr.button','<li class="{className:s}"><span class="ui-state-default">{label:s}</span></li>');$.widget('ui.timepickr',{plugins:{},_create:function(){this._dom={menu:$.tpl('timepickr.menu'),row:$.tpl('timepickr.menu')};this._trigger('initialize');this._trigger('initialized');},_trigger:function(type,e,ui){var ui=ui||this;$.ui.plugin.call(this,type,[e,ui]);return $.Widget.prototype._trigger.call(this,type,e,ui);},_createButton:function(i,format,className){var o=format&&$.format(format,i)||i;var cn=className&&'ui-timepickr-button '+className||'ui-timepickr-button';return $.tpl('timepickr.button',{className:cn,label:o}).data('id',i).bind('mouseover',function(){$(this).siblings().find('span').removeClass('ui-state-hover').end().end().find('span').addClass('ui-state-hover');});},_addRow:function(range,format,className,insertAfter){var ui=this;var btn=false;var row=$.tpl('timepickr.row').bind('mouseover',function(){$(this).next().show();});$.each(range,function(idx,val){ui._createButton(val,format||false).appendTo(row);});if(className){$(row).addClass(className);}
if(this.options.corners){row.find('span').addClass('ui-corner-'+this.options.corners);}
if(insertAfter){row.insertAfter(insertAfter);}
else{ui._dom.menu.append(row);}
return row;},_setVal:function(val){val=val||this._getVal();if(!(val.h===''&&val.m==='')){this.element.data('timepickr.initialValue',val);this.element.val(this._formatVal(val));}
if(this._dom.menu.is(':hidden')){this.element.trigger('change');}},_getVal:function(){var ols=this._dom.menu.find('ol');function get(unit){var u=ols.filter('.'+unit).find('.ui-state-hover:first').text();return u||ols.filter('.'+unit+'li:first span').text();}
return{h:get('hours'),m:get('minutes'),s:get('seconds'),a:get('prefix'),z:get('suffix'),f:this.options['format'+this.c],c:this.c};},_formatVal:function(ival){var val=ival||this._getVal();val.c=this.options.convention;val.f=val.c===12&&this.options.format12||this.options.format24;return(new Time(val)).getTime();},blur:function(){return this.element.blur();},focus:function(){return this.element.focus();},show:function(){this._trigger('show');this.element.trigger(this.options.trigger);},hide:function(){this._trigger('hide');this._dom.menu.hide();}});$.extend($.ui.timepickr.prototype,{version:'0.7.0a',options:{convention:24,trigger:'mouseover',format12:'{h:02.d}:{m:02.d} {z:s}',format24:'{h:02.d}:{m:02.d}',hours:true,prefix:['am','pm'],suffix:['am','pm'],prefixVal:false,suffixVal:true,rangeHour12:$.range(1,13),rangeHour24:[$.range(0,12),$.range(12,24)],rangeMin:$.range(0,60,15),rangeSec:$.range(0,60,15),corners:'all',core:true,minutes:true,seconds:false,val:false,updateLive:true,resetOnBlur:true,keyboardnav:true,handle:false,handleEvent:'click'}});$.ui.plugin.add('timepickr','core',{initialized:function(e,ui){var menu=ui._dom.menu;var pos=ui.element.position();menu.insertAfter(ui.element).css('left',pos.left);if(!$.boxModel){menu.css('margin-top',ui.element.height()+8);}
ui.element.bind(ui.options.trigger,function(){ui._dom.menu.show();ui._dom.menu.find('ol:first').show();ui._trigger('focus');if(ui.options.trigger!='focus'){ui.element.focus();}
ui._trigger('focus');}).bind('blur',function(){ui.hide();ui._trigger('blur');});menu.find('li').bind('mouseover.timepickr',function(){ui._trigger('refresh');});},refresh:function(e,ui){ui._dom.menu.find('ol').each(function(){var p=$(this).prev('ol');try{$(this).css('left',p.position().left+p.find('.ui-state-hover').position().left);}catch(e){};});}});$.ui.plugin.add('timepickr','hours',{initialize:function(e,ui){if(ui.options.convention===24){ui._dom.prefix=ui._addRow(ui.options.prefix,false,'prefix');if($.isArray(ui.options.rangeHour24[0])){var range=[];$.merge(range,ui.options.rangeHour24[0]);$.merge(range,ui.options.rangeHour24[1]);ui._dom.hours=ui._addRow(range,'{0:0.2d}','hours');ui._dom.hours.find('li').slice(ui.options.rangeHour24[0].length,-1).hide();var lis=ui._dom.hours.find('li');var show=[function(){lis.slice(ui.options.rangeHour24[0].length).hide().end().slice(0,ui.options.rangeHour24[0].length).show().filter(':visible:first').trigger('mouseover');},function(){lis.slice(0,ui.options.rangeHour24[0].length).hide().end().slice(ui.options.rangeHour24[0].length).show().filter(':visible:first').trigger('mouseover');}];ui._dom.prefix.find('li').bind('mouseover.timepickr',function(){var index=ui._dom.menu.find('.prefix li').index(this);show[index].call();});}
else{ui._dom.hours=ui._addRow(ui.options.rangeHour24,'{0:0.2d}','hours');ui._dom.hours.find('li').slice(12,-1).hide();}}
else{ui._dom.hours=ui._addRow(ui.options.rangeHour12,'{0:0.2d}','hours');ui._dom.suffix=ui._addRow(ui.options.suffix,false,'suffix');}}});$.ui.plugin.add('timepickr','minutes',{initialize:function(e,ui){var p=ui._dom.hours&&ui._dom.hours||false;ui._dom.minutes=ui._addRow(ui.options.rangeMin,'{0:0.2d}','minutes',p);}});$.ui.plugin.add('timepickr','seconds',{initialize:function(e,ui){var p=ui._dom.minutes&&ui._dom.minutes||false;ui._dom.seconds=ui._addRow(ui.options.rangeSec,'{0:0.2d}','seconds',p);}});$.ui.plugin.add('timepickr','val',{initialized:function(e,ui){ui._setVal(ui.options.val);}});$.ui.plugin.add('timepickr','updateLive',{refresh:function(e,ui){ui._setVal();}});$.ui.plugin.add('timepickr','resetOnBlur',{initialized:function(e,ui){ui.element.data('timepickr.initialValue',ui._getVal());ui._dom.menu.find('li > span').bind('mousedown.timepickr',function(){ui.element.data('timepickr.initialValue',ui._getVal());});},blur:function(e,ui){ui._setVal(ui.element.data('timepickr.initialValue'));}});$.ui.plugin.add('timepickr','handle',{initialized:function(e,ui){$(ui.options.handle).bind(ui.options.handleEvent+'.timepickr',function(){ui.show();});}});$.ui.plugin.add('timepickr','keyboardnav',{initialized:function(e,ui){ui.element.bind('keydown',function(e){if($.keyIs('enter',e)){ui._setVal();ui.blur();}
else if($.keyIs('escape',e)){ui.blur();}});}});var Time=function(){if(!(this instanceof arguments.callee)){throw Error("Constructor called as a function");}
if(arguments.length==1&&$.isObject(arguments[0])){this.h=arguments[0].h||0;this.m=arguments[0].m||0;this.s=arguments[0].s||0;this.c=arguments[0].c&&($.inArray(arguments[0].c,[12,24])>=0)&&arguments[0].c||24;this.f=arguments[0].f||((this.c==12)&&'{h:02.d}:{m:02.d} {z:02.d}'||'{h:02.d}:{m:02.d}');this.z=arguments[0].z||'am';}
else if(arguments.length<4&&$.isString(arguments[1])){this.c=arguments[2]&&($.inArray(arguments[0],[12,24])>=0)&&arguments[0]||24;this.f=arguments[3]||((this.c==12)&&'{h:02.d}:{m:02.d} {z:02.d}'||'{h:02.d}:{m:02.d}');this.z=arguments[4]||'am';this.h=arguments[1]||0;this.m=arguments[1]||0;this.s=arguments[1]||0;}
else if(arguments.length===0){}
else{this.h=arguments[0]||0;this.m=arguments[1]||0;this.s=arguments[2]||0;this.c=arguments[3]&&($.inArray(arguments[3],[12,24])>=0)&&arguments[3]||24;this.f=this.f||((this.c==12)&&'{h:02.d}:{m:02.d} {z:02.d}'||'{h:02.d}:{m:02.d}');this.z='am';}
return this;};Time.prototype.get=function(p,f,u){return u&&this.h||$.format(f,this.h);};Time.prototype.getHours=function(unformated){return this.get('h','{0:02.d}',unformated);};Time.prototype.getMinutes=function(unformated){return this.get('m','{0:02.d}',unformated);};Time.prototype.getSeconds=function(unformated){return this.get('s','{0:02.d}',unformated);};Time.prototype.setFormat=function(format){return this.f=format;};Time.prototype.getObject=function(){return{h:this.h,m:this.m,s:this.s,c:this.c,f:this.f,z:this.z};};Time.prototype.getTime=function(){return $.format(this.f,{h:this.h,m:this.m,suffix:this.z});};Time.prototype.parse=function(str){if(this.c===12){this.tokens=str.split(/\s|:/);this.h=this.tokens[0]||0;this.m=this.tokens[1]||0;this.s=this.tokens[2]||0;this.z=this.tokens[3]||'';return this.getObject();}
else{this.tokens=/:/.test(str)&&str.split(/:/)||str.match(/[0-9]{2}/g);this.h=this.tokens[0]||0;this.m=this.tokens[1]||0;this.s=this.tokens[2]||0;this.z=this.tokens[3]||'';return this.getObject();}};})(jQuery);String.prototype.score=function(abbreviation,offset){offset=offset||0
if(abbreviation.length==0)return 0.9
if(abbreviation.length>this.length)return 0.0
for(var i=abbreviation.length;i>0;i--){var sub_abbreviation=abbreviation.substring(0,i)
var index=this.indexOf(sub_abbreviation)
if(index<0)continue;if(index+abbreviation.length>this.length+offset)continue;var next_string=this.substring(index+sub_abbreviation.length)
var next_abbreviation=null
if(i>=abbreviation.length)
next_abbreviation=''
else
next_abbreviation=abbreviation.substring(i)
var remaining_score=next_string.score(next_abbreviation,offset+index)
if(remaining_score>0){var score=this.length-next_string.length;if(index!=0){var j=0;var c=this.charCodeAt(index-1)
if(c==32||c==9){for(var j=(index-2);j>=0;j--){c=this.charCodeAt(j)
score-=((c==32||c==9)?1:0.15)}}else{score-=index}}
score+=remaining_score*next_string.length
score/=this.length;return score}}
return 0.0}
var BG={increase_id:function(element){var num=parseInt(/\d+/.exec(element)[0]);var replacement=element.replace(num,num+1);return replacement;},to_infopage:function(){window.location=$(this).closest('.has-infopage').find('.infopage-link').attr('href');return false;}}
jQuery.ajaxSetup({'beforeSend':function(xhr){xhr.setRequestHeader("Accept","text/javascript")}})
$(document).ready(function(){$('.recommendations form.edit_company').submitWithAjax();$('#delete-infopage-image-popup .edit_company').submitWithAjax();$('#filter-wrapper input').liveUpdate($('#main-column .company h3'),{onShow:function(item){$(item).parents('.company').show()},onHide:function(item){$(item).parents('.company').hide()}})
hash=document.location.href.match(/#company-[0-9]+/gi)
if(hash&&hash.length>0){$(hash[0]).children('.company-main').css({outline:'1px solid red'});}
$('.company').hover(function(){$(this).children('.company-actions-wrapper').children().show();},function(){$(this).children('.company-actions-wrapper').children().hide();});$('.company-main.has-infopage').find('.infopage-trigger').click(BG.to_infopage);$('#error-report-popup').jqm({trigger:'.error-report-link',onTop:true,closeClass:'close-popup',onShow:function(h){$.ajax({type:"GET",url:'/feilmeldinger/ny',data:"error_report[company_id]="+h.t.id.split('-').pop(),success:function(html){$('#error-report-popup').html(html);$('form.new_error_report').submitWithAjax();$('.close-popup').click(function(){$('#error-report-popup').jqmHide();return false;});h.w.fadeIn('fast',function(){h.w.show();});},beforeSend:function(xhr){xhr.setRequestHeader("Accept","text/html")}});},onHide:function(h){h.w.fadeOut('fast',function(){if(h.o)h.o.remove();});}});$('#map-popup').dialog({autoOpen:false,position:['center',145],show:'fade',hide:'fade',width:946,height:450,close:function(event,ui){$('#map').empty();}});$('.open-map-link').click(function(){$.ajax({type:'GET',url:'/bedrifter/'+$(this).attr('id').split('-').pop()+'/map',dataType:'script'});$('#map-popup').dialog('open');});$('#delete-infopage-image-popup').jqm({trigger:'#delete-infopage-image',onTop:true,closeClass:'close-popup',onHide:function(h){h.w.fadeOut('fast',function(){if(h.o)h.o.remove();});}});$('#loopedSlider').loopedSlider();$('#main-column form #infopage-imagegallery > button').click(function(){var parent_div=$(this).parent();var div=$('div:visible:last',parent_div)
var new_fields=div.children('input, label').filter(':not([name*="_delete"])').filter(':not([for*="_delete"])').clone().map(function(index,domElement){var replacement=$(this)
$.each(['for','id','name'],function(i,val){var att=replacement.attr(val);if(typeof(att)!='undefined'&&att.length>0){replacement.attr(val,BG.increase_id(att));if(replacement.is('input')){replacement.val("");}}})
if(replacement!=null){replacement=replacement.get(0)}
return replacement;});div.after('<div class="appended"></div>');div.next().append(new_fields);});$('#hd-search-form').validate({onfocusout:false,onkeyup:false,onclick:false,highlight:function(element,errorClass){$(element).effect("highlight")},errorPlacement:function(error,element){},});$('#new_user_session').validate({onfocusout:false,onkeyup:false,onclick:false,highlight:function(element,errorClass){$(element).effect("highlight")},errorPlacement:function(error,element){},});$('#password_reset').validate({onfocusout:false,onkeyup:false,onclick:false,highlight:function(element,errorClass){$(element).effect("highlight")},errorPlacement:function(error,element){},});$('form#new_user_session a + a').click(function(){email=$('input[name*="email"]',form).val();if(typeof email!==undefined&&typeof email!=null){href=$(this).attr('href');$(this).attr('href',href+'?email='+email);}});$('.root-industry-popup').jqm({onTop:true,closeClass:'close-popup',onShow:function(h){h.w.fadeIn('fast',function(){h.w.show();});},onHide:function(h){h.w.fadeOut('fast',function(){if(h.o)h.o.remove();});}});$('.show-all-link').click(function(e){var industry_id=$(this).closest('.root-industry').children('h2').attr('id').split('-').pop();$('#root-industry-'+industry_id).jqmShow();return false;});});$('#main-column form').ready(function(){$('#main-column form div.opening-hours > button',this).click(function(){var parent_div=$(this).parent();var div=$('div:visible:last',parent_div)
var new_fields=div.children('input, select, label, span').filter(':not([name*="_destroy"])').filter(':not([for*="_destroy"])').clone().map(function(index,domElement){var replacement=$(this)
$.each(['for','id','name'],function(i,val){var att=replacement.attr(val);if(typeof(att)!='undefined'&&att.length>0){replacement.attr(val,BG.increase_id(att));if(replacement.is('select')){replacement.children().removeAttr('selected');}
if(replacement.is('input')){replacement.val("");}}})
if(replacement!=null){replacement=replacement.get(0)}
return replacement;});div.after('<div class="appended"></div>');div.next().append(new_fields);});$('.pick-time').live('click',function(){$(this).timepickr({convention:24,format24:"{h:02.d}.{m:02.d}",prefix:['Formiddag','Ettermiddag'],suffix:['',''],trigger:'click'});});});(function(){$(function(){if($('#google-results').length<1)return;var options={};options[google.search.Search.RESTRICT_EXTENDED_ARGS]={'lr':'lang_no','cr':'countryNO','gl':'no'};var search=new google.search.CustomSearchControl('partner-pub-0031389257411981:5701623836',options);var drawOptions=new google.search.DrawOptions();drawOptions.enableSearchResultsOnly();search.setLinkTarget(google.search.Search.LINK_TARGET_SELF);search.draw('google-results',drawOptions);search.execute($('#google-results').data('search'));});})();
