(function(){var a=false,b=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;this.Class=function(){};Class.extend=function(g){var f=this.prototype;a=true;var e=new this();a=false;for(var d in g){e[d]=typeof g[d]=="function"&&typeof f[d]=="function"&&b.test(g[d])?(function(h,j){return function(){var l=this._super;this._super=f[h];var k=j.apply(this,arguments);this._super=l;return k}})(d,g[d]):g[d]}function c(){if(!a&&this.init){this.init.apply(this,arguments)}}c.prototype=e;c.constructor=c;c.extend=arguments.callee;return c}})();CupMan={wr:null,translations:new Map(),getServiceUrl:function(c,d){var d=d||{edition:true};if(typeof d.edition=="undefined"){d.edition=true}var b=this.wr.ids;if(!d.edition){b=this.wr.otherIds.noEdition}if(d.ids!=null){b=d.ids}if(b!=""){b+=",service"}else{b="service"}var a="/"+b+"/"+c;if(c=="SingleSignOnService"||c=="LoginService"){a="http://login.cupmanager.net"+a}else{a="http://"+window.location.host+a}return a},callService:function(b,a,d){a.url=this.getServiceUrl(b,d);a.type="POST";if(a.url.indexOf("login.cupmanager.net")>0){a.type="GET";a.dataType="jsonp";a.url+="?jsonp=true"}var c=a.success||function(){};var e=a.error||function(){};a.success=function(h){try{var k=h.nodeType!=undefined;if(k){var g=jQuery(h).children();var f=g.attr("status");if(f!=0){e(g,g.text(),f)}else{c(g,0)}}else{var f=h.status;if(typeof f=="undefined"){c(h)}else{if(f!=0){e(h,h.statusText,f)}else{c(h,0)}}}}catch(j){console.exception(j)}};a.error=function(j,h,f){console.error("ERROR",j,h,f);try{e(null,h)}catch(g){console.exception(g)}};jQuery.ajax(a)},translate:function(a,b){this.translations.put(a,b)},T:function(b,a){var c=this.translations.get(b)||this.translations.get("Web.Validate."+b)||a;if(c==""||!c){console.log(b," has no translation");return b}return c},notify:function(c){for(var a=0;a<c.size();a++){var b=c.get(a);b()}}};jQuery.fn.setFlag=function(a){var a=a.toLowerCase();var b="http://static.cupmanager.net/images/flags_iso/16/"+a+".png";jQuery(this).css("background-image","url("+b+")");jQuery(this).css("background-repeat","no-repeat");if(jQuery(this).css("background-position")=="0% 0%"){if(jQuery(this).css("font-size")=="10px"){jQuery(this).css("background-position","1px 0px")}else{jQuery(this).css("background-position","3px 2px")}}if(jQuery(this).css("font-size")=="10px"){jQuery(this).css("padding-left","17px")}else{jQuery(this).css("padding-left","20px")}jQuery(this).css("border","1px solid #ccc")};jQuery.fn.removeFlag=function(){jQuery(this).css("background","");jQuery(this).css("border","");jQuery(this).css("padding-left","")};function convertFlagFields(){jQuery("[flag]").each(function(){jQuery(this).setFlag(jQuery(this).attr("flag"))});jQuery(".flag").each(function(){jQuery(this).css("padding-left","20px");jQuery(this).css("border","1px solid #ccc")})}jQuery(function(){convertFlagFields()});function parsePx(b){var a=parseInt(b.replace("px",""));if(isNaN(a)){return 0}else{return a}}CupMan.Tooltip=Class.extend({init:function(b){this.source=b;this.element=jQuery("<div />");this.element.addClass("cupmanTip");this.element.css("left","-9999px");this.element.css("top","-9999px");this.originalMargins=[parsePx(this.source.css("margin-top")),parsePx(this.source.css("margin-right")),parsePx(this.source.css("margin-bottom")),parsePx(this.source.css("margin-left"))];this.margins=[this.originalMargins[0]-3,this.originalMargins[1]-3,this.originalMargins[2]-3,this.originalMargins[3]-3];this.element.appendTo(jQuery("body"));this.hideTimer=null;var a=this;this.element.hover(function(){clearTimeout(a.hideTimer)},function(){a._hide()})},setMargins:function(a){this.source.css("margin-top",a[0]+"px");this.source.css("margin-right",a[1]+"px");this.source.css("margin-bottom",a[2]+"px");this.source.css("margin-left",a[3]+"px")},show:function(a){clearTimeout(this.hideTimer);this.source.addClass("tooltipped");this.source.addClass("tooltipped_holder");this.setMargins(this.margins);a=a||"below";var c=this.source.offset();this.element.width(Math.max(this.source.width(),100));this.element.css("left",c.left);this.element.css("top",c.top+this.source.outerHeight()-3);var b=this;this.source.bind("mouseout.cupmanTip",function(){b.hide()})},hide:function(){this.source.removeClass("tooltipped_holder");var a=this;clearTimeout(this.hideTimer);this.hideTimer=setTimeout(function(){a._hide()},100)},_hide:function(){this.source.unbind("mouseout.cupmanTip");clearTimeout(this.hideTimer);this.element.unbind();this.element.remove();if(!this.source.is("tooltipped_holder")){this.source.removeClass("tooltipped");this.setMargins(this.originalMargins)}}});var likeCounterData={};jQuery.fn.likeCounter=function(){var b=this.attr("contextId");var d=this;var f=this.find(".info");var g=this.find(".dash");var e=this.find("a");var c=readCookie("CupManWebsite_liked_"+b)=="yes";var a=0;this.setLikes=function(h,j){likeCounterData[b]={likes:h,texts:j};if(c){h--}if(h<0){h=0}if(c){f.html(j.you);e.hide();g.hide()}else{e.show();g.show();f.html(j.text);if(h==0){f.html("");g.hide()}}};if(likeCounterData[b]){data=likeCounterData[b];a=data.likes;d.setLikes(a,data.texts)}else{CupMan.callService("website.LikeService",{data:{contextId:b,readOnly:true},success:function(h){a=h.likes;d.setLikes(a,h.texts)}})}e.click(function(){CupMan.callService("website.LikeService",{data:{contextId:b},success:function(h){c=true;a=h.likes;d.setLikes(a,h.texts);createCookie("CupManWebsite_liked_"+b,"yes",10000);CupMan.Tracker.trackEvent("Likes","Like",b)}});return false})};function popUp(URL){day=new Date();id=day.getTime();eval("page"+id+" = window.open(URL, '"+id+"', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=400,height=243');")}String.prototype.trim=function(){return this.replace(/(^\s+)/,"").replace(/(\s+$)/,"")};String.prototype.startsWith=function(a){return(this.substring(0,a.length)==a)};String.prototype.pad=function(){if(this.length==1){return"0"+this}return this};if(typeof console=="undefined"){console={log:function(){},trace:function(){}}}jQuery.fn.disable=function(b){var a=this.find("input,button,submit,select,textarea").andSelf();a.each(function(){if(b||typeof b=="undefined"){jQuery(this).addClass("disabled");jQuery(this).attr("disabled","disabled");jQuery(this).attr("oldHref",jQuery(this).attr("href"));jQuery(this).removeAttr("href")}else{jQuery(this).removeClass("disabled");jQuery(this).removeAttr("disabled");if(jQuery(this).attr("oldHref")){jQuery(this).attr("href",jQuery(this).attr("oldHref"));jQuery(this).removeAttr("oldHref")}}})};jQuery.fn.enable=function(){this.disable(false)};jQuery.fn.disabled=function(){return this.attr("disabled")=="disabled"};var ids="$ids";function addOnLoad(a){jQuery(a)}function stripHash(b){var a=b.indexOf("#");if(a>-1){return b.substring(0,a)}else{return b}}function getBaseUrl(){alert("baseUrl() is deprecated.")}function getUrl(){alert("getUrl()")}function getRelUrl(){return window.location.pathname}function buildUrl(a){alert("buildurl() is deprecated")}jQuery(function(){jQuery("input:radio").click(function(){var a=jQuery(this).attr("name");var b=jQuery("input:radio[name='"+a+"']");b.each(function(){var d=jQuery(this).attr("id");var c=jQuery("label[for='"+d+"']");if(this.checked){c.css("font-weight","bold")}else{c.css("font-weight","normal")}})});jQuery("input:radio:checked").click()});function createCookie(c,d,e){if(e){var b=new Date();b.setTime(b.getTime()+(e*24*60*60*1000));var a="; expires="+b.toGMTString()}else{var a=""}document.cookie=c+"="+d+a+"; path=/"}function readCookie(b){var e=b+"=";var a=document.cookie.split(";");for(var d=0;d<a.length;d++){var f=a[d];while(f.charAt(0)==" "){f=f.substring(1,f.length)}if(f.indexOf(e)==0){return f.substring(e.length,f.length)}}return null}function eraseCookie(a){createCookie(a,"",-1)}jQuery(function(){jQuery(".tabContainer .tabs .tab").click(function(){jQuery(this).closest(".tabs").find(".selectedTab").removeClass("selectedTab");jQuery(this).addClass("selectedTab");var b=jQuery(this).closest(".tabs").find(".tab").index(jQuery(this));var a=jQuery(this).closest(".tabContainer");a.find(".tabContent").hide();a.find(".tabContent").eq(b).show();jQuery(this).find("input:text").focus()});jQuery.fn.activateTab=function(){var b=jQuery(this);if(b.is(".tabContent")){var a=b.closest(".tabContentContainer").find(".tabContent").index(b);var c=b.closest(".tabContainer").find(".tabs .tab").eq(a);c.click()}};jQuery(".tabContainer .tabs .tab:first-child").click()});jQuery(function(){jQuery(".codaBubble").each(function(){var b=10;var f=250;var j=300;var g=null;var c=false;var k=false;var d=jQuery(this);var h=!d.is(".down");var e=jQuery("a",this);var a=jQuery(".bubble",this).css("opacity",0);jQuery([e.get(0),a.get(0)]).mouseover(function(){if(g){clearTimeout(g)}if(c||k){return}else{c=true;a.css({top:h?-a.height()+10:0,left:e.width()/2-a.width()/2,display:"block"}).animate({top:"-="+(h?b:-b)+"px",opacity:1},f,"swing",function(){c=false;k=true})}}).mouseout(function(){if(g){clearTimeout(g)}g=setTimeout(function(){g=null;a.animate({top:"-="+(h?b:-b)+"px",opacity:0},f,"swing",function(){k=false;a.css("display","none")})},j)})});jQuery(".codaBubble .bubble img").css("opacity","0.7");jQuery(".codaBubble .bubble img").hover(function(){jQuery(this).css("opacity","1")},function(){jQuery(this).css("opacity","0.7")})});function setImageUrl_size(b,c,j,h){var d=b.lastIndexOf(".");var e=b.substring(0,d);var g=b.substring(d+1);var a=e.split(",")[0];var f=(c>-1?c:"")+(h?"-":"x")+(j>-1?j:"");return a+","+f+"."+g}CupMan.Tracker={account:"",cupId:0,cupName:"",langCode:"",tracker:null,init:function(c,b,a,d){if(this.tracker!=null){return}this.account=c;this.cupId=b;this.langCode=d;this.cupName=a;window._gaq=window._gaq||[];window._gaq.push(["_setAccount",this.account],["_setDomainName","none"],["_setAllowLinker",true],["_setCustomVar",1,"cupId",this.cupId,3],["_setCustomVar",2,"cupName",this.cupName,3],["_setCustomVar",3,"languageId",this.langCode,3]);(function(){var f=document.createElement("script");f.type="text/javascript";
f.async=true;f.src=("https:"==document.location.protocol?"https://ssl":"http://www")+".google-analytics.com/ga.js";var e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(f,e)})();return this},track:function(a){return window._gaq.push(["_trackPageview",a])},trackSearch:function(a){return this.trackEvent("Search","Search",a)},trackEvent:function(a,c,b,d){return window._gaq.push(["_trackEvent",a,c,b,d])}};function clearFieldErrors(a){var b=a;if(typeof b=="object"){b=a}else{if(typeof b=="string"){b=jQuery("#"+a+", ."+a+"")}else{b=jQuery(".field")}}if(!b.find(".status").is(".sticky")){b.find(".statusContainer, .staticStatusContainer").hide()}}function clearAllFieldErrors(a){jQuery(a).find(".field").each(function(){clearFieldErrors(jQuery(this))})}function _showFieldStatus(e,j,d){var g=e;if(typeof e=="string"){var g=jQuery("#"+e+", ."+e+"")}if(j==null){clearFieldErrors(g)}if(j==-1){return}if(j==""){j="Unknown error!"}var a=jQuery('<div class="statusContainer"><span class="status"></span></div>');var b=g.find(".status");if(b.length==0){g.find("*[validate]").after(a)}else{b=b.eq(0);if(b.parent().is(".staticStatusContainer")){a=b.parent()}else{if(b.parent().is(".statusContainer")){b.parent().replaceWith(a)}else{b.replaceWith(a)}}}b=a.find(".status");if(d=="success"||d=="info"){if(a.is(".staticStatusContainer")){a.removeClass("staticStatusContainerBad");a.addClass("staticStatusContainerGood")}else{a.removeClass("statusContainerBad");a.addClass("statusContainerGood")}}else{if(a.is(".staticStatusContainer")){a.removeClass("staticStatusContainerGood");a.addClass("staticStatusContainerBad")}else{a.removeClass("statusContainerGood");a.addClass("statusContainerBad")}}if(a.is(".statusContainer")){var h=g.find("*[validate]");if(h.size()==0){h=a}a.css("width",h.outerWidth()-4-2);var f=a.position().left-h.position().left;f-=parseInt(h.css("marginLeft").replace("px","").replace("auto","0"));var c=a.position().top-h.position().top;c-=parseInt(h.css("marginTop").replace("px","").replace("auto","0"));a.css("marginLeft",-f+2+"px");a.css("marginTop",-c+h.outerHeight()-1)}b.html(j);a.show();return b}function showFieldError(a,b){return _showFieldStatus(a,b,"error")}function showFieldWarning(a,b){return _showFieldStatus(a,b,"warning")}function showFieldInfo(a,b){return _showFieldStatus(a,b,"info")}function showFieldSuccess(a,b){setTimeout(function(){clearFieldErrors(a)},2500);return _showFieldStatus(a,b,"success")}function emailTest(b){var a=(/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i).test(b);return a?null:"Web.Validate.Email"}function phoneTest(a){return notEmptyTest(a)}function regexTest(c,b){var a=(b).test(c);return a?null:"regex"}function notEmptyTest(b){var a=regexTest(b,/[^ ]+/);return a==null?null:"Web.Validate.NotEmpty"}function nameTest(b){var a=regexTest(b,/^[^ ]+( [^ ]+)+ *$/);return a==null?null:"Web.Validate.Name"}function numberTest(b){var a=regexTest(b,/^\d+$/);return a==null?null:"Web.Validate.Number"}function postalTest(b){var a=regexTest(b,/^\d( ?\d+)+ *$/);return a==null?null:"Web.Validate.Postal"}function personNrTest(b){var a=regexTest(b,/^(\d\d)?\d{6}-\d{4}$/);return a==null?null:"Web.Validate.PersonNr"}function birthDateTest(b){var a=regexTest(b,/^\d{8}$/);return a==null?null:"Web.Validate.BirthDate"}function birthYearTest(b){var a=regexTest(b,/^\d{4}$/);return a==null?null:"Web.Validate.BirthYear"}function notNegativeTest(b){var a=parseInt(b)>-1;return a?null:"Web.Validate.NotNegative"}function comboTest(b){var a=notNegativeTest(b);return a==null?null:"Web.Validate.Combo"}function categoryComboTest(b){var a=notNegativeTest(b);return a==null?null:"Web.Validate.CategoryCombo"}function positiveTest(b){var a=parseInt(b)>0;return a?null:"Web.Validate.Positive"}function noTest(a){return null}function stickyTest(b,a){if(a.closest(".field").find(".sticky").length==0){return null}else{return -1}}function checkedTest(b,a){return a.get(0).checked?null:"checked"}function validateField(el,validation){var validate=el.attr("validate")||validation;if(validate==undefined||validate==""){return true}var func=validate+"Test";var notEmptyRes=notEmptyTest(el.val(),el);var valid=null;if(el.attr("required")=="true"){if(notEmptyRes!=null){valid=notEmptyRes}else{valid=eval(func)(el.val(),el)}}else{if(notEmptyRes!=null){valid=null}else{valid=eval(func)(el.val(),el)}}if(valid==null||el.disabled()){clearFieldErrors(el.parents(".field"));el.attr("validated","validated");el.addClass("valid");el.removeClass("invalid")}else{var errorText=CupMan.T(valid);if(valid==validate){if(el.attr("error")){errorText=el.attr("error")}}showFieldError(el.parents(".field"),errorText);el.removeAttr("validated");el.addClass("invalid");el.removeClass("valid");el.removeAttr("readonly");el.closest(".hasValueField").removeClass("hasValueField")}return(valid==null||el.disabled())}function setValid(b){var a=b;if(a.is(".field")){a=a.find("input")}clearFieldErrors(a.parents(".field"));a.attr("validated","validated");a.addClass("valid");a.removeClass("invalid")}jQuery.fn.validate=function(){this.each(function(){validateField(jQuery(this))})};function validateEvent(b){var a=jQuery(this);validateField(a)}jQuery(function(){jQuery(".field input[validate], .field select[validate], .field textarea[validate]").keydown(function(){});jQuery(".field input[validate], .field select[validate], .field textarea[validate]").change(validateEvent).keyup(validateEvent);jQuery(".field *[validate]").blur(function(){if(!jQuery(this).closest(".field").find(".status").is(".sticky")){clearFieldErrors(jQuery(this).closest(".field"))}});jQuery(".field *[validate]").focus(function(){jQuery(this).validate()});jQuery(".button-bar, .buttonBar").attr("align","center");jQuery("input.numeric").numeric();jQuery("form[action='']").attr("action",stripHash(window.location.href))});var ids="$ids";function stripHash(b){var a=b.indexOf("#");if(a>-1){return b.substring(0,a)}else{return b}}function getBaseUrl(){if(onAjaxSite){return"#"}var a="$baseUrl/";return a}function getUrl(){var a=window.location.href;if(a.indexOf("#")>-1){a=a.substr(0,a.indexOf("#"))}return a}function getRelUrl(){return window.location.pathname}function buildUrl(a){var b=getBaseUrl().substr(0,getBaseUrl().length-1);return b+a}jQuery(function(){jQuery("input:radio").click(function(){var a=jQuery(this).attr("name");var b=jQuery("input:radio[name='"+a+"']");b.each(function(){var d=jQuery(this).attr("id");var c=jQuery("label[for='"+d+"']");if(this.checked){c.css("font-weight","bold")}else{c.css("font-weight","normal")}})});jQuery("input:radio:checked").click()});function FancyMapControl(c){this.map=c;var d=document.createElement("div");var f=document.createElement("img");var h=document.createElement("img");var o=document.createElement("div");o.style.height="81px";var b=document.createElement("div");b.style.paddingLeft="21px";var k=document.createElement("div");var q=document.createElement("div");var g=document.createElement("div");var p=document.createElement("div");var a=document.createElement("div");var j=document.createElement("div");var m=document.createElement("div");var n=document.createElement("div");var e=document.createElement("div");this.setBarStyle_(n,e,c);this.setHandleStyle_(e,d,n,c);var l=this;this.setButtonStyle_(j,29,88,function(){var r=c.getZoom();if(r<19){r=r+1;c.setZoom(r);e.style.top=l._barToContainer(l._zoomToPixel(r))+"px"}});this.setButtonStyle_(m,30,240,function(){var r=c.getZoom();if(r>1){r=r-1;c.setZoom(r);e.style.top=l._barToContainer(l._zoomToPixel(r))+"px"}});this.setButtonStyle_(k,30,9,function(){c.panBy(0,-100)});this.setButtonStyle_(q,30,49,function(){c.panBy(0,100)});this.setButtonStyle_(g,9,29,function(){c.panBy(-100,0)});this.setButtonStyle_(p,50,29,function(){c.panBy(100,0)});o.appendChild(k);o.appendChild(q);o.appendChild(g);o.appendChild(p);b.appendChild(j);b.appendChild(m);b.appendChild(n);b.appendChild(e);f.src="http://static.cupmanager.net/images/map_top.png";h.src="http://static.cupmanager.net/images/map_zoom.png";o.appendChild(f);b.appendChild(h);d.appendChild(o);d.appendChild(b);d.style.cursor="url(http://maps.gstatic.com/intl/sv_se/mapfiles/openhand_8_8.cur), default";return d}FancyMapControl.prototype._screenToBar=function(b){var a=b;var b=b-jQuery(this.map.getDiv()).offset().top+jQuery(document).scrollTop();b=b-121;if(b<0){b=0}if(b>125){b=125}return b};FancyMapControl.prototype._pixelToZoom=function(c){var a=125/19;var b=Math.round(c/a);b=19-b;return b};FancyMapControl.prototype._zoomToPixel=function(b){var a=125/19;b=19-b;var c=b*a;return c};FancyMapControl.prototype._barToContainer=function(a){return 105+a};FancyMapControl.prototype.setButtonStyle_=function(b,a,d,c){b.style.position="absolute";b.style.cursor="pointer";b.style.width="23px";b.style.height="23px";b.style.left=a+"px";b.style.top=d+"px";b.style.zIndex=1000;google.maps.event.addDomListener(b,"mouseover",function(){this.style.backgroundImage="url(http://static.cupmanager.net/images/map_hoover.png)"});google.maps.event.addDomListener(b,"mouseout",function(){this.style.backgroundImage="none"});google.maps.event.addDomListener(b,"click",c)};FancyMapControl.prototype.setBarStyle_=function(b,c,d){b.style.position="absolute";b.style.cursor="pointer";b.style.width="10px";b.style.height="132px";b.style.left="35px";b.style.top="112px";var a=this;google.maps.event.addDomListener(b,"click",function(e){var f=a._pixelToZoom(a._screenToBar(e.clientY));d.setZoom(f);c.style.top=a._barToContainer(a._zoomToPixel(f))+"px"})};FancyMapControl.prototype.setHandleStyle_=function(d,b,e,a){var c=this;d.style.position="absolute";d.style.width="33px";d.style.height="19px";d.style.left="24px";d.style.top=this._barToContainer(this._zoomToPixel(a.getZoom()));var f=false;var g=a.getZoom();var h="url(http://maps.gstatic.com/intl/sv_se/mapfiles/openhand_8_8.cur), default";var j="url(http://maps.gstatic.com/intl/sv_se/mapfiles/closedhand_8_8.cur), default";d.style.cursor="url(http://maps.gstatic.com/intl/sv_se/mapfiles/openhand_8_8.cur), default";
d.style.backgroundImage="url(http://static.cupmanager.net/images/map_handle.png)";var c=this;google.maps.event.addListener(a,"zoom_changed",function(){if(a.getZoom()!=g){g=a.getZoom();d.style.top=c._barToContainer(c._zoomToPixel(g))+"px"}});google.maps.event.addDomListener(d,"mousedown",function(k){d.style.cursor=j;b.style.cursor=j;e.style.cursor=j;f=true;k.cancelBubble=true;if(k.stopPropagation){k.stopPropagation()}if(k.preventDefault){k.preventDefault()}});google.maps.event.addDomListener(b,"mousemove",function(k){if(f){var m=c._screenToBar(k.clientY);var l=c._pixelToZoom(m);d.style.top=c._barToContainer(c._zoomToPixel(l))+"px"}});google.maps.event.addDomListener(b,"mouseout",function(k){if(f&&k.clientX+document.documentElement.scrollLeft-jQuery(a.getDiv()).offset().left>80){d.style.cursor=h;b.style.cursor=h;e.style.cursor="pointer";f=false;d.style.top=(108+dy*(19-a.getZoom()))+"px"}});google.maps.event.addDomListener(b,"mouseup",function(k){if(f){d.style.cursor=h;b.style.cursor=h;e.style.cursor="pointer";f=false;var m=c._screenToBar(k.clientY);var l=c._pixelToZoom(m);a.setZoom(l);d.style.top=c._barToContainer(c._zoomToPixel(l))+"px"}})};if(true){function ButtonMapControl(){this.buttons=[]}ButtonMapControl.prototype.addButton=function(c,d,b){var a={title:c,onclick:d,startSelected:b};this.buttons.push(a)};ButtonMapControl.prototype.initialize=function(g){this.map=g;var a=document.createElement("div");var e=this;for(var c=0;c<this.buttons.length;c++){var b=this.buttons[c];var f=document.createElement("div");var d=document.createElement("div");b.buttonDiv=f;b.innerDiv=d;this.setButtonStyle_(b);if(b.startSelected){this.setButtonStyle_selected(b)}a.appendChild(f);f.appendChild(d);d.appendChild(document.createTextNode(b.title));f.onclick=function(h){return function(){e.select(h);h.onclick()}}(b);if(b.startSelected){b.onclick()}}return a};ButtonMapControl.prototype.select=function(c){for(var b=0;b<this.buttons.length;b++){var a=this.buttons[b];if(a==c){this.setButtonStyle_selected(a)}else{this.setButtonStyle_(a)}}};ButtonMapControl.prototype.getDefaultPosition=function(){var b=90*this.buttons.length+2*(this.buttons.length-1);var a=this.map.getSize().width;return new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(a/2-b/2,5))};ButtonMapControl.prototype.setButtonStyle_=function(a){a.buttonDiv.style.cssFloat="left";a.buttonDiv.style.styleFloat="left";a.buttonDiv.style.border="1px solid #829BB5";a.buttonDiv.style.background="white";a.innerDiv.style.borderColor="white #B0B0B0 #B0B0B0 white";a.innerDiv.style.borderStyle="solid";a.innerDiv.style.borderWidth="1px";a.buttonDiv.style.cursor="pointer";a.buttonDiv.style.maxWidth="150px";a.buttonDiv.style.textAlign="center";a.buttonDiv.style.font="small Arial";a.buttonDiv.style.marginRight="2px";a.innerDiv.style.color="black";a.innerDiv.style.padding="1px 4px";a.innerDiv.style.whiteSpace="nowrap";a.innerDiv.style.fontWeight="normal"};ButtonMapControl.prototype.setButtonStyle_selected=function(a){a.innerDiv.style.borderColor="#345684 #6C9DDF #6C9DDF #345684";a.innerDiv.style.fontWeight="bold"};
/*
 * jquery.qtip. The jQuery tooltip plugin
 *
 * Copyright (c) 2009 Craig Thompson
 * http://craigsworks.com
 *
 * Licensed under MIT
 * http://www.opensource.org/licenses/mit-license.php
 *
 * Launch  : February 2009
 * Version : 1.0.0-rc3
 * Released: Tuesday 12th May, 2009 - 00:00
 * Debug: jquery.qtip.debug.js
 */
}(function(f){f.fn.qtip=function(B,u){var y,t,A,s,x,w,v,z;if(typeof B=="string"){if(typeof f(this).data("qtip")!=="object"){f.fn.qtip.log.error.call(self,1,f.fn.qtip.constants.NO_TOOLTIP_PRESENT,false)}if(B=="api"){return f(this).data("qtip").interfaces[f(this).data("qtip").current]}else{if(B=="interfaces"){return f(this).data("qtip").interfaces}}}else{if(!B){B={}}if(typeof B.content!=="object"||(B.content.jquery&&B.content.length>0)){B.content={text:B.content}}if(typeof B.content.title!=="object"){B.content.title={text:B.content.title}}if(typeof B.position!=="object"){B.position={corner:B.position}}if(typeof B.position.corner!=="object"){B.position.corner={target:B.position.corner,tooltip:B.position.corner}}if(typeof B.show!=="object"){B.show={when:B.show}}if(typeof B.show.when!=="object"){B.show.when={event:B.show.when}}if(typeof B.show.effect!=="object"){B.show.effect={type:B.show.effect}}if(typeof B.hide!=="object"){B.hide={when:B.hide}}if(typeof B.hide.when!=="object"){B.hide.when={event:B.hide.when}}if(typeof B.hide.effect!=="object"){B.hide.effect={type:B.hide.effect}}if(typeof B.style!=="object"){B.style={name:B.style}}B.style=c(B.style);s=f.extend(true,{},f.fn.qtip.defaults,B);s.style=a.call({options:s},s.style);s.user=f.extend(true,{},B)}return f(this).each(function(){if(typeof B=="string"){w=B.toLowerCase();A=f(this).qtip("interfaces");if(typeof A=="object"){if(u===true&&w=="destroy"){while(A.length>0){A[A.length-1].destroy()}}else{if(u!==true){A=[f(this).qtip("api")]}for(y=0;y<A.length;y++){if(w=="destroy"){A[y].destroy()}else{if(A[y].status.rendered===true){if(w=="show"){A[y].show()}else{if(w=="hide"){A[y].hide()}else{if(w=="focus"){A[y].focus()}else{if(w=="disable"){A[y].disable(true)}else{if(w=="enable"){A[y].disable(false)}}}}}}}}}}}else{v=f.extend(true,{},s);v.hide.effect.length=s.hide.effect.length;v.show.effect.length=s.show.effect.length;if(v.position.container===false){v.position.container=f(document.body)}if(v.position.target===false){v.position.target=f(this)}if(v.show.when.target===false){v.show.when.target=f(this)}if(v.hide.when.target===false){v.hide.when.target=f(this)}t=f.fn.qtip.interfaces.length;for(y=0;y<t;y++){if(typeof f.fn.qtip.interfaces[y]=="undefined"){t=y;break}}x=new d(f(this),v,t);f.fn.qtip.interfaces[t]=x;if(typeof f(this).data("qtip")=="object"){if(typeof f(this).attr("qtip")==="undefined"){f(this).data("qtip").current=f(this).data("qtip").interfaces.length}f(this).data("qtip").interfaces.push(x)}else{f(this).data("qtip",{current:0,interfaces:[x]})}if(v.content.prerender===false&&v.show.when.event!==false&&v.show.ready!==true){v.show.when.target.bind(v.show.when.event+".qtip-"+t+"-create",{qtip:t},function(C){z=f.fn.qtip.interfaces[C.data.qtip];z.options.show.when.target.unbind(z.options.show.when.event+".qtip-"+C.data.qtip+"-create");z.cache.mouse={x:C.pageX,y:C.pageY};p.call(z);z.options.show.when.target.trigger(z.options.show.when.event)})}else{x.cache.mouse={x:v.show.when.target.offset().left,y:v.show.when.target.offset().top};p.call(x)}}})};function d(u,t,v){var s=this;s.id=v;s.options=t;s.status={animated:false,rendered:false,disabled:false,focused:false};s.elements={target:u.addClass(s.options.style.classes.target),tooltip:null,wrapper:null,content:null,contentWrapper:null,title:null,button:null,tip:null,bgiframe:null};s.cache={mouse:{},position:{},toggle:0};s.timers={};f.extend(s,s.options.api,{show:function(y){var x,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"show")}if(s.elements.tooltip.css("display")!=="none"){return s}s.elements.tooltip.stop(true,false);x=s.beforeShow.call(s,y);if(x===false){return s}function w(){if(s.options.position.type!=="static"){s.focus()}s.onShow.call(s,y);if(f.browser.msie){s.elements.tooltip.get(0).style.removeAttribute("filter")}}s.cache.toggle=1;if(s.options.position.type!=="static"){s.updatePosition(y,(s.options.show.effect.length>0))}if(typeof s.options.show.solo=="object"){z=f(s.options.show.solo)}else{if(s.options.show.solo===true){z=f("div.qtip").not(s.elements.tooltip)}}if(z){z.each(function(){if(f(this).qtip("api").status.rendered===true){f(this).qtip("api").hide()}})}if(typeof s.options.show.effect.type=="function"){s.options.show.effect.type.call(s.elements.tooltip,s.options.show.effect.length);s.elements.tooltip.queue(function(){w();f(this).dequeue()})}else{switch(s.options.show.effect.type.toLowerCase()){case"fade":s.elements.tooltip.fadeIn(s.options.show.effect.length,w);break;case"slide":s.elements.tooltip.slideDown(s.options.show.effect.length,function(){w();if(s.options.position.type!=="static"){s.updatePosition(y,true)}});break;case"grow":s.elements.tooltip.show(s.options.show.effect.length,w);break;default:s.elements.tooltip.show(null,w);w();break}s.elements.tooltip.addClass(s.options.style.classes.active)}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_SHOWN,"show")},hide:function(y){var x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"hide")}else{if(s.elements.tooltip.css("display")==="none"){return s}}clearTimeout(s.timers.show);s.elements.tooltip.stop(true,false);x=s.beforeHide.call(s,y);if(x===false){return s}function w(){s.onHide.call(s,y)}s.cache.toggle=0;if(typeof s.options.hide.effect.type=="function"){s.options.hide.effect.type.call(s.elements.tooltip,s.options.hide.effect.length);s.elements.tooltip.queue(function(){w();f(this).dequeue()})}else{switch(s.options.hide.effect.type.toLowerCase()){case"fade":s.elements.tooltip.fadeOut(s.options.hide.effect.length,w);break;case"slide":s.elements.tooltip.slideUp(s.options.hide.effect.length,w);break;case"grow":s.elements.tooltip.hide(s.options.hide.effect.length,w);break;default:s.elements.tooltip.hide(null,w);break}s.elements.tooltip.removeClass(s.options.style.classes.active)}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_HIDDEN,"hide")},updatePosition:function(w,x){var C,G,L,J,H,E,y,I,B,D,K,A,F,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updatePosition")}else{if(s.options.position.type=="static"){return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.CANNOT_POSITION_STATIC,"updatePosition")}}G={position:{left:0,top:0},dimensions:{height:0,width:0},corner:s.options.position.corner.target};L={position:s.getPosition(),dimensions:s.getDimensions(),corner:s.options.position.corner.tooltip};if(s.options.position.target!=="mouse"){if(s.options.position.target.get(0).nodeName.toLowerCase()=="area"){J=s.options.position.target.attr("coords").split(",");
for(C=0;C<J.length;C++){J[C]=parseInt(J[C])}H=s.options.position.target.parent("map").attr("name");E=f('img[usemap="#'+H+'"]:first').offset();G.position={left:Math.floor(E.left+J[0]),top:Math.floor(E.top+J[1])};switch(s.options.position.target.attr("shape").toLowerCase()){case"rect":G.dimensions={width:Math.ceil(Math.abs(J[2]-J[0])),height:Math.ceil(Math.abs(J[3]-J[1]))};break;case"circle":G.dimensions={width:J[2]+1,height:J[2]+1};break;case"poly":G.dimensions={width:J[0],height:J[1]};for(C=0;C<J.length;C++){if(C%2==0){if(J[C]>G.dimensions.width){G.dimensions.width=J[C]}if(J[C]<J[0]){G.position.left=Math.floor(E.left+J[C])}}else{if(J[C]>G.dimensions.height){G.dimensions.height=J[C]}if(J[C]<J[1]){G.position.top=Math.floor(E.top+J[C])}}}G.dimensions.width=G.dimensions.width-(G.position.left-E.left);G.dimensions.height=G.dimensions.height-(G.position.top-E.top);break;default:return f.fn.qtip.log.error.call(s,4,f.fn.qtip.constants.INVALID_AREA_SHAPE,"updatePosition");break}G.dimensions.width-=2;G.dimensions.height-=2}else{if(s.options.position.target.add(document.body).length===1){G.position={left:f(document).scrollLeft(),top:f(document).scrollTop()};G.dimensions={height:f(window).height(),width:f(window).width()}}else{if(typeof s.options.position.target.attr("qtip")!=="undefined"){G.position=s.options.position.target.qtip("api").cache.position}else{G.position=s.options.position.target.offset()}G.dimensions={height:s.options.position.target.outerHeight(),width:s.options.position.target.outerWidth()}}}y=f.extend({},G.position);if(G.corner.search(/right/i)!==-1){y.left+=G.dimensions.width}if(G.corner.search(/bottom/i)!==-1){y.top+=G.dimensions.height}if(G.corner.search(/((top|bottom)Middle)|center/)!==-1){y.left+=(G.dimensions.width/2)}if(G.corner.search(/((left|right)Middle)|center/)!==-1){y.top+=(G.dimensions.height/2)}}else{G.position=y={left:s.cache.mouse.x,top:s.cache.mouse.y};G.dimensions={height:1,width:1}}if(L.corner.search(/right/i)!==-1){y.left-=L.dimensions.width}if(L.corner.search(/bottom/i)!==-1){y.top-=L.dimensions.height}if(L.corner.search(/((top|bottom)Middle)|center/)!==-1){y.left-=(L.dimensions.width/2)}if(L.corner.search(/((left|right)Middle)|center/)!==-1){y.top-=(L.dimensions.height/2)}I=(f.browser.msie)?1:0;B=(f.browser.msie&&parseInt(f.browser.version.charAt(0))===6)?1:0;if(s.options.style.border.radius>0){if(L.corner.search(/Left/)!==-1){y.left-=s.options.style.border.radius}else{if(L.corner.search(/Right/)!==-1){y.left+=s.options.style.border.radius}}if(L.corner.search(/Top/)!==-1){y.top-=s.options.style.border.radius}else{if(L.corner.search(/Bottom/)!==-1){y.top+=s.options.style.border.radius}}}if(I){if(L.corner.search(/top/)!==-1){y.top-=I}else{if(L.corner.search(/bottom/)!==-1){y.top+=I}}if(L.corner.search(/left/)!==-1){y.left-=I}else{if(L.corner.search(/right/)!==-1){y.left+=I}}if(L.corner.search(/leftMiddle|rightMiddle/)!==-1){y.top-=1}}if(s.options.position.adjust.screen===true){y=o.call(s,y,G,L)}if(s.options.position.target==="mouse"&&s.options.position.adjust.mouse===true){if(s.options.position.adjust.screen===true&&s.elements.tip){K=s.elements.tip.attr("rel")}else{K=s.options.position.corner.tooltip}y.left+=(K.search(/right/i)!==-1)?-6:6;y.top+=(K.search(/bottom/i)!==-1)?-6:6}if(!s.elements.bgiframe&&f.browser.msie&&parseInt(f.browser.version.charAt(0))==6){f("select, object").each(function(){A=f(this).offset();A.bottom=A.top+f(this).height();A.right=A.left+f(this).width();if(y.top+L.dimensions.height>=A.top&&y.left+L.dimensions.width>=A.left){k.call(s)}})}y.left+=s.options.position.adjust.x;y.top+=s.options.position.adjust.y;F=s.getPosition();if(y.left!=F.left||y.top!=F.top){z=s.beforePositionUpdate.call(s,w);if(z===false){return s}s.cache.position=y;if(x===true){s.status.animated=true;s.elements.tooltip.animate(y,200,"swing",function(){s.status.animated=false})}else{s.elements.tooltip.css(y)}s.onPositionUpdate.call(s,w);if(typeof w!=="undefined"&&w.type&&w.type!=="mousemove"){f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_POSITION_UPDATED,"updatePosition")}}return s},updateWidth:function(w){var x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateWidth")}else{if(w&&typeof w!=="number"){return f.fn.qtip.log.error.call(s,2,"newWidth must be of type number","updateWidth")}}x=s.elements.contentWrapper.siblings().add(s.elements.tip).add(s.elements.button);if(!w){if(typeof s.options.style.width.value=="number"){w=s.options.style.width.value}else{s.elements.tooltip.css({width:"auto"});x.hide();if(f.browser.msie){s.elements.wrapper.add(s.elements.contentWrapper.children()).css({zoom:"normal"})}w=s.getDimensions().width+1;if(!s.options.style.width.value){if(w>s.options.style.width.max){w=s.options.style.width.max}if(w<s.options.style.width.min){w=s.options.style.width.min}}}}if(w%2!==0){w-=1}s.elements.tooltip.width(w);x.show();if(s.options.style.border.radius){s.elements.tooltip.find(".qtip-betweenCorners").each(function(y){f(this).width(w-(s.options.style.border.radius*2))})}if(f.browser.msie){s.elements.wrapper.add(s.elements.contentWrapper.children()).css({zoom:"1"});s.elements.wrapper.width(w);if(s.elements.bgiframe){s.elements.bgiframe.width(w).height(s.getDimensions.height)}}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_WIDTH_UPDATED,"updateWidth")},updateStyle:function(w){var z,A,x,y,B;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateStyle")}else{if(typeof w!=="string"||!f.fn.qtip.styles[w]){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.STYLE_NOT_DEFINED,"updateStyle")}}s.options.style=a.call(s,f.fn.qtip.styles[w],s.options.user.style);s.elements.content.css(q(s.options.style));if(s.options.content.title.text!==false){s.elements.title.css(q(s.options.style.title,true))}s.elements.contentWrapper.css({borderColor:s.options.style.border.color});if(s.options.style.tip.corner!==false){if(f("<canvas>").get(0).getContext){z=s.elements.tooltip.find(".qtip-tip canvas:first");x=z.get(0).getContext("2d");x.clearRect(0,0,300,300);y=z.parent("div[rel]:first").attr("rel");B=b(y,s.options.style.tip.size.width,s.options.style.tip.size.height);h.call(s,z,B,s.options.style.tip.color||s.options.style.border.color)}else{if(f.browser.msie){z=s.elements.tooltip.find('.qtip-tip [nodeName="shape"]');z.attr("fillcolor",s.options.style.tip.color||s.options.style.border.color)}}}if(s.options.style.border.radius>0){s.elements.tooltip.find(".qtip-betweenCorners").css({backgroundColor:s.options.style.border.color});if(f("<canvas>").get(0).getContext){A=g(s.options.style.border.radius);s.elements.tooltip.find(".qtip-wrapper canvas").each(function(){x=f(this).get(0).getContext("2d");x.clearRect(0,0,300,300);y=f(this).parent("div[rel]:first").attr("rel");r.call(s,f(this),A[y],s.options.style.border.radius,s.options.style.border.color)})}else{if(f.browser.msie){s.elements.tooltip.find('.qtip-wrapper [nodeName="arc"]').each(function(){f(this).attr("fillcolor",s.options.style.border.color)})}}}return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_STYLE_UPDATED,"updateStyle")},updateContent:function(A,y){var z,x,w;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateContent")}else{if(!A){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateContent")}}z=s.beforeContentUpdate.call(s,A);if(typeof z=="string"){A=z}else{if(z===false){return}}if(f.browser.msie){s.elements.contentWrapper.children().css({zoom:"normal"})}if(A.jquery&&A.length>0){A.clone(true).appendTo(s.elements.content).show()}else{s.elements.content.html(A)}x=s.elements.content.find("img[complete=false]");if(x.length>0){w=0;x.each(function(C){f('<img src="'+f(this).attr("src")+'" />').load(function(){if(++w==x.length){B()}})})}else{B()}function B(){s.updateWidth();if(y!==false){if(s.options.position.type!=="static"){s.updatePosition(s.elements.tooltip.is(":visible"),true)}if(s.options.style.tip.corner!==false){n.call(s)}}}s.onContentUpdate.call(s);return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_CONTENT_UPDATED,"loadContent")},loadContent:function(w,z,A){var y;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"loadContent")}y=s.beforeContentLoad.call(s);if(y===false){return s}if(A=="post"){f.post(w,z,x)}else{f.get(w,z,x)}function x(B){s.onContentLoad.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_CONTENT_LOADED,"loadContent");s.updateContent(B)}return s},updateTitle:function(w){if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"updateTitle")}else{if(!w){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.NO_CONTENT_PROVIDED,"updateTitle")}}returned=s.beforeTitleUpdate.call(s);if(returned===false){return s}if(s.elements.button){s.elements.button=s.elements.button.clone(true)}s.elements.title.html(w);if(s.elements.button){s.elements.title.prepend(s.elements.button)}s.onTitleUpdate.call(s);return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_TITLE_UPDATED,"updateTitle")},focus:function(A){var y,x,w,z;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"focus")}else{if(s.options.position.type=="static"){return f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.CANNOT_FOCUS_STATIC,"focus")}}y=parseInt(s.elements.tooltip.css("z-index"));x=6000+f("div.qtip[qtip]").length-1;if(!s.status.focused&&y!==x){z=s.beforeFocus.call(s,A);if(z===false){return s}f("div.qtip[qtip]").not(s.elements.tooltip).each(function(){if(f(this).qtip("api").status.rendered===true){w=parseInt(f(this).css("z-index"));if(typeof w=="number"&&w>-1){f(this).css({zIndex:parseInt(f(this).css("z-index"))-1})}f(this).qtip("api").status.focused=false}});s.elements.tooltip.css({zIndex:x});s.status.focused=true;s.onFocus.call(s,A);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_FOCUSED,"focus")
}return s},disable:function(w){if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"disable")}if(w){if(!s.status.disabled){s.status.disabled=true;f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_DISABLED,"disable")}else{f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.TOOLTIP_ALREADY_DISABLED,"disable")}}else{if(s.status.disabled){s.status.disabled=false;f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_ENABLED,"disable")}else{f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.TOOLTIP_ALREADY_ENABLED,"disable")}}return s},destroy:function(){var w,x,y;x=s.beforeDestroy.call(s);if(x===false){return s}if(s.status.rendered){s.options.show.when.target.unbind("mousemove.qtip",s.updatePosition);s.options.show.when.target.unbind("mouseout.qtip",s.hide);s.options.show.when.target.unbind(s.options.show.when.event+".qtip");s.options.hide.when.target.unbind(s.options.hide.when.event+".qtip");s.elements.tooltip.unbind(s.options.hide.when.event+".qtip");s.elements.tooltip.unbind("mouseover.qtip",s.focus);s.elements.tooltip.remove()}else{s.options.show.when.target.unbind(s.options.show.when.event+".qtip-create")}if(typeof s.elements.target.data("qtip")=="object"){y=s.elements.target.data("qtip").interfaces;if(typeof y=="object"&&y.length>0){for(w=0;w<y.length-1;w++){if(y[w].id==s.id){y.splice(w,1)}}}}delete f.fn.qtip.interfaces[s.id];if(typeof y=="object"&&y.length>0){s.elements.target.data("qtip").current=y.length-1}else{s.elements.target.removeData("qtip")}s.onDestroy.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_DESTROYED,"destroy");return s.elements.target},getPosition:function(){var w,x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getPosition")}w=(s.elements.tooltip.css("display")!=="none")?false:true;if(w){s.elements.tooltip.css({visiblity:"hidden"}).show()}x=s.elements.tooltip.offset();if(w){s.elements.tooltip.css({visiblity:"visible"}).hide()}return x},getDimensions:function(){var w,x;if(!s.status.rendered){return f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.TOOLTIP_NOT_RENDERED,"getDimensions")}w=(!s.elements.tooltip.is(":visible"))?true:false;if(w){s.elements.tooltip.css({visiblity:"hidden"}).show()}x={height:s.elements.tooltip.outerHeight(),width:s.elements.tooltip.outerWidth()};if(w){s.elements.tooltip.css({visiblity:"visible"}).hide()}return x}})}function p(){var s,w,u,t,v,y,x;s=this;s.beforeRender.call(s);s.status.rendered=true;s.elements.tooltip='<div qtip="'+s.id+'" class="qtip '+(s.options.style.classes.tooltip||s.options.style)+'"style="display:none; -moz-border-radius:0; -webkit-border-radius:0; border-radius:0;position:'+s.options.position.type+';">  <div class="qtip-wrapper" style="position:relative; overflow:hidden; text-align:left;">    <div class="qtip-contentWrapper" style="overflow:hidden;">       <div class="qtip-content '+s.options.style.classes.content+'"></div></div></div></div>';s.elements.tooltip=f(s.elements.tooltip);s.elements.tooltip.appendTo(s.options.position.container);s.elements.tooltip.data("qtip",{current:0,interfaces:[s]});s.elements.wrapper=s.elements.tooltip.children("div:first");s.elements.contentWrapper=s.elements.wrapper.children("div:first").css({background:s.options.style.background});s.elements.content=s.elements.contentWrapper.children("div:first").css(q(s.options.style));if(f.browser.msie){s.elements.wrapper.add(s.elements.content).css({zoom:1})}if(s.options.hide.when.event=="unfocus"){s.elements.tooltip.attr("unfocus",true)}if(typeof s.options.style.width.value=="number"){s.updateWidth()}if(f("<canvas>").get(0).getContext||f.browser.msie){if(s.options.style.border.radius>0){m.call(s)}else{s.elements.contentWrapper.css({border:s.options.style.border.width+"px solid "+s.options.style.border.color})}if(s.options.style.tip.corner!==false){e.call(s)}}else{s.elements.contentWrapper.css({border:s.options.style.border.width+"px solid "+s.options.style.border.color});s.options.style.border.radius=0;s.options.style.tip.corner=false;f.fn.qtip.log.error.call(s,2,f.fn.qtip.constants.CANVAS_VML_NOT_SUPPORTED,"render")}if((typeof s.options.content.text=="string"&&s.options.content.text.length>0)||(s.options.content.text.jquery&&s.options.content.text.length>0)){u=s.options.content.text}else{if(typeof s.elements.target.attr("title")=="string"&&s.elements.target.attr("title").length>0){u=s.elements.target.attr("title").replace("\\n","<br />");s.elements.target.attr("title","")}else{if(typeof s.elements.target.attr("alt")=="string"&&s.elements.target.attr("alt").length>0){u=s.elements.target.attr("alt").replace("\\n","<br />");s.elements.target.attr("alt","")}else{u=" ";f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.NO_VALID_CONTENT,"render")}}}if(s.options.content.title.text!==false){j.call(s)}s.updateContent(u);l.call(s);if(s.options.show.ready===true){s.show()}if(s.options.content.url!==false){t=s.options.content.url;v=s.options.content.data;y=s.options.content.method||"get";s.loadContent(t,v,y)}s.onRender.call(s);f.fn.qtip.log.error.call(s,1,f.fn.qtip.constants.EVENT_RENDERED,"render")}function m(){var F,z,t,B,x,E,u,G,D,y,w,C,A,s,v;F=this;F.elements.wrapper.find(".qtip-borderBottom, .qtip-borderTop").remove();t=F.options.style.border.width;B=F.options.style.border.radius;x=F.options.style.border.color||F.options.style.tip.color;E=g(B);u={};for(z in E){u[z]='<div rel="'+z+'" style="'+((z.search(/Left/)!==-1)?"left":"right")+":0; position:absolute; height:"+B+"px; width:"+B+'px; overflow:hidden; line-height:0.1px; font-size:1px">';if(f("<canvas>").get(0).getContext){u[z]+='<canvas height="'+B+'" width="'+B+'" style="vertical-align: top"></canvas>'}else{if(f.browser.msie){G=B*2+3;u[z]+='<v:arc stroked="false" fillcolor="'+x+'" startangle="'+E[z][0]+'" endangle="'+E[z][1]+'" style="width:'+G+"px; height:"+G+"px; margin-top:"+((z.search(/bottom/)!==-1)?-2:-1)+"px; margin-left:"+((z.search(/Right/)!==-1)?E[z][2]-3.5:-1)+'px; vertical-align:top; display:inline-block; behavior:url(#default#VML)"></v:arc>'}}u[z]+="</div>"}D=F.getDimensions().width-(Math.max(t,B)*2);y='<div class="qtip-betweenCorners" style="height:'+B+"px; width:"+D+"px; overflow:hidden; background-color:"+x+'; line-height:0.1px; font-size:1px;">';w='<div class="qtip-borderTop" dir="ltr" style="height:'+B+"px; margin-left:"+B+'px; line-height:0.1px; font-size:1px; padding:0;">'+u.topLeft+u.topRight+y;F.elements.wrapper.prepend(w);C='<div class="qtip-borderBottom" dir="ltr" style="height:'+B+"px; margin-left:"+B+'px; line-height:0.1px; font-size:1px; padding:0;">'+u.bottomLeft+u.bottomRight+y;F.elements.wrapper.append(C);if(f("<canvas>").get(0).getContext){F.elements.wrapper.find("canvas").each(function(){A=E[f(this).parent("[rel]:first").attr("rel")];r.call(F,f(this),A,B,x)})}else{if(f.browser.msie){F.elements.tooltip.append('<v:image style="behavior:url(#default#VML);"></v:image>')}}s=Math.max(B,(B+(t-B)));v=Math.max(t-B,0);F.elements.contentWrapper.css({border:"0px solid "+x,borderWidth:v+"px "+s+"px"})}function r(u,w,s,t){var v=u.get(0).getContext("2d");v.fillStyle=t;v.beginPath();v.arc(w[0],w[1],s,0,Math.PI*2,false);v.fill()}function e(v){var t,s,x,u,w;t=this;if(t.elements.tip!==null){t.elements.tip.remove()}s=t.options.style.tip.color||t.options.style.border.color;if(t.options.style.tip.corner===false){return}else{if(!v){v=t.options.style.tip.corner}}x=b(v,t.options.style.tip.size.width,t.options.style.tip.size.height);t.elements.tip='<div class="'+t.options.style.classes.tip+'" dir="ltr" rel="'+v+'" style="position:absolute; height:'+t.options.style.tip.size.height+"px; width:"+t.options.style.tip.size.width+'px; margin:0 auto; line-height:0.1px; font-size:1px;">';if(f("<canvas>").get(0).getContext){t.elements.tip+='<canvas height="'+t.options.style.tip.size.height+'" width="'+t.options.style.tip.size.width+'"></canvas>'}else{if(f.browser.msie){u=t.options.style.tip.size.width+","+t.options.style.tip.size.height;w="m"+x[0][0]+","+x[0][1];w+=" l"+x[1][0]+","+x[1][1];w+=" "+x[2][0]+","+x[2][1];w+=" xe";t.elements.tip+='<v:shape fillcolor="'+s+'" stroked="false" filled="true" path="'+w+'" coordsize="'+u+'" style="width:'+t.options.style.tip.size.width+"px; height:"+t.options.style.tip.size.height+"px; line-height:0.1px; display:inline-block; behavior:url(#default#VML); vertical-align:"+((v.search(/top/)!==-1)?"bottom":"top")+'"></v:shape>';t.elements.tip+='<v:image style="behavior:url(#default#VML);"></v:image>';t.elements.contentWrapper.css("position","relative")}}t.elements.tooltip.prepend(t.elements.tip+"</div>");t.elements.tip=t.elements.tooltip.find("."+t.options.style.classes.tip).eq(0);if(f("<canvas>").get(0).getContext){h.call(t,t.elements.tip.find("canvas:first"),x,s)}if(v.search(/top/)!==-1&&f.browser.msie&&parseInt(f.browser.version.charAt(0))===6){t.elements.tip.css({marginTop:-4})}n.call(t,v)}function h(t,v,s){var u=t.get(0).getContext("2d");u.fillStyle=s;u.beginPath();u.moveTo(v[0][0],v[0][1]);u.lineTo(v[1][0],v[1][1]);u.lineTo(v[2][0],v[2][1]);u.fill()}function n(u){var t,w,s,x,v;t=this;if(t.options.style.tip.corner===false||!t.elements.tip){return}if(!u){u=t.elements.tip.attr("rel")}w=positionAdjust=(f.browser.msie)?1:0;t.elements.tip.css(u.match(/left|right|top|bottom/)[0],0);if(u.search(/top|bottom/)!==-1){if(f.browser.msie){if(parseInt(f.browser.version.charAt(0))===6){positionAdjust=(u.search(/top/)!==-1)?-3:1}else{positionAdjust=(u.search(/top/)!==-1)?1:2}}if(u.search(/Middle/)!==-1){t.elements.tip.css({left:"50%",marginLeft:-(t.options.style.tip.size.width/2)})}else{if(u.search(/Left/)!==-1){t.elements.tip.css({left:t.options.style.border.radius-w})}else{if(u.search(/Right/)!==-1){t.elements.tip.css({right:t.options.style.border.radius+w})}}}if(u.search(/top/)!==-1){t.elements.tip.css({top:-positionAdjust})}else{t.elements.tip.css({bottom:positionAdjust})}}else{if(u.search(/left|right/)!==-1){if(f.browser.msie){positionAdjust=(parseInt(f.browser.version.charAt(0))===6)?1:((u.search(/left/)!==-1)?1:2)
}if(u.search(/Middle/)!==-1){t.elements.tip.css({top:"50%",marginTop:-(t.options.style.tip.size.height/2)})}else{if(u.search(/Top/)!==-1){t.elements.tip.css({top:t.options.style.border.radius-w})}else{if(u.search(/Bottom/)!==-1){t.elements.tip.css({bottom:t.options.style.border.radius+w})}}}if(u.search(/left/)!==-1){t.elements.tip.css({left:-positionAdjust})}else{t.elements.tip.css({right:positionAdjust})}}}s="padding-"+u.match(/left|right|top|bottom/)[0];x=t.options.style.tip.size[(s.search(/left|right/)!==-1)?"width":"height"];t.elements.tooltip.css("padding",0);t.elements.tooltip.css(s,x);if(f.browser.msie&&parseInt(f.browser.version.charAt(0))==6){v=parseInt(t.elements.tip.css("margin-top"))||0;v+=parseInt(t.elements.content.css("margin-top"))||0;t.elements.tip.css({marginTop:v})}}function j(){var s=this;if(s.elements.title!==null){s.elements.title.remove()}s.elements.title=f('<div class="'+s.options.style.classes.title+'">').css(q(s.options.style.title,true)).css({zoom:(f.browser.msie)?1:0}).prependTo(s.elements.contentWrapper);if(s.options.content.title.text){s.updateTitle.call(s,s.options.content.title.text)}if(s.options.content.title.button!==false&&typeof s.options.content.title.button=="string"){s.elements.button=f('<a class="'+s.options.style.classes.button+'" style="float:right; position: relative"></a>').css(q(s.options.style.button,true)).html(s.options.content.title.button).prependTo(s.elements.title).click(function(t){if(!s.status.disabled){s.hide(t)}})}}function l(){var t,v,u,s;t=this;v=t.options.show.when.target;u=t.options.hide.when.target;if(t.options.hide.fixed){u=u.add(t.elements.tooltip)}if(t.options.hide.when.event=="inactive"){s=["click","dblclick","mousedown","mouseup","mousemove","mouseout","mouseenter","mouseleave","mouseover"];function y(z){if(t.status.disabled===true){return}clearTimeout(t.timers.inactive);t.timers.inactive=setTimeout(function(){f(s).each(function(){u.unbind(this+".qtip-inactive");t.elements.content.unbind(this+".qtip-inactive")});t.hide(z)},t.options.hide.delay)}}else{if(t.options.hide.fixed===true){t.elements.tooltip.bind("mouseover.qtip",function(){if(t.status.disabled===true){return}clearTimeout(t.timers.hide)})}}function x(z){if(t.status.disabled===true){return}if(t.options.hide.when.event=="inactive"){f(s).each(function(){u.bind(this+".qtip-inactive",y);t.elements.content.bind(this+".qtip-inactive",y)});y()}clearTimeout(t.timers.show);clearTimeout(t.timers.hide);t.timers.show=setTimeout(function(){t.show(z)},t.options.show.delay)}function w(z){if(t.status.disabled===true){return}if(t.options.hide.fixed===true&&t.options.hide.when.event.search(/mouse(out|leave)/i)!==-1&&f(z.relatedTarget).parents("div.qtip[qtip]").length>0){clearTimeout(t.timers.hide)}clearTimeout(t.timers.show);clearTimeout(t.timers.hide);t.elements.tooltip.stop(true,true);t.timers.hide=setTimeout(function(){t.hide(z)},t.options.hide.delay)}if((t.options.show.when.target.add(t.options.hide.when.target).length===1&&t.options.show.when.event==t.options.hide.when.event&&t.options.hide.when.event!=="inactive")||t.options.hide.when.event=="unfocus"){t.cache.toggle=0;v.bind(t.options.show.when.event+".qtip",function(z){if(t.cache.toggle==0){x(z)}else{w(z)}})}else{v.bind(t.options.show.when.event+".qtip",x);if(t.options.hide.when.event!=="inactive"){u.bind(t.options.hide.when.event+".qtip",w)}}if(t.options.position.type.search(/(fixed|absolute)/)!==-1){t.elements.tooltip.bind("mouseover.qtip",t.focus)}if(t.options.position.target==="mouse"&&t.options.position.type!=="static"){v.bind("mousemove.qtip",function(z){t.cache.mouse={x:z.pageX,y:z.pageY};if(t.status.disabled===false&&t.options.position.adjust.mouse===true&&t.options.position.type!=="static"&&t.elements.tooltip.css("display")!=="none"){t.updatePosition(z)}})}}function o(u,v,A){var z,s,x,y,t,w;z=this;if(A.corner=="center"){return v.position}s=f.extend({},u);y={x:false,y:false};t={left:(s.left<f.fn.qtip.cache.screen.scroll.left),right:(s.left+A.dimensions.width+2>=f.fn.qtip.cache.screen.width+f.fn.qtip.cache.screen.scroll.left),top:(s.top<f.fn.qtip.cache.screen.scroll.top),bottom:(s.top+A.dimensions.height+2>=f.fn.qtip.cache.screen.height+f.fn.qtip.cache.screen.scroll.top)};x={left:(t.left&&(A.corner.search(/right/i)!=-1||(A.corner.search(/right/i)==-1&&!t.right))),right:(t.right&&(A.corner.search(/left/i)!=-1||(A.corner.search(/left/i)==-1&&!t.left))),top:(t.top&&A.corner.search(/top/i)==-1),bottom:(t.bottom&&A.corner.search(/bottom/i)==-1)};if(x.left){if(z.options.position.target!=="mouse"){s.left=v.position.left+v.dimensions.width}else{s.left=z.cache.mouse.x}y.x="Left"}else{if(x.right){if(z.options.position.target!=="mouse"){s.left=v.position.left-A.dimensions.width}else{s.left=z.cache.mouse.x-A.dimensions.width}y.x="Right"}}if(x.top){if(z.options.position.target!=="mouse"){s.top=v.position.top+v.dimensions.height}else{s.top=z.cache.mouse.y}y.y="top"}else{if(x.bottom){if(z.options.position.target!=="mouse"){s.top=v.position.top-A.dimensions.height}else{s.top=z.cache.mouse.y-A.dimensions.height}y.y="bottom"}}if(s.left<0){s.left=u.left;y.x=false}if(s.top<0){s.top=u.top;y.y=false}if(z.options.style.tip.corner!==false){s.corner=new String(A.corner);if(y.x!==false){s.corner=s.corner.replace(/Left|Right|Middle/,y.x)}if(y.y!==false){s.corner=s.corner.replace(/top|bottom/,y.y)}if(s.corner!==z.elements.tip.attr("rel")){e.call(z,s.corner)}}return s}function q(u,t){var v,s;v=f.extend(true,{},u);for(s in v){if(t===true&&s.search(/(tip|classes)/i)!==-1){delete v[s]}else{if(!t&&s.search(/(width|border|tip|title|classes|user)/i)!==-1){delete v[s]}}}return v}function c(s){if(typeof s.tip!=="object"){s.tip={corner:s.tip}}if(typeof s.tip.size!=="object"){s.tip.size={width:s.tip.size,height:s.tip.size}}if(typeof s.border!=="object"){s.border={width:s.border}}if(typeof s.width!=="object"){s.width={value:s.width}}if(typeof s.width.max=="string"){s.width.max=parseInt(s.width.max.replace(/([0-9]+)/i,"$1"))}if(typeof s.width.min=="string"){s.width.min=parseInt(s.width.min.replace(/([0-9]+)/i,"$1"))}if(typeof s.tip.size.x=="number"){s.tip.size.width=s.tip.size.x;delete s.tip.size.x}if(typeof s.tip.size.y=="number"){s.tip.size.height=s.tip.size.y;delete s.tip.size.y}return s}function a(){var s,t,u,x,v,w;s=this;u=[true,{}];for(t=0;t<arguments.length;t++){u.push(arguments[t])}x=[f.extend.apply(f,u)];while(typeof x[0].name=="string"){x.unshift(c(f.fn.qtip.styles[x[0].name]))}x.unshift(true,{classes:{tooltip:"qtip-"+(arguments[0].name||"defaults")}},f.fn.qtip.styles.defaults);v=f.extend.apply(f,x);w=(f.browser.msie)?1:0;v.tip.size.width+=w;v.tip.size.height+=w;if(v.tip.size.width%2>0){v.tip.size.width+=1}if(v.tip.size.height%2>0){v.tip.size.height+=1}if(v.tip.corner===true){v.tip.corner=(s.options.position.corner.tooltip==="center")?false:s.options.position.corner.tooltip}return v}function b(v,u,t){var s={bottomRight:[[0,0],[u,t],[u,0]],bottomLeft:[[0,0],[u,0],[0,t]],topRight:[[0,t],[u,0],[u,t]],topLeft:[[0,0],[0,t],[u,t]],topMiddle:[[0,t],[u/2,0],[u,t]],bottomMiddle:[[0,0],[u,0],[u/2,t]],rightMiddle:[[0,0],[u,t/2],[0,t]],leftMiddle:[[u,0],[u,t],[0,t/2]]};s.leftTop=s.bottomRight;s.rightTop=s.bottomLeft;s.leftBottom=s.topRight;s.rightBottom=s.topLeft;return s[v]}function g(s){var t;if(f("<canvas>").get(0).getContext){t={topLeft:[s,s],topRight:[0,s],bottomLeft:[s,0],bottomRight:[0,0]}}else{if(f.browser.msie){t={topLeft:[-90,90,0],topRight:[-90,90,-s],bottomLeft:[90,270,0],bottomRight:[90,270,-s]}}}return t}function k(){var s,t,u;s=this;u=s.getDimensions();t='<iframe class="qtip-bgiframe" frameborder="0" tabindex="-1" src="javascript:false" style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=\'0\'); border: 1px solid red; height:'+u.height+"px; width:"+u.width+'px" />';s.elements.bgiframe=s.elements.wrapper.prepend(t).children(".qtip-bgiframe:first")}f(document).ready(function(){f.fn.qtip.cache={screen:{scroll:{left:f(window).scrollLeft(),top:f(window).scrollTop()},width:f(window).width(),height:f(window).height()}};var s;f(window).bind("resize scroll",function(t){clearTimeout(s);s=setTimeout(function(){if(t.type==="scroll"){f.fn.qtip.cache.screen.scroll={left:f(window).scrollLeft(),top:f(window).scrollTop()}}else{f.fn.qtip.cache.screen.width=f(window).width();f.fn.qtip.cache.screen.height=f(window).height()}for(i=0;i<f.fn.qtip.interfaces.length;i++){var u=f.fn.qtip.interfaces[i];if(u.status.rendered===true&&(u.options.position.type!=="static"||u.options.position.adjust.scroll&&t.type==="scroll"||u.options.position.adjust.resize&&t.type==="resize")){u.updatePosition(t,true)}}},100)});f(document).bind("mousedown.qtip",function(t){if(f(t.target).parents("div.qtip").length===0){f(".qtip[unfocus]").each(function(){var u=f(this).qtip("api");if(f(this).is(":visible")&&!u.status.disabled&&f(t.target).add(u.elements.target).length>1){u.hide(t)}})}})});f.fn.qtip.interfaces=[];f.fn.qtip.log={error:function(){return this}};f.fn.qtip.constants={};f.fn.qtip.defaults={content:{prerender:false,text:false,url:false,data:null,title:{text:false,button:false}},position:{target:false,corner:{target:"bottomRight",tooltip:"topLeft"},adjust:{x:0,y:0,mouse:true,screen:false,scroll:true,resize:true},type:"absolute",container:false},show:{when:{target:false,event:"mouseover"},effect:{type:"fade",length:100},delay:140,solo:false,ready:false},hide:{when:{target:false,event:"mouseout"},effect:{type:"fade",length:100},delay:0,fixed:false},api:{beforeRender:function(){},onRender:function(){},beforePositionUpdate:function(){},onPositionUpdate:function(){},beforeShow:function(){},onShow:function(){},beforeHide:function(){},onHide:function(){},beforeContentUpdate:function(){},onContentUpdate:function(){},beforeContentLoad:function(){},onContentLoad:function(){},beforeTitleUpdate:function(){},onTitleUpdate:function(){},beforeDestroy:function(){},onDestroy:function(){},beforeFocus:function(){},onFocus:function(){}}};f.fn.qtip.styles={defaults:{background:"white",color:"#111",overflow:"hidden",textAlign:"left",width:{min:0,max:250},padding:"5px 9px",border:{width:1,radius:0,color:"#d3d3d3"},tip:{corner:false,color:false,size:{width:13,height:13},opacity:1},title:{background:"#e1e1e1",fontWeight:"bold",padding:"7px 12px"},button:{cursor:"pointer"},classes:{target:"",tip:"qtip-tip",title:"qtip-title",button:"qtip-button",content:"qtip-content",active:"qtip-active"}},cream:{border:{width:3,radius:0,color:"#F9E98E"},title:{background:"#F0DE7D",color:"#A27D35"},background:"#FBF7AA",color:"#A27D35",classes:{tooltip:"qtip-cream"}},light:{border:{width:3,radius:0,color:"#E2E2E2"},title:{background:"#f1f1f1",color:"#454545"},background:"white",color:"#454545",classes:{tooltip:"qtip-light"}},gothia:{border:{width:1,radius:1,color:"#ccc"},title:{background:"#f1f1f1",color:"#454545"},background:"rgb(245,245,245)",color:"rgb(169,169,169)",classes:{tooltip:"qtip-light"}},dark:{border:{width:3,radius:0,color:"#303030"},title:{background:"#404040",color:"#f3f3f3"},background:"#505050",color:"#f3f3f3",classes:{tooltip:"qtip-dark"}},red:{border:{width:3,radius:0,color:"#CE6F6F"},title:{background:"#f28279",color:"#9C2F2F"},background:"#F79992",color:"#9C2F2F",classes:{tooltip:"qtip-red"}},green:{border:{width:3,radius:0,color:"#A9DB66"},title:{background:"#b9db8c",color:"#58792E"},background:"#CDE6AC",color:"#58792E",classes:{tooltip:"qtip-green"}},blue:{border:{width:3,radius:0,color:"#ADD9ED"},title:{background:"#D0E9F5",color:"#5E99BD"},background:"#E5F6FE",color:"#4D9FBF",classes:{tooltip:"qtip-blue"}}}
})(jQuery);function List(){this.elements=new Array()}List.prototype.size=function(){return this.elements.length};List.prototype.isEmpty=function(){return(this.elements.length==0)};List.prototype.add=function(value,index){if(value){with(this){if(isNaN(index)||!checkIndex(index)){index=elements.length}if(index<elements.length){for(var i=elements.length;i>index;i--){elements[i]=elements[i-1]}}elements[index]=value}}};List.prototype.addAll=function(a){for(var b=0;b<a.size();b++){this.add(a.get(b))}};List.prototype.set=function(b,a){if(b&&!isNaN(a)&&this.checkIndex(a)){this.elements[a]=b}};List.prototype.get=function(index){with(this){if(isNaN(index)){return first()}return(checkIndex(index))?elements[index]:null}};List.prototype.first=function(){with(this){return(isEmpty())?null:get(0)}};List.prototype.last=function(){with(this){return(isEmpty())?null:get(elements.length-1)}};List.prototype.remove=function(index){if(isNaN(index)){index=0}var obj=null;with(this){if(checkIndex(index)){obj=elements[index];for(var j=index;j<(elements.length-1);j++){elements[j]=elements[j+1]}elements.length-=1}}return obj};List.prototype.contains=function(a){return(this.indexOf(a)!=-1)};List.prototype.indexOf=function(value){if(value){with(this){for(var i=0;i<elements.length;i++){if(elements[i]==value){return i}}}}return -1};List.prototype.lastIndexOf=function(value){if(value){with(this){for(var i=(elements.length-1);i>=0;i--){if(elements[i]==value){return i}}}}return -1};List.prototype.sort=function(a){if(a&&a!=null){this.elements.sort(a)}else{this.elements.sort()}};List.prototype.clear=function(){this.elements.length=0};List.prototype.checkIndex=function(a){return(a>=0&&a<this.elements.length)};List.prototype.toString=function(){return"[object List]"};function Map(b){this.buckets=new Array();if(isNaN(b)||b<1){b=10}for(var a=0;a<b;a++){this.buckets[a]=new Bucket()}}function hash(b){var a=0;var d=b.toString();for(var c=0;c<d.length;c++){a^=d.charCodeAt(c)}return a}Map.prototype.bucketFor=function(obj){with(this){return buckets[hash(obj)%buckets.length]}};Map.prototype.size=function(){var sz=0;with(this){for(var i=0;i<buckets.length;i++){sz+=buckets[i].depth}}return sz};Map.prototype.isEmpty=function(){with(this){for(var i=0;i<buckets.length;i++){if(buckets[i].depth>0){return false}}}return true};Map.prototype.keys=function(){var a=new Array();with(this){var bucket,e;for(var i=0;i<buckets.length;i++){bucket=buckets[i];for(e=bucket.first;e!=null;e=e.next){a[a.length]=e.key}}}return a};Map.prototype.values=function(){var a=new Array();with(this){var bucket,e;for(var i=0;i<buckets.length;i++){bucket=buckets[i];for(e=bucket.first;e!=null;e=e.next){a[a.length]=e.value}}}return a};Map.prototype.containsKey=function(key){if(key&&key!=null){with(this){var bucket=bucketFor(key);for(var e=bucket.first;e!=null;e=e.next){if(e.key==key){return true}}}}return false};Map.prototype.containsValue=function(value){if(value){with(this){var bucket,e;for(var i=0;i<buckets.length;i++){bucket=buckets[i];for(e=bucket.first;e!=null;e=e.next){if(e.value==value){return true}}}}}return false};Map.prototype.put=function(key,value){with(this){return(key&&key!=null)?bucketFor(key).add(key,value):null}};Map.prototype.get=function(key){if(key&&key!=null){with(this){var bucket=bucketFor(key);for(var e=bucket.first;e!=null;e=e.next){if(e.key==key){return e.value}}}}return null};Map.prototype.remove=function(key){if(key&&key!=null){with(this){return bucketFor(key).remove(key)}}return null};Map.prototype.clear=function(){with(this){for(var i=0;i<buckets.length;i++){buckets[i].clear()}}};Map.prototype.toString=function(){return"[object Map]"};function Bucket(){this.depth=0;this.first=null}Bucket.prototype.add=function(key,value){with(this){if(first!=null){for(var e=first;e!=null;e=e.next){if(e.key==key){var old=e.value;e.value=value;return old}}}first=new Entry(key,value,first);depth++}return null};Bucket.prototype.remove=function(key){with(this){if(first!=null){for(var e=first,prev=null;e!=null;prev=e,e=e.next){if(e.key==key){if(prev==null){first=e.next}else{prev.next=e.next}depth--;return e.value}}}}return null};Bucket.prototype.clear=function(){with(this){first=null;depth=0}};Bucket.prototype.toString=function(){return"[object Bucket]"};function Entry(b,c,a){this.key=b;this.value=c;this.next=a?a:null}Entry.prototype.toString=function(){return"[object Entry]"};function Set(a){this.map=new Map(a)}Set.placeholder=new Object();Set.prototype.size=function(){return this.map.size()};Set.prototype.isEmpty=function(){return this.map.isEmpty()};Set.prototype.clear=function(){return this.map.clear()};Set.prototype.add=function(a){return(this.map.put(a,Set.placeholder)==null)};Set.prototype.contains=function(a){return this.map.containsKey(a)};Set.prototype.remove=function(a){return(this.map.remove(a)==Set.placeholder)};Set.prototype.values=function(){return this.map.keys()};Set.prototype.toString=function(){return"[object Set]"};jQuery.fn.highlightFade=function(f){var j=(f&&f.constructor==String)?{start:f}:f||{};var h=jQuery.highlightFade.defaults;var e=j.interval||h.interval;var b=j.attr||h.attr;var g={linear:function(d,k,a,l){return parseInt(d+(l/a)*(k-d))},sinusoidal:function(d,k,a,l){return parseInt(d+Math.sin(((l/a)*90)*(Math.PI/180))*(k-d))},exponential:function(d,k,a,l){return parseInt(d+(Math.pow(l/a,2))*(k-d))}};var c=(j.iterator&&j.iterator.constructor==Function)?j.iterator:g[j.iterator]||g[h.iterator]||g.linear;if(h.iterator&&h.iterator.constructor==Function){c=h.iterator}return this.each(function(){if(!this.highlighting){this.highlighting={}}var k=(this.highlighting[b])?this.highlighting[b].end:jQuery.highlightFade.getBaseValue(this,b)||[255,255,255];var l=jQuery.highlightFade.getRGB(j.start||j.colour||j.color||h.start||[255,255,128]);var a=jQuery.speed(j.speed||h.speed);var d=j["final"]||(this.highlighting[b]&&this.highlighting[b].orig)?this.highlighting[b].orig:jQuery.curCSS(this,b);if(j.end||h.end){d=jQuery.highlightFade.asRGBString(k=jQuery.highlightFade.getRGB(j.end||h.end))}if(typeof j["final"]!="undefined"){d=j["final"]}if(this.highlighting[b]&&this.highlighting[b].timer){window.clearInterval(this.highlighting[b].timer)}this.highlighting[b]={steps:((a.duration)/e),interval:e,currentStep:0,start:l,end:k,orig:d,attr:b};jQuery.highlightFade(this,b,j.complete,c)})};jQuery.highlightFade=function(d,b,f,c){d.highlighting[b].timer=window.setInterval(function(){var e=c(d.highlighting[b].start[0],d.highlighting[b].end[0],d.highlighting[b].steps,d.highlighting[b].currentStep);var a=c(d.highlighting[b].start[1],d.highlighting[b].end[1],d.highlighting[b].steps,d.highlighting[b].currentStep);var g=c(d.highlighting[b].start[2],d.highlighting[b].end[2],d.highlighting[b].steps,d.highlighting[b].currentStep);jQuery(d).css(b,jQuery.highlightFade.asRGBString([e,a,g]));if(d.highlighting[b].currentStep++>=d.highlighting[b].steps){jQuery(d).css(b,d.highlighting[b].orig||"");window.clearInterval(d.highlighting[b].timer);d.highlighting[b]=null;if(f&&f.constructor==Function){f.call(d)}}},d.highlighting[b].interval)};jQuery.highlightFade.defaults={start:[255,255,128],interval:50,speed:400,attr:"backgroundColor"};jQuery.highlightFade.getRGB=function(e,b){var a;if(e&&e.constructor==Array&&e.length==3){return e}if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(e)){return[parseInt(a[1]),parseInt(a[2]),parseInt(a[3])]}else{if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(e)){return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55]}else{if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(e)){return[parseInt("0x"+a[1]),parseInt("0x"+a[2]),parseInt("0x"+a[3])]}else{if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(e)){return[parseInt("0x"+a[1]+a[1]),parseInt("0x"+a[2]+a[2]),parseInt("0x"+a[3]+a[3])]}else{return jQuery.highlightFade.checkColorName(e)||b||null}}}}};jQuery.highlightFade.asRGBString=function(b){return"rgb("+b.join(",")+")"};jQuery.highlightFade.getBaseValue=function(h,d,c){var g,f;c=c||false;f=d=d||jQuery.highlightFade.defaults.attr;do{g=jQuery(h).css(f||"backgroundColor");if((g!=""&&g!="transparent")||(h.tagName.toLowerCase()=="body")||(!c&&h.highlighting&&h.highlighting[d]&&h.highlighting[d].end)){break}f=false}while(h=h.parentNode);if(!c&&h.highlighting&&h.highlighting[d]&&h.highlighting[d].end){g=h.highlighting[d].end}if(g==undefined||g==""||g=="transparent"){g=[255,255,255]}return jQuery.highlightFade.getRGB(g)};jQuery.highlightFade.checkColorName=function(a){if(!a){return null}switch(a.replace(/^\s*|\s*$/g,"").toLowerCase()){case"aqua":return[0,255,255];case"black":return[0,0,0];case"blue":return[0,0,255];case"fuchsia":return[255,0,255];case"gray":return[128,128,128];case"green":return[0,128,0];case"lime":return[0,255,0];case"maroon":return[128,0,0];case"navy":return[0,0,128];case"olive":return[128,128,0];case"purple":return[128,0,128];case"red":return[255,0,0];case"silver":return[192,192,192];case"teal":return[0,128,128];case"white":return[255,255,255];case"yellow":return[255,255,0]}};(function(c){var b=c.browser.msie&&parseInt(c.browser.version)==6&&!window.XMLHttpRequest,d=c.browser.msie&&!c.boxModel,a=[];c.modal=function(f,e){return c.modal.impl.init(f,e)};c.modal.close=function(){c.modal.impl.close()};c.fn.modal=function(e){return c.modal.impl.init(this,e)};c.modal.defaults={opacity:50,overlayId:"simplemodal-overlay",overlayCss:{},containerId:"simplemodal-container",containerCss:{},dataCss:{},zIndex:10000,close:true,closeHTML:'<a class="modalCloseImg" title="Close"></a>',closeClass:"simplemodal-close",position:null,positioning:"absolute",persist:false,onOpen:null,onShow:null,onClose:null};c.modal.impl={opts:null,dialog:{},init:function(f,e){if(this.dialog.data){return false}this.opts=c.extend({},c.modal.defaults,e);this.zIndex=this.opts.zIndex;this.occb=false;if(typeof f=="object"){f=f instanceof c?f:c(f);if(f.parent().parent().size()>0){this.dialog.parentNode=f.parent();
if(!this.opts.persist){this.dialog.orig=f.clone(true)}}}else{if(typeof f=="string"||typeof f=="number"){f=c("<div/>").html(f)}else{alert("SimpleModal Error: Unsupported data type: "+typeof f);return false}}this.dialog.data=f.addClass("simplemodal-data").css(this.opts.dataCss);f=null;this.create();this.open();if(c.isFunction(this.opts.onShow)){this.opts.onShow.apply(this,[this.dialog])}return this},create:function(){a=this.getDimensions();if(b){this.dialog.iframe=c('<iframe src="javascript:false;"/>').css(c.extend(this.opts.iframeCss,{display:"none",opacity:0,position:"absolute",height:a[0],width:a[1],zIndex:this.opts.zIndex,top:0,left:0})).appendTo("body")}this.dialog.overlay=c("<div/>").attr("id",this.opts.overlayId).addClass("simplemodal-overlay").css(c.extend(this.opts.overlayCss,{display:"none",opacity:this.opts.opacity/100,height:a[0],width:a[1],position:d?"absolute":"fixed",left:0,top:0,zIndex:this.opts.zIndex+1})).appendTo("body");this.dialog.container=c("<div/>").attr("id",this.opts.containerId).addClass("simplemodal-container").css(c.extend(this.opts.containerCss,{display:"none",position:this.opts.positioning,zIndex:this.opts.zIndex+2})).append(this.opts.close?c(this.opts.closeHTML).addClass(this.opts.closeClass):"").appendTo("body");this.setPosition();if(b||d){this.fixIE()}this.dialog.container.append(this.dialog.data.hide());this.setPosition()},bindEvents:function(){var e=this;c("."+this.opts.closeClass).bind("click.simplemodal",function(f){f.preventDefault();e.close(true)});c(window).bind("resize.simplemodal",function(){a=e.getDimensions();e.setPosition();if(b||d){e.dialog.iframe&&e.dialog.iframe.css({height:a[0],width:a[1]});e.dialog.overlay.css({height:a[0],width:a[1]});e.fixIE()}else{e.dialog.iframe&&e.dialog.iframe.css({height:a[0],width:a[1]});e.dialog.overlay.css({height:a[0],width:a[1]})}})},unbindEvents:function(){c("."+this.opts.closeClass).unbind("click.simplemodal");c(window).unbind("resize.simplemodal")},fixIE:function(){if(c.browser.msie&&parseInt(c.browser.version)>=8){return}var e=this.opts.position;c.each([this.dialog.iframe||null,this.dialog.overlay],function(q,j){if(j){var o="document.body.clientHeight",t="document.body.clientWidth",v="document.body.scrollHeight",r="document.body.scrollLeft",m="document.body.scrollTop",h="document.body.scrollWidth",g="document.documentElement.clientHeight",p="document.documentElement.clientWidth",n="document.documentElement.scrollLeft",w="document.documentElement.scrollTop",x=j[0].style;x.position="absolute";if(q<2){x.removeExpression("height");x.removeExpression("width");x.setExpression("height",""+v+" > "+o+" ? "+v+" : "+o+' + "px"');x.setExpression("width",""+h+" > "+t+" ? "+h+" : "+t+' + "px"')}else{var l,f;if(e&&e.constructor==Array){if(e[0]){var u=typeof e[0]=="number"?e[0].toString():e[0].replace(/px/,"");l=u.indexOf("%")==-1?u+" + (t = "+w+" ? "+w+" : "+m+') + "px"':parseInt(u.replace(/%/,""))+" * (("+g+" || "+o+") / 100) + (t = "+w+" ? "+w+" : "+m+') + "px"'}if(e[1]){var k=typeof e[1]=="number"?e[1].toString():e[1].replace(/px/,"");f=k.indexOf("%")==-1?k+" + (t = "+n+" ? "+n+" : "+r+') + "px"':parseInt(k.replace(/%/,""))+" * (("+p+" || "+t+") / 100) + (t = "+n+" ? "+n+" : "+r+') + "px"'}}else{l="("+g+" || "+o+") / 2 - (this.offsetHeight / 2) + (t = "+w+" ? "+w+" : "+m+') + "px"';f="("+p+" || "+t+") / 2 - (this.offsetWidth / 2) + (t = "+n+" ? "+n+" : "+r+') + "px"'}x.removeExpression("top");x.removeExpression("left");x.setExpression("top",l);x.setExpression("left",f)}}})},getDimensions:function(){var f=c(window);var e=c.browser.opera&&c.browser.version>"9.5"&&c.fn.jquery<="1.2.6"?document.documentElement.clientHeight:f.height();return[e,f.width()]},setPosition:function(){var h,g,f=(a[0]/2)-((this.dialog.container.height()||this.dialog.data.height())/2),e=(a[1]/2)-((this.dialog.container.width()||this.dialog.data.width())/2);if(this.opts.position&&this.opts.position.constructor==Array){h=this.opts.position[0]||f;g=this.opts.position[1]||e}else{h=f;g=e}h+=c(window).scrollTop();this.dialog.container.css({left:g,top:h})},open:function(){this.dialog.iframe&&this.dialog.iframe.show();if(c.isFunction(this.opts.onOpen)){this.opts.onOpen.apply(this,[this.dialog])}else{this.dialog.overlay.show();this.dialog.container.show();this.dialog.data.show();this.setPosition()}this.bindEvents()},close:function(e){if(!this.dialog.data){return false}if(c.isFunction(this.opts.onClose)&&!this.occb){this.occb=true;this.opts.onClose.apply(this,[this.dialog,!!e])}if(this.dialog.parentNode){if(this.opts.persist){this.dialog.data.hide().appendTo(this.dialog.parentNode)}else{this.dialog.data.remove();this.dialog.orig.appendTo(this.dialog.parentNode)}}else{this.dialog.data.remove()}this.dialog.container.remove();this.dialog.overlay.remove();this.dialog.iframe&&this.dialog.iframe.remove();this.dialog={};this.unbindEvents()}}})(jQuery);jQuery.fn.SpinButton=function(a){return this.each(function(){this.spinCfg={min:a&&!isNaN(parseFloat(a.min))?Number(a.min):null,max:a&&!isNaN(parseFloat(a.max))?Number(a.max):null,step:a&&a.step?Number(a.step):1,page:a&&a.page?Number(a.page):10,upClass:a&&a.upClass?a.upClass:"up",downClass:a&&a.downClass?a.downClass:"down",reset:a&&a.reset?a.reset:this.value,delay:a&&a.delay?Number(a.delay):500,interval:a&&a.interval?Number(a.interval):100,_btn_width:20,_btn_height:12,_direction:null,_delay:null,_repeat:null};this.adjustValue=function(d){var c=(isNaN(this.value)?this.spinCfg.reset:Number(this.value))+Number(d);if(this.spinCfg.min!==null){c=Math.max(c,this.spinCfg.min)}if(this.spinCfg.max!==null){c=Math.min(c,this.spinCfg.max)}this.value=c;jQuery(this).change()};jQuery(this).addClass(a&&a.spinClass?a.spinClass:"spin-button").mousemove(function(g){var c=g.pageX||g.x;var h=g.pageY||g.y;var d=g.target||g.srcElement;var f=(c>jQuery(d).offset().left+d.offsetWidth-this.spinCfg._btn_width)?((h<jQuery(d).offset().top+this.spinCfg._btn_height)?1:-1):0;if(f!==this.spinCfg._direction){switch(f){case 1:jQuery(this).removeClass(this.spinCfg.downClass).addClass(this.spinCfg.upClass);break;case -1:jQuery(this).removeClass(this.spinCfg.upClass).addClass(this.spinCfg.downClass);break;default:jQuery(this).removeClass(this.spinCfg.upClass).removeClass(this.spinCfg.downClass)}this.spinCfg._direction=f}}).mouseout(function(){jQuery(this).removeClass(this.spinCfg.upClass).removeClass(this.spinCfg.downClass);this.spinCfg._direction=null}).mousedown(function(f){if(this.spinCfg._direction!=0){var c=this;var d=function(){c.adjustValue(c.spinCfg._direction*c.spinCfg.step)};d();c.spinCfg._delay=window.setTimeout(function(){d();c.spinCfg._repeat=window.setInterval(d,c.spinCfg.interval)},c.spinCfg.delay)}}).mouseup(function(c){window.clearInterval(this.spinCfg._repeat);window.clearTimeout(this.spinCfg._delay)}).dblclick(function(c){if(jQuery.browser.msie){this.adjustValue(this.spinCfg._direction*this.spinCfg.step)}}).keydown(function(c){switch(c.keyCode){case 38:this.adjustValue(this.spinCfg.step);break;case 40:this.adjustValue(-this.spinCfg.step);break;case 33:this.adjustValue(this.spinCfg.page);break;case 34:this.adjustValue(-this.spinCfg.page);break}}).change(function(c){}).keyup(function(c){if(!isNaN(parseInt(jQuery(this).val()))){this.adjustValue(0)}})});function b(e,g){var f=e[g],d=document.body;while((e=e.offsetParent)&&(e!=d)){if(!jQuery.browser.msie||(e.currentStyle.position!="relative")){f+=e[g]}}return f}};jQuery.cookie=function(d,e,b){if(arguments.length>1&&String(e)!=="[object Object]"){b=jQuery.extend({},b);if(e===null||e===undefined){b.expires=-1}if(typeof b.expires==="number"){var g=b.expires,c=b.expires=new Date();c.setDate(c.getDate()+g)}e=String(e);return(document.cookie=[encodeURIComponent(d),"=",b.raw?e:encodeURIComponent(e),b.expires?"; expires="+b.expires.toUTCString():"",b.path?"; path="+b.path:"",b.domain?"; domain="+b.domain:"",b.secure?"; secure":""].join(""))}b=e||{};var a,f=b.raw?function(h){return h}:decodeURIComponent;return(a=new RegExp("(?:^|; )"+encodeURIComponent(d)+"=([^;]*)").exec(document.cookie))?f(a[1]):null};eval(function(h,b,j,d,g,f){g=function(a){return(a<b?"":g(parseInt(a/b)))+((a=a%b)>35?String.fromCharCode(a+29):a.toString(36))};if(!"".replace(/^/,String)){while(j--){f[g(j)]=d[j]||g(j)}d=[function(a){return f[a]}];g=function(){return"\\w+"};j=1}while(j--){if(d[j]){h=h.replace(new RegExp("\\b"+g(j)+"\\b","g"),d[j])}}return h}('r.E.W=7(c,d){c=c||".";d=q d=="7"?d:7(){};6.K(7(e){g a=e.i?e.i:e.h?e.h:0;2(a==k&&6.N.J()=="G"){5 3}f 2(a==k){5 j}g b=j;2((e.4&&a==y)||(e.4&&a==v))5 3;2((e.4&&a==t)||(e.4&&a==u))5 3;2((e.4&&a==V)||(e.4&&a==S))5 3;2((e.4&&a==R)||(e.4&&a==Q))5 3;2((e.4&&a==P)||(e.4&&a==O)||(e.L&&a==p))5 3;2(a<I||a>H){2(a==p&&6.l.F==0)5 3;2(a==c.n(0)&&6.l.o(c)!=-1){b=j}2(a!=8&&a!=9&&a!=k&&a!=D&&a!=C&&a!=M&&a!=B&&a!=A){b=j}f{2(q e.i!="z"){2(e.h==e.m&&e.m!=0){b=3}f 2(e.h!=0&&e.i==0&&e.m==0){b=3}}}2(a==c.n(0)&&6.l.o(c)==-1){b=3}}f{b=3}5 b}).x(7(){g a=r(6).w();2(a!=""){g b=T U("^\\\\d+$|\\\\d*"+c+"\\\\d+");2(!b.s(a)){d.X(6)}}});5 6}',60,60,"||if|true|ctrlKey|return|this|function||||||||else|var|keyCode|charCode|false|13|value|which|charCodeAt|indexOf|45|typeof|jQuery|exec|120|88|65|val|blur|97|undefined|46|39|36|35|fn|length|input|57|48|toLowerCase|keypress|shiftKey|37|nodeName|86|118|90|122|67|new|RegExp|99|numeric|apply".split("|"),0,{}));function checkSSO(a){CupMan.callService("SingleSignOnService",{data:{domain:window.location.hostname},success:a,error:a})}function showLoginDialog(a,b){if(a.force){jQuery(".loginPopup").modal(a);if(typeof b=="function"){b()}return false}checkSSO(function(c){if(c.status==0){window.location.href=window.location.href}jQuery(".loginPopup").modal(a);if(typeof b=="function"){b()}})}function logout(a){CupMan.callService("LogoutService",{data:{},success:function(){},error:function(){},complete:function(){a()}})}function loginCallback(b){var a=b.status;clearFieldErrors("loginEmailField");clearFieldErrors("loginPasswordField");if(a==0){jQuery("#loginScreen form").submit()}else{jQuery(".loginButton").disable(false);
if(a==1){showFieldError("loginEmailField",CupMan.T("Web.Login.Error.NoSuchUser"))}else{showFieldError("loginPasswordField",CupMan.T("Web.Login.Error.WrongPassword"))}}}function setLoginPopupScreen(c,a,b){clearFieldErrors("newEmailField");var d=function(){jQuery.modal.impl.setPosition();if(a){a()}};if(c=="CreateAccount"){jQuery("#loginScreen").hide();jQuery("#createAccountScreen").show(0,d)}else{jQuery("#createAccountScreen").hide();jQuery("#loginScreen").show(0,d)}}function setLoginScreen(a){if(a=="Need"){jQuery("#loginNeed").show();jQuery("#loginChange").hide()}else{jQuery("#loginNeed").hide();jQuery("#loginChange").show()}}function recoverPassword(c,b,a){CupMan.callService("ResetPasswordService",{data:{username:c,method:b},success:function(e){var d=parseInt(e.attr("status"));a(d,e.attr("has-phone")=="1",e.attr("has-email")=="1")},error:function(e){var d=parseInt(e.attr("status"));a(d,e.attr("has-phone")=="1",e.attr("has-email")=="1")}})}jQuery(function(){jQuery(".loginButton").click(function(){var a=jQuery("#loginEmail").val();var b=jQuery("#loginPassword").val();jQuery(".loginButton").disable(true);CupMan.callService("LoginService",{data:{username:a,password:b,domain:window.location.hostname},success:loginCallback,error:loginCallback});return false});jQuery("#loginNeed a, #loginChange a").click(function(){setLoginPopupScreen("CreateAccount",null,true);return false});jQuery(".signupInfo a").click(function(){setLoginPopupScreen("Login",null,true);return false});jQuery("#loginEmail").focus(function(){});jQuery("#loginEmail").keyup(function(){clearFieldErrors("loginEmailField");jQuery(".loginForgotContainer").slideUp(500);jQuery("a.forgot").show()});jQuery("#loginScreen input").keyup(function(c){var a=c||window.event;var b=a.keyCode;if(b==13){jQuery(this).closest("#loginScreen").find("button").click()}});jQuery("a.forgot").click(function(){recoverPassword(jQuery("#loginEmail").val(),"test",function(b,c,a){if(b==1){showFieldError("loginEmailField",CupMan.T("Web.Login.Error.NoSuchUser"));jQuery("a.forgotByEmail").disable(true);jQuery("a.forgotBySms").disable(true)}else{clearFieldErrors("loginEmailField");jQuery(".loginForgotContainer").slideDown(500);jQuery("a.forgot").hide();jQuery("a.forgotByEmail").disable(!a);jQuery("a.forgotBySms").disable(!c)}});return false});jQuery("a.forgotByEmail").click(function(){if(!jQuery(this).hasClass("disabled")){recoverPassword(jQuery("#loginEmail").val(),"email",function(){jQuery("#loginEmail").keyup();showFieldSuccess("loginEmailField",CupMan.T("Web.Login.ResetEmailMsg"))})}return false});jQuery("a.forgotBySms").click(function(){if(!jQuery(this).hasClass("disabled")){recoverPassword(jQuery("#loginEmail").val(),"sms",function(){jQuery("#loginEmail").keyup();showFieldSuccess("loginEmailField",CupMan.T("Web.Login.ResetSmsMsg"))})}return false});jQuery("a.forgotCancel").click(function(){jQuery("#loginEmail").keyup();return false});jQuery("#newEmail").keyup(function(){var c=function(){jQuery(".createAccountButton").hide();jQuery(".switchToLoginButton").show();jQuery("#newName").val(CupMan.T("Registration.LoginPopup.NameInput_EmailExists")).disable();setValid(jQuery("#newName"))};var a=function(){jQuery(".createAccountButton").show();jQuery(".switchToLoginButton").hide();jQuery("#newName").val("").enable()};var b=validateField(jQuery("#newEmail").attr("validate","email"));if(b){recoverPassword(jQuery("#newEmail").val(),"test",function(e,f,d){if(e==0){c()}else{a()}jQuery("#newName, .createAccountButton").disable(e==0)})}else{jQuery("#newName, .createAccountButton").disable(false);a()}});jQuery(".switchToLoginButton").click(function(){jQuery("#loginEmail").val(jQuery("#newEmail").val());setLoginPopupScreen("Login");setLoginScreen("Need");jQuery("#loginPassword").focus();return false});jQuery(".createAccountButton").click(function(){var c=jQuery("#newName").val();jQuery(".createAccountButton").disable(true);var b=jQuery("#newEmail").val();var a=function(f,e){console.log("completeFunc");clearFieldErrors("createAccountScreen");jQuery(".createAccountButton").disable(e==0);if(e==1){validateField(jQuery("#newName"))}else{if(e==2){validateField(jQuery("#newEmail"),"email")}else{if(e==3){var d=showFieldError("newEmailField",CupMan.T("Web.Login.Error.UserAlreadyExists"));d.find("a").click(function(){clearFieldErrors("newEmailField");jQuery("#loginEmail").val(jQuery("#newEmail").val());setLoginPopupScreen("Login");setLoginScreen("Need");return false})}else{if(e==4){showFieldError("createAccountButtonField",f.text())}else{showFieldSuccess("createAccountButtonField",CupMan.T("Web.Login.Msg.AccountCreated"));window.location.reload()}}}}};CupMan.callService("CreateAccountService",{data:{name:c,email:b},success:function(e,d){a(e,d)},error:function(e,f,d){a(e,d)}})})});(function(a){a.fn.autoResize=function(b){var c=a.extend({onResize:function(){},animate:true,animateDuration:150,animateCallback:function(){},extraSpace:20,limit:1000},b);this.filter("textarea").each(function(){var e=a(this).css({resize:"none",overflow:"hidden"}),g=e.height(),h=(function(){var j=["height","width","lineHeight","textDecoration","letterSpacing"],k={};a.each(j,function(l,m){k[m]=e.css(m)});return e.clone().appendTo(a("body")).removeAttr("id").removeAttr("name").css({position:"absolute",top:0,left:-9999,fontFamily:e.css("font-family"),fontSize:e.css("font-size")}).css(k).attr("tabIndex","-1")})(),f=null,d=function(){h.height(0).width(a(this).width()).val(a(this).val()).scrollTop(10000);h.css({fontFamily:a(this).css("font-family"),fontSize:a(this).css("font-size")});var k=Math.max(h.scrollTop(),g)+c.extraSpace,j=a(this).add(h);if(f===k){return}f=k;if(k>=c.limit){a(this).css("overflow-y","");return}c.onResize.call(this);c.animate&&e.css("display")==="block"?j.stop().animate({height:k},c.animateDuration,c.animateCallback):j.height(k)};e.unbind(".dynSiz").bind("keyup.dynSiz",d).bind("keydown.dynSiz",d).bind("change.dynSiz",d)});return this}})(jQuery);(function(a){a.fn.autoGrowInput=function(b){b=a.extend({maxWidth:1000,minWidth:0,comfortZone:15},b);this.filter("input:text").each(function(){var f=b.minWidth||a(this).width(),g="",d=a(this),e=a("<span/>").css({position:"absolute",top:-99999,left:-99999,width:"auto",fontSize:d.css("fontSize"),fontFamily:d.css("fontFamily"),fontWeight:d.css("fontWeight"),letterSpacing:d.css("letterSpacing"),whiteSpace:"nowrap"}),c=function(){g=d.val();var m=g.replace(/&/g,"&amp;").replace(/\s/g,"&nbsp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");e.html(m);e.css({position:"absolute",top:-99999,left:-99999,width:"auto",fontSize:d.css("fontSize"),fontFamily:d.css("fontFamily"),fontWeight:d.css("fontWeight"),letterSpacing:d.css("letterSpacing"),whiteSpace:"nowrap"});var k=e.width(),l=(k+b.comfortZone)>=f?k+b.comfortZone:f,j=d.width(),h=(l<j&&l>=f)||(l>f&&l<b.maxWidth);if(h){d.width(l)}};e.insertAfter(d);a(this).bind("keyup keydown blur update",c)});return this}})(jQuery);(function(a){a.fn.quickPager=function(b){var c={pageSize:10,currentPage:1,holder:null,pagerLocation:"after"};var b=a.extend(c,b);return this.each(function(){var e=a(this);var d=1;if(!e.parent().is(".simplePagerContainer")){e.wrap("<div class='simplePagerContainer'></div>")}e.children().each(function(h){if(h<d*b.pageSize&&h>=(d-1)*b.pageSize){a(this).addClass("simplePagerPage"+d)}else{a(this).addClass("simplePagerPage"+(d+1));d++}});e.children().hide();e.children(".simplePagerPage"+b.currentPage).show();if(d<=1){return}var g="<ul class='simplePagerNav'>";for(i=1;i<=d;i++){if(i==b.currentPage){g+="<li class='currentPage simplePageNav"+i+"'><a rel='"+i+"' href='#'>"+i+"</a></li>"}else{g+="<li class='simplePageNav"+i+"'><a rel='"+i+"' href='#'>"+i+"</a></li>"}}g+="</ul>";var f=e.data("simplePagerNav");if(f){f.remove()}g=jQuery(g);e.data("simplePagerNav",g);if(!b.holder){switch(b.pagerLocation){case"before":e.before(g);break;case"both":e.before(g);e.after(g);break;default:e.after(g)}}else{a(b.holder).append(g)}e.parent().find(".simplePagerNav a").click(function(){var h=a(this).attr("rel");b.currentPage=h;if(b.holder){a(this).parent("li").parent("ul").parent(b.holder).find("li.currentPage").removeClass("currentPage");a(this).parent("li").parent("ul").parent(b.holder).find("a[rel='"+h+"']").parent("li").addClass("currentPage")}else{a(this).parent("li").parent("ul").parent(".simplePagerContainer").find("li.currentPage").removeClass("currentPage");a(this).parent("li").parent("ul").parent(".simplePagerContainer").find("a[rel='"+h+"']").parent("li").addClass("currentPage")}e.children().hide();e.find(".simplePagerPage"+h).show();return false})})}})(jQuery);Date.prototype.getDayOfYear=function(){var a=new Date(this.getFullYear(),0,1);return Math.ceil((this-a)/86400000)};jQuery.fn.updateTime=function(){jQuery(this).each(function(){var a=jQuery(this).attr("time");jQuery(this).html(CupMan.Name.formatNiceDate(new Date(parseInt(a))))})};jQuery(function(){var a=function(){jQuery(".time[time]:not(input)").updateTime();setTimeout(a,60*1000)};a()});CupMan.Name={months:{},days:{},Formats:{},format:function(c,a){var b=CupMan.Name.Formats[c];return b(a)},switsh:function(a,b){if(b[a]){return b[a]}return b["default"]},formatNiceDate:function(b){var h=new Date();var j=h.getTime()-b.getTime();var f=Math.floor(j/(1000*60));var d=Math.floor(f/60);var e=Math.floor(d/24);var k=Math.floor(e/7);var l=h.getDayOfYear()==b.getDayOfYear();var c=h.getFullYear()==b.getFullYear();var g=h.getDayOfYear()-b.getDayOfYear();if(f<=1){return CupMan.Name.format("Common.Date.Tiny")}else{if(f<60){var a={minutes:f};return CupMan.Name.format("Common.Date.Minutes",a)}else{if(d<4){var a={hours:d};return CupMan.Name.format("Common.Date.Hours",a)}else{if(e<1&&l){var a={ampm:(b.getHours()<12?"am":"pm")};return CupMan.Name.format("Common.Date.Today",a)}else{if(e<4&&g<3){var a={days:g,ampm:(b.getHours()<12?"am":"pm")};return CupMan.Name.format("Common.Date.Days",a)}else{if(k<1){var a={weekday:CupMan.Name.days[b.getDay()],ampm:(b.getHours()<12?"am":"pm")};return CupMan.Name.format("Common.Date.ThisWeekDay",a)
}else{if(k<2){var a={weekday:CupMan.Name.days[b.getDay()],ampm:(b.getHours()<12?"am":"pm")};return CupMan.Name.format("Common.Date.LastWeekDay",a)}else{if(k<5){var a={weeks:k};return CupMan.Name.format("Common.Date.Weeks",a)}else{if(c||k<40){var a={day:b.getDate(),month:CupMan.Name.months[b.getMonth()]};return CupMan.Name.format("Common.Date.Month",a)}else{var a={day:b.getDate(),month:CupMan.Name.months[b.getMonth()],year:b.getFullYear()};return CupMan.Name.format("Common.Date.MonthYear",a)}}}}}}}}}}};(function(a){a.fn.hint=function(b){if(!b){b="blur"}return this.each(function(){var g=a(this),e=g.attr("title"),d=a(this.form),f=a(window);function c(){if(g.val()===e&&g.hasClass(b)){g.val("")}g.removeClass(b)}if(e){g.blur(function(){if(this.value===""){g.val(e).addClass(b)}}).focus(c).blur();d.submit(c);f.unload(c)}})}})(jQuery);jQuery(function(){jQuery("input.hint").hint()});
