(function($){jQuery.rcn=function(options){if(options){jQuery.rcn.settings=$.extend({},$.rcn.defaults,options);jQuery.rcn.settings.triggers["login"]=true}};jQuery.rcn.settings=[];jQuery.rcn.events={loggedIn:"loggedin",loggedOut:"loggedout",shoppingcartChanged:"shoppingcartchanged",contentLoaded:"contentLoaded",FBsessionChange:"FBsessionChange",customerRegistered:"customerRegistered",registerPageOpened:"registerPageOpened",showProductLayer:"showProductLayer",productAddedToWishlist:"productAddedToWishlist"};
jQuery.rcn.sourceOfRegisterPage={Header:"Register Page opened \u2013 from Header",LoginLayer:"Register Page opened \u2013 from Login Layer",Checkout:"Register Page opened \u2013 from Checkout",ProductDetail:"Register Page opened \u2013 from PDP"};function getCacheKey(){return(new Date).getTime()}jQuery.rcn.addToBasketSource={PRODUCTLAYER:"Product Layer",PRODUCTDETAILPAGE:"Product Detail Page",ORDERDIRECT:"Order Direct",WISHLIST:"Wish List",MYOFFER:"My Offer"};$.extend($.rcn,{defaults:{cacheKey:getCacheKey(),
sitename:"Sitename not set",title:"Title not set",bml:0,url:{},selectors:{},isLoggedIn:false,triggers:new Array,monthLocale:new Array},resetCache:function(){$.rcn.settings.cacheKey=getCacheKey()},bind:function(eventName,func){$("body").bind(eventName,func)},trigger:function(eventName,args){$("body").trigger(eventName,args)},unbind:function(eventName){$("body").unbind(eventName)},formatString:function(str){for(i=1;i<arguments.length;i++)str=str.replace("{"+(i-1)+"}",arguments[i]);return str},getQueryParameter:function(name){name=
name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(window.location.href);if(results==null)return"";else return results[1]},utf8Decode:function(utftext){var string="";var i=0;var c=c1=c2=0;while(i<utftext.length){c=utftext.charCodeAt(i);if(c<128){string+=String.fromCharCode(c);i++}else if(c>191&&c<224){c2=utftext.charCodeAt(i+1);string+=String.fromCharCode((c&31)<<6|c2&63);i+=2}else{c2=utftext.charCodeAt(i+1);c3=
utftext.charCodeAt(i+2);string+=String.fromCharCode((c&15)<<12|(c2&63)<<6|c3&63);i+=3}}return string},getDateFromDateTime:function(dateTime){return new Date(parseInt(dateTime.replace("/Date(","").replace(")/","")))},loadRssFeed:function(settings){if(!settings.url)return;var api="//ajax.googleapis.com/ajax/services/feed/load?v=1.0&callback=?&q="+settings.url;if(settings.count)api+="&num="+settings.count;$.getJSON(api,function(data){if(data.responseStatus==200)settings.onSuccess(data.responseData.feed);
else if(settings.onError)settings.onError(data)})}})})(jQuery);(function($){$.extend($.rcn,{ui:{reloadPage:function(){var prm=Sys.WebForms.PageRequestManager.getInstance();if(prm.get_isInAsyncPostBack())prm.abortPostBack();location.reload()},loader:{show:function(){$($.rcn.settings.selectors.loaderLayer).jqm({onHide:function(){$.rcn.ui.loader.afterLoad=null},modal:true}).jqmShow()},hide:function(){$($.rcn.settings.selectors.loaderLayer).jqmHide()},afterLoad:null},login:{show:function(){$($.rcn.settings.selectors.loginLayer).jqm({onHide:function(){$.rcn.ui.login.afterLogin=
null}}).jqmShow()},hide:function(){$($.rcn.settings.selectors.loginLayer).jqmHide()},afterLogin:null},createUser:{show:function(sourceOfRegisterPage){if(sourceOfRegisterPage)$.rcn.trigger($.rcn.events.registerPageOpened,[sourceOfRegisterPage]);$($.rcn.settings.selectors.createUserLayer).jqm({onHide:function(){$.rcn.ui.createUser.afterCreate=null}}).jqmShow()},hide:function(){$($.rcn.settings.selectors.createUserLayer).jqmHide()},afterCreate:null},createCustomer:{show:function(){$($.rcn.settings.selectors.createCustomerLayer).jqm({onHide:function(){$.rcn.ui.createCustomer.afterCreate=
null}}).jqmShow()},hide:function(){$($.rcn.settings.selectors.createCustomerLayer).jqmHide()},afterCreate:null},continueWithoutLogin:{show:function(){$($.rcn.settings.selectors.continueWithoutLoginLayer).jqm({onHide:function(){$.rcn.ui.continueWithoutLogin.afterCreate=null}}).jqmShow()},hide:function(){$($.rcn.settings.selectors.continueWithoutLoginLayer).jqmHide()},afterCreate:null},product:{show:function(productId){$.ajaxSetup({url:"/javascripts/Page/detail-min.js",cache:true});$.ajax({type:"POST",
url:"/detail/Product/"+productId,success:function(productDetail){var productLayer=$($.rcn.settings.selectors.productLayer);productLayer.find("#productLayerError").hide();productLayer.find("#productLayerContent").html(productDetail).show();productLayer.jqm({onHide:function(){}}).jqmShow();$.rcn.ui.initResources();$.getScript("/javascripts/Page/detail-min.js");jQuery.rcn.trigger(jQuery.rcn.events.showProductLayer)},error:function(){var productLayer=$($.rcn.settings.selectors.productLayer);productLayer.find("#productLayerError").show();
productLayer.find("#productLayerContent").hide();productLayer.jqm({onHide:function(){}}).jqmShow()}})},hide:function(){$($.rcn.settings.selectors.productLayer).jqmHide()}},contentLayer:{show:function(content,header){var contentLayer=$($.rcn.settings.selectors.contentLayer);if(header)contentLayer.find("#contentLayerHeader").html(header);contentLayer.find("#contentLayerContent").html(content);contentLayer.jqm({onHide:function(){}}).jqmShow()},hide:function(){$($.rcn.settings.selectors.contentLayer).jqmHide()}},
resourceidentifiers:new Array,resources:{},getResource:function(identifier){return $.rcn.ui.resources[identifier]},addResourceIdentifier:function(identifiers){if($.isArray(identifiers)){if($.inArray(identifiers[0],$.rcn.ui.resourceidentifiers)==-1)$.rcn.ui.resourceidentifiers=$.rcn.ui.resourceidentifiers.concat(identifiers)}else $.rcn.ui.resourceidentifiers.push(identifiers)},initResources:function(){var serializedIdentifiers={};if($.rcn.ui.resourceidentifiers.length==0)return{};$.each($.rcn.ui.resourceidentifiers,
function(key,val){serializedIdentifiers[key]=val});$.ajax({url:"/services/apis/1.0/content/GetResources",dataType:"json",data:{identifiers:serializedIdentifiers},success:function(data){$.rcn.ui.resources=data},async:false,type:"POST"})},init:function(){if(!$.rcn.settings.isLoggedIn)$(".reqlogin").each(function(i,element){var events=$(this).data("events");if(events&&events.click){var clickHandlers=$(this).data("events").click.slice(0);$(this).unbind("click").click(function(){$.rcn.ui.login.afterLogin=
function(){$.each(clickHandlers,function(i,handleObj){var func=handleObj.handler;func()})};$.rcn.ui.login.show()})}})}}})})(jQuery);(function($){$.extend($.rcn,{membership:{suppressLoginEvent:function(){jQuery.rcn.settings.triggers["login"]=false},isLoggedIn:function(){return $.rcn.settings.isLoggedIn},login:function(username,password,onSuccess,onError){var url=jQuery.rcn.settings.url.login+"?username="+encodeURIComponent(username)+"&password="+encodeURIComponent(password)+"&cid="+jQuery.rcn.settings.cacheKey+"&method=?";$.getJSON(url,function(isLoggedIn,textStatus){if(isLoggedIn){onSuccess();jQuery.rcn.resetCache();if(jQuery.rcn.settings.triggers["login"])jQuery.rcn.trigger(jQuery.rcn.events.loggedIn)}else onError(textStatus)})},
createUser:function(username,password,acceptNewsLetter,onSuccess,onError){var url=jQuery.rcn.settings.url.createUser+"?username="+encodeURIComponent(username)+"&password="+encodeURIComponent(password)+"&acceptNewsLetter="+acceptNewsLetter+"&cid="+jQuery.rcn.settings.cacheKey+"&method=?";$.ajax({url:url,type:"GET",dataType:"json",success:function(messages,textStatus){onSuccess(messages);if(messages.Errors.length==0)jQuery.rcn.trigger(jQuery.rcn.events.loggedIn,{isUserRegistration:true})},error:function(XMLHttpRequest,
textStatus,errorThrown){onError()}});jQuery.rcn.resetCache()},addToWishlist:function(productId,variantId,onSuccess,onError){$.post(jQuery.rcn.settings.url.addToWishlist,{productId:productId,variantId:variantId},function(data){if(data&&data.Errors.length==0){if(data&&onSuccess)onSuccess(data)}else if(onError)onError(textStatus)})}}})})(jQuery);(function($){$.extend($.rcn,{customer:{lookupPersonalData:function(civicNumber,onSuccess,onError){var url=jQuery.rcn.settings.url.lookupPersonalData+"?civicnumber="+civicNumber+"&cid="+jQuery.rcn.settings.cacheKey+"&method=?";$.getJSON(url,function(info){if(info){onSuccess(info);jQuery.rcn.resetCache()}else onError(info)})},create:function(customer,onSuccess,onError){var url=jQuery.rcn.settings.url.createCustomer+"?firstName="+customer.firstName+"&civicNumber="+customer.civicNumber+"&applyForCredit="+
customer.applyForCredit+"&lastName="+customer.lastName+"&street="+customer.street+"&zipCode="+customer.zipCode+"&city="+customer.city+"&coAddress="+customer.coAddress+"&mobilePhone="+customer.mobilePhone+"&gender="+customer.gender+"&postalDeliveryNotification="+customer.postalDeliveryNotification+"&marketingchannel="+customer.marketingchannel+"&acceptTerms="+customer.acceptTerms+"&cid="+jQuery.rcn.settings.cacheKey+"&method=?";url=encodeURI(url);$.ajax({url:url,type:"GET",dataType:"json",success:function(messages,
textStatus){onSuccess(messages)},error:function(XMLHttpRequest,textStatus,errorThrown){onError()}});jQuery.rcn.resetCache()}}})})(jQuery);(function($){$.extend($.rcn,{socialinteraction:{deleteProductReview:function(productId,reviewId,reviewType,onSuccess,onError){$.post(jQuery.rcn.settings.url.deleteProductReview,{ProductId:productId,ReviewId:reviewId,ReviewType:reviewType},function(data){onSuccess(data)})},addproductreviewprotest:function(productId,reviewId,reviewType,onSuccess,onError){$.post(jQuery.rcn.settings.url.addproductreviewprotest,{ProductId:productId,ReviewId:reviewId,ReviewType:reviewType},function(data){onSuccess(data)})},
addProductReview:function(productId,reviewType,title,text,alias,rating,onSuccess,onError){$.post(jQuery.rcn.settings.url.addProductReview,{ProductId:productId,Title:title,Text:text,Alias:alias,Rating:rating,ReviewType:reviewType},function(data){onSuccess(data)})},editProductReview:function(productId,reviewId,reviewType,title,text,alias,rating,onSuccess,onError){$.post(jQuery.rcn.settings.url.editProductReview,{ProductId:productId,ReviewId:reviewId,ReviewType:reviewType,Title:title,Text:text,Alias:alias,
Rating:rating},function(data){onSuccess(data)})},getProductReview:function(productId,reviewId,reviewType,onSuccess,onError){$.post(jQuery.rcn.settings.url.getProductReview,{ProductId:productId,ReviewId:reviewId,ReviewType:reviewType},function(data){onSuccess(data)})},getProductReviews:function(productId,count,onSuccess,onError){$.post(jQuery.rcn.settings.url.getProductReviews,{ProductId:productId,Count:count},function(data){onSuccess(data)})},addProductReviewQuestion:function(productId,title,text,
alias,onSuccess,onError){$.post(jQuery.rcn.settings.url.addProductReviewQuestion,{ProductId:productId,Title:title,Text:text,Alias:alias},function(data){onSuccess(data)})},addProductReviewAnswer:function(productId,reviewId,title,text,alias,onSuccess,onError){$.post(jQuery.rcn.settings.url.addProductReviewAnswer,{ProductId:productId,ReviewId:reviewId,Title:title,Text:text,Alias:alias},function(data){onSuccess(data)})},addproductreviewfeedback:function(productId,reviewId,reviewType,isPositiveReview,
onSuccess,onError){$.post(jQuery.rcn.settings.url.addproductreviewfeedback,{ProductId:productId,ReviewId:reviewId,ReviewType:reviewType,IsPositiveReview:isPositiveReview},function(data){onSuccess(data)})},setFBLikeCount:function(FBUserId,productId,url,likeCount,onSuccess,onError){$.post(jQuery.rcn.settings.url.setFBLikeCount,{FBUserId:FBUserId,ProductId:productId,Url:url,LikeCount:likeCount},function(data){if(onSuccess)onSuccess(data)})},getFBLikeCount:function(numberOfLikes,likeType,onSuccess,onError){$.post(jQuery.rcn.settings.url.getFBLikeCount,
{numberOfLikes:numberOfLikes,likeType:likeType},function(data){if(onSuccess)onSuccess(data)})}}})})(jQuery);(function($){$.extend($.rcn,{insurance:{getPremiums:function(civicNo,onSuccess,onError){var url=jQuery.rcn.settings.url.insurance+"?civicNo="+encodeURIComponent(civicNo)+"&cid="+jQuery.rcn.settings.cacheKey+"&method=?";$.getJSON(url,function(data,textStatus){jQuery.rcn.resetCache();if(data)onSuccess(data);else onError(textStatus)})}}})})(jQuery);(function($){$.extend($.rcn,{marketing:{subscribeToNewsletter:function(emailAddress,onSuccess){$.post(jQuery.rcn.settings.url.subscribeToNewsletter,{emailAddress:emailAddress},function(data){if(onSuccess)onSuccess(data)})}}})})(jQuery);(function($){$.extend($.rcn,{content:{getMenu:function(input,onSuccess,onError){var postData={tabDimensions:input.tabDimensions.split(";"),subDimensions:input.subDimensions.split(";")};$.ajax({type:"POST",url:jQuery.rcn.settings.url.getMenu,data:postData,success:function(info){if(info)onSuccess(info);else onError(info)},dataType:"json",traditional:true})}}})})(jQuery);(function($){$.extend($.rcn,{shoppingCart:{add:function(variantId,quantity,source,onSuccess,onError){$.post("/services/apis/1.0/shoppingcart/add",{variantid:variantId,quantity:quantity},function(data){if(data.Item!=null){data.Source=source;onSuccess(data)}else if(shoppingCart.onError)onError(data)},"json")},addByBookingNumber:function(bookingNumber,size,quantity,onSuccess,onError){$.post("/services/apis/1.0/shoppingcart/add",{bookingNumber:bookingNumber.replace(/-/g,""),size:size,quantity:quantity},
function(data){if(data.Item!=null)onSuccess(data);else if(shoppingCart.onError)onError(data)},"json")},addOffer:function(orderCode,onSuccess,onError){$.post("/services/apis/1.0/shoppingcart/add",{orderCode:orderCode},function(data){if(data.OrderCode!=null)onSuccess(data);else onError(data)},"json")}}})})(jQuery);(function($){$.extend($.rcn,{order:{checkPaymentStatus:function(onSuccess,onError){$.ajax({type:"POST",url:jQuery.rcn.settings.url.checkPaymentStatus,success:function(info){if(info)onSuccess(info);else onError(info)},dataType:"json",traditional:true})}}})})(jQuery);(function(d){d.fn.toggleCheckboxes=function(a,b){a=a||"*";b=b||false;var c=d([]);this.each(function(){var e=d("input[type=checkbox]",this).filter(a).each(function(){this.checked=!this.checked}).filter(":checked");c=e});if(!b)c=this;return c};d.fn.checkCheckboxes=function(a,b){a=a||"*";b=b||false;var c=d([]);this.each(function(){var e=d("input[type=checkbox]",this).filter(a).each(function(){this.checked=true}).filter(":checked");c=e});if(!b)c=this;return c};d.fn.unCheckCheckboxes=function(a,b){a=a||
"*";b=b||false;var c=d([]);this.each(function(){var e=d("input[type=checkbox]",this).filter(a).each(function(){this.checked=false}).filter(":not(:checked)");c=e});if(!b)c=this;return c};d.radioCheckboxGroup=function(e,a){a=a||"*";var b="input[type=checkbox]";if(e)b+="[name="+e+"]";var c=d(b).filter(a);c.click(function(){c.not(this).each(function(){this.checked=false}).end()})}})(jQuery);(function($){function CreateDummyInput(jElement,options){var watermarkText=options.watermarkText?options.watermarkText:jElement.attr("title");var dummyInput=$('<input type="text">').attr("id",jElement.attr("id")+"_watermark").addClass(options.watermarkCssClass).css({height:options.height?options.height:jElement.height(),width:options.width?options.width:jElement.width()}).val(watermarkText).hide();jElement.after(dummyInput)}function MakeWatermark(element,options){element.each(function(){var thisEl=
jQuery(this);CreateDummyInput(thisEl,options);var dummyInput=$("#"+thisEl.attr("id")+"_watermark");dummyInput.click(function(e){thisEl.show().focus();$(this).hide()});dummyInput.focus(function(e){thisEl.show().focus();$(this).hide()});thisEl.blur(function(e){if(this.value==""){$(this).hide();dummyInput.show()}});if(thisEl.val()==""){thisEl.hide();dummyInput.show()}});return element}$.fn.watermark=function(options){return MakeWatermark(this,options)}})(jQuery);(function($){function CreateFadePopup(popupelement,openelements,closeelements,focuselement,speed,onFadeIn,onFadeOut){$(openelements).click(function(){if($(openelements).hasClass("active")){popupelement.fadeOut(speed,onFadeOut);$(openelements).removeClass("active")}else{if(onFadeIn)onFadeIn();popupelement.fadeIn(speed);$(openelements).addClass("active");$(focuselement).focus()}});$("html").click(function(){popupelement.fadeOut(speed,onFadeOut);$(openelements).removeClass("active")});$(closeelements).click(function(event){popupelement.fadeOut(speed,
onFadeOut);$(openelements).removeClass("active");event.stopPropagation()});$(popupelement).click(function(event){event.stopPropagation()});return popupelement}$.fn.fadepopup=function(openelements,closeelements,focuselement,speed,onFadeIn,onFadeOut){return CreateFadePopup(this,openelements,closeelements,focuselement,speed,onFadeIn,onFadeOut)}})(jQuery);
(function($){function Popup(popupelement,openelements,closeelements,focuselement,speed){$(openelements).click(function(){if($(openelements).hasClass("active")){popupelement.hide(speed);$(openelements).removeClass("active");return false}popupelement.show(speed);$(openelements).addClass("active");$(focuselement).focus();return false});$(closeelements).click(function(){popupelement.hide(speed);$(openelements).removeClass("active");return false});return popupelement}$.fn.popup=function(openelements,closeelements,
focuselement,speed){return Popup(this,openelements,closeelements,focuselement,speed)}})(jQuery);
(function($){function CreateSlidingPopup(popupelement,openelements,closeelements,animationspeed){$(openelements).click(function(){if($(openelements).hasClass("active")){popupelement.slideUp(animationspeed);$(openelements).removeClass("active");return false}$(openelements).addClass("active");popupelement.slideDown(animationspeed);this.focus();return false});$(closeelements).click(function(){popupelement.slideUp(animationspeed);$(openelements).removeClass("active");return false});return popupelement}
$.fn.slidingpopup=function(openelements,closeelements,animationspeed){return CreateSlidingPopup(this,openelements,closeelements,animationspeed)}})(jQuery);function CreatePulPopup(){$('A[rel="pulpopup"]').click(function(){window.open("/misc/PulPopup.aspx","conditions","scrollbars=yes,toolbar=no,menubar=no,width=615,height=300,left="+(screen.width-615)/2+",top="+(screen.height-300)/2);return false})}
(function($){$.extend($.fn,{defaultButton:function(selector){this.keypress(function(e){if(e.which==13&&e.target.type!="textarea"){var tmpBtn=$(this).find(selector);var ret=$(tmpBtn[0]).click();if(ret&&tmpBtn[0].type!="submit")eval(unescape(tmpBtn[0].href));return false}})}})})(jQuery);
(function($){$.fn.center=function(width,height){this.css("position","absolute");this.css({top:($(window).height()-(height?height:this.height()))/2+$(window).scrollTop()+"px",left:($(window).width()-(width?width:this.width()))/2+$(window).scrollLeft()+"px"});return this}})(jQuery);jQuery.extend(jQuery.expr[":"],{reallyhidden:"(jQuery(a).is(':hidden') || jQuery(a).parents(':hidden').length)"});(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});this.submit(function(event){if(validator.settings.debug)event.preventDefault();
function handle(){if(validator.settings.submitHandler){validator.settings.submitHandler.call(validator,validator.currentForm);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=false;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}});$.format=function(source,params){if(arguments.length==1)return function(){var args=$.makeArray(arguments);args.unshift(source);
return $.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};$.validator=function(options,form){this.settings=$.extend({},$.validator.defaults,options);this.currentForm=form;this.init()};$.extend($.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",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.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){$(element).addClass(errorClass)},unhighlight:function(element,errorClass){$(element).removeClass(errorClass)}},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\u00fcltiges 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:$.format("Please enter no more than {0} characters."),minlength:$.format("Please enter at least {0} characters."),
rangelength:$.format("Please enter a value between {0} and {1} characters long."),range:$.format("Please enter a value between {0} and {1}."),max:$.format("Please enter a value less than or equal to {0}."),min:$.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).validateDelegate("focusin focusout keyup",":text, :password, :file, select, textarea",delegate).validateDelegate("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.parents(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.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.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;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){if(response){var submitted=validator.formSubmitted;validator.prepareElement(element);validator.formSubmitted=submitted;validator.successList.push(element);validator.showErrors()}else{var errors={};errors[element.name]=response||validator.defaultMessage(element,"remote");validator.showErrors(errors)}previous.valid=response;validator.stopRequest(element,response)}},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:"png|jpe?g|gif";return this.optional(element)||value.match(new RegExp(".("+param+")$","i"))},equalTo:function(value,element,param){return value==$(param).val()}}})})(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,{validateDelegate: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);(function($){$.extend($.fn,{currentValidator:function(){return $.data($(this[0]).subForm(),"validator")},subForm:function(){return $(this[0]).parents().filter(function(index){return $.data(this,"validator")})[0]},rules:function(command,argument){var element=this[0];if(command){var settings=$(element).currentValidator().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},valid:function(){if($(this[0]).is("form")||$.data(this[0],"validator"))return this.validate().form();else{var valid=false;var validator=$(this[0]).currentValidator();this.each(function(){valid|=validator.element(this)});return valid}}})})(jQuery);
(function($){$.extend($.validator.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=$(this[0]).currentValidator();validator.settings["on"+event.type]&&validator.settings["on"+event.type].call(validator,this[0])}$(this.currentForm).validateDelegate("focusin focusout keyup",":text, :password, :file, select, textarea",delegate).validateDelegate("click",":radio, :checkbox",delegate);if(this.settings.invalidHandler)$(this.currentForm).bind("invalid-form.validate",
this.settings.invalidHandler)},elements:function(){var validator=this,rulesCache={};var el;if($(this.currentForm).is("form"))el=$([]).add(this.currentForm.elements);else el=$(this.currentForm).find("*");return el.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})},findByName:function(name){var form=this.currentForm;if($(form).is("form"))return $(document.getElementsByName(name)).map(function(index,element){return element.form==form&&element.name==name&&element||null});else return $(form).find("[name="+name+"]")},dependTypes:{"boolean":function(param,element){return param},string:function(param,element){return!!$(param,$(element).subForm()).length},"function":function(param,element){return param(element)}}})})(jQuery);
(function($){$.extend($.validator,{metadataRules:function(element){if(!$.metadata)return{};var meta=$(element).currentValidator().settings.meta;return meta?$(element).metadata()[meta]:$(element).metadata()},staticRules:function(element){var rules={};var validator=$(element).currentValidator();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).subForm()).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}})})(jQuery);(function($){$.extend($.fn,{countdown:function(options){var settings={seconds:30,showTicks:true};if(options)$.extend(settings,options);if($(this).length==0)return false;var obj=this;if(settings.seconds<0){if(settings.callback)settings.callback();return this}window.setTimeout(function(){if(settings.showTicks)$(obj).html(String(settings.seconds));settings.seconds--;$(obj).countdown(settings)},1E3);return this}})})(jQuery);(function($){$.transform=function(o){var createXmlObj=function(data){if($.browser.msie){var x=$("<xml>")[0];x.loadXML(data);return x}else{var parser=new DOMParser;return parser.parseFromString(data,"text/xml")}};var call=function(f,o,tel,other){if($.isFunction(f)){var arg1=tel.html();if(o.c.dataType.toUpperCase()=="JSON")arg1=eval("("+tel.html()+")");if(o.c.dataType.toUpperCase()=="XML")arg1=createXmlObj(tel.html());f(arg1,o.c.xslstr,o.c.xmlstr,o.c,other)}};var t=this;t.c={el:o.el,cache:o.cache==
null?false:o.cache,async:o.async==null?true:o.async,xsl:o.xsl==null?false:o.xsl,xml:o.xml==null?false:o.xml,xslstr:o.xslstr==null?false:o.xslstr,xmlstr:o.xmlstr==null?false:o.xmlstr,xslobj:o.xslobj==null?false:o.xslobj,xmlobj:o.xmlobj==null?false:o.xmlobj,xslParams:o.xslParams==null?false:o.xslParams,error:o.error==null?false:o.error,success:o.success==null?false:o.success,complete:o.complete==null?false:o.complete,island:o.island==null?false:o.island,pass:o.pass==null?false:o.pass,msg:o.msg==null?
false:o.msg,dataType:o.dataType==null?"html":o.dataType};if(o.msg)$(o.el).html(typeof o.msg=="string"?o.msg:$(o.msg).html());var id=function(pre){var name=pre+"_"+Math.round(Math.random()*999);return $("#"+name).length==0?name:id(pre)};var replaceref=function(val,o){o.c.xsl=o.c.xsl?o.c.xsl:"";var c=location.protocol=="file:"&&$.browser.msie?"\\":"/";var path1=location.protocol+c+c+location.host;var path2=location.pathname.substring(0,location.pathname.lastIndexOf(c)+1)+o.c.xsl.substring(0,o.c.xsl.lastIndexOf("/")+
1);if(val.substring(0,1)==c)return path1+val;else if(val.substring(0,2)==".."){var count=0;while(val.indexOf("..")!=-1){val=val.substring(val.indexOf("..")+3);count+=1}var p=path1+path2.substring(0,path2.length-1);for(var x=0;x<count;x++)p=p.substring(0,p.lastIndexOf(c));return p+c+val}else return path1+path2+val};var checkReady=function(o){if((o.c.xslstr||o.c.xslobj)&&(o.c.xmlstr||o.c.xmlobj)){var fail=false;var tel=$("<div></div>");if(o.c.throwerror){call(o.c.error,o,tel,{message:"Bad XML or XSL call"});
return}if(o.c.island){if(o.c.island==true)o.c.island="body";o.c.xslid=id("xsl");$(o.c.island).append("<div id='"+o.c.xslid+"' name='"+o.c.xslid+"' style='display:none;'>"+o.c.xslstr+"</div>");o.c.xmlid=id("xml");$(o.c.island).append("<div id='"+o.c.xmlid+"' name='"+o.c.xmlid+"' style='display:none;'>"+o.c.xmlstr+"</div>")}o.c.xslobj=o.c.xslobj?o.c.xslobj:createXmlObj(o.c.xslstr);o.c.xmlobj=o.c.xmlobj?o.c.xmlobj:createXmlObj(o.c.xmlstr);if($.browser.msie)try{var fixref=function(ref,xObj){var vals=
xObj.selectNodes(ref);for(var x=0;x<vals.length;x++)vals[x].setAttribute("href",replaceref(vals[x].getAttribute("href"),o))};fixref("//xsl:include",o.c.xslobj);fixref("//xsl:import",o.c.xslobj);var addparams=function(op,xObj){for(var p in op){var strParam="//xsl:param[@name='"+p+"']";try{var v=op[p];if(isNaN(parseInt(op[p]))&&op[p].indexOf("'")<0)v="'"+op[p]+"'";var xslParam=xObj.selectSingleNode(strParam);xslParam.setAttribute("select",v)}catch(ex){}}};addparams(o.c.xslParams,o.c.xslobj);tel.empty().html(o.c.xmlobj.transformNode(o.c.xslobj))}catch(ex){fail=
true;call(o.c.error,o,tel,ex)}else try{var proc=new XSLTProcessor;var fixref=function(ref,xObj){ref=$.browser.mozilla&&$.browser.version.substring(0,3)=="1.9"?"xsl:"+ref:ref;var vals=xObj.getElementsByTagName(ref);for(var x=0;x<vals.length;x++)vals[x].setAttribute("href",replaceref(vals[x].getAttribute("href"),o))};fixref("import",o.c.xslobj);fixref("include",o.c.xslobj);var addparams=function(op){for(var p in op)proc.setParameter(null,p,op[p])};addparams(o.c.xslParams);var doc=document.implementation.createDocument("",
"",null);proc.importStylesheet(o.c.xslobj);tel.empty().append(proc.transformToFragment(o.c.xmlobj,doc))}catch(ex){fail=true;call(o.c.error,o,tel,ex)}if(o.c.el)$(o.c.el).html(tel.html());if(!fail)call(o.c.success,o,tel);call(o.c.complete,o,tel);return tel.html()}};var makeCall=function(t,options,type){if(typeof options=="string")options={cache:false,url:options,dataType:"xml",async:t.c.async,pass:t.c.pass};options.complete=function(r){if(type=="XSL")if(r.status==200)t.c.xslstr=r.responseText;else{t.c.xslstr=
"error";t.c.throwerror=true}else if(r.status==200)t.c.xmlstr=r.responseText;else{t.c.xmlstr="error";t.c.throwerror=true}if(t.c.async)checkReady(t)};$.ajax(options)};if(t.c.xsl)makeCall(t,o.xsl,"XSL");if(t.c.xml)makeCall(t,o.xml,"XML");if(!t.c.async||t.c.xmlstr||t.c.xmlobj||t.c.xslstr||t.c.xslobj)return checkReady(t)};$.fn.transform=function(o){return this.each(function(){o=o?o:{};o.el=this;new $.transform(o)})}})(jQuery);
$().ready(function(){$("[transform]").each(function(num,el){$(el).transform(eval("("+$(el).attr("transform")+")"))})});(function($){$.extend($.fn,{swapClass:function(c1,c2){var c1Elements=this.filter("."+c1);this.filter("."+c2).removeClass(c2).addClass(c1);c1Elements.removeClass(c1).addClass(c2);return this},replaceClass:function(c1,c2){return this.filter("."+c1).removeClass(c1).addClass(c2).end()},hoverClass:function(className){className=className||"hover";return this.hover(function(){$(this).addClass(className)},function(){$(this).removeClass(className)})},heightToggle:function(animated,callback){animated?this.animate({height:"toggle"},
animated,callback):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();if(callback)callback.apply(this,arguments)})},heightHide:function(animated,callback){if(animated)this.animate({height:"hide"},animated,callback);else{this.hide();if(callback)this.each(callback)}},prepareBranches:function(settings){if(!settings.prerendered){this.filter(":last-child:not(ul)").addClass(CLASSES.last);this.filter(":first:not(ul)").addClass(CLASSES.firstMenuItem);this.filter((settings.collapsed?
"":"."+CLASSES.closed)+":not(."+CLASSES.open+")").find(">ul").hide()}return this.filter(":has(>ul)")},applyClasses:function(settings,toggler){this.filter(":has(>ul):not(:has(>a))").find(">span").unbind("click.treeview").bind("click.treeview",function(event){if(this==event.target)toggler.apply($(this).next())}).add($("a",this)).hoverClass();if(!settings.prerendered){this.filter(":has(>ul:hidden)").addClass(CLASSES.expandable).replaceClass(CLASSES.last,CLASSES.lastExpandable);this.not(":has(>ul:hidden)").addClass(CLASSES.collapsable).replaceClass(CLASSES.last,
CLASSES.lastCollapsable);var hitarea=this.find("div."+CLASSES.hitarea);if(!hitarea.length)hitarea=this.prepend('<div class="'+CLASSES.hitarea+'"/>').find("div."+CLASSES.hitarea);hitarea.removeClass().addClass(CLASSES.hitarea).each(function(){var classes="";$.each($(this).parent().attr("class").split(" "),function(){classes+=this+"-hitarea "});$(this).addClass(classes)})}this.find("div."+CLASSES.hitarea).click(toggler)},treeview:function(settings){settings=$.extend({cookieId:"treeview"},settings);
if(settings.toggle){var callback=settings.toggle;settings.toggle=function(){return callback.apply($(this).parent()[0],arguments)}}function treeController(tree,control){function handler(filter){return function(){toggler.apply($("div."+CLASSES.hitarea,tree).filter(function(){return filter?$(this).parent("."+filter).length:true}));return false}}$("a:eq(0)",control).click(handler(CLASSES.collapsable));$("a:eq(1)",control).click(handler(CLASSES.expandable));$("a:eq(2)",control).click(handler())}function toggler(){$(this).parent().find(">.hitarea").swapClass(CLASSES.collapsableHitarea,
CLASSES.expandableHitarea).swapClass(CLASSES.lastCollapsableHitarea,CLASSES.lastExpandableHitarea).end().swapClass(CLASSES.collapsable,CLASSES.expandable).swapClass(CLASSES.lastCollapsable,CLASSES.lastExpandable).find(">ul").heightToggle(settings.animated,settings.toggle);if(settings.unique)$(this).parent().siblings().find(">.hitarea").replaceClass(CLASSES.collapsableHitarea,CLASSES.expandableHitarea).replaceClass(CLASSES.lastCollapsableHitarea,CLASSES.lastExpandableHitarea).end().replaceClass(CLASSES.collapsable,
CLASSES.expandable).replaceClass(CLASSES.lastCollapsable,CLASSES.lastExpandable).find(">ul").heightHide(settings.animated,settings.toggle)}this.data("toggler",toggler);function serialize(){function binary(arg){return arg?1:0}var data=[];branches.each(function(i,e){data[i]=$(e).is(":has(>ul:visible)")?1:0});$.cookie(settings.cookieId,data.join(""),settings.cookieOptions)}function deserialize(){var stored=$.cookie(settings.cookieId);if(stored){var data=stored.split("");branches.each(function(i,e){$(e).find(">ul")[parseInt(data[i])?
"show":"hide"]()})}}this.addClass("treeview");var branches=this.find("li").prepareBranches(settings);switch(settings.persist){case "cookie":var toggleCallback=settings.toggle;settings.toggle=function(){serialize();if(toggleCallback)toggleCallback.apply(this,arguments)};deserialize();break;case "location":var current=this.find("a").filter(function(){return this.href.toLowerCase()==location.href.toLowerCase()});if(current.length)current.addClass("selected").parents("ul, li").add(current.next()).show();
break}branches.applyClasses(settings,toggler);if(settings.control){treeController(this,settings.control);$(settings.control).show()}return this}});$.treeview={};var CLASSES=$.treeview.classes={open:"open",closed:"closed",expandable:"expandable",expandableHitarea:"expandable-hitarea",lastExpandableHitarea:"lastExpandable-hitarea",collapsable:"collapsable",collapsableHitarea:"collapsable-hitarea",lastCollapsableHitarea:"lastCollapsable-hitarea",lastCollapsable:"lastCollapsable",lastExpandable:"lastExpandable",
last:"last",hitarea:"hitarea",firstMenuItem:"firstMenuItem"};$.fn.Treeview=$.fn.treeview})(jQuery);(function($){$.fn.jqm=function(o){var p={overlay:30,overlayClass:"layerOverlay",closeClass:"layerCloseButton",trigger:"showlayer",popuplayer:".layer",ajax:F,ajaxText:"",target:F,modal:F,toTop:F,onShow:F,onHide:F,onLoad:F,ok:"",okAction:function(onSuccess,onError){}};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.jqmShowWithCallback=function(onSuccess,onError,t){return this.each(function(){t=t||window.event;$.jqm.open(this._jqm,t,onSuccess,onError)})};$.fn.jqmHide=function(t){return this.each(function(){t=t||window.event;$.jqm.close(this._jqm,t)})};$.jqm={hash:{},open:function(s,t,onSuccess,onError){var h=
H[s],c=h.c,cc="."+c.closeClass,z=parseInt(h.w.css("z-index")),z=z>0?z:3E3,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;if(c.okAction&&c.ok)$(c.ok).unbind("click").click(function(){c.okAction(onSuccess,onError)});var pObj=$(h.w).parent();h.o=o?o.addClass(c.overlayClass).prependTo(pObj):
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'")}}var wHeight=window.innerHeight?window.innerHeight:document.documentElement.offsetHeight;$(c.popuplayer).css({top:(document.documentElement.scrollTop||document.body.scrollTop)+Math.round(8*wHeight/100)+"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);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);(function($){$.fn.extend({autocomplete:function(urlOrData,options){var isUrl=typeof urlOrData=="string";options=$.extend({},$.Autocompleter.defaults,{url:isUrl?urlOrData:null,data:isUrl?null:urlOrData,delay:isUrl?$.Autocompleter.defaults.delay:10,max:options&&!options.scroll?10:150},options);options.highlight=options.highlight||function(value){return value};options.formatMatch=options.formatMatch||options.formatItem;return this.each(function(){new $.Autocompleter(this,options)})},result:function(handler){return this.bind("result",
handler)},search:function(handler){return this.trigger("search",[handler])},flushCache:function(){return this.trigger("flushCache")},setOptions:function(options){return this.trigger("setOptions",[options])},unautocomplete:function(){return this.trigger("unautocomplete")}});$.Autocompleter=function(input,options){var KEY={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8};var $input=$(input).attr("autocomplete","off").addClass(options.inputClass);var timeout;var previousValue=
"";var cache=$.Autocompleter.Cache(options);var hasFocus=0;var lastKeyPressCode;var config={mouseDownOnSelect:false};var select=$.Autocompleter.Select(options,input,selectCurrent,config);var blockSubmit;$.browser.opera&&$(input.form).bind("submit.autocomplete",function(){if(blockSubmit){blockSubmit=false;return false}});$input.bind(($.browser.opera?"keypress":"keydown")+".autocomplete",function(event){hasFocus=1;lastKeyPressCode=event.keyCode;switch(event.keyCode){case KEY.UP:event.preventDefault();
if(select.visible())select.prev();else onChange(0,true);break;case KEY.DOWN:event.preventDefault();if(select.visible())select.next();else onChange(0,true);break;case KEY.PAGEUP:event.preventDefault();if(select.visible())select.pageUp();else onChange(0,true);break;case KEY.PAGEDOWN:event.preventDefault();if(select.visible())select.pageDown();else onChange(0,true);break;case options.multiple&&$.trim(options.multipleSeparator)==","&&KEY.COMMA:case KEY.TAB:case KEY.RETURN:if(selectCurrent()){event.preventDefault();
blockSubmit=true;return false}break;case KEY.ESC:select.hide();break;default:clearTimeout(timeout);timeout=setTimeout(onChange,options.delay);break}}).focus(function(){hasFocus++}).blur(function(){hasFocus=0;if(!config.mouseDownOnSelect)hideResults()}).click(function(){if(hasFocus++>1&&!select.visible())onChange(0,true)}).bind("search",function(){var fn=arguments.length>1?arguments[1]:null;function findValueCallback(q,data){var result;if(data&&data.length)for(var i=0;i<data.length;i++)if(data[i].result.toLowerCase()==
q.toLowerCase()){result=data[i];break}if(typeof fn=="function")fn(result);else $input.trigger("result",result&&[result.data,result.value])}$.each(trimWords($input.val()),function(i,value){request(value,findValueCallback,findValueCallback)})}).bind("flushCache",function(){cache.flush()}).bind("setOptions",function(){$.extend(options,arguments[1]);if("data"in arguments[1])cache.populate()}).bind("unautocomplete",function(){select.unbind();$input.unbind();$(input.form).unbind(".autocomplete")});function selectCurrent(){var selected=
select.selected();if(!selected)return false;var v=selected.result;previousValue=v;if(options.multiple){var words=trimWords($input.val());if(words.length>1){var seperator=options.multipleSeparator.length;var cursorAt=$(input).selection().start;var wordAt,progress=0;$.each(words,function(i,word){progress+=word.length;if(cursorAt<=progress){wordAt=i;return false}progress+=seperator});words[wordAt]=v;v=words.join(options.multipleSeparator)}v+=options.multipleSeparator}$input.val(v);hideResultsNow();$input.trigger("result",
[selected.data,selected.value]);return true}function onChange(crap,skipPrevCheck){if(lastKeyPressCode==KEY.DEL){select.hide();return}var currentValue=$input.val();if(!skipPrevCheck&&currentValue==previousValue)return;previousValue=currentValue;currentValue=lastWord(currentValue);if(currentValue.length>=options.minChars){$input.addClass(options.loadingClass);if(!options.matchCase)currentValue=currentValue.toLowerCase();request(currentValue,receiveData,hideResultsNow)}else{stopLoading();select.hide()}}
function trimWords(value){if(!value)return[""];if(!options.multiple)return[$.trim(value)];return $.map(value.split(options.multipleSeparator),function(word){return $.trim(value).length?$.trim(word):null})}function lastWord(value){if(!options.multiple)return value;var words=trimWords(value);if(words.length==1)return words[0];var cursorAt=$(input).selection().start;if(cursorAt==value.length)words=trimWords(value);else words=trimWords(value.replace(value.substring(cursorAt),""));return words[words.length-
1]}function autoFill(q,sValue){if(options.autoFill&&lastWord($input.val()).toLowerCase()==q.toLowerCase()&&lastKeyPressCode!=KEY.BACKSPACE){$input.val($input.val()+sValue.substring(lastWord(previousValue).length));$(input).selection(previousValue.length,previousValue.length+sValue.length)}}function hideResults(){clearTimeout(timeout);timeout=setTimeout(hideResultsNow,200)}function hideResultsNow(){var wasVisible=select.visible();select.hide();clearTimeout(timeout);stopLoading();if(options.mustMatch)$input.search(function(result){if(!result)if(options.multiple){var words=
trimWords($input.val()).slice(0,-1);$input.val(words.join(options.multipleSeparator)+(words.length?options.multipleSeparator:""))}else{$input.val("");$input.trigger("result",null)}})}function receiveData(q,data){if(data&&data.length&&hasFocus){stopLoading();select.display(data,q);autoFill(q,data[0].value);select.show()}else hideResultsNow()}function request(term,success,failure){if(!options.matchCase)term=term.toLowerCase();var data=cache.load(term);if(data&&data.length)success(term,data);else if(typeof options.url==
"string"&&options.url.length>0){var extraParams={timestamp:+new Date};$.each(options.extraParams,function(key,param){extraParams[key]=typeof param=="function"?param():param});$.ajax({mode:"abort",port:"autocomplete"+input.name,dataType:options.dataType,url:options.url,data:$.extend({q:lastWord(term),limit:options.max},extraParams),success:function(data){var parsed=options.parse&&options.parse(data)||parse(data);cache.add(term,parsed);success(term,parsed)}})}else{select.emptyList();failure(term)}}
function parse(data){var parsed=[];var rows=data.split("\n");for(var i=0;i<rows.length;i++){var row=$.trim(rows[i]);if(row){row=row.split("|");parsed[parsed.length]={data:row,value:row[0],result:options.formatResult&&options.formatResult(row,row[0])||row[0]}}}return parsed}function stopLoading(){$input.removeClass(options.loadingClass)}};$.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:false,matchSubset:true,matchContains:false,
cacheLength:10,max:100,mustMatch:false,extraParams:{},selectFirst:true,formatItem:function(row){return row[0]},formatMatch:null,autoFill:false,width:252,multiple:false,multipleSeparator:", ",highlight:function(value,term){return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<span class='autocompleterQueried'>$1</span>")},scroll:true,scrollHeight:180};$.Autocompleter.Cache=function(options){var data={};
var length=0;function matchSubset(s,sub){if(!options.matchCase)s=s.toLowerCase();var i=s.indexOf(sub);if(options.matchContains=="word")i=s.toLowerCase().search("\\b"+sub.toLowerCase());if(i==-1)return false;return i==0||options.matchContains}function add(q,value){if(length>options.cacheLength)flush();if(!data[q])length++;data[q]=value}function populate(){if(!options.data)return false;var stMatchSets={},nullData=0;if(!options.url)options.cacheLength=1;stMatchSets[""]=[];for(var i=0,ol=options.data.length;i<
ol;i++){var rawValue=options.data[i];rawValue=typeof rawValue=="string"?[rawValue]:rawValue;var value=options.formatMatch(rawValue,i+1,options.data.length);if(value===false)continue;var firstChar=value.charAt(0).toLowerCase();if(!stMatchSets[firstChar])stMatchSets[firstChar]=[];var row={value:value,data:rawValue,result:options.formatResult&&options.formatResult(rawValue)||value};stMatchSets[firstChar].push(row);if(nullData++<options.max)stMatchSets[""].push(row)}$.each(stMatchSets,function(i,value){options.cacheLength++;
add(i,value)})}setTimeout(populate,25);function flush(){data={};length=0}return{flush:flush,add:add,populate:populate,load:function(q){if(!options.cacheLength||!length)return null;if(!options.url&&options.matchContains){var csub=[];for(var k in data)if(k.length>0){var c=data[k];$.each(c,function(i,x){if(matchSubset(x.value,q))csub.push(x)})}return csub}else if(data[q])return data[q];else if(options.matchSubset)for(var i=q.length-1;i>=options.minChars;i--){var c=data[q.substr(0,i)];if(c){var csub=
[];$.each(c,function(i,x){if(matchSubset(x.value,q))csub[csub.length]=x});return csub}}return null}}};$.Autocompleter.Select=function(options,input,select,config){var CLASSES={ACTIVE:"ac_over"};var listItems,active=-1,data,term="",needsInit=true,element,list;function init(){if(!needsInit)return;element=$("<div/>").hide().addClass(options.resultsClass).css("position","absolute").appendTo(document.body);list=$("<ul/>").appendTo(element).mouseover(function(event){if(target(event).nodeName&&target(event).nodeName.toUpperCase()==
"LI"){active=$("li",list).removeClass(CLASSES.ACTIVE).index(target(event));$(target(event)).addClass(CLASSES.ACTIVE)}}).click(function(event){$(target(event)).addClass(CLASSES.ACTIVE);select();input.focus();return false}).mousedown(function(){config.mouseDownOnSelect=true}).mouseup(function(){config.mouseDownOnSelect=false});if(options.width>0)element.css("width",options.width);needsInit=false}function target(event){var element=event.target;while(element&&element.tagName!="LI")element=element.parentNode;
if(!element)return[];return element}function moveSelect(step){listItems.slice(active,active+1).removeClass(CLASSES.ACTIVE);movePosition(step);var activeItem=listItems.slice(active,active+1).addClass(CLASSES.ACTIVE);if(options.scroll){var offset=0;listItems.slice(0,active).each(function(){offset+=this.offsetHeight});if(offset+activeItem[0].offsetHeight-list.scrollTop()>list[0].clientHeight)list.scrollTop(offset+activeItem[0].offsetHeight-list.innerHeight());else if(offset<list.scrollTop())list.scrollTop(offset)}}
function movePosition(step){active+=step;if(active<0)active=listItems.size()-1;else if(active>=listItems.size())active=0}function limitNumberOfItems(available){return options.max&&options.max<available?options.max:available}function fillList(){list.empty();var max=limitNumberOfItems(data.length);for(var i=0;i<max;i++){if(!data[i])continue;var formatted=options.formatItem(data[i].data,i+1,max,data[i].value,term);if(formatted===false)continue;var li=$("<li/>").html(options.highlight(formatted,term)).addClass(i%
2==0?"ac_even":"ac_odd").appendTo(list)[0];$.data(li,"ac_data",data[i])}listItems=list.find("li");if(options.selectFirst){listItems.slice(0,1).addClass(CLASSES.ACTIVE);active=0}if($.fn.bgiframe)list.bgiframe()}return{display:function(d,q){init();data=d;term=q;fillList()},next:function(){moveSelect(1)},prev:function(){moveSelect(-1)},pageUp:function(){if(active!=0&&active-8<0)moveSelect(-active);else moveSelect(-8)},pageDown:function(){if(active!=listItems.size()-1&&active+8>listItems.size())moveSelect(listItems.size()-
1-active);else moveSelect(8)},hide:function(){element&&element.hide();listItems&&listItems.removeClass(CLASSES.ACTIVE);active=-1},visible:function(){return element&&element.is(":visible")},current:function(){return this.visible()&&(listItems.filter("."+CLASSES.ACTIVE)[0]||options.selectFirst&&listItems[0])},show:function(){var offset=$(input).offset();element.css({width:typeof options.width=="string"||options.width>0?options.width:$(input).width(),top:offset.top+input.offsetHeight,left:offset.left}).show();
if(options.scroll){list.scrollTop(0);list.css({maxHeight:options.scrollHeight,overflow:"auto"});if($.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var listHeight=0;listItems.each(function(){listHeight+=this.offsetHeight});var scrollbarsVisible=listHeight>options.scrollHeight;list.css("height",scrollbarsVisible?options.scrollHeight:listHeight);if(!scrollbarsVisible)listItems.width(list.width()-parseInt(listItems.css("padding-left"))-parseInt(listItems.css("padding-right")))}}},
selected:function(){var selected=listItems&&listItems.filter("."+CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);return selected&&selected.length&&$.data(selected[0],"ac_data")},emptyList:function(){list&&list.empty()},unbind:function(){element&&element.remove()}}};$.fn.selection=function(start,end){if(start!==undefined)return this.each(function(){if(this.createTextRange){var selRange=this.createTextRange();if(end===undefined||start==end){selRange.move("character",start);selRange.select()}else{selRange.collapse(true);
selRange.moveStart("character",start);selRange.moveEnd("character",end);selRange.select()}}else if(this.setSelectionRange)this.setSelectionRange(start,end);else if(this.selectionStart){this.selectionStart=start;this.selectionEnd=end}});var field=this[0];if(field.createTextRange){var range=document.selection.createRange(),orig=field.value,teststring="<->",textLength=range.text.length;range.text=teststring;var caretAt=field.value.indexOf(teststring);field.value=orig;this.selection(caretAt,caretAt+textLength);
return{start:caretAt,end:caretAt+textLength}}else if(field.selectionStart!==undefined)return{start:field.selectionStart,end:field.selectionEnd}}})(jQuery);(function($){$.fn.jqzoomunbind=function(){return this.each(function(){$(this).unbind()})};$.fn.jqzoom=function(options){var settings={zoomType:"standard",zoomWidth:200,zoomHeight:200,xOffset:10,yOffset:0,position:"right",lens:true,lensReset:false,imageOpacity:0.2,title:true,alwaysOn:false,showEffect:"show",hideEffect:"hide",fadeinSpeed:"fast",fadeoutSpeed:"slow",preloadImages:true,showPreload:false,preloadText:"Loading zoom",preloadPosition:"center",cursor:"crosshair"};options=options||{};$.extend(settings,
options);return this.each(function(){$(this).jqzoomunbind();settings.container=$(this);var a=$(this);var aTitle=a.prop("title");$(a).removeProp("title");$(a).css("outline-style","none");var largeImgUrl;var img;if($(this).is("div")){aTitle=" ";var imgurl=$(this).css("background-image").replace(/"/g,"").replace(/url\(|\)$/ig,"");if($("img.#zsdfg4236dummy").length>0)$("img.#zsdfg4236dummy").remove();img=$('<img id="zsdfg4236dummy" src="'+imgurl+'" title="" style="display:none;"></img>').appendTo("body");
largeImgUrl=$(this).attr("href")}else{img=$("img",this);largeImgUrl=a[0].href}var imageTitle=img.prop("title");img.removeProp("title");var smallimage=new Smallimage(img);var smallimagedata={};var btop=0;var bleft=0;var loader=null;loader=new Loader;var ZoomTitle=trim(aTitle).length>0?aTitle:trim(imageTitle).length>0?imageTitle:null;var ZoomTitleObj=new zoomTitle;var largeimage=new Largeimage(largeImgUrl);var lens=new Lens;var lensdata={};var largeimageloaded=false;var scale={};var stage=null;var running=
false;var mousepos={};var firstime=0;var preloadshow=false;var isMouseDown=false;var dragstatus=false;smallimage.loadimage();$(this).hover(function(e){mousepos.x=e.pageX;mousepos.y=e.pageY;activate()},function(){deactivate()});if(settings.alwaysOn)setTimeout(function(){activate()},150);function activate(){if(!running){smallimage.findborder();running=true;imageTitle=img.attr("title");img.removeAttr("title");aTitle=a.attr("title");$(a).removeAttr("title");if(!largeimage||$.browser.safari)largeimage=
new Largeimage(largeImgUrl);if(!largeimageloaded||$.browser.safari)largeimage.loadimage();else{if(settings.zoomType!="innerzoom"){stage=new Stage;stage.activate()}lens=new Lens;lens.activate()}a[0].blur();return false}}function deactivate(){if(settings.zoomType=="reverse"&&!settings.alwaysOn)img.css({opacity:1});if(!settings.alwaysOn){running=false;largeimageloaded=false;$(lens.node).unbind("mousemove");lens.remove();if($("div.jqZoomWindow").length>0)stage.remove();if($("div.jqZoomTitle").length>
0)ZoomTitleObj.remove();img.attr("title",imageTitle);a.attr("title",aTitle);$().unbind();a.unbind("mousemove");firstime=0;if(jQuery(".zoom_ieframe").length>0)jQuery(".zoom_ieframe").remove()}else if(settings.lensReset)switch(settings.zoomType){case "innerzoom":largeimage.setcenter();break;default:lens.center();break}if(settings.alwaysOn)activate()}function Smallimage(image){this.node=image[0];this.loadimage=function(){this.node.src=image[0].src};this.findborder=function(){var bordertop="";bordertop=
$(img).css("border-top-width");btop="";var borderleft="";borderleft=$(img).css("border-left-width");bleft="";if(bordertop)for(i=0;i<3;i++){var x=[];x=bordertop.substr(i,1);if(isNaN(x)==false)btop=btop+""+bordertop.substr(i,1);else break}if(borderleft)for(i=0;i<3;i++)if(!isNaN(borderleft.substr(i,1)))bleft=bleft+borderleft.substr(i,1);else break;btop=btop.length>0?eval(btop):0;bleft=bleft.length>0?eval(bleft):0};this.node.onload=function(){a.css({cursor:settings.cursor,display:"block"});if(a.css("position")!=
"absolute"&&a.parent().css("position"))a.css({cursor:settings.cursor,position:"relative",display:"block"});if(a.parent().css("position")!="absolute")a.parent().css("position","relative");else;if($.browser.safari||$.browser.opera)$(img).css({position:"absolute",top:"0px",left:"0px"});smallimagedata.w=$(this).width();smallimagedata.h=$(this).height();smallimagedata.pos=settings.container.offset();smallimagedata.pos.l=settings.container.offset().left;smallimagedata.pos.t=settings.container.offset().top;
smallimagedata.pos.r=smallimagedata.w+smallimagedata.pos.l;smallimagedata.pos.b=smallimagedata.h+smallimagedata.pos.t;a.height(smallimagedata.h);a.width(smallimagedata.w);if(settings.preloadImages)largeimage.loadimage()};return this}function Lens(){this.node=document.createElement("div");$(this.node).addClass("jqZoomPup");this.node.onerror=function(){$(lens.node).remove();lens=new Lens;lens.activate()};this.loadlens=function(){switch(settings.zoomType){case "reverse":this.image=new Image;this.image.src=
smallimage.node.src;this.node.appendChild(this.image);$(this.node).css({opacity:1});break;case "innerzoom":this.image=new Image;this.image.src=largeimage.node.src;this.node.appendChild(this.image);$(this.node).css({opacity:1});break;default:break}switch(settings.zoomType){case "innerzoom":lensdata.w=smallimagedata.w;lensdata.h=smallimagedata.h;break;default:lensdata.w=settings.zoomWidth/scale.x;lensdata.h=settings.zoomHeight/scale.y;break}$(this.node).css({width:lensdata.w+"px",height:lensdata.h+
"px",position:"absolute",display:"none",borderWidth:1+"px"});a.append(this.node)};return this}Lens.prototype.activate=function(){this.loadlens();switch(settings.zoomType){case "reverse":img.css({opacity:settings.imageOpacity});settings.alwaysOn?lens.center():lens.setposition(null);a.bind("mousemove",function(e){mousepos.x=e.pageX;mousepos.y=e.pageY;lens.setposition(e)});break;case "innerzoom":$(this.node).css({top:0,left:0});if(settings.title)ZoomTitleObj.loadtitle();largeimage.setcenter();a.bind("mousemove",
function(e){mousepos.x=e.pageX;mousepos.y=e.pageY;largeimage.setinner(e)});break;default:settings.alwaysOn?lens.center():lens.setposition(null);$(a).bind("mousemove",function(e){mousepos.x=e.pageX;mousepos.y=e.pageY;lens.setposition(e)});break}return this};Lens.prototype.setposition=function(e){if(e){mousepos.x=e.pageX;mousepos.y=e.pageY}if(firstime==0){var lensleft=smallimagedata.w/2-lensdata.w/2;var lenstop=smallimagedata.h/2-lensdata.h/2;$("div.jqZoomPup").show();if(settings.lens)this.node.style.visibility=
"visible";else{this.node.style.visibility="hidden";$("div.jqZoomPup").hide()}firstime=1}else{var lensleft=mousepos.x-smallimagedata.pos.l-lensdata.w/2;var lenstop=mousepos.y-smallimagedata.pos.t-lensdata.h/2}if(overleft())lensleft=0+bleft;else if(overright())if($.browser.msie)lensleft=smallimagedata.w-lensdata.w+bleft+1;else lensleft=smallimagedata.w-lensdata.w+bleft-1;if(overtop())lenstop=0+btop;else if(overbottom())if($.browser.msie)lenstop=smallimagedata.h-lensdata.h+btop+1;else lenstop=smallimagedata.h-
lensdata.h-1+btop;lensleft=parseInt(lensleft);lenstop=parseInt(lenstop);$("div.jqZoomPup",a).css({top:lenstop,left:lensleft});if(settings.zoomType=="reverse")$("div.jqZoomPup img",a).css({position:"absolute",top:-(lenstop-btop+1),left:-(lensleft-bleft+1)});this.node.style.left=lensleft+"px";this.node.style.top=lenstop+"px";largeimage.setposition();function overleft(){return mousepos.x-(lensdata.w+2*1)/2-bleft<smallimagedata.pos.l}function overright(){return mousepos.x+(lensdata.w+2*1)/2>smallimagedata.pos.r+
bleft}function overtop(){return mousepos.y-(lensdata.h+2*1)/2-btop<smallimagedata.pos.t}function overbottom(){return mousepos.y+(lensdata.h+2*1)/2>smallimagedata.pos.b+btop}return this};Lens.prototype.center=function(){$("div.jqZoomPup",a).css("display","none");var lensleft=smallimagedata.w/2-lensdata.w/2;var lenstop=smallimagedata.h/2-lensdata.h/2;this.node.style.left=lensleft+"px";this.node.style.top=lenstop+"px";$("div.jqZoomPup",a).css({top:lenstop,left:lensleft});if(settings.zoomType=="reverse")$("div.jqZoomPup img",
a).css({position:"absolute",top:-(lenstop-btop+1),left:-(lensleft-bleft+1)});largeimage.setposition();if($.browser.msie)$("div.jqZoomPup",a).show();else setTimeout(function(){$("div.jqZoomPup").fadeIn("fast")},10)};Lens.prototype.getoffset=function(){var o={};o.left=parseInt(this.node.style.left);o.top=parseInt(this.node.style.top);return o};Lens.prototype.remove=function(){if(settings.zoomType=="innerzoom")$("div.jqZoomPup",a).fadeOut("fast",function(){$(this).remove()});else $("div.jqZoomPup",a).remove()};
Lens.prototype.findborder=function(){var bordertop="";bordertop=$("div.jqZoomPup").css("borderTop");lensbtop="";var borderleft="";borderleft=$("div.jqZoomPup").css("borderLeft");lensbleft="";if($.browser.msie){var temp=bordertop.split(" ");bordertop=temp[1];var temp=borderleft.split(" ");borderleft=temp[1]}if(bordertop)for(i=0;i<3;i++){var x=[];x=bordertop.substr(i,1);if(isNaN(x)==false)lensbtop=lensbtop+""+bordertop.substr(i,1);else break}if(borderleft)for(i=0;i<3;i++)if(!isNaN(borderleft.substr(i,
1)))lensbleft=lensbleft+borderleft.substr(i,1);else break;lensbtop=lensbtop.length>0?eval(lensbtop):0;lensbleft=lensbleft.length>0?eval(lensbleft):0};function Largeimage(url){this.url=url;this.node=new Image;this.loadimage=function(){if(!this.node)this.node=new Image;this.node.style.position="absolute";this.node.style.display="none";this.node.style.left="-5000px";this.node.style.top="10px";loader=new Loader;if(settings.showPreload&&!preloadshow){loader.show();preloadshow=true}document.body.appendChild(this.node);
this.node.src=this.url};this.node.onload=function(){this.style.display="block";var w=Math.round($(this).width());var h=Math.round($(this).height());this.style.display="none";scale.x=w/smallimagedata.w;scale.y=h/smallimagedata.h;if($("div.preload").length>0)$("div.preload").remove();largeimageloaded=true;if(settings.zoomType!="innerzoom"&&running){stage=new Stage;stage.activate()}if(running){lens=new Lens;lens.activate()}if($("div.preload").length>0)$("div.preload").remove()};return this}Largeimage.prototype.setposition=
function(){this.node.style.left=Math.ceil(-scale.x*parseInt(lens.getoffset().left)+bleft)+"px";this.node.style.top=Math.ceil(-scale.y*parseInt(lens.getoffset().top)+btop)+"px"};Largeimage.prototype.setinner=function(e){this.node.style.left=Math.ceil(-scale.x*Math.abs(e.pageX-smallimagedata.pos.l))+"px";this.node.style.top=Math.ceil(-scale.y*Math.abs(e.pageY-smallimagedata.pos.t))+"px";$("div.jqZoomPup img",a).css({position:"absolute",top:this.node.style.top,left:this.node.style.left})};Largeimage.prototype.setcenter=
function(){this.node.style.left=Math.ceil(-scale.x*Math.abs(smallimagedata.w/2))+"px";this.node.style.top=Math.ceil(-scale.y*Math.abs(smallimagedata.h/2))+"px";$("div.jqZoomPup img",a).css({position:"absolute",top:this.node.style.top,left:this.node.style.left})};function Stage(){var leftpos=smallimagedata.pos.l;var toppos=smallimagedata.pos.t;this.node=document.createElement("div");$(this.node).addClass("jqZoomWindow");$(this.node).css({position:"absolute",width:Math.round(settings.zoomWidth)+"px",
height:Math.round(settings.zoomHeight)+"px",display:"none",zIndex:1E4,overflow:"hidden"});switch(settings.position){case "right":leftpos=smallimagedata.pos.r+Math.abs(settings.xOffset)+settings.zoomWidth<screen.width?smallimagedata.pos.l+smallimagedata.w+Math.abs(settings.xOffset):smallimagedata.pos.l-settings.zoomWidth-Math.abs(settings.xOffset);topwindow=smallimagedata.pos.t+settings.yOffset+settings.zoomHeight;toppos=topwindow<screen.height&&topwindow>0?smallimagedata.pos.t+settings.yOffset:smallimagedata.pos.t;
break;case "left":leftpos=smallimagedata.pos.l-Math.abs(settings.xOffset)-settings.zoomWidth>0?smallimagedata.pos.l-Math.abs(settings.xOffset)-settings.zoomWidth:smallimagedata.pos.l+smallimagedata.w+Math.abs(settings.xOffset);topwindow=smallimagedata.pos.t+settings.yOffset+settings.zoomHeight;toppos=topwindow<screen.height&&topwindow>0?smallimagedata.pos.t+settings.yOffset:smallimagedata.pos.t;break;case "top":toppos=smallimagedata.pos.t-Math.abs(settings.yOffset)-settings.zoomHeight>0?smallimagedata.pos.t-
Math.abs(settings.yOffset)-settings.zoomHeight:smallimagedata.pos.t+smallimagedata.h+Math.abs(settings.yOffset);leftwindow=smallimagedata.pos.l+settings.xOffset+settings.zoomWidth;leftpos=leftwindow<screen.width&&leftwindow>0?smallimagedata.pos.l+settings.xOffset:smallimagedata.pos.l;break;case "bottom":toppos=smallimagedata.pos.b+Math.abs(settings.yOffset)+settings.zoomHeight<$("body").height()?smallimagedata.pos.b+Math.abs(settings.yOffset):smallimagedata.pos.t-settings.zoomHeight-Math.abs(settings.yOffset);
leftwindow=smallimagedata.pos.l+settings.xOffset+settings.zoomWidth;leftpos=leftwindow<screen.width&&leftwindow>0?smallimagedata.pos.l+settings.xOffset:smallimagedata.pos.l;break;default:leftpos=smallimagedata.pos.l+smallimagedata.w+settings.xOffset+settings.zoomWidth<screen.width?smallimagedata.pos.l+smallimagedata.w+Math.abs(settings.xOffset):smallimagedata.pos.l-settings.zoomWidth-Math.abs(settings.xOffset);toppos=smallimagedata.pos.b+Math.abs(settings.yOffset)+settings.zoomHeight<screen.height?
smallimagedata.pos.b+Math.abs(settings.yOffset):smallimagedata.pos.t-settings.zoomHeight-Math.abs(settings.yOffset);break}this.node.style.left=leftpos+"px";this.node.style.top=toppos+"px";return this}Stage.prototype.activate=function(){if(!this.node.firstChild)this.node.appendChild(largeimage.node);if(settings.title)ZoomTitleObj.loadtitle();document.body.appendChild(this.node);switch(settings.showEffect){case "show":$(this.node).show();break;case "fadein":$(this.node).fadeIn(settings.fadeinSpeed);
break;default:$(this.node).show();break}$(this.node).show();if($.browser.msie&&$.browser.version<7)this.ieframe=$('<iframe class="zoom_ieframe" frameborder="0" src="#"></iframe>').css({position:"absolute",left:this.node.style.left,top:this.node.style.top,zIndex:99,width:settings.zoomWidth,height:settings.zoomHeight}).insertBefore(this.node);largeimage.node.style.display="block"};Stage.prototype.remove=function(){switch(settings.hideEffect){case "hide":$(".jqZoomWindow").remove();break;case "fadeout":$(".jqZoomWindow").fadeOut(settings.fadeoutSpeed);
break;default:$(".jqZoomWindow").remove();break}};function zoomTitle(){this.node=jQuery("<div />").addClass("jqZoomTitle").html(""+ZoomTitle+"");this.loadtitle=function(){if(settings.zoomType=="innerzoom")$(this.node).css({position:"absolute",top:smallimagedata.pos.b+3,left:smallimagedata.pos.l+1,width:smallimagedata.w}).appendTo("body");else $(this.node).appendTo(stage.node)}}zoomTitle.prototype.remove=function(){$(".jqZoomTitle").remove()};function Loader(){this.node=document.createElement("div");
$(this.node).addClass("preload");$(this.node).html(settings.preloadText);$(this.node).appendTo("body").css("visibility","hidden");this.show=function(){switch(settings.preloadPosition){case "center":loadertop=smallimagedata.pos.t+(smallimagedata.h-$(this.node).height())/2;loaderleft=smallimagedata.pos.l+(smallimagedata.w-$(this.node).width())/2;break;default:var loaderoffset=this.getoffset();loadertop=!isNaN(loaderoffset.top)?smallimagedata.pos.t+loaderoffset.top:smallimagedata.pos.t+0;loaderleft=
!isNaN(loaderoffset.left)?smallimagedata.pos.l+loaderoffset.left:smallimagedata.pos.l+0;break}$(this.node).css({top:loadertop,left:loaderleft,position:"absolute",visibility:"visible"})};return this}Loader.prototype.getoffset=function(){var o=null;o=$("div.preload").offset();return o}})}})(jQuery);
function trim(stringa){while(stringa.substring(0,1)==" ")stringa=stringa.substring(1,stringa.length);while(stringa.substring(stringa.length-1,stringa.length)==" ")stringa=stringa.substring(0,stringa.length-1);return stringa};(function(i){var q={vertical:false,rtl:false,start:1,offset:1,size:null,scroll:3,visible:null,animation:"normal",easing:"swing",auto:0,wrap:null,initCallback:null,reloadCallback:null,itemLoadCallback:null,itemFirstInCallback:null,itemFirstOutCallback:null,itemLastInCallback:null,itemLastOutCallback:null,itemVisibleInCallback:null,itemVisibleOutCallback:null,buttonNextHTML:"<div></div>",buttonPrevHTML:"<div></div>",buttonNextEvent:"click",buttonPrevEvent:"click",buttonNextCallback:null,buttonPrevCallback:null,
itemFallbackDimension:null},r=false;i(window).bind("load.jcarousel",function(){r=true});i.jcarousel=function(a,c){this.options=i.extend({},q,c||{});this.autoStopped=this.locked=false;this.buttonPrevState=this.buttonNextState=this.buttonPrev=this.buttonNext=this.list=this.clip=this.container=null;if(!c||c.rtl===undefined)this.options.rtl=(i(a).attr("dir")||i("html").attr("dir")||"").toLowerCase()=="rtl";this.wh=!this.options.vertical?"width":"height";this.lt=!this.options.vertical?this.options.rtl?
"right":"left":"top";for(var b="",d=a.className.split(" "),f=0;f<d.length;f++)if(d[f].indexOf("jcarousel-skin")!=-1){i(a).removeClass(d[f]);b=d[f];break}if(a.nodeName.toUpperCase()=="UL"||a.nodeName.toUpperCase()=="OL"){this.list=i(a);this.container=this.list.parent();if(this.container.hasClass("jcarousel-clip")){if(!this.container.parent().hasClass("jcarousel-container"))this.container=this.container.wrap("<div></div>");this.container=this.container.parent()}else if(!this.container.hasClass("jcarousel-container"))this.container=
this.list.wrap("<div></div>").parent()}else{this.container=i(a);this.list=this.container.find("ul,ol").eq(0)}b!==""&&this.container.parent()[0].className.indexOf("jcarousel-skin")==-1&&this.container.wrap('<div class=" '+b+'"></div>');this.clip=this.list.parent();if(!this.clip.length||!this.clip.hasClass("jcarousel-clip"))this.clip=this.list.wrap("<div></div>").parent();this.buttonNext=i(".jcarousel-next",this.container);if(this.buttonNext.size()===0&&this.options.buttonNextHTML!==null)this.buttonNext=
this.clip.after(this.options.buttonNextHTML).next();this.buttonNext.addClass(this.className("jcarousel-next"));this.buttonPrev=i(".jcarousel-prev",this.container);if(this.buttonPrev.size()===0&&this.options.buttonPrevHTML!==null)this.buttonPrev=this.clip.after(this.options.buttonPrevHTML).next();this.buttonPrev.addClass(this.className("jcarousel-prev"));this.clip.addClass(this.className("jcarousel-clip")).css({overflow:"hidden",position:"relative"});this.list.addClass(this.className("jcarousel-list")).css({overflow:"hidden",
position:"relative",top:0,margin:0,padding:0}).css(this.options.rtl?"right":"left",0);this.container.addClass(this.className("jcarousel-container")).css({position:"relative"});!this.options.vertical&&this.options.rtl&&this.container.addClass("jcarousel-direction-rtl").attr("dir","rtl");var j=this.options.visible!==null?Math.ceil(this.clipping()/this.options.visible):null;b=this.list.children("li");var e=this;if(b.size()>0){var g=0,k=this.options.offset;b.each(function(){e.format(this,k++);g+=e.dimension(this,
j)});this.list.css(this.wh,g+100+"px");if(!c||c.size===undefined)this.options.size=b.size()}this.container.css("display","block");this.buttonNext.css("display","block");this.buttonPrev.css("display","block");this.funcNext=function(){e.next()};this.funcPrev=function(){e.prev()};this.funcResize=function(){e.reload()};this.options.initCallback!==null&&this.options.initCallback(this,"init");if(!r&&i.browser.safari){this.buttons(false,false);i(window).bind("load.jcarousel",function(){e.setup()})}else this.setup()};
var h=i.jcarousel;h.fn=h.prototype={jcarousel:"0.2.7"};h.fn.extend=h.extend=i.extend;h.fn.extend({setup:function(){this.prevLast=this.prevFirst=this.last=this.first=null;this.animating=false;this.tail=this.timer=null;this.inTail=false;if(!this.locked){this.list.css(this.lt,this.pos(this.options.offset)+"px");var a=this.pos(this.options.start,true);this.prevFirst=this.prevLast=null;this.animate(a,false);i(window).unbind("resize.jcarousel",this.funcResize).bind("resize.jcarousel",this.funcResize)}},
reset:function(){this.list.empty();this.list.css(this.lt,"0px");this.list.css(this.wh,"10px");this.options.initCallback!==null&&this.options.initCallback(this,"reset");this.setup()},reload:function(){this.tail!==null&&this.inTail&&this.list.css(this.lt,h.intval(this.list.css(this.lt))+this.tail);this.tail=null;this.inTail=false;this.options.reloadCallback!==null&&this.options.reloadCallback(this);if(this.options.visible!==null){var a=this,c=Math.ceil(this.clipping()/this.options.visible),b=0,d=0;
this.list.children("li").each(function(f){b+=a.dimension(this,c);if(f+1<a.first)d=b});this.list.css(this.wh,b+"px");this.list.css(this.lt,-d+"px")}this.scroll(this.first,false)},lock:function(){this.locked=true;this.buttons()},unlock:function(){this.locked=false;this.buttons()},size:function(a){if(a!==undefined){this.options.size=a;this.locked||this.buttons()}return this.options.size},has:function(a,c){if(c===undefined||!c)c=a;if(this.options.size!==null&&c>this.options.size)c=this.options.size;for(var b=
a;b<=c;b++){var d=this.get(b);if(!d.length||d.hasClass("jcarousel-item-placeholder"))return false}return true},get:function(a){return i(".jcarousel-item-"+a,this.list)},add:function(a,c){var b=this.get(a),d=0,f=i(c);if(b.length===0){var j,e=h.intval(a);for(b=this.create(a);;){j=this.get(--e);if(e<=0||j.length){e<=0?this.list.prepend(b):j.after(b);break}}}else d=this.dimension(b);if(f.get(0).nodeName.toUpperCase()=="LI"){b.replaceWith(f);b=f}else b.empty().append(c);this.format(b.removeClass(this.className("jcarousel-item-placeholder")),
a);f=this.options.visible!==null?Math.ceil(this.clipping()/this.options.visible):null;d=this.dimension(b,f)-d;a>0&&a<this.first&&this.list.css(this.lt,h.intval(this.list.css(this.lt))-d+"px");this.list.css(this.wh,h.intval(this.list.css(this.wh))+d+"px");return b},remove:function(a){var c=this.get(a);if(!(!c.length||a>=this.first&&a<=this.last)){var b=this.dimension(c);a<this.first&&this.list.css(this.lt,h.intval(this.list.css(this.lt))+b+"px");c.remove();this.list.css(this.wh,h.intval(this.list.css(this.wh))-
b+"px")}},next:function(){this.tail!==null&&!this.inTail?this.scrollTail(false):this.scroll((this.options.wrap=="both"||this.options.wrap=="last")&&this.options.size!==null&&this.last==this.options.size?1:this.first+this.options.scroll)},prev:function(){this.tail!==null&&this.inTail?this.scrollTail(true):this.scroll((this.options.wrap=="both"||this.options.wrap=="first")&&this.options.size!==null&&this.first==1?this.options.size:this.first-this.options.scroll)},scrollTail:function(a){if(!(this.locked||
this.animating||!this.tail)){this.pauseAuto();var c=h.intval(this.list.css(this.lt));c=!a?c-this.tail:c+this.tail;this.inTail=!a;this.prevFirst=this.first;this.prevLast=this.last;this.animate(c)}},scroll:function(a,c){if(!(this.locked||this.animating)){this.pauseAuto();this.animate(this.pos(a),c)}},pos:function(a,c){var b=h.intval(this.list.css(this.lt));if(this.locked||this.animating)return b;if(this.options.wrap!="circular")a=a<1?1:this.options.size&&a>this.options.size?this.options.size:a;for(var d=
this.first>a,f=this.options.wrap!="circular"&&this.first<=1?1:this.first,j=d?this.get(f):this.get(this.last),e=d?f:f-1,g=null,k=0,l=false,m=0;d?--e>=a:++e<a;){g=this.get(e);l=!g.length;if(g.length===0){g=this.create(e).addClass(this.className("jcarousel-item-placeholder"));j[d?"before":"after"](g);if(this.first!==null&&this.options.wrap=="circular"&&this.options.size!==null&&(e<=0||e>this.options.size)){j=this.get(this.index(e));if(j.length)g=this.add(e,j.clone(true))}}j=g;m=this.dimension(g);if(l)k+=
m;if(this.first!==null&&(this.options.wrap=="circular"||e>=1&&(this.options.size===null||e<=this.options.size)))b=d?b+m:b-m}f=this.clipping();var p=[],o=0,n=0;j=this.get(a-1);for(e=a;++o;){g=this.get(e);l=!g.length;if(g.length===0){g=this.create(e).addClass(this.className("jcarousel-item-placeholder"));j.length===0?this.list.prepend(g):j[d?"before":"after"](g);if(this.first!==null&&this.options.wrap=="circular"&&this.options.size!==null&&(e<=0||e>this.options.size)){j=this.get(this.index(e));if(j.length)g=
this.add(e,j.clone(true))}}j=g;m=this.dimension(g);if(m===0)throw Error("jCarousel: No width/height set for items. This will cause an infinite loop. Aborting...");if(this.options.wrap!="circular"&&this.options.size!==null&&e>this.options.size)p.push(g);else if(l)k+=m;n+=m;if(n>=f)break;e++}for(g=0;g<p.length;g++)p[g].remove();if(k>0){this.list.css(this.wh,this.dimension(this.list)+k+"px");if(d){b-=k;this.list.css(this.lt,h.intval(this.list.css(this.lt))-k+"px")}}k=a+o-1;if(this.options.wrap!="circular"&&
this.options.size&&k>this.options.size)k=this.options.size;if(e>k){o=0;e=k;for(n=0;++o;){g=this.get(e--);if(!g.length)break;n+=this.dimension(g);if(n>=f)break}}e=k-o+1;if(this.options.wrap!="circular"&&e<1)e=1;if(this.inTail&&d){b+=this.tail;this.inTail=false}this.tail=null;if(this.options.wrap!="circular"&&k==this.options.size&&k-o+1>=1){d=h.margin(this.get(k),!this.options.vertical?"marginRight":"marginBottom");if(n-d>f)this.tail=n-f-d}if(c&&a===this.options.size&&this.tail){b-=this.tail;this.inTail=
true}for(;a-- >e;)b+=this.dimension(this.get(a));this.prevFirst=this.first;this.prevLast=this.last;this.first=e;this.last=k;return b},animate:function(a,c){if(!(this.locked||this.animating)){this.animating=true;var b=this,d=function(){b.animating=false;a===0&&b.list.css(b.lt,0);if(!b.autoStopped&&(b.options.wrap=="circular"||b.options.wrap=="both"||b.options.wrap=="last"||b.options.size===null||b.last<b.options.size||b.last==b.options.size&&b.tail!==null&&!b.inTail))b.startAuto();b.buttons();b.notify("onAfterAnimation");
if(b.options.wrap=="circular"&&b.options.size!==null)for(var f=b.prevFirst;f<=b.prevLast;f++)if(f!==null&&!(f>=b.first&&f<=b.last)&&(f<1||f>b.options.size))b.remove(f)};this.notify("onBeforeAnimation");if(!this.options.animation||c===false){this.list.css(this.lt,a+"px");d()}else this.list.animate(!this.options.vertical?this.options.rtl?{right:a}:{left:a}:{top:a},this.options.animation,this.options.easing,d)}},startAuto:function(a){if(a!==undefined)this.options.auto=a;if(this.options.auto===0)return this.stopAuto();
if(this.timer===null){this.autoStopped=false;var c=this;this.timer=window.setTimeout(function(){c.next()},this.options.auto*1E3)}},stopAuto:function(){this.pauseAuto();this.autoStopped=true},pauseAuto:function(){if(this.timer!==null){window.clearTimeout(this.timer);this.timer=null}},buttons:function(a,c){if(a==null){a=!this.locked&&this.options.size!==0&&(this.options.wrap&&this.options.wrap!="first"||this.options.size===null||this.last<this.options.size);if(!this.locked&&(!this.options.wrap||this.options.wrap==
"first")&&this.options.size!==null&&this.last>=this.options.size)a=this.tail!==null&&!this.inTail}if(c==null){c=!this.locked&&this.options.size!==0&&(this.options.wrap&&this.options.wrap!="last"||this.first>1);if(!this.locked&&(!this.options.wrap||this.options.wrap=="last")&&this.options.size!==null&&this.first==1)c=this.tail!==null&&this.inTail}var b=this;if(this.buttonNext.size()>0){this.buttonNext.unbind(this.options.buttonNextEvent+".jcarousel",this.funcNext);a&&this.buttonNext.bind(this.options.buttonNextEvent+
".jcarousel",this.funcNext);this.buttonNext[a?"removeClass":"addClass"](this.className("jcarousel-next-disabled")).attr("disabled",a?false:true);this.options.buttonNextCallback!==null&&this.buttonNext.data("jcarouselstate")!=a&&this.buttonNext.each(function(){b.options.buttonNextCallback(b,this,a)}).data("jcarouselstate",a)}else this.options.buttonNextCallback!==null&&this.buttonNextState!=a&&this.options.buttonNextCallback(b,null,a);if(this.buttonPrev.size()>0){this.buttonPrev.unbind(this.options.buttonPrevEvent+
".jcarousel",this.funcPrev);c&&this.buttonPrev.bind(this.options.buttonPrevEvent+".jcarousel",this.funcPrev);this.buttonPrev[c?"removeClass":"addClass"](this.className("jcarousel-prev-disabled")).attr("disabled",c?false:true);this.options.buttonPrevCallback!==null&&this.buttonPrev.data("jcarouselstate")!=c&&this.buttonPrev.each(function(){b.options.buttonPrevCallback(b,this,c)}).data("jcarouselstate",c)}else this.options.buttonPrevCallback!==null&&this.buttonPrevState!=c&&this.options.buttonPrevCallback(b,
null,c);this.buttonNextState=a;this.buttonPrevState=c},notify:function(a){var c=this.prevFirst===null?"init":this.prevFirst<this.first?"next":"prev";this.callback("itemLoadCallback",a,c);if(this.prevFirst!==this.first){this.callback("itemFirstInCallback",a,c,this.first);this.callback("itemFirstOutCallback",a,c,this.prevFirst)}if(this.prevLast!==this.last){this.callback("itemLastInCallback",a,c,this.last);this.callback("itemLastOutCallback",a,c,this.prevLast)}this.callback("itemVisibleInCallback",
a,c,this.first,this.last,this.prevFirst,this.prevLast);this.callback("itemVisibleOutCallback",a,c,this.prevFirst,this.prevLast,this.first,this.last)},callback:function(a,c,b,d,f,j,e){if(!(this.options[a]==null||typeof this.options[a]!="object"&&c!="onAfterAnimation")){var g=typeof this.options[a]=="object"?this.options[a][c]:this.options[a];if(i.isFunction(g)){var k=this;if(d===undefined)g(k,b,c);else if(f===undefined)this.get(d).each(function(){g(k,this,d,b,c)});else{a=function(m){k.get(m).each(function(){g(k,
this,m,b,c)})};for(var l=d;l<=f;l++)l!==null&&!(l>=j&&l<=e)&&a(l)}}}},create:function(a){return this.format("<li></li>",a)},format:function(a,c){a=i(a);for(var b=a.get(0).className.split(" "),d=0;d<b.length;d++)b[d].indexOf("jcarousel-")!=-1&&a.removeClass(b[d]);a.addClass(this.className("jcarousel-item")).addClass(this.className("jcarousel-item-"+c)).css({"float":this.options.rtl?"right":"left","list-style":"none"}).attr("jcarouselindex",c);return a},className:function(a){return a+" "+a+(!this.options.vertical?
"-horizontal":"-vertical")},dimension:function(a,c){var b=a.jquery!==undefined?a[0]:a,d=!this.options.vertical?(b.offsetWidth||h.intval(this.options.itemFallbackDimension))+h.margin(b,"marginLeft")+h.margin(b,"marginRight"):(b.offsetHeight||h.intval(this.options.itemFallbackDimension))+h.margin(b,"marginTop")+h.margin(b,"marginBottom");if(c==null||d==c)return d;d=!this.options.vertical?c-h.margin(b,"marginLeft")-h.margin(b,"marginRight"):c-h.margin(b,"marginTop")-h.margin(b,"marginBottom");i(b).css(this.wh,
d+"px");return this.dimension(b)},clipping:function(){return!this.options.vertical?this.clip[0].offsetWidth-h.intval(this.clip.css("borderLeftWidth"))-h.intval(this.clip.css("borderRightWidth")):this.clip[0].offsetHeight-h.intval(this.clip.css("borderTopWidth"))-h.intval(this.clip.css("borderBottomWidth"))},index:function(a,c){if(c==null)c=this.options.size;return Math.round(((a-1)/c-Math.floor((a-1)/c))*c)+1}});h.extend({defaults:function(a){return i.extend(q,a||{})},margin:function(a,c){if(!a)return 0;
var b=a.jquery!==undefined?a[0]:a;if(c=="marginRight"&&i.browser.safari){var d={display:"block","float":"none",width:"auto"},f,j;i.swap(b,d,function(){f=b.offsetWidth});d.marginRight=0;i.swap(b,d,function(){j=b.offsetWidth});return j-f}return h.intval(i.css(b,c))},intval:function(a){a=parseInt(a,10);return isNaN(a)?0:a}});i.fn.jcarousel=function(a){if(typeof a=="string"){var c=i(this).data("jcarousel"),b=Array.prototype.slice.call(arguments,1);return c[a].apply(c,b)}else return this.each(function(){i(this).data("jcarousel",
new h(this,a))})}})(jQuery);(function($){var JFMFS=function(element,options){var elem=$(element),obj=this,uninitializedImagefriendElements=[],keyUpTimer,friends_per_row=0,friend_height_px=0,first_element_offset_px;var settings=$.extend({max_selected:-1,max_selected_message:"{0} of {1} selected",pre_selected_friends:[],exclude_friends:[],friend_fields:"id,name",sorter:function(a,b){var x=a.name.toLowerCase();var y=b.name.toLowerCase();return x<y?-1:x>y?1:0},labels:{selected:"Selected",filter_default:"Start typing a name",filter_title:"Find Friends:",
all:"All",max_selected_message:"{0} of {1} selected"}},options||{});var lastSelected;var arrayToObjectGraph=function(a){var o={};for(var i=0,l=a.length;i<l;i++)o[a[i]]="";return o};elem.html("<div id='jfmfs-friend-selector'>"+"    <div id='jfmfs-inner-header'>"+"        <span class='jfmfs-title'>"+settings.labels.filter_title+" </span><input type='text' id='jfmfs-friend-filter-text' value='"+settings.labels.filter_default+"'/>"+"        <div class='jfmfs-title-links'><a class='filter-link selected' id='jfmfs-filter-all' href='#'>"+
settings.labels.all+"</a>"+"        <a class='filter-link' id='jfmfs-filter-selected' href='#'>"+settings.labels.selected+" (<span id='jfmfs-selected-count'>0</span>)</a>"+(settings.max_selected>0?"<div id='jfmfs-max-selected-wrapper'></div>":"")+"    </div></div>"+"    <div id='jfmfs-friend-container'></div>"+"</div>");var friend_container=$("#jfmfs-friend-container"),container=$("#jfmfs-friend-selector"),preselected_friends_graph=arrayToObjectGraph(settings.pre_selected_friends),excluded_friends_graph=
arrayToObjectGraph(settings.exclude_friends),all_friends;FB.api("/me/friends?fields="+settings.friend_fields,function(response){var sortedFriendData=response.data.sort(settings.sorter),preselectedFriends={},buffer=[],selectedClass="";$.each(sortedFriendData,function(i,friend){if(!(friend.id in excluded_friends_graph)){selectedClass=friend.id in preselected_friends_graph?"selected":"";buffer.push("<div class='jfmfs-friend "+selectedClass+" ' id='"+friend.id+"'><img/><div class='friend-name'>"+friend.name+
"</div></div>")}});friend_container.append(buffer.join(""));uninitializedImagefriendElements=$(".jfmfs-friend",elem);uninitializedImagefriendElements.bind("inview",function(event,visible){if($(this).attr("src")===undefined)$("img",$(this)).attr("src","//graph.facebook.com/"+this.id+"/picture");$(this).unbind("inview")});init()});this.getSelectedIds=function(){var ids=[];$.each(elem.find(".jfmfs-friend.selected"),function(i,friend){ids.push($(friend).attr("id"))});return ids};this.getSelectedIdsAndNames=
function(){var selected=[];$.each(elem.find(".jfmfs-friend.selected"),function(i,friend){selected.push({id:$(friend).attr("id"),name:$(friend).find(".friend-name").text()})});return selected};this.clearSelected=function(){all_friends.removeClass("selected")};var init=function(){all_friends=$(".jfmfs-friend",elem);first_element_offset_px=all_friends.first().offset().top;for(var i=0,l=all_friends.length;i<l;i++)if($(all_friends[i]).offset().top===first_element_offset_px)friends_per_row++;else{friend_height_px=
$(all_friends[i]).offset().top-first_element_offset_px;break}elem.delegate(".jfmfs-friend","click",function(event){if(!$(this).hasClass("selected")&&maxSelectedEnabled()&&$(".jfmfs-friend.selected").size()>=settings.max_selected&&settings.max_selected!=1)return;if(settings.max_selected==1)elem.find(".selected").removeClass("selected");$(this).toggleClass("selected");$(this).removeClass("hover");if($(this).hasClass("selected"))if(!lastSelected)lastSelected=$(this);else if(event.shiftKey){var selIndex=
$(this).index();var lastIndex=lastSelected.index();var end=Math.max(selIndex,lastIndex);var start=Math.min(selIndex,lastIndex);for(var i=start;i<=end;i++){var aFriend=$(all_friends[i]);if(!aFriend.hasClass("hide-non-selected")&&!aFriend.hasClass("hide-filtered"))if(maxSelectedEnabled()&&$(".jfmfs-friend.selected").size()<settings.max_selected)$(all_friends[i]).addClass("selected")}}lastSelected=$(this);updateSelectedCount();if(maxSelectedEnabled())updateMaxSelectedMessage();elem.trigger("jfmfs.selection.changed",
[obj.getSelectedIdsAndNames()])});$("#jfmfs-filter-selected").click(function(event){event.preventDefault();all_friends.not(".selected").addClass("hide-non-selected");$(".filter-link").removeClass("selected");$(this).addClass("selected")});$("#jfmfs-filter-all").click(function(event){event.preventDefault();all_friends.removeClass("hide-non-selected");$(".filter-link").removeClass("selected");$(this).addClass("selected")});elem.find(".jfmfs-friend:not(.selected)").live("hover",function(ev){if(ev.type==
"mouseover")$(this).addClass("hover");if(ev.type=="mouseout")$(this).removeClass("hover")});elem.find("#jfmfs-friend-filter-text").keyup(function(){var filter=$(this).val();clearTimeout(keyUpTimer);keyUpTimer=setTimeout(function(){if(filter=="")all_friends.removeClass("hide-filtered");else{container.find(".friend-name:not(:Contains("+filter+"))").parent().addClass("hide-filtered");container.find(".friend-name:Contains("+filter+")").parent().removeClass("hide-filtered")}showImagesInViewPort()},400)}).focus(function(){if($.trim($(this).val())==
"Start typing a name")$(this).val("")}).blur(function(){if($.trim($(this).val())=="")$(this).val("Start typing a name")});elem.find(".jfmfs-button").hover(function(){$(this).addClass("jfmfs-button-hover")},function(){$(this).removeClass("jfmfs-button-hover")});var getViewportHeight=function(){var height=window.innerHeight;var mode=document.compatMode;if(mode||!$.support.boxModel)height=mode=="CSS1Compat"?document.documentElement.clientHeight:document.body.clientHeight;return height};var showImagesInViewPort=
function(){var container_height_px=friend_container.innerHeight(),scroll_top_px=friend_container.scrollTop(),container_offset_px=friend_container.offset().top,$el,top_px,elementVisitedCount=0,foundVisible=false,allVisibleFriends=$(".jfmfs-friend:not(.hide-filtered )");$.each(allVisibleFriends,function(i,$el){elementVisitedCount++;if($el!==null){$el=$(allVisibleFriends[i]);top_px=first_element_offset_px+friend_height_px*Math.ceil(elementVisitedCount/friends_per_row)-scroll_top_px-container_offset_px;
if(top_px+friend_height_px>=-10&&top_px-friend_height_px<container_height_px){$el.data("inview",true);$el.trigger("inview",[true]);foundVisible=true}else if(foundVisible)return false}})};var updateSelectedCount=function(){$("#jfmfs-selected-count").html(selectedCount())};friend_container.bind("scroll",$.debounce(250,showImagesInViewPort));updateMaxSelectedMessage();showImagesInViewPort();updateSelectedCount();elem.trigger("jfmfs.friendload.finished")};var selectedCount=function(){return $(".jfmfs-friend.selected").size()};
var maxSelectedEnabled=function(){return settings.max_selected>0};var updateMaxSelectedMessage=function(){var message=settings.labels.max_selected_message.replace("{0}",selectedCount()).replace("{1}",settings.max_selected);$("#jfmfs-max-selected-wrapper").html(message)}};$.fn.jfmfs=function(options){return this.each(function(){var element=$(this);if(element.data("jfmfs"))return;var jfmfs=new JFMFS(this,options);element.data("jfmfs",jfmfs)})};jQuery.expr[":"].Contains=function(a,i,m){return jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())>=
0}})(jQuery);if($.debounce===undefined)(function(b,c){var $=b.jQuery||b.Cowboy||(b.Cowboy={}),a;$.throttle=a=function(e,f,j,i){var h,d=0;if(typeof f!=="boolean"){i=j;j=f;f=c}function g(){var o=this,m=+new Date-d,n=arguments;function l(){d=+new Date;j.apply(o,n)}function k(){h=c}if(i&&!h)l();h&&clearTimeout(h);if(i===c&&m>e)l();else if(f!==true)h=setTimeout(i?k:l,i===c?e-m:e)}if($.guid)g.guid=j.guid=j.guid||$.guid++;return g};$.debounce=function(d,e,f){return f===c?a(d,e,false):a(d,f,e!==false)}})(this);(function($){var helper={},current,title,tID,IE=$.browser.msie&&/MSIE\s(5\.5|6\.)/.test(navigator.userAgent),track=false;$.tooltip={blocked:false,defaults:{delay:200,fade:false,showURL:false,fixPNG:true,extraClass:"",top:-80,left:-70,id:"tooltip"},block:function(){$.tooltip.blocked=!$.tooltip.blocked}};$.fn.extend({tooltip:function(settings){settings=$.extend({},$.tooltip.defaults,settings);createHelper(settings);return this.each(function(){$.data(this,"tooltip",settings);this.tOpacity=helper.parent.css("opacity");
this.tooltipText=this.title;$(this).removeAttr("title");this.alt=""}).mouseover(save).mouseout(hide).click(hide)},fixPNG:IE?function(){return this.each(function(){var image=$(this).css("backgroundImage");if(image.match(/^url\(["']?(.*\.png)["']?\)$/i)){image=RegExp.$1;$(this).css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+image+"')"}).each(function(){var position=$(this).css("position");if(position!="absolute"&&position!=
"relative")$(this).css("position","relative")})}})}:function(){return this},unfixPNG:IE?function(){return this.each(function(){$(this).css({filter:"",backgroundImage:""})})}:function(){return this},hideWhenEmpty:function(){return this.each(function(){$(this)[$(this).html()?"show":"hide"]()})},url:function(){return this.attr("href")||this.attr("src")}});function createHelper(settings){if(helper.parent)return;helper.parent=$('<div id="'+settings.id+'"><div class="tooltipTop"></div><div class="intro"></div><div class="body"></div><div class="url"></div><div class="tooltipBottom"></div></div>').appendTo(document.body).hide();
if($.fn.bgiframe)helper.parent.bgiframe();helper.title=$("div.intro",helper.parent);helper.body=$("div.body",helper.parent);helper.url=$("div.url",helper.parent)}function settings(element){return $.data(element,"tooltip")}function handle(event){if(settings(this).delay)tID=setTimeout(show,settings(this).delay);else show();track=!!settings(this).track;$(document.body).bind("mousemove",update);update(event)}function save(){if($.tooltip.blocked||this==current||!this.tooltipText&&!settings(this).bodyHandler)return;
current=this;title=this.tooltipText;if(settings(this).bodyHandler){helper.title.hide();var bodyContent=settings(this).bodyHandler.call(this);if(bodyContent.nodeType||bodyContent.jquery)helper.body.empty().append(bodyContent);else helper.body.html(bodyContent);helper.body.show()}else if(settings(this).showBody){var parts=title.split(settings(this).showBody);if(parts.length>1)helper.title.html(parts.shift()).show();helper.body.empty();for(var i=0,part;part=parts[i];i++){if(i>0)helper.body.append("<br/>");
helper.body.append(part)}helper.body.hideWhenEmpty()}else{helper.title.html(title).show();helper.body.hide()}if(settings(this).showURL&&$(this).url())helper.url.html($(this).url().replace("http://","")).show();else helper.url.hide();helper.parent.addClass(settings(this).extraClass);if(settings(this).fixPNG)helper.parent.fixPNG();handle.apply(this,arguments)}function show(){tID=null;if((!IE||!$.fn.bgiframe)&&settings(current).fade)if(helper.parent.is(":animated"))helper.parent.stop().show().fadeTo(settings(current).fade,
current.tOpacity);else helper.parent.is(":visible")?helper.parent.fadeTo(settings(current).fade,current.tOpacity):helper.parent.fadeIn(settings(current).fade);else helper.parent.show();update()}function update(event){if($.tooltip.blocked)return;if(event&&event.target.tagName=="OPTION")return;if(!track&&helper.parent.is(":visible"))$(document.body).unbind("mousemove",update);if(current==null){$(document.body).unbind("mousemove",update);return}helper.parent.removeClass("viewport-right").removeClass("viewport-bottom");
var left=helper.parent[0].offsetLeft;var top=helper.parent[0].offsetTop;left=$(current).offset().left-settings(current).left;top=$(current).offset().top+settings(current).top;helper.parent.css({left:left+"px"}).addClass("viewport-right");helper.parent.css({top:top+"px"}).addClass("viewport-bottom")}function hide(event){if($.tooltip.blocked)return;if(tID)clearTimeout(tID);current=null;var tsettings=settings(this);function complete(){helper.parent.removeClass(tsettings.extraClass).hide().css("opacity",
"")}if((!IE||!$.fn.bgiframe)&&tsettings.fade)if(helper.parent.is(":animated"))helper.parent.stop().fadeTo(tsettings.fade,0,complete);else helper.parent.stop().fadeOut(tsettings.fade,complete);else complete();if(settings(this).fixPNG)helper.parent.unfixPNG();if(title!=null)helper.title.html(title).hide()}})(jQuery);(function(b,a,c){b.fn.jScrollPane=function(f){function d(E,P){var aA,R=this,Z,al,w,an,U,aa,z,r,aB,aG,aw,j,J,i,k,ab,V,ar,Y,u,B,at,ag,ao,H,m,av,az,y,ax,aJ,g,M,ak=true,Q=true,aI=false,l=false,aq=E.clone(false,false).empty(),ad=b.fn.mwheelIntent?"mwheelIntent.jsp":"mousewheel.jsp";aJ=E.css("paddingTop")+" "+E.css("paddingRight")+" "+E.css("paddingBottom")+" "+E.css("paddingLeft");g=(parseInt(E.css("paddingLeft"),10)||0)+(parseInt(E.css("paddingRight"),10)||0);function au(aS){var aN,aP,aO,aL,aK,aR,aQ=
false,aM=false;aA=aS;if(Z===c){aK=E.scrollTop();aR=E.scrollLeft();E.css({overflow:"hidden",padding:0});al=E.innerWidth()+g;w=E.innerHeight();E.width(al);Z=b('<div class="jspPane" />').css("padding",aJ).append(E.children());an=b('<div class="jspContainer" />').css({width:al+"px",height:w+"px"}).append(Z).appendTo(E)}else{E.css("width","");aQ=aA.stickToBottom&&L();aM=aA.stickToRight&&C();aL=E.innerWidth()+g!=al||E.outerHeight()!=w;if(aL){al=E.innerWidth()+g;w=E.innerHeight();an.css({width:al+"px",height:w+
"px"})}if(!aL&&M==U&&Z.outerHeight()==aa){E.width(al);return}M=U;Z.css("width","");E.width(al);an.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end()}Z.css("overflow","auto");if(aS.contentWidth)U=aS.contentWidth;else U=Z[0].scrollWidth;aa=Z[0].scrollHeight;Z.css("overflow","");z=U/al;r=aa/w;aB=r>1;aG=z>1;if(!(aG||aB)){E.removeClass("jspScrollable");Z.css({top:0,width:an.width()-g});o();F();S();x();aj()}else{E.addClass("jspScrollable");aN=aA.maintainPosition&&(J||ab);if(aN){aP=aE();aO=aC()}aH();
A();G();if(aN){O(aM?U-al:aP,false);N(aQ?aa-w:aO,false)}K();ah();ap();if(aA.enableKeyboardNavigation)T();if(aA.clickOnTrack)q();D();if(aA.hijackInternalLinks)n()}if(aA.autoReinitialise&&!ax)ax=setInterval(function(){au(aA)},aA.autoReinitialiseDelay);else if(!aA.autoReinitialise&&ax)clearInterval(ax);aK&&E.scrollTop(0)&&N(aK,false);aR&&E.scrollLeft(0)&&O(aR,false);E.trigger("jsp-initialised",[aG||aB])}function aH(){if(aB){an.append(b('<div class="jspVerticalBar" />').append(b('<div class="jspCap jspCapTop" />'),
b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragTop" />'),b('<div class="jspDragBottom" />'))),b('<div class="jspCap jspCapBottom" />')));V=an.find(">.jspVerticalBar");ar=V.find(">.jspTrack");aw=ar.find(">.jspDrag");if(aA.showArrows){at=b('<a class="jspArrow jspArrowUp" />').bind("mousedown.jsp",aF(0,-1)).bind("click.jsp",aD);ag=b('<a class="jspArrow jspArrowDown" />').bind("mousedown.jsp",aF(0,1)).bind("click.jsp",aD);if(aA.arrowScrollOnHover){at.bind("mouseover.jsp",
aF(0,-1,at));ag.bind("mouseover.jsp",aF(0,1,ag))}am(ar,aA.verticalArrowPositions,at,ag)}u=w;an.find(">.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow").each(function(){u-=b(this).outerHeight()});aw.hover(function(){aw.addClass("jspHover")},function(){aw.removeClass("jspHover")}).bind("mousedown.jsp",function(aK){b("html").bind("dragstart.jsp selectstart.jsp",aD);aw.addClass("jspActive");var s=aK.pageY-aw.position().top;b("html").bind("mousemove.jsp",function(aL){W(aL.pageY-s,false)}).bind("mouseup.jsp mouseleave.jsp",
ay);return false});p()}}function p(){ar.height(u+"px");J=0;Y=aA.verticalGutter+ar.outerWidth();Z.width(al-Y-g);try{if(V.position().left===0)Z.css("margin-left",Y+"px")}catch(s){}}function A(){if(aG){an.append(b('<div class="jspHorizontalBar" />').append(b('<div class="jspCap jspCapLeft" />'),b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragLeft" />'),b('<div class="jspDragRight" />'))),b('<div class="jspCap jspCapRight" />')));ao=an.find(">.jspHorizontalBar");
H=ao.find(">.jspTrack");i=H.find(">.jspDrag");if(aA.showArrows){az=b('<a class="jspArrow jspArrowLeft" />').bind("mousedown.jsp",aF(-1,0)).bind("click.jsp",aD);y=b('<a class="jspArrow jspArrowRight" />').bind("mousedown.jsp",aF(1,0)).bind("click.jsp",aD);if(aA.arrowScrollOnHover){az.bind("mouseover.jsp",aF(-1,0,az));y.bind("mouseover.jsp",aF(1,0,y))}am(H,aA.horizontalArrowPositions,az,y)}i.hover(function(){i.addClass("jspHover")},function(){i.removeClass("jspHover")}).bind("mousedown.jsp",function(aK){b("html").bind("dragstart.jsp selectstart.jsp",
aD);i.addClass("jspActive");var s=aK.pageX-i.position().left;b("html").bind("mousemove.jsp",function(aL){X(aL.pageX-s,false)}).bind("mouseup.jsp mouseleave.jsp",ay);return false});m=an.innerWidth();ai()}}function ai(){an.find(">.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function(){m-=b(this).outerWidth()});H.width(m+"px");ab=0}function G(){if(aG&&aB){var aK=H.outerHeight(),s=ar.outerWidth();u-=aK;b(ao).find(">.jspCap:visible,>.jspArrow").each(function(){m+=b(this).outerWidth()});
m-=s;w-=s;al-=aK;H.parent().append(b('<div class="jspCorner" />').css("width",aK+"px"));p();ai()}if(aG)Z.width(an.outerWidth()-g+"px");aa=Z.outerHeight();r=aa/w;if(aG){av=Math.ceil(1/z*m);if(av>aA.horizontalDragMaxWidth)av=aA.horizontalDragMaxWidth;else if(av<aA.horizontalDragMinWidth)av=aA.horizontalDragMinWidth;i.width(av+"px");k=m-av;af(ab)}if(aB){B=Math.ceil(1/r*u);if(B>aA.verticalDragMaxHeight)B=aA.verticalDragMaxHeight;else if(B<aA.verticalDragMinHeight)B=aA.verticalDragMinHeight;aw.height(B+
"px");j=u-B;ae(J)}}function am(aL,aN,aK,s){var aP="before",aM="after",aO;if(aN=="os")aN=/Mac/.test(navigator.platform)?"after":"split";if(aN==aP)aM=aN;else if(aN==aM){aP=aN;aO=aK;aK=s;s=aO}aL[aP](aK)[aM](s)}function aF(aK,s,aL){return function(){I(aK,s,this,aL);this.blur();return false}}function I(aN,aM,aQ,aP){aQ=b(aQ).addClass("jspActive");var aO,aL,aK=true,s=function(){if(aN!==0)R.scrollByX(aN*aA.arrowButtonSpeed);if(aM!==0)R.scrollByY(aM*aA.arrowButtonSpeed);aL=setTimeout(s,aK?aA.initialDelay:
aA.arrowRepeatFreq);aK=false};s();aO=aP?"mouseout.jsp":"mouseup.jsp";aP=aP||b("html");aP.bind(aO,function(){aQ.removeClass("jspActive");aL&&clearTimeout(aL);aL=null;aP.unbind(aO)})}function q(){x();if(aB)ar.bind("mousedown.jsp",function(aP){if(aP.originalTarget===c||aP.originalTarget==aP.currentTarget){var aN=b(this),aQ=aN.offset(),aO=aP.pageY-aQ.top-J,aL,aK=true,s=function(){var aT=aN.offset(),aU=aP.pageY-aT.top-B/2,aR=w*aA.scrollPagePercent,aS=j*aR/(aa-w);if(aO<0)if(J-aS>aU)R.scrollByY(-aR);else W(aU);
else if(aO>0)if(J+aS<aU)R.scrollByY(aR);else W(aU);else{aM();return}aL=setTimeout(s,aK?aA.initialDelay:aA.trackClickRepeatFreq);aK=false},aM=function(){aL&&clearTimeout(aL);aL=null;b(document).unbind("mouseup.jsp",aM)};s();b(document).bind("mouseup.jsp",aM);return false}});if(aG)H.bind("mousedown.jsp",function(aP){if(aP.originalTarget===c||aP.originalTarget==aP.currentTarget){var aN=b(this),aQ=aN.offset(),aO=aP.pageX-aQ.left-ab,aL,aK=true,s=function(){var aT=aN.offset(),aU=aP.pageX-aT.left-av/2,aR=
al*aA.scrollPagePercent,aS=k*aR/(U-al);if(aO<0)if(ab-aS>aU)R.scrollByX(-aR);else X(aU);else if(aO>0)if(ab+aS<aU)R.scrollByX(aR);else X(aU);else{aM();return}aL=setTimeout(s,aK?aA.initialDelay:aA.trackClickRepeatFreq);aK=false},aM=function(){aL&&clearTimeout(aL);aL=null;b(document).unbind("mouseup.jsp",aM)};s();b(document).bind("mouseup.jsp",aM);return false}})}function x(){if(H)H.unbind("mousedown.jsp");if(ar)ar.unbind("mousedown.jsp")}function ay(){b("html").unbind("dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp");
if(aw)aw.removeClass("jspActive");if(i)i.removeClass("jspActive")}function W(s,aK){if(!aB)return;if(s<0)s=0;else if(s>j)s=j;if(aK===c)aK=aA.animateScroll;if(aK)R.animate(aw,"top",s,ae);else{aw.css("top",s);ae(s)}}function ae(aK){if(aK===c)aK=aw.position().top;an.scrollTop(0);J=aK;var aN=J===0,aL=J==j,aM=aK/j,s=-aM*(aa-w);if(ak!=aN||aI!=aL){ak=aN;aI=aL;E.trigger("jsp-arrow-change",[ak,aI,Q,l])}v(aN,aL);Z.css("top",s);E.trigger("jsp-scroll-y",[-s,aN,aL]).trigger("scroll")}function X(aK,s){if(!aG)return;
if(aK<0)aK=0;else if(aK>k)aK=k;if(s===c)s=aA.animateScroll;if(s)R.animate(i,"left",aK,af);else{i.css("left",aK);af(aK)}}function af(aK){if(aK===c)aK=i.position().left;an.scrollTop(0);ab=aK;var aN=ab===0,aM=ab==k,aL=aK/k,s=-aL*(U-al);if(Q!=aN||l!=aM){Q=aN;l=aM;E.trigger("jsp-arrow-change",[ak,aI,Q,l])}t(aN,aM);Z.css("left",s);E.trigger("jsp-scroll-x",[-s,aN,aM]).trigger("scroll")}function v(aK,s){if(aA.showArrows){at[aK?"addClass":"removeClass"]("jspDisabled");ag[s?"addClass":"removeClass"]("jspDisabled")}}
function t(aK,s){if(aA.showArrows){az[aK?"addClass":"removeClass"]("jspDisabled");y[s?"addClass":"removeClass"]("jspDisabled")}}function N(s,aK){var aL=s/(aa-w);W(aL*j,aK)}function O(aK,s){var aL=aK/(U-al);X(aL*k,s)}function ac(aX,aS,aL){var aP,aM,aN,s=0,aW=0,aK,aR,aQ,aU,aT,aV;try{aP=b(aX)}catch(aO){return}aM=aP.outerHeight();aN=aP.outerWidth();an.scrollTop(0);an.scrollLeft(0);while(!aP.is(".jspPane")){s+=aP.position().top;aW+=aP.position().left;aP=aP.offsetParent();if(/^body|html$/i.test(aP[0].nodeName))return}aK=
aC();aQ=aK+w;if(s<aK||aS)aT=s-aA.verticalGutter;else if(s+aM>aQ)aT=s-w+aM+aA.verticalGutter;if(aT)N(aT,aL);aR=aE();aU=aR+al;if(aW<aR||aS)aV=aW-aA.horizontalGutter;else if(aW+aN>aU)aV=aW-al+aN+aA.horizontalGutter;if(aV)O(aV,aL)}function aE(){return-Z.position().left}function aC(){return-Z.position().top}function L(){var s=aa-w;return s>20&&s-aC()<10}function C(){var s=U-al;return s>20&&s-aE()<10}function ah(){an.unbind(ad).bind(ad,function(aN,aO,aM,aK){var aL=ab,s=J;R.scrollBy(aM*aA.mouseWheelSpeed,
-aK*aA.mouseWheelSpeed,false);return aL==ab&&s==J})}function o(){an.unbind(ad)}function aD(){return false}function K(){Z.find(":input,a").unbind("focus.jsp").bind("focus.jsp",function(s){ac(s.target,false)})}function F(){Z.find(":input,a").unbind("focus.jsp")}function T(){var s,aK,aM=[];aG&&aM.push(ao[0]);aB&&aM.push(V[0]);Z.focus(function(){E.focus()});E.attr("tabindex",0).unbind("keydown.jsp keypress.jsp").bind("keydown.jsp",function(aP){if(aP.target!==this&&!(aM.length&&b(aP.target).closest(aM).length))return;
var aO=ab,aN=J;switch(aP.keyCode){case 40:case 38:case 34:case 32:case 33:case 39:case 37:s=aP.keyCode;aL();break;case 35:N(aa-w);s=null;break;case 36:N(0);s=null;break}aK=aP.keyCode==s&&aO!=ab||aN!=J;return!aK}).bind("keypress.jsp",function(aN){if(aN.keyCode==s)aL();return!aK});if(aA.hideFocus){E.css("outline","none");if("hideFocus"in an[0])E.attr("hideFocus",true)}else{E.css("outline","");if("hideFocus"in an[0])E.attr("hideFocus",false)}function aL(){var aO=ab,aN=J;switch(s){case 40:R.scrollByY(aA.keyboardSpeed,
false);break;case 38:R.scrollByY(-aA.keyboardSpeed,false);break;case 34:case 32:R.scrollByY(w*aA.scrollPagePercent,false);break;case 33:R.scrollByY(-w*aA.scrollPagePercent,false);break;case 39:R.scrollByX(aA.keyboardSpeed,false);break;case 37:R.scrollByX(-aA.keyboardSpeed,false);break}aK=aO!=ab||aN!=J;return aK}}function S(){E.attr("tabindex","-1").removeAttr("tabindex").unbind("keydown.jsp keypress.jsp")}function D(){if(location.hash&&location.hash.length>1){var aL,aK;try{aL=b(location.hash)}catch(s){return}if(aL.length&&
Z.find(location.hash))if(an.scrollTop()===0)aK=setInterval(function(){if(an.scrollTop()>0){ac(location.hash,true);b(document).scrollTop(an.position().top);clearInterval(aK)}},50);else{ac(location.hash,true);b(document).scrollTop(an.position().top)}}}function aj(){b("a.jspHijack").unbind("click.jsp-hijack").removeClass("jspHijack")}function n(){aj();b("a[href^=#]").addClass("jspHijack").bind("click.jsp-hijack",function(){var s=this.href.split("#"),aK;if(s.length>1){aK=s[1];if(aK.length>0&&Z.find("#"+
aK).length>0){ac("#"+aK,true);return false}}})}function ap(){var aL,aK,aN,aM,aO,s=false;an.unbind("touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick").bind("touchstart.jsp",function(aP){var aQ=aP.originalEvent.touches[0];aL=aE();aK=aC();aN=aQ.pageX;aM=aQ.pageY;aO=false;s=true}).bind("touchmove.jsp",function(aS){if(!s)return;var aR=aS.originalEvent.touches[0],aQ=ab,aP=J;R.scrollTo(aL+aN-aR.pageX,aK+aM-aR.pageY);aO=aO||Math.abs(aN-aR.pageX)>5||Math.abs(aM-aR.pageY)>5;return aQ==ab&&aP==
J}).bind("touchend.jsp",function(aP){s=false}).bind("click.jsp-touchclick",function(aP){if(aO){aO=false;return false}})}function h(){var s=aC(),aK=aE();E.removeClass("jspScrollable").unbind(".jsp");E.replaceWith(aq.append(Z.children()));aq.scrollTop(s);aq.scrollLeft(aK)}b.extend(R,{reinitialise:function(aK){aK=b.extend({},aA,aK);au(aK)},scrollToElement:function(aL,aK,s){ac(aL,aK,s)},scrollTo:function(aL,s,aK){O(aL,aK);N(s,aK)},scrollToX:function(aK,s){O(aK,s)},scrollToY:function(s,aK){N(s,aK)},scrollToPercentX:function(aK,
s){O(aK*(U-al),s)},scrollToPercentY:function(aK,s){N(aK*(aa-w),s)},scrollBy:function(aK,s,aL){R.scrollByX(aK,aL);R.scrollByY(s,aL)},scrollByX:function(s,aL){var aK=aE()+s,aM=aK/(U-al);X(aM*k,aL)},scrollByY:function(s,aL){var aK=aC()+s,aM=aK/(aa-w);W(aM*j,aL)},positionDragX:function(s,aK){X(s,aK)},positionDragY:function(aK,s){W(aK,s)},animate:function(aK,aN,s,aM){var aL={};aL[aN]=s;aK.animate(aL,{duration:aA.animateDuration,ease:aA.animateEase,queue:false,step:aM})},getContentPositionX:function(){return aE()},
getContentPositionY:function(){return aC()},getContentWidth:function(){return U},getContentHeight:function(){return aa},getPercentScrolledX:function(){return aE()/(U-al)},getPercentScrolledY:function(){return aC()/(aa-w)},getIsScrollableH:function(){return aG},getIsScrollableV:function(){return aB},getContentPane:function(){return Z},scrollToBottom:function(s){W(j,s)},hijackInternalLinks:function(){n()},destroy:function(){h()}});au(P)}f=b.extend({},b.fn.jScrollPane.defaults,f);b.each(["mouseWheelSpeed",
"arrowButtonSpeed","trackClickSpeed","keyboardSpeed"],function(){f[this]=f[this]||f.speed});var e;this.each(function(){var g=b(this),h=g.data("jsp");if(h)h.reinitialise(f);else{h=new d(g,f);g.data("jsp",h)}e=e?e.add(g):g});return e};b.fn.jScrollPane.defaults={showArrows:false,maintainPosition:true,stickToBottom:false,stickToRight:false,clickOnTrack:true,autoReinitialise:false,autoReinitialiseDelay:500,verticalDragMinHeight:0,verticalDragMaxHeight:99999,horizontalDragMinWidth:0,horizontalDragMaxWidth:99999,
contentWidth:c,animateScroll:false,animateDuration:300,animateEase:"linear",hijackInternalLinks:false,verticalGutter:4,horizontalGutter:4,mouseWheelSpeed:0,arrowButtonSpeed:0,arrowRepeatFreq:50,arrowScrollOnHover:false,trackClickSpeed:0,trackClickRepeatFreq:70,verticalArrowPositions:"split",horizontalArrowPositions:"split",enableKeyboardNavigation:true,hideFocus:false,keyboardSpeed:0,initialDelay:300,speed:30,scrollPagePercent:0.8}})(jQuery,this);(function($){var types=["DOMMouseScroll","mousewheel"];$.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var i=types.length;i;)this.addEventListener(types[--i],handler,false);else this.onmousewheel=handler},teardown:function(){if(this.removeEventListener)for(var i=types.length;i;)this.removeEventListener(types[--i],handler,false);else this.onmousewheel=null}};$.fn.extend({mousewheel:function(fn){return fn?this.bind("mousewheel",fn):this.trigger("mousewheel")},unmousewheel:function(fn){return this.unbind("mousewheel",
fn)}});function handler(event){var orgEvent=event||window.event,args=[].slice.call(arguments,1),delta=0,returnValue=true,deltaX=0,deltaY=0;event=$.event.fix(orgEvent);event.type="mousewheel";if(event.wheelDelta)delta=event.wheelDelta/120;if(event.detail)delta=-event.detail/3;deltaY=delta;if(orgEvent.axis!==undefined&&orgEvent.axis===orgEvent.HORIZONTAL_AXIS){deltaY=0;deltaX=-1*delta}if(orgEvent.wheelDeltaY!==undefined)deltaY=orgEvent.wheelDeltaY/120;if(orgEvent.wheelDeltaX!==undefined)deltaX=-1*orgEvent.wheelDeltaX/
120;args.unshift(event,delta,deltaX,deltaY);return $.event.handle.apply(this,args)}})(jQuery);(function($){if($.fn.dotdotdot)return;$.fn.dotdotdot=function(o){if(this.length==0)return this;if(this.length>1)return this.each(function(){$(this).dotdotdot(o)});var $dot=this,$tt0=this[0];$dot.bind_events=function(){$dot.bind("update.dot"+serial,function(e,stop){e.stopPropagation();var wrpHeight=getTrueInnerHeight($dot);opts.maxHeight=typeof opts.height=="number"?opts.height:wrpHeight;$inr.empty();$inr.append(orgContent.clone(true));var after=false;if(opts.afterElement){after=opts.afterElement.clone(true);
opts.afterElement.remove()}if(test($inr,opts))ellipsis($inr,$inr,opts,after)});$dot.bind("destroy.dot"+serial,function(e){e.stopPropagation();$dot.unwatch();$dot.unbind_events();$dot.empty();$dot.append(orgContent)})};$dot.unbind_events=function(){$dot.unbind(".dot"+serial)};$dot.watch=function(){$dot.unwatch();if(opts.watch=="window")$(window).bind("resize.dot"+serial,function(){if(watchInt)clearInterval(watchInt);watchInt=setTimeout(function(){$dot.trigger("update")},10)});else{watchOrg=getSizes($dot);
watchInt=setInterval(function(){var watchNew=getSizes($dot);if(watchOrg.width!=watchNew.width||watchOrg.height!=watchNew.height){$dot.trigger("update");watchOrg=getSizes($dot)}},100)}};$dot.unwatch=function(){if(watchInt)clearInterval(watchInt)};if($dot.find("> .dotdotdot").length>0)$dot.trigger("destroy");var opts=$.extend(true,{},$.fn.dotdotdot.defaults,o),serial=$.fn.dotdotdot.serial++,orgContent=$dot.contents(),watchOrg={},watchInt=null,$inr=$dot.wrapInner("<"+opts.wrapper+' class="dotdotdot" />').find("> .dotdotdot");
opts.afterElement=getElement(opts.after,$inr);$dot.bind_events();if(opts.watch)$dot.watch();$dot.trigger("update");return $dot};$.fn.dotdotdot.serial=0;$.fn.dotdotdot.defaults={wrapper:"div",ellipsis:"... ",wrap:"word",after:null,height:null,watch:false,debug:false};function ellipsis($elem,$i,o,after){var $elements=$elem.contents(),isFilled=false;$elem.empty();for(var a=0,l=$elements.length;a<l;a++){if(isFilled)break;var e=$elements[a],$e=$(e);if(typeof e=="undefined")continue;$elem.append($e);if(after)$elem.append(after);
if(e.nodeType==3){if(test($i,o))isFilled=ellipsisElement($e,$i,o)}else isFilled=ellipsis($e,$i,o,after);if(!isFilled)if(after)after.remove()}return isFilled}function ellipsisElement($e,$i,o){var isFilled=false,e=$e[0];if(typeof e=="undefined")return false;var seporator=o.wrap=="letter"?"":" ",textArr=getTextContent(e).split(seporator);setTextContent(e,textArr.join(seporator)+o.ellipsis);for(var a=textArr.length-1;a>=0;a--)if(test($i,o))setTextContent(e,getTextContent(e).substring(0,getTextContent(e).length-
(textArr[a].length+seporator.length+o.ellipsis.length))+o.ellipsis);else{isFilled=true;break}if(!isFilled){var $w=$e.parent();$e.remove();isFilled=ellipsisElement($w.contents().last(),$i,o)}return isFilled}function test($i,o){return $i.innerHeight()>o.maxHeight}function getSizes($d){return{width:$d.innerWidth(),height:$d.innerHeight()}}function setTextContent(e,content){if(e.innerText)e.innerText=content;else if(e.nodeValue)e.nodeValue=content;else if(e.textContent)e.textContent=content}function getTextContent(e){if(e.innerText)return e.innerText;
else if(e.nodeValue)return e.nodeValue;else if(e.textContent)return e.textContent;else return""}function getElement(e,$i){if(typeof e=="undefined")return false;if(!e)return false;if(typeof e=="string"){e=$(e,$i);return e.length?e:false}if(typeof e=="object")return typeof e.jquery=="undefined"?false:e;return false}function getTrueInnerHeight($el){var h=$el.innerHeight(),a=["paddingTop","paddingBottom"];for(z=0,l=a.length;z<l;z++){var m=parseInt($el.css(a[z]));if(isNaN(m))m=0;h-=m}return h}function debug(d,
m){if(!d)return false;if(typeof m=="string")m="dotdotdot: "+m;else m=["dotdotdot:",m];if(window.console&&window.console.log)window.console.log(m);return false}})(jQuery);window.onload=init;var onLoads=new Array;function init(){for(var i=0;i<onLoads.length;i++)eval(onLoads[i])}function addOnLoad(func){onLoads[onLoads.length]=func}function validatelimit(obj,length){if(this.id)obj=this;if(obj.value.length>length){obj.value=obj.value.substring(length,0);return false}else return true}
function trackOrder(url,strInvoiceNo){if(strInvoiceNo=="")return false;window.open(url+strInvoiceNo,"track_order","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=600,height=500");return true}
function printContent(contentId,width,height){var popup=window.open("","Print","width="+width+",height="+height+",top=200,left=250,toolbars=no,scrollbars=yes,status=no,resizable=no");popup.document.body.innerHTML=$("#"+contentId).html();popup.document.close();popup.print();popup.close()}
function showContentInPopup(contentId,width,height){var popup=window.open("","Print","width="+width+",height="+height+",top=200,left=250,toolbars=no,scrollbars=yes,status=no,resizable=no");popup.document.body.innerHTML=$("#"+contentId).html()}
function popupContent(url,width,height){var popup=window.open("","popup","width="+width+",height="+height+",top=200,left=250,toolbars=no,scrollbars=yes,status=no,resizable=yes,location=no");var result;$.ajax({url:url,type:"GET",processData:false,dataType:"html",timeout:1E4,success:function(response){result=response},error:function(){alert("error!");return},async:false});popup.document.write("<html><head><title>Ellos</title></head><body>"+result+"</body></html>")}
function registerForNewsletter(email){var result=false;var url="/Services/Customer.svc/RegisterForNewsLetter/"+email+"/json";$.ajax({url:url,type:"GET",processData:false,timeout:1E4,success:function(response){result=response=="true"},error:function(request,status,errorThrown){result=false},async:false});return result}
function ResetScrollPosition(){var scrollX=document.getElementById("__SCROLLPOSITIONX");var scrollY=document.getElementById("__SCROLLPOSITIONY");if(scrollX&&scrollY){scrollX.value=0;scrollY.value=0}};if(typeof deconcept=="undefined")var deconcept=new Object;if(typeof deconcept.util=="undefined")deconcept.util=new Object;if(typeof deconcept.SWFObjectUtil=="undefined")deconcept.SWFObjectUtil=new Object;
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){if(!document.createElement||!document.getElementById)return;this.DETECT_KEY=_b?_b:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object;this.variables=new Object;this.attributes=new Array;if(_1)this.setAttribute("swf",_1);if(id)this.setAttribute("id",id);if(w)this.setAttribute("width",w);if(h)this.setAttribute("height",h);if(_5)this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion(this.getAttribute("version"),_7);if(c)this.addParam("bgcolor",c);var q=_8?_8:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",_7);this.setAttribute("doExpressInstall",false);var _d=_9?_9:window.location;this.setAttribute("xiRedirectUrl",_d);this.setAttribute("redirectUrl","");if(_a)this.setAttribute("redirectUrl",_a)};
deconcept.SWFObject.prototype={setAttribute:function(_e,_f){this.attributes[_e]=_f},getAttribute:function(_10){return this.attributes[_10]},addParam:function(_11,_12){this.params[_11]=_12},getParams:function(){return this.params},addVariable:function(_13,_14){this.variables[_13]=_14},getVariable:function(_15){return this.variables[_15]},getVariables:function(){return this.variables},getVariablePairs:function(){var _16=new Array;var key;var _18=this.getVariables();for(key in _18)_16.push(key+"="+_18[key]);
return _16},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall"))this.addVariable("MMplayerType","PlugIn");_19='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'"';_19+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var _1a=this.getParams();for(var key in _1a)_19+=[key]+'="'+
_1a[key]+'" ';var _1c=this.getVariablePairs().join("&");if(_1c.length>0)_19+='flashvars="'+_1c+'"';_19+="/>"}else{if(this.getAttribute("doExpressInstall"))this.addVariable("MMplayerType","ActiveX");_19='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'">';_19+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var _1d=this.getParams();for(var key in _1d)_19+='<param name="'+
key+'" value="'+_1d[key]+'" />';var _1f=this.getVariablePairs().join("&");if(_1f.length>0)_19+='<param name="flashvars" value="'+_1f+'" />';_19+="</object>"}return _19},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title)}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=typeof _20=="string"?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true}else if(this.getAttribute("redirectUrl")!="")document.location.replace(this.getAttribute("redirectUrl"));return false}};
deconcept.SWFObjectUtil.getPlayerVersion=function(_23,_24){var _25=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description)_25=new deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");for(var i=3;axo!=null;i++){axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);_25=new deconcept.PlayerVersion([i,
0,0])}}catch(e){}if(_23&&_25.major>_23.major)return _25;if(!_23||(_23.minor!=0||_23.rev!=0)&&_25.major==_23.major||_25.major!=6||_24)try{_25=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","))}catch(e){}}return _25};deconcept.PlayerVersion=function(_29){this.major=parseInt(_29[0])!=null?parseInt(_29[0]):0;this.minor=parseInt(_29[1])||0;this.rev=parseInt(_29[2])||0};
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major)return false;if(this.major>fv.major)return true;if(this.minor<fv.minor)return false;if(this.minor>fv.minor)return true;if(this.rev<fv.rev)return false;return true};
deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(q){var _2d=q.indexOf(_2b+"=");var _2e=q.indexOf("&",_2d)>-1?q.indexOf("&",_2d):q.length;if(q.length>1&&_2d>-1)return q.substring(q.indexOf("=",_2d)+1,_2e)}return""}};if(Array.prototype.push==null)Array.prototype.push=function(_2f){this[this.length]=_2f;return this.length};var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;$(function(){if($(".breadBox").height()>0)$(".mainContainer").css("background-position","0px "+($(".breadBox").height()+40)+"px");$(".brandMenu .listItem").hover(function(){var menuItem=$(this);menuItem.addClass("over");if(menuItem.attr("subIds")==""||menuItem.attr("loaded")=="1")return;var ids={tabDimensions:menuItem.attr("tabIds"),subDimensions:menuItem.attr("subIds")};$.rcn.content.getMenu(ids,function(info){if(info.Items.length>0){var html=tmpl("topMenuTemplate",{Items:info.Items});$(".subSiteMenu",
menuItem).html(html)}else $(".subSiteMenu",menuItem).hide();menuItem.attr("loaded",1)},function(info){})},function(){$(this).removeClass("over")});$("#brandBoutiquesPanelLink").click(getBrandThemeVertical);$("#brandBoutiquesPanel").popup($("#brandBoutiquesPanelLink"),$("#closeConcept, #subStorePanelLink"),null,0);function getBrandThemeVertical(){renderBrandThemeVertical("/XmlResource.axd?r=MenuBrand_XML","#flash_container_brand_vertical2",loadBrandVerticalFlash)}function loadBrandVerticalFlash(){var brand_vertical=
new SWFObject("//media.redcatsnordic.com/ellos/images/generic/brand_theme_menu/vert_menu.swf","vert_menu","191","345","9","#FFFFFF");brand_vertical.addParam("wmode","transparent");brand_vertical.addParam("allowScriptAccess","always");brand_vertical.addVariable("xmlPath","/XmlResource.axd?r=MenuBrand_XML_Endeca");brand_vertical.write("flash_container_brand_vertical")}function renderBrandThemeVertical(xmlFile,container,callback){$("#brandBoutiquesPanelLink").unbind("click",getBrandThemeVertical);$.get(xmlFile,
function(d){$(d).find("Store").each(function(){var title=$(this).attr("title");var link=$(this).find("link").text();var html='<a class="arrowLink brandThemeMenu" href="'+link+'" >';html+=title;html+="</a><br>";$(container).append($(html))});callback()})}function initLoginLayer(){$("#registerLink").click(function(){$.rcn.ui.login.hide();$.rcn.ui.createUser.show($.rcn.sourceOfRegisterPage.LoginLayer)});$("a.#loginbutton").click(function(){if($("div.#loginArea").validate().form()){var username=$("input.#loginusername").val();
var password=$("input.#loginpassword").val();$("div.#loginWorking").show();$("div.#loginArea").hide();$.rcn.membership.login(username,password,function(){if($.rcn.ui.login.afterLogin)$.rcn.ui.login.afterLogin();$("div.#loginLayer").jqmHide()},function(){$("div.#loginWorking").hide();$("div.#loginArea").show();loginFailure()})}});$("a.#createUser").click(function(){if($("div.#createUserArea").validate().form()){var username=$("input.#registerUsername").val();var password=$("input.#registerPassword").val();
var acceptNewsLetter=$("input.#acceptNewsLetter").is(":checked");$("div.#registerWorking").show();$("div.#createUserArea").hide();$.rcn.membership.createUser(username,password,acceptNewsLetter,function(messages){createUserHandler(messages)},function(err){$("div.#registerWorking").hide();$("div.#createUserArea").show();if(err)$("#registerError").text(err);else createUserServerError()})}});$("a.#btnFetchPersonal").click(function(){var civicno=$.trim($("input.#registerCivicNo").val());if(civicno.length>
0&&$.validator.methods.civicNumber(civicno)){$("div.#fetchPersonalArea").hide();$("div.#applyForCredit").hide();$("div.#fetchPersonalWorking").show();$.rcn.customer.lookupPersonalData(civicno,function(info){$("div.#fetchPersonalWorking").hide();$("div.#fetchPersonalArea").show();if(info.Errors.length>0)fetchPersonalInfoHandler(info);else{$("input.#registerFirstName").val(info.FirstName);$("input.#registerLastName").val(info.LastName);$("input.#registerStreet").val(info.Street);$("input.#registerCO").val(info.COAddress);
$("input.#registerZipCode").val(info.ZipCode);$("input.#registerCity").val(info.City);$("input.#registerMobilePhone").val(info.MobilePhone)}if(info.CanApplyForCredit)$("div.#applyForCredit").slideDown("slow");else $("div.#applyForCredit").hide()},function(err){$("div.#fetchPersonalWorking").hide();$("div.#fetchPersonalArea").show()})}});$("a.#btnRegisterCustomer").click(function(){if($("div.#moreInfoContent").validate().form()){$("div.#registerCustomerWorking").show();$("div.#moreInfoContent").hide();
var customer={civicNumber:$("input.#registerCivicNo").val(),applyForCredit:$("input[name=registerApplyForCredit]:radio:checked").val()=="1",firstName:$("input.#registerFirstName").val(),lastName:$("input.#registerLastName").val(),street:$("input.#registerStreet").val(),zipCode:$("input.#registerZipCode").val(),city:$("input.#registerCity").val(),coAddress:$("input.#registerCO").val(),mobilePhone:$("input.#registerMobilePhone").val(),gender:$("input[name=registerGender]:radio:checked").val(),postalDeliveryNotification:$("input[name=registerPostalDeliveryNotification]:radio:checked").val(),
marketingchannel:$("input[name=registerOfferSms]:radio:checked").val(),acceptTerms:$("input.#registerAcceptTerms").is(":checked")};$.rcn.customer.create(customer,function(messages){createCustomerHandler(messages)},function(err){$("div.#registerCustomerWorking").hide();$("div.#moreInfoContent").show();createCustomerServerError()})}})}var pid=$.rcn.getQueryParameter("pid");if(pid.length>0)$.rcn.ui.product.show(pid);function setNotificationBubble(){$(".notificationBubble").fadepopup($(".notificationIconLink"),
$(".closePanelLink, .newsLetterPanelLink, .offerCodePanelLink, .cartPanelLink"),$(".notificationBubble"),400)}$("a.#showCreateUser").click(function(){$.rcn.ui.createUser.show($.rcn.sourceOfRegisterPage.Header)});$.rcn.bind($.rcn.events.loggedIn,function(){Sys.WebForms.PageRequestManager.getInstance().add_endRequest(initToolbar);$.rcn.ui.loader.show();$.rcn.ui.reloadPage()});$.rcn.bind($.rcn.events.loggedOut,function(){Sys.WebForms.PageRequestManager.getInstance().add_endRequest(initToolbar);$.rcn.ui.reloadPage()});
function initToolbar(){$("a.#showlogin").click(function(){$.rcn.ui.login.show()});setNotificationBubble();initBasket();initOfferCodePanel();Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(initToolbar)}initLoginLayer();initToolbar();$.rcn.bind($.rcn.events.loggedIn,function(){$("ul.#ypLoggedOutNavigation").hide();$("ul.#ypLoggedInNavigation").css("display","");$("a.#ypShowLogin").hide();$("a.#ypToPage").show()});function initAccountMenu(){$("a.#ypShowLogin").click(function(){$.rcn.ui.login.afterLogin=
function(){window.location=$.rcn.settings.url.myPage};$.rcn.ui.login.show()})}initAccountMenu();$(".ypHover").hover(function(){$("#ypLoggedInNavigation").show();$(".column2b").addClass("columnSelected")},function(){$("#ypLoggedInNavigation").hide();$(".column2b").removeClass("columnSelected")});function urlParts(url){var urlParts=/^(https?:\/\/.+?)?(\/.+?)(\?.*?)?$/.exec(url);return{server:urlParts[1]?urlParts[1]:"",path:urlParts[2]?urlParts[2]:"",query:urlParts[3]?urlParts[3]:""}}$("a.search").live("click",
contentSearchLinkClickHandler);$("#SearchTerm").live("keypress",function(e){if(e.which==13){e.preventDefault();$("#SearchTerm").blur();navigateToSearchUrl();return false}});function contentSearchLinkClickHandler(e){e.preventDefault();navigateToSearchUrl();return false}function navigateToSearchUrl(){var terms=$("#SearchTerm").val().trim().replace(/[&-]/g," ");if(terms.length>1){terms=terms.split(/\s+/);var searchTerm="";$.each(terms,function(index,term){var bookingNumber=getBookingNumber(term);if(bookingNumber!=
null)searchTerm=searchTerm+bookingNumber+"+";else searchTerm=searchTerm+(term.trim().length>0?term.trim()+"+":"")});if(searchTerm.length>0)searchTerm=searchTerm.slice(0,-1);url=$("a.#SearchLink").attr("href").replace("searchTerm",searchTerm).replace("%7c1%7c","%7c"+terms.length+"%7c");var parts=urlParts(url);window.location.href=encodeURI(parts.path+parts.query)}}function getBookingNumber(value){var m=value.match(/^\d{3}[\.-]?\d{4}$/);if(m==null)return null;return m[0].replace(/[\.-]?/g,"")}function initTypeAhead(){if($("#SearchTerm").length>
0)$("#SearchTerm").autocomplete("/Content/GetTypeAhead",{dataType:"json",minChars:2,selectFirst:false,matchSubset:false,parse:function(data){var array=new Array;for(var i=0;i<data.length;i++)array[array.length]={data:data[i],value:data[i],result:data[i]};return array},formatItem:function(item){return item}}).result(function(event,item){$("#SearchTerm").val(item);$("a.#SearchLink").trigger("click")})}initTypeAhead();$(".label1, .label2, .label3, .label4").tooltip({positionLeft:false,track:false,top:-73,
left:160,fixPNG:true,showBody:" - "});$(".splitPaymentToolTipResultListList").tooltip({positionLeft:false,track:false,top:-84,left:165,fixPNG:true,showBody:" - "});$(".splitPaymentToolTipClothesline").tooltip({positionLeft:false,track:false,top:19,left:100,fixPNG:true,extraClass:"arrowUp",showBody:" - "});$(".limitTwoRowsWithDots").dotdotdot({height:30,wrap:"letter"});$(".limitTwoRowsWithDotsClothesline").dotdotdot({height:24,wrap:"letter"})});var basketTimeout;function initBasket(){$("#cartPanel").fadepopup($(".cartPanelLink"),$(".closePanelLink, .newsLetterPanelLink, .notificationIconLink, .offerCodePanelLink"),$(".closePanelLink"),400)}function basketEndRequest(){$("#cartPanel").fadepopup($(".cartPanelLink"),$(".closePanelLink, .newsLetterPanelLink, .notificationIconLink, .offerCodePanelLink"),$(".closePanelLink"),400);openbasket(3E3)}
function openbasket(timeout){clearTimeout(basketTimeout);$(".cartPanelLink").click();if(timeout!=undefined&&timeout>0)basketTimeout=setTimeout("closebasket()",timeout)}function closebasket(){$(".closePanelLink").click()}function updateBasketCount(count){var cartText=$("#cartCount").text().trim();$("#cartCount").text((isNaN(cartText.charAt(0))?count:Number(cartText.substring(0,cartText.indexOf(" ")))+Number(count))+cartText.substring(cartText.indexOf(" "),cartText.length));openbasket(3E3)}
function setBasketText(text){if($("#cartInfoMessage").length==0)$("#cartContent").prepend('<div class="cartInfoMessage" id="cartInfoMessage"><span class="cartOfferDescription">'+text+"</span></div>");else $("#cartInfoMessage").html('<span class="cartOfferDescription">'+text+"</span>")}
var shoppingCart={add:function(variantId,quantity,source){$.rcn.shoppingCart.add(variantId,quantity,source,updateShoppingCart,shoppingCart.onError)},addByBookingNumber:function(bookingNumber,size,quantity){$.rcn.shoppingCart.addByBookingNumber(bookingNumber,size,quantity,updateShoppingCart,shoppingCart.onError)},addOffer:function(orderCode){$.rcn.shoppingCart.addOffer(orderCode,function(data){setBasketText(data.OrderCode.Text);openbasket(3E3)},shoppingCart.onError)},onError:function(){shoppingCartError()}};var events=new Array;var linkTrackVars="events";var eVars=new Array;var props=new Array;var refinements=new Array;var products;var refinementCookieName="refinements";var scOpenCookieName="scOpen";var crossSellCookieName="crossSell";function resetTrackingVars(){events=new Array;linkTrackVars="events";eVars=new Array;props=new Array;refinements=new Array}function nameValuePair(variable,value){this.name=variable;this.value=value}
function setEvent(event){if($.inArray(event,events)==-1)events.push(event)}
function productsString(productId,quantity,price,source){var retValue=";"+productId+";";if(quantity>0&&price>0){setEvent("event11");setEvent("event12");retValue+=quantity*price+";"+quantity+";event11="+quantity*price+"|event12="+quantity;switch(source){case $.rcn.addToBasketSource.PRODUCTLAYER:setEvent("event34");setEvent("event35");retValue+="|event35="+quantity*price;break;case $.rcn.addToBasketSource.PRODUCTDETAILPAGE:setEvent("event36");setEvent("event37");retValue+="|event37="+quantity*price;
break;case $.rcn.addToBasketSource.WISHLIST:setEvent("event38");setEvent("event39");retValue+="|event39="+quantity*price;break}}else retValue+=";";return retValue}function setEvar(eVar,value){eVars.push(new nameValuePair(eVar,value))}function setProp(prop,value){props.push(new nameValuePair(prop,value))}function setRefinement(type,value){refinements.push(new nameValuePair(type,value))}
function reportEvents(){if(events.length>0){var eventString="";for(i=0;i<events.length;i++){if(i>0)eventString+=",";eventString+=events[i]}s.events=eventString}}
function reportRefinements(){var refinementsString="";if(refinements.length>0){for(i=0;i<refinements.length;i++){if(i>0)refinementsString+=",";refinementsString+=refinements[i].name+":"+refinements[i].value}linkTrackVars=linkTrackVars+",eVar18,prop14";s.eVar18=refinementsString+",events";s.prop14=refinementsString;s.pageName=getPageNamePrefix()+refinementsString}}
function reportProps(){for(i=0;i<props.length;i++){eval("s.prop"+props[i].name+"='"+props[i].value+"'");linkTrackVars=linkTrackVars+",prop"+props[i].name}}function reportEVars(){for(i=0;i<eVars.length;i++){eval("s.eVar"+eVars[i].name+"='"+eVars[i].value+"'");linkTrackVars=linkTrackVars+",eVar"+eVars[i].name}}
function findRefinement(refinementArray,refinementElement){var index;for(index in refinementArray)if(refinementArray[index].name==refinementElement.name&&refinementArray[index].value==refinementElement.value)return true;return false}function arrayToCookie(values){var value="";var index;for(index in values)value+=values[index].name+"#"+values[index].value.replace("#","").replace("|","")+"|";return value}
function cookieToArray(value){var values=new Array;if(value!=null){var startIndex=0;var endIndex=0;var refinementType;while(startIndex<value.length){endIndex=value.indexOf("#",startIndex);if(endIndex!=-1){refinementType=value.substring(startIndex,endIndex);if(refinementType.length>0)values.push(new nameValuePair(refinementType,value.substring(endIndex+1,value.indexOf("|",endIndex))));startIndex=value.indexOf("|",endIndex)+1}}}return values}
function createRefinementCookie(value){createCookie(refinementCookieName,value)}function createCookie(name,value){document.cookie=name+"="+value+"; path=/"}function readRefinementCookie(){return readCookie(refinementCookieName)}function readCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(";");for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==" ")c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length)}return null}
function eraseRefinementCookie(){eraseCookie(refinementCookieName)}function eraseCookie(name){createCookie(name,"")}function isShoppingCartOpen(){var cookieValue=readCookie(scOpenCookieName);return cookieValue==null?false:cookieValue=="Y"?true:false}function openShoppingCart(){createCookie(scOpenCookieName,"Y")}function reportSocialMediaTracking(value){var s=s_gi(s_account);s.prop21=value;s.linkTrackVars="prop21";s.tl(true,"o","SocialMediaTracking");resetTrackingVars()}
function setCrossSellParameter(value){createCookie(crossSellCookieName,value)}function readCrossSellParameter(){return readCookie(crossSellCookieName)}function clearCrossSellParameter(){eraseCookie(crossSellCookieName)}
function trackAddToBasket(cartItem,source){var s=s_gi(s_account);setEvent("scAdd");if(!isShoppingCartOpen()){openShoppingCart();setEvent("scOpen")}products=productsString(cartItem.ProductId,cartItem.Quantity,cartItem.UnformattedPrice,source);linkTrackVars+=",products,evar20";setEvar("20",source);reportEvents();reportEVars();s.linkTrackVars=linkTrackVars;s.linkTrackEvents=s.events;s.products=products;s.tl(true,"o","Add to Cart");resetTrackingVars()}
function trackLoggedIn(isUserRegistration){var s=s_gi(s_account);if(isUserRegistration)setEvent("event19");setEvent("event1");if(typeof getPageName!="undefined")setEvar("6","Inloggning - "+getPageName());else setEvar("6","Inloggning - "+s.pageName);setProp("44","Login");linkTrackVars+=",products,evar6,prop44";reportEVars();reportProps();reportEvents();s.linkTrackVars=linkTrackVars;s.linkTrackEvents=s.events;s.tl(true,"o",isUserRegistration?"Registration \u2013 User":"Login");resetTrackingVars()}
function trackFacebookLike(){var s=s_gi(s_account);setEvent("event22");reportEvents();s.linkTrackVars=linkTrackVars;s.linkTrackEvents=s.events;s.tl(true,"o","Facebook Like");resetTrackingVars()}function trackProductAddedToWishlist(){var s=s_gi(s_account);resetTrackingVars();setEvent("event22");reportEvents();s.linkTrackVars=linkTrackVars;s.linkTrackEvents=s.events;s.tl(true,"o","Product Added To Wishlist");resetTrackingVars()}
function trackShowProductLayer(){var s=s_gi(s_account);resetTrackingVars();if(typeof getPageName!="undefined")setEvar("30","Show Product Layer - "+getPageName());else setEvar("30","Show Product Layer - "+s.pageName);linkTrackVars+="evar30";reportEVars();s.linkTrackVars=linkTrackVars;s.tl(true,"o","Show Product Layer");resetTrackingVars()}
function trackingUpdateFull(){if(typeof setTrackingParameters!="undefined")setTrackingParameters();if(typeof s!="undefined"){reportEVars();reportProps();reportEvents();reportRefinements();if(products)s.products=products}}function trackCustomerRegistered(){var s=s_gi(s_account);setEvent("event20");reportEvents();s.linkTrackVars=linkTrackVars;s.linkTrackEvents=s.events;s.tl(true,"o","Registration \u2013 Customer");resetTrackingVars()}
function trackRegisterPageOpened(sourceOfRegisterPage){var s=s_gi(s_account);s.tl(true,"o",sourceOfRegisterPage)}$.rcn.bind($.rcn.events.shoppingcartChanged,function(event,args){trackAddToBasket(args.item,args.source)});$.rcn.bind($.rcn.events.loggedIn,function(event,args){trackLoggedIn(args?args.isUserRegistration:false)});$.rcn.bind($.rcn.events.customerRegistered,function(){trackCustomerRegistered()});$.rcn.bind($.rcn.events.showProductLayer,function(){trackShowProductLayer()});
$.rcn.bind($.rcn.events.productAddedToWishlist,function(){trackProductAddedToWishlist()});$.rcn.bind($.rcn.events.registerPageOpened,function(event,args){trackRegisterPageOpened(args)});(function(){var cache={};this.tmpl=function tmpl(str,data){var fn=!/\W/.test(str)?(cache[str]=cache[str]||tmpl(document.getElementById(str).innerHTML)):new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};"+"with(obj){p.push('"+str.replace(/[\r\t\n]/g," ").replace(/'(?=[^#]*#>)/g,"\t").split("'").join("\\'").split("\t").join("'").replace(/<#=(.+?)#>/g,"',$1,'").split("<#").join("');").split("#>").join("p.push('")+"');}return p.join('');");return data?fn(data):fn}})();function SetQuantity(value,offerSectionId){$("#selectedQuantity"+offerSectionId).val(value)}function SetVariant(value,offerSectionId){var values=value.split("--");$("#selectedVariant"+offerSectionId).val(values[0]);$("#variantPrice"+offerSectionId).html(values[1])}function SetSelectPG(value,offerSectionId){$("#selectPG"+offerSectionId).val(value)}
function ReadMoreClick(offerCode){$("#offerDetails"+offerCode).slideDown(600,function(){if(jQuery.browser.msie)$(this).get(0).style.removeAttribute("filter")});$("#ReadMore"+offerCode).toggleClass("hide");$("#closeReadMore"+offerCode).removeClass("hide")}
function CloseReadMoreClick(offerCode){$("#offerDetails"+offerCode).slideUp(600,function(){if(jQuery.browser.msie)$(this).get(0).style.removeAttribute("filter")});$("#closeReadMore"+offerCode).toggleClass("hide");$("#ReadMore"+offerCode).removeClass("hide")}function DisableAddForCurrentOffer(offerCode){$('a[id^="activateOffer"]').removeClass("hide");$('a[id^="startShopping"]').toggleClass("hide");$("#activateOffer"+offerCode).toggleClass("hide");$("#startShopping"+offerCode).removeClass("hide")}
function AddOfferToBasket(offerCode){shoppingCart.addOffer(offerCode);var offerSections=$("input").filter(function(index){return $(this).attr("offer")==offerCode});var offerSectionsAdded=new Array;for(var i=0;i<offerSections.length;i++){var offerSectionId=$(offerSections[i]).attr("offerSection");if($("#selectPG"+offerSectionId).val()&&$.inArray(offerSectionId,offerSectionsAdded)<0){var selectedVariant=$("#selectedVariant"+offerSectionId).val();var selectedQuantity=$("#selectedQuantity"+offerSectionId).val();
shoppingCart.add(selectedVariant,selectedQuantity,$.rcn.addToBasketSource.MYOFFER)}offerSections=jQuery.grep(offerSections,function(value){return $(value).attr("offerSection")!=offerSectionId});offerSectionsAdded[offerSectionsAdded.length]=offerSectionId}DisableAddForCurrentOffer(offerCode)};$(function(){var TEH_EVENT=new Array;TEH_EVENT["closetimer"]=0;TEH_EVENT["contentSet"]=0;var mywidth=220;var myheight=271;function TEH_EVENT_CreateIframe(){var element=document.createElement("iframe");var teJsHost="https:"==document.location.protocol?"https":"http";if(document.URL.indexOf("ellos.no")>-1)element.src=teJsHost+"://www.tryggehandel.no/teh_mouseover_verify.php?id=10";else element.src=teJsHost+"://www.tryggehandel.se/verifybutik.php?id=168";element.style.display="none";element.style.position=
"absolute";element.style.width=mywidth+"px";element.style.height=myheight+"px";element.style.border="0px";element.style.zIndex="9999";element.frameBorder="0";element.scrolling="no";element.allowTransparency="true";if(element.addEventListener){element.addEventListener("mouseover",TEH_EVENT_Show,false);element.addEventListener("mouseout",TEH_EVENT_HideTime,false)}else{element.attachEvent("onmouseover",TEH_EVENT_Show);element.attachEvent("onmouseout",TEH_EVENT_HideTime)}return element}function findPosX(obj){var curleft=
0;if(obj.offsetParent)while(obj.offsetParent){curleft+=obj.offsetLeft;obj=obj.offsetParent}else if(obj.x)curleft+=obj.x;return curleft}function findPosY(obj){var curtop=0;if(obj.offsetParent)while(obj.offsetParent){curtop+=obj.offsetTop;obj=obj.offsetParent}else if(obj.y)curtop+=obj.y;return curtop}function TEH_EVENT_Show(event){TEH_EVENT_CancelClose();if(!TEH_EVENT["iframe"]){TEH_EVENT["iframe"]=TEH_EVENT_CreateIframe();document.body.appendChild(TEH_EVENT["iframe"])}if(TEH_EVENT["iframe"].style.display==
"none"){var yy=document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop;var px=GetWndCliSiz("Width");var py=GetWndCliSiz("Height");var llogo=document.getElementById("TEH_LOGOTYPE");var tx=llogo.offsetWidth;var ty=llogo.height;var lx=findPosX(llogo);var ly=findPosY(llogo);var totalwidth=tx+lx+mywidth;var totalheight=ly+ty+myheight+yy;if(totalwidth>px){var newposx=lx-mywidth+20;TEH_EVENT["iframe"].style.left=newposx+"px"}else TEH_EVENT["iframe"].style.left=lx+tx+
"px";if(document.addEventListener){yDiff=ly-window.scrollY;TEH_EVENT["iframe"].style.top=self.pageYOffset+yDiff+"px"}else{yDiff=ly-document.body.parentNode.scrollTop;TEH_EVENT["iframe"].style.top=document.documentElement.scrollTop+yDiff+"px"}}TEH_EVENT["iframe"].style.display="inline"}function TEH_EVENT_Hide(){if(TEH_EVENT["iframe"])TEH_EVENT["iframe"].style.display="none"}function TEH_EVENT_ShowTime(){TEH_EVENT["opentimer"]=window.setTimeout(TEH_EVENT_Show,300)}function TEH_EVENT_HideTime(){if(TEH_EVENT["iframe"])TEH_EVENT["closetimer"]=
window.setTimeout(TEH_EVENT_Hide,500);else window.clearTimeout(TEH_EVENT["opentimer"])}function TEH_EVENT_CancelClose(){if(TEH_EVENT["closetimer"]){window.clearTimeout(TEH_EVENT["closetimer"]);TEH_EVENT["closetimer"]=null}}function GetWndCliSiz(s){var db,y=window["inner"+s],sC="client"+s,sN="number";if(typeof y==sN){var y2;return(db=document.body)&&typeof(y2=db[sC])==sN&&y2&&y2<=y?y2:(db=document.documentElement)&&typeof(y2=db[sC])==sN&&y2&&y2<=y?y2:y}return(db=document.documentElement)&&(y=db[sC])?
y:document.body[sC]}if(document.getElementById("TEH_LOGOTYPE")!=null)if(document.addEventListener){document.getElementById("TEH_LOGOTYPE").addEventListener("mouseover",TEH_EVENT_Show,false);document.getElementById("TEH_LOGOTYPE").addEventListener("mouseout",TEH_EVENT_HideTime,false)}else{document.getElementById("TEH_LOGOTYPE").attachEvent("onmouseover",TEH_EVENT_Show);document.getElementById("TEH_LOGOTYPE").attachEvent("onmouseout",TEH_EVENT_HideTime)}});

