menuHover=function(){$("#navigation .navli").bind("mouseenter",function(){$(this).addClass("hover");if($(this).hasClass("has_sub")){$("#goto_section").html(menuLinksMap[this.id].title);$("#goto_section").attr("href",menuLinksMap[this.id].uri);var a=$(this).attr("id");$(this).append($("#nav_item"));var b=$(this).position();$("#nav_item").css("left",-b.left-8);$("#"+a+"_sub").show();timerEnter=setTimeout(function(){$("#nav_item").show()},300)}}).bind("mouseleave",function(){$(this).removeClass("hover");clearTimeout(timerEnter);$("#nav_item").hide();$(".sub_nav").hide()})};topratedHover=function(){$(".top_rated .numbered li").hover(function(){$(this).siblings().removeClass("hover");$(this).addClass("hover");var a=$(this).index()},function(){$(this).removeClass("hover")});$(".top_rated .numbered").hover(function(){},function(){$("li:first",this).addClass("hover");var a=$("li:first",this).index()})};initMapSelect=function(){if(!Array.prototype.indexOf){Array.prototype.indexOf=function(v,w){for(var u=(w||0),t=this.length;u<t;u++){if(this[u]===v){return u}}return -1}}var g={stroke:false,fillColor:"1ab7ea",fillOpacity:1,groupBy:"data-group-id"},a=$("#map_large"),p=$("#image_map_large"),s=$("#area_tooltip"),d=[],q=[],f=-40,e=10,o=0,n=0,m=function(){a.maphilight(g)},l=function(t){for(var v=t.length-1;v>-1;v--){var u=p.find('area[data-group-id="'+t[v]+'"]');c(u,true);m()}},c=function(t,u){t.data("maphilight",{alwaysOn:true});t.addClass("on");j(t);!u&&m()},b=function(t){t.data("maphilight",{alwaysOn:false});t.removeClass("on");j(t,true);m()},j=function(v,u){var u=u?true:false,w=v.attr("data-group-id"),t=(~d.indexOf(w))?d.indexOf(w):-1;if(u&&t>-1){d.splice(t,1)}else{if(!(t>-1)){d.push(w)}}k(v,u)},k=function(x,t){var u=$("#map_selected_list"),w=u.find('[data-group-id="'+x.attr("data-group-id")+'"]'),v='<li data-group-id="%id">%s <a href="" class="remove_selection">remove %s</a>';t&&w.remove()||!w.length&&u.append(v.replace(/%s/g,x.attr("data-title")).replace(/%id/,x.attr("data-group-id")));if(d.length===0){u.parent().find(".instruction").show()}else{if(d.length===1){u.parent().find(".instruction").hide()}}},r=function(){$("#map_selected_list").empty().parent().find(".instruction").show();$("#modal_map").find("area").removeClass("on").data("maphilight",false);d=[]};$(document).bind("mousemove",function(t){if(!t){var t=window.event}if(t.pageX||t.pageY){o=t.pageX;n=t.pageY}else{if(t.clientX||t.clientY){o=t.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;n=t.clientY+document.body.scrollTop+document.documentElement.scrollTop}}});$("#modal_map").delegate("area","click",function(v){v.preventDefault();var x=$(this).attr("data-group-id"),u=$('area[data-group-id="'+x+'"]'),t=$(this).data("maphilight"),w=t&&t.alwaysOn;if(w){b(u)}else{c(u)}s.fadeOut();return false});p.find("area:not(.on)").hoverIntent({over:function(){var v=$(this).data("maphilight");if(v&&v.alwaysOn){return}var u=$(this).attr("data-group-id");var t=stateInformationTable[u];$("#area_tooltip_region_link").html(t.title);$("#area_tooltip_content").html(t.state_info);$("#area_tooltip_resort_link").html(t.num_resorts);s.css({top:n+e+"px",left:o+f+"px"}).fadeIn()},out:function(){s.fadeOut()},interval:300});$("#map_region_list").find("a").bind("click",function(){var t=$(this).attr("data-group-id").split(",");l(t);return false});$("#map_selected_list").delegate(".remove_selection","click",function(){var u=$(this).parent().attr("data-group-id"),t=$('area[data-group-id="'+u+'"]');b(t);return false});$("#map_selector").bind("show.overlay",function(){m();q.length&&l(q);$("body").append(s)});$("#map_selector").bind("close.overlay",function(){r()});console.log("binding #save_map_changes");$("#save_map_changes").bind("click",function(){q=d.slice(0);console.log(q);if(q.length>1){OTS.resortFinder.resortFinderRedirect(q)}else{if(q.length==1){console.log("saved: "+q[0]);OTS.resortFinder.regionProfileRedirect(q[0])}}return false})};setCheckboxes=function(){$().cssCheckbox()};jQuery.fn.cssCheckbox=function(){var a=$("input[@type='checkbox'] + label").add("input[@type='radio'] + label");jQuery(a,this).each(function(){if(jQuery(this).prev()[0].checked){jQuery(this).addClass("checked")}}).hover(function(){jQuery(this).addClass("over")},function(){jQuery(this).removeClass("over")}).click(function(){jQuery(this).toggleClass("checked").prev()[0].click();if(jQuery(this).prev()[0].type=="radio"){var b=$(this).prev()[0].name;$(":radio[name='"+b+"'] + label").removeClass("checked");$(this).addClass("checked")}}).prev().hide()};jQuery.fn.extend({selectbox:function(a){return this.each(function(){new jQuery.SelectBox(this,a)})}});var zi=50;jQuery.SelectBox=function(u,d){var a=d||{};a.inputClass=a.inputClass||"selectbox";a.containerClass=a.containerClass||"selectbox-wrapper";a.hoverClass=a.hoverClass||"current";a.currentClass=a.selectedClass||"selected";a.maxOptions=a.maxOptions||9;a.debug=a.debug||false;var l=u.id;var e=-1;var c=false;var t=0;var s=$(u);var q=g(a);var b=n(a);s.hide().wrap("<div class='dropdown_wrap'></div>").before(b).before(q);r();s.parents(".dropdown_wrap").css({zIndex:zi});q.css({zIndex:zi--});b.css({zIndex:zi--});b.click(function(){if(!c){q.toggle()}}).focus(function(){if(q.not(":visible")){c=true;q.slideDown(250,"swing");if(!$.browser.mozilla){q.focus()}}}).keydown(function(v){switch(v.keyCode){case 38:v.preventDefault();m(-1);break;case 40:v.preventDefault();m(1);break;case 13:v.preventDefault();$("li."+a.hoverClass).trigger("click");break;case 27:j();break}});q.keydown(function(v){switch(v.keyCode){case 38:v.preventDefault();m(-1);break;case 40:v.preventDefault();m(1);break;case 13:v.preventDefault();$("li."+a.hoverClass).trigger("click");break;case 27:j();break}});if(!$.browser.mozilla){q.blur(function(){if(q.is(":visible")){j()}})}else{b.blur(function(){if(q.is(":visible")&&t>0){if(a.debug){console.log("container visible and has focus")}}else{j()}})}function j(){t=0;q.hide()}function r(){q.append(o(b.attr("id"))).hide();var v=b.css("width");if($.browser.msie){if((s.children("option").length>a.maxOptions)&&(parseInt($.browser.version)<7)){q.css("height",q.css("max-height"))}}if($.browser.safari){$("body").click(function(){if(event.target.id!=l+"_input"){j()}})}}function g(w){var v=document.createElement("div");q=$(v);q.attr("id",l+"_container");q.addClass(w.containerClass);return q}function n(w){var v=document.createElement("div");var x=$(v);x.attr("id",l+"_input");x.addClass(w.inputClass);x.attr("tabIndex",s.attr("tabindex"));return x}function m(w){var v=$("li",q);if(!v){return}e+=w;if(e<0){e=0}else{if(e>=v.size()){e=v.size()-1}}v.removeClass(a.hoverClass);$(v[e]).addClass(a.hoverClass)}function f(){var v=$("li."+a.currentClass,q).get(0);var w=(""+v.id).split("_");var x=w[w.length-1];s.val(x);if(s.attr("onchange")){dropdownAction(x,s.attr("id"))}b.text($(v).html());return true}function p(){return s.val()}function k(){return b.text()}function o(w){var x=new Array();var v=document.createElement("ul");s.find("option").add("optgroup").each(function(){if($(this).attr("label")){var z=document.createElement("li");z.className="group";z.innerHTML=$(this).attr("label");v.appendChild(z);$(z).mousedown(function(A){A.preventDefault()})}else{var y=document.createElement("li");y.setAttribute("id",w+"_"+$(this).val());y.innerHTML=$(this).html();if($(this).is(":selected")){b.text($(this).html());$(y).addClass(a.currentClass)}v.appendChild(y);$(y).mouseover(function(A){t=1;if(a.debug){console.log("over on : "+this.id)}jQuery(A.target,q).addClass(a.hoverClass)}).mouseout(function(A){t=-1;if(a.debug){console.log("out on : "+this.id)}jQuery(A.target,q).removeClass(a.hoverClass)}).click(function(A){var B=$("li."+a.hoverClass,q).get(0);if(a.debug){console.log("click on :"+this.id)}$("li."+a.currentClass+"[id^="+l+"_]").removeClass(a.currentClass);$(this).addClass(a.currentClass);f();j()})}});return v}};setSelectboxes=function(){if(($.browser.safari)||(tb_detectMacXFF())){$("body").addClass("safari")}if($(".dropdown").length>0){$(".dropdown").selectbox()}};function tb_detectMacXFF(){var a=navigator.userAgent.toLowerCase();if(a.indexOf("mac")!=-1&&a.indexOf("firefox")!=-1){return true}}function dropdownAction(a,b){switch(b){case"map_country":OTS.OverlayMap.setCountryMap(a);break;default:location.href=a}}var SR_WIDGET={init:function(){var a=$("#snowreport_search").attr("title");$("#snowreport_search").focus(function(b){if($(b.target).val()==a){$(b.target).val("")}else{$(b.target).select()}}).blur(function(b){if($(b.target).val()==""){$(b.target).val(a)}})}};var FH_WIDGET={data_start:0,data_end:4,data_content:false,mouse_y:0,scroll_height:0,slide_bar_height:0,slider_height:0,loading_html:'<li class="loading"></li>',loaded:false,list_count:0,animate_once:false,init:function(f,p){var m,n,j,l,e,r,s,g,t,d,q,k,u,a=0,b=0,c=false,o=func=FH_WIDGET;if($("#first_hand_report.home").length>0){q=$("#first_hand_report div.tab_content ul li:eq(0)").height()+32;b=$("#first_hand_report div.tab_content ul li").length;$("#first_hand_report div.move_arrow").addClass("dim").css("height",q).filter("div.right").removeClass("inactive");$("#first_hand_report div.tab_content ul").css({height:q,width:(b*304)+"px"});$("#first_hand_report div.tab_content").css("height",q);$("#first_hand_report div.tab_content ul li").css("left","0px");$("#first_hand_report div.move_arrow").hover(function(){$(this).removeClass("dim")},function(){$(this).addClass("dim")});$("#first_hand_report div.move_arrow").click(function(){k=parseInt($("#first_hand_report div.tab_content ul li").css("left"),10);if($(this).hasClass("right")){b=$("#first_hand_report div.tab_content ul li").length;if(a==b-2){if(!c){c=true;$("#first_hand_report div.move_arrow.right").css({backgroundImage:"url(/images/loading.gif)",cursor:"wait"});var v="/ajax/recent_first_hand_reports.html?offset="+a+"&numRequired="+4;$.get(v,function(x){$("#first_hand_report div.move_arrow.right").css({backgroundImage:'url("/images/firsthand_rightArrow.png")',cursor:"pointer"});var w=$("#first_hand_report div.tab_content ul li").length;$("#first_hand_report div.tab_content ul").css("width",((w+4)*304)+"px");$("#first_hand_report div.tab_content ul").append(x)})}else{return false}}else{if(a==b-1){return false}else{c=false}}a++;u=k-298;q=$("#first_hand_report div.tab_content ul li:eq("+a+")").height()+32;$("#first_hand_report div.tab_content, #first_hand_report div.tab_content ul, #first_hand_report div.move_arrow").animate({height:q});$("#first_hand_report div.move_arrow").addClass("dim").css("height",q);$("#first_hand_report div.tab_content ul li").animate({left:u+"px"},function(){});if(u<0){$("#first_hand_report div.move_arrow.left").removeClass("inactive")}}else{if($(this).hasClass("left")){a--;u=k+298;q=$("#first_hand_report div.tab_content ul li:eq("+a+")").height()+32;$("#first_hand_report div.tab_content, #first_hand_report div.tab_content ul, #first_hand_report div.move_arrow").animate({height:q});$("#first_hand_report div.tab_content ul li").animate({left:u+"px"},function(){});if(u>=0){$("#first_hand_report div.move_arrow.left").addClass("inactive")}}}console.log(a)})}else{if($("#first_hand_report").length>0){$("#first_hand_report div.tab_content ul li").each(function(){o.scroll_height+=$(this).height()});o.scroll_height+=(32*5);o.slide_bar_height=o.scroll_height-16;o.slider_height=(o.scroll_height/4);$("#first_hand_report div.tab_content, #first_hand_report div.scroll").css("height",o.scroll_height+"px");$("#first_hand_report div.scroll").removeClass("inactive").addClass("active").find("div.slider_bar").css("height",o.slide_bar_height+"px").find("div.slider").css("height",o.slider_height+"px");o.data_start=o.data_end+1;o.data_end=o.data_end+5;func.get_reports(o.data_start,5,f,p,false);$("#first_hand_report div.scroll div.slider_bar div.slider").css("top","0px");$("#first_hand_report div.scroll div.slider_bar div.slider").mousedown(function(v){v.preventDefault();n=v.pageY;j=parseInt($(v.target).css("top"),10);$("#first_hand_report").find("*").disableTextSelect();g=$("#first_hand_report div.tab_content ul").height();t=parseInt($("#first_hand_report div.tab_content ul").css("top"),10);$("html").bind("mousemove",function(w){l=j-(n-w.pageY);r=(o.slide_bar_height-o.slider_height);d=Math.round((l/(o.slide_bar_height-o.slider_height))*100)/100;if(d<0){d=0}else{if(d>1){d=1}}t=(g-$("#first_hand_report div.tab_content").height())*d;$("#first_hand_report div.tab_content ul").css("top",-t+"px");if(l>0&&l<r){$("#first_hand_report div.scroll div.slider_bar div.slider").css("top",(l)+"px");if(l>=(r-32)){if(!o.loaded){o.data_start=o.data_end+1;o.data_end=o.data_end+5;func.get_reports(o.data_start,5,f,p,true);o.loaded=true}}}else{if(l<=0){$("#first_hand_report div.scroll div.slider_bar div.slider").css("top","0px")}else{if(l>=r){$("#first_hand_report div.scroll div.slider_bar div.slider").css("top",r+"px")}}}}).bind("mouseup",function(w){$("#first_hand_report").find("*").enableTextSelect();$("html").unbind("mousemove").unbind("mouseup")});return false})}}},get_reports:function(d,p,n,o,e){var a,m,b,j,k,g,f,l,c;if(n=="region"){a="/ajax/region_first_hand_reports.html?offset="+d+"&numRequired="+p+"&regionId="+o}else{if(n=="resort"){a="/ajax/resort_first_hand_reports.html?offset="+d+"&numRequired="+p+"&clientId="+o}else{a="/ajax/recent_first_hand_reports.html?offset="+d+"&numRequired="+p}}g=$("#first_hand_report div.tab_content ul").height();$.get(a,function(q){if(q==""){console.log("Blank")}$("#first_hand_report div.tab_content ul li:last-child").remove();$("#first_hand_report div.tab_content ul").append(q).append(FH_WIDGET.loading_html);if(e){if(Math.round(FH_WIDGET.slider_height*0.9)>60){FH_WIDGET.slider_height=Math.round(FH_WIDGET.slider_height*0.9)}else{if(Math.round(FH_WIDGET.slider_height*0.7)>20){FH_WIDGET.slider_height=Math.round(FH_WIDGET.slider_height*0.7)}else{FH_WIDGET.slider_height=20}}f=$("#first_hand_report div.tab_content ul").height();l=g-FH_WIDGET.scroll_height;k=-Math.round((l/(FH_WIDGET.scroll_height-f))*100)/100;c=Math.round((FH_WIDGET.slide_bar_height-FH_WIDGET.slider_height)*k);$("#first_hand_report div.scroll div.slider_bar div.slider").animate({top:c+"px",height:FH_WIDGET.slider_height+"px"});$("#first_hand_report").find("*").enableTextSelect();$("html").unbind("mousemove").unbind("mouseup")}FH_WIDGET.loaded=false})}};var SS_CONTROLLER={init:function(){var a;a=$("div.residual_nav").offset().top;if($("html, body").scrollTop()>=a-10){$("div.residual_nav").addClass("float")}else{if($("div.residual_nav").hasClass("float")){$("div.residual_nav").removeClass("float")}}$(window).scroll(function(b){if($("html, body").scrollTop()>=a-10){$("div.residual_nav").addClass("float")}else{if($("div.residual_nav").hasClass("float")){$("div.residual_nav").removeClass("float")}}});$("div.residual_nav ul li a, div.featured_video a").click(function(d){d.preventDefault();var c,b;c=$(d.target).attr("href");if(c==undefined){c=$(d.target).parent().attr("href")}$("div.residual_nav ul li").removeClass("active");if($(d.target).closest("div.featured_video").length>0){$("div.residual_nav ul li").each(function(){if($(this).find("a").attr("href")==c){$(this).addClass("active")}})}else{if(c!="#snowscience_top"){if($(d.target).parent().attr("href")){$(d.target).parent().parent().addClass("active")}else{$(d.target).parent().addClass("active")}}}b=$(c).offset().top;$("html,body").animate({scrollTop:b});return false})}};$(document).ready(function(){menuHover();setCheckboxes();setSelectboxes();topratedHover();if($("#snowscience.intro").length>0){SS_CONTROLLER.init()}});(function(a){if(a.browser.mozilla){a.fn.disableTextSelect=function(){return this.each(function(){a(this).css({MozUserSelect:"none"})})};a.fn.enableTextSelect=function(){return this.each(function(){a(this).css({MozUserSelect:""})})}}else{if(a.browser.msie){a.fn.disableTextSelect=function(){return this.each(function(){a(this).bind("selectstart.disableTextSelect",function(){return false})})};a.fn.enableTextSelect=function(){return this.each(function(){a(this).unbind("selectstart.disableTextSelect")})}}else{a.fn.disableTextSelect=function(){return this.each(function(){a(this).bind("mousedown.disableTextSelect",function(){return false})})};a.fn.enableTextSelect=function(){return this.each(function(){a(this).unbind("mousedown.disableTextSelect")})}}}})(jQuery);function OAS_temp_RICH(a){if(a=="Top"){document.write('<script type="text/javascript">\n');document.write("OTS.oas.isPushDown = 1;\n");document.write('var OTSBannerImgUrl = "http://imagec14.247realmedia.com/RealMedia/ads/Creatives/MtnNews/Test_Campaign_PD/bannerTest1.jpg";\n');document.write('var OTSPanelImgUrl = "http://imagec14.247realmedia.com/RealMedia/ads/Creatives/MtnNews/Test_Campaign_PD/bannerTest2.jpg";\n');document.write('var OTSClickTrackUrl = "http://oascentral.onthesnow.com/RealMedia/ads/click_lx.ads/staging.onthesnow.com/index.html/L32/1116070507/Top/MtnNews/Test_Campaign_PD/Templated_PD_Test.html/726a4f774c5536757433384144595833"; \n');document.write('var OTSImpressionImgUrl = ""; <\/script> \n');document.write('<script type="text/javascript" src="http://tj.onthesnow.com/js/OTSPushDownAd.js"><\/script>\n')}}if(typeof OTS=="undefined"){var OTS={}}if(typeof OTS.Strings=="undefined"){OTS.Strings={}}(function($){OTS.domain="";OTS.baseURL=""+OTS.domain;OTS.imgURL=""+OTS.domain;OTS.loadPaginationAjax=function(el){var _url=$(el).attr("href");var _http=_url.match(/^http[s]{0,1}:\/\/(?:.+?)\//);if(_http){_url=_url.replace(_http,_http+"ajax/")}else{_url="/ajax"+_url}$.ajax({url:_url,success:function(result){$(el).parents(".ajaxPaginate").replaceWith(result);OTS.oas.reload()}});return false};OTS.loadPagination=function(el){$.ajax({url:$(el).attr("href"),success:function(result){$(el).parents(".ajaxPaginate").replaceWith(result);OTS.oas.reload()}});return false};OTS.oas={isPushDown:0,isXXL:0,isFixedPanel:0,listpos:null,url:"http://oascentral.onthesnow.com/RealMedia/ads/",sitepage:"",query:"",_timeout:null,hasPushedDown:0,init:function(args){OTS.oas.listpos=args.listpos;OTS.oas.sitepage=(args.sitepage);OTS.oas.setQuery(args.keywords,args.taxonomy)},setQuery:function(keywords,taxonomy){var OAS_geo="";var OTS_c=OTS.oas.getCookie("localization");if(OTS_c&&OTS_c!=""){var OTS_zip=OTS_c.match("zip&([^&]*)");OTS_zip=(OTS_zip&&OTS_zip[1]!="")?OTS_zip[1]:"";var OTS_country=OTS_c.match("cnty&([^&]*)");OTS_country=(OTS_country&&OTS_country[1]!="")?OTS_country[1]:"";OAS_geo=(OTS_country!=""&&OTS_zip!="")?"&_OAS_GEO_OVERRIDE_="+OTS_country+":"+OTS_zip:""}var OAS_device=(screen.width<=640)?"&UDEV=mobile":"";OTS.oas.query=""+OAS_geo+keywords+taxonomy+OAS_device},write:function(){return'<script src="'+OTS.oas.url+"adstream_mjx.ads/"+OTS.oas.sitepage+"/1"+OTS.oas.getRNS()+"@"+OTS.oas.listpos+"?"+OTS.oas.query+'"><\/script>'},makePushDown:function(){var o=document.getElementById("leaderboard_wrap");if(o){o.className+=" pushdown"}},makeXXL:function(){$(".hideWhenXXL").each(function(){$(this).remove()});var o=document.getElementById("main_wrap");if(o){o.className+=" xxl"}if(OTS.FBActivity){OTS.FBActivity.allow=0}if(OTS.TWTRActivity){OTS.TWTRActivity.allow=0}},makeFixedPanel:function(){$(".hideWhenFixedPanel").each(function(){$(this).remove()});var o=document.getElementById("main_wrap");if(o){o.className+=" fixed_panel"}var a=document.getElementById("adpos_Right1_extra");var b=document.getElementById("adpos_Right1_wrap");$(b).removeClass("ad_300x250");if(!a||!b){return}a.style.display="block";b.parentNode.removeChild(b);a.appendChild(b);if(OTS.FBActivity){OTS.FBActivity.allow=0}if(OTS.TWTRActivity){OTS.TWTRActivity.allow=0}},modAds:function(){if(OTS.oas.isPushDown==1){OTS.oas.makePushDown()}if(OTS.oas.isXXL==1){OTS.oas.makeXXL()}if(OTS.oas.isFixedPanel==1){OTS.oas.makeFixedPanel()}},makeAds:function(listpos){var list=(listpos)?listpos:OTS.oas.listpos;var pos=list.split(",");if(pos==0){return}OTS.oas.modAds();for(var i=0,l=pos.length;i<l;i++){var a=document.getElementById("adpos_"+pos[i]);var b=document.getElementById("adpos_"+pos[i]+"_lazy");if(!a||!b){continue}b.style.display="block";b.parentNode.removeChild(b);a.appendChild(b)}},getCookie:function(n){var c=document.cookie.match("(^|;) ?"+n+"=([^;]*)(;|$)");return(c)?(unescape(c[2])):""},getRNS:function(){return(new String(Math.random())).substring(2,11)},reload:function(){if(OTS.oas._timeout!==null){return false}$.getScript(OTS.oas.url+"adstream_mjx.ads/"+OTS.oas.sitepage+"/1"+OTS.oas.getRNS()+"@"+OTS.oas.listpos+"?"+OTS.oas.query,function(data,textStatus){$("body").append("<div id='tmp_ad_bucket'></div>");$("#tmp_ad_bucket").hide();var posList=OTS.oas.listpos.split(",");for(i in posList){var pos=posList[i];$("#adpos_"+pos).append("<div id='adpos_"+pos+"_tmp'></div>");$("#adpos_"+pos+"_tmp").hide();var adContent=OTS.oas._processAdPos(pos);document.write=function(evil){$("#tmp_ad_bucket").append(evil)};document.writeln=function(evil){$("#tmp_ad_bucket").append(evil)};$("#adpos_"+pos+"_tmp").html(adContent)}OTS.oas._timeout=setTimeout("OTS.oas._fixPositions()",300)});return false},_processAdPos:function(pos){var adContent="";document.write=function(evil){adContent+=evil};document.writeln=function(evil){adContent+=evil};OAS_RICH(pos);return adContent},_elementIsEmpty:function(adElement){if((adElement.find("img").length==0||adElement.find("noscript").length>0)&&adElement.find("object").length==0){return true}return false},_elementIsNewAd:function(adElement){if($(adElement).is("object")||$(adElement).is("a")||$(adElement).is("img")){return true}return false},_fixPositions:function(){OTS.oas._timeout=null;var posList=OTS.oas.listpos.split(",");posList=posList.reverse();for(i in posList){var pos=posList[i];var posElement=$("#adpos_"+pos+"_tmp");if(OTS.oas._elementIsEmpty(posElement)){var objectFound=false;$("#tmp_ad_bucket").children().each(function(){if(OTS.oas._elementIsNewAd(this)&&!objectFound){objectFound=true}else{if(OTS.oas._elementIsNewAd(this)&&objectFound){return false}}if($(this).is("object")&&(pos=="Top"||pos=="Bottom")&&$(this).attr("height")>90){objectFound=false;return}else{if($(this).is("object")&&(pos!="Top"&&pos!="Bottom")&&$(this).attr("height")==90){objectFound=false;return}}if(objectFound){$(posElement).append($(this))}})}}for(i in posList){var pos=posList[i];var posElement=$("#adpos_"+pos+"_tmp");if(OTS.oas._elementIsEmpty(posElement)){$(posElement).remove()}else{$("#adpos_"+pos+"_lazy").remove();$(posElement).attr("id","adpos_"+pos+"_lazy")}}$("#tmp_ad_bucket").remove();OTS.oas.makeAds();OTS.oas._googlePageView();OTS.oas._nielsenPageView();return false},_googlePageView:function(){pageTracker._trackPageview();pageTracker2._trackPageview();return false},_nielsenPageView:function(){var pvar={cid:"us-onthesnow",content:"0",server:"secure-us"};var trac=nol_t(pvar);trac.record().post();return false}};OTS.OverlayMap={_maphilightDefaults:{stroke:false,fillColor:"1ab7ea",fillOpacity:1,groupBy:"data-group-id"},_selected:[],_saved:[],_offsetX:-40,_offsetY:10,_mousePosX:0,_mousePosY:0,init:function(){$.modal.defaults.closeHTML='<a id="modal_main_close" href="">close</a>';$.modal.defaults.closeClass="modal_close";$(".overlay_target").click(function(ev){var target=$($(this).attr("href"));var country=$(this).attr("title");target.modal({opacity:80,overlayClose:true,persist:true,onClose:function(){$.modal.close();target.trigger("close.overlay")},onShow:function(){OTS.OverlayMap.setCountryMap(country)}});return false});$("#map_selected_list").delegate(".remove_selection","click",function(){var areaId=$(this).parent().attr("data-group-id");var area=$('area[data-group-id="'+areaId+'"]');if(area.length!==0){OTS.OverlayMap.deselectArea(area)}else{OTS.OverlayMap.removeFromSelected(areaId)}return false});$("#map_selector").bind("show.overlay",function(){OTS.OverlayMap.refreshHilighting();OTS.OverlayMap._saved.length&&OTS.OverlayMap.selectFromArray(OTS.OverlayMap._saved);$("body").append(OTS.OverlayMap._tooltip)});$(document).bind("mousemove",function(e){if(!e){e=window.event}if(e.pageX||e.pageY){OTS.OverlayMap._mousePosX=e.pageX;OTS.OverlayMap._mousePosY=e.pageY}else{if(e.clientX||e.clientY){OTS.OverlayMap._mousePosX=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;OTS.OverlayMap._mousePosY=e.clientY+document.body.scrollTop+document.documentElement.scrollTop}}});$("#modal_map").delegate("area","click",function(e){e.preventDefault();var areaId=$(this).attr("data-group-id"),area=$('area[data-group-id="'+areaId+'"]'),areaData=$(this).data("maphilight"),isOn=areaData&&areaData.alwaysOn;if(isOn){OTS.OverlayMap.deselectArea(area)}else{OTS.OverlayMap.selectArea(area)}OTS.OverlayMap._tooltip.fadeOut();return false})},initMapSelect:function(){OTS.OverlayMap._map=$("#map_large");OTS.OverlayMap._imageMap=$("#image_map_large");OTS.OverlayMap._tooltip=$("#area_tooltip");OTS.OverlayMap._imageMap.find("area:not(.on)").hoverIntent({over:function(){var mapData=$(this).data("maphilight");if(mapData&&mapData.alwaysOn){return}var areaId=$(this).attr("data-group-id");var stateInfo=stateInformationTable[areaId];$("#area_tooltip_region_link").html(stateInfo.title);$("#area_tooltip_content").html(stateInfo.state_info);$("#area_tooltip_resort_link").html(stateInfo.num_resorts);OTS.OverlayMap._tooltip.css({top:OTS.OverlayMap._mousePosY+OTS.OverlayMap._offsetY+"px",left:OTS.OverlayMap._mousePosX+OTS.OverlayMap._offsetX+"px"}).fadeIn()},out:function(){OTS.OverlayMap._tooltip.fadeOut()},interval:300});$("#map_region_list").find("a").bind("click",function(){var selections=$(this).attr("data-group-id").split(",");OTS.OverlayMap.selectFromArray(selections);return false});$("#map_selector").bind("close.overlay",function(){});$("#save_map_changes").bind("click",function(){OTS.OverlayMap._saved=OTS.OverlayMap._selected.slice(0);if(OTS.OverlayMap._saved.length>1){OTS.resortFinder.resortFinderRedirect(OTS.OverlayMap._saved)}else{if(OTS.OverlayMap._saved.length==1){OTS.resortFinder.regionProfileRedirect(OTS.OverlayMap._saved[0])}}return false})},setCountryMap:function(country){country=country.toLowerCase();$.ajax({url:"/ajax/select_overlay_country_map_"+country+".html",context:$("#modal_map"),success:function(html){$(this).html(html);$("#save_map_changes").unbind();OTS.OverlayMap.initMapSelect();$("#map_selector").trigger("show.overlay");OTS.OverlayMap.selectFromArray(OTS.OverlayMap._selected);$("#map_country_input").text(OTS.Strings[country])}})},refreshHilighting:function(){OTS.OverlayMap._map.maphilight(OTS.OverlayMap._maphilightDefaults)},selectFromArray:function(arr){for(var i=arr.length-1;i>-1;i--){var thisArea=OTS.OverlayMap._imageMap.find('area[data-group-id="'+arr[i]+'"]');if(thisArea.length===0){continue}OTS.OverlayMap.selectArea(thisArea,true);OTS.OverlayMap.refreshHilighting()}},selectArea:function(area,skipInit){area.data("maphilight",{alwaysOn:true});area.addClass("on");OTS.OverlayMap.updateSelectedArray(area);!skipInit&&OTS.OverlayMap.refreshHilighting()},deselectArea:function(area){area.data("maphilight",{alwaysOn:false});area.removeClass("on");OTS.OverlayMap.updateSelectedArray(area,true);OTS.OverlayMap.refreshHilighting()},updateSelectedArray:function(area,remove){remove=remove?true:false;var areaId=area.attr("data-group-id");if(remove){OTS.OverlayMap.removeFromSelected(areaId)}else{OTS.OverlayMap.addToSelected(area,areaId)}},removeFromSelected:function(areaId){var selectedIndex=(~OTS.OverlayMap._selected.indexOf(areaId))?OTS.OverlayMap._selected.indexOf(areaId):-1;if(selectedIndex>-1){OTS.OverlayMap._selected.splice(selectedIndex,1);OTS.OverlayMap.removeFromSelectedDisplay(areaId)}},addToSelected:function(area,areaId){var selectedIndex=(~OTS.OverlayMap._selected.indexOf(areaId))?OTS.OverlayMap._selected.indexOf(areaId):-1;if(!(selectedIndex>-1)){OTS.OverlayMap._selected.push(areaId);OTS.OverlayMap.addToSelectedDisplay(area)}},updatedSelectedDisplay:function(area,remove){var container=$("#map_selected_list"),existing=container.find('[data-group-id="'+area.attr("data-group-id")+'"]'),template='<li data-group-id="%id">%s <a href="" class="remove_selection">remove %s</a>';remove&&existing.remove()||!existing.length&&container.append(template.replace(/%s/g,area.attr("data-title")).replace(/%id/,area.attr("data-group-id")));if(OTS.OverlayMap._selected.length===0){container.parent().find(".instruction").show()}else{if(OTS.OverlayMap._selected.length===1){container.parent().find(".instruction").hide()}}},addToSelectedDisplay:function(area){var container=$("#map_selected_list"),existing=container.find('[data-group-id="'+area.attr("data-group-id")+'"]'),template='<li data-group-id="%id">%s <a href="" class="remove_selection">remove %s</a>';!existing.length&&container.append(template.replace(/%s/g,area.attr("data-title")).replace(/%id/,area.attr("data-group-id")));if(OTS.OverlayMap._selected.length===1){container.parent().find(".instruction").hide()}},removeFromSelectedDisplay:function(areaId){var container=$("#map_selected_list"),existing=container.find('[data-group-id="'+areaId+'"]');existing.remove();if(OTS.OverlayMap._selected.length===0){container.parent().find(".instruction").show()}},clearAllSelections:function(){$("#map_selected_list").empty().parent().find(".instruction").show();$("#modal_map").find("area").removeClass("on").data("maphilight",false);OTS.OverlayMap._selected=[]}};OTS.Search={_delay:200,_url:"/ajax/resortSearch",_customKeyCodes:{40:"downArrow",38:"upArrow",13:"enter"},_searchBox:"#global_search",_resultsDiv:"#global_results",init:function(){$("#global_search,#search_page,#snowreport_search").keyup(function(e){var term=$(this).val();OTS.Search._searchBox="#"+$(this).attr("id");OTS.Search._resultsDiv=(OTS.Search._searchBox=="#global_search"?"#global_results":(OTS.Search._searchBox=="#snowreport_search"?"#snowreport_results":"#search_page_results"));if(OTS.Search._customKeyCodes[e.keyCode]){return OTS.Search[OTS.Search._customKeyCodes[e.keyCode]](e)}if(term.length<2){return false}$.post(OTS.Search._url,{search:term},function(data){OTS.Search.callback(data)})}).focus(function(e){if($(this).val()===OTS.Strings.Search.defaultText){$(this).val("")}}).blur(function(e){if($(this).val()===""){$(this).val(OTS.Strings.Search.defaultText)}});$("#global_results li,#snowreport_search li,#search_page_results li").live("mouseover",function(){$(this).addClass("highlight")}).live("mouseout",function(){$(this).removeClass("highlight")})},callback:function(data){$(OTS.Search._resultsDiv).html(data);$(OTS.Search._resultsDiv).show();$("body").bind("click",function(){$("#global_results, #search_page_results","#snowreport_search").hide();$("body").unbind("click");if($("#global_search").val()===""){$("#global_search").val(OTS.Strings.Search.defaultText)}})},downArrow:function(e){var $active=$(OTS.Search._resultsDiv+" li.highlight");if(!$active){$active=$(OTS.Search._resultsDiv+" li:first")}var $next=($active.next().length===0?$(OTS.Search._resultsDiv+" li:first"):$active.next());$active.removeClass("highlight");$next.addClass("highlight");return false},upArrow:function(e){var $active=$(OTS.Search._resultsDiv+" li.highlight");if(!$active){$active=$(OTS.Search._resultsDiv+"li:last")}var $prev=($active.prev().length==0?$(OTS.Search._resultsDiv+" li:last"):$active.prev());$active.removeClass("highlight");$prev.addClass("highlight");return false},enter:function(e){if($(OTS.Search._resultsDiv+" li.highlight").length){window.location=$(OTS.Search._resultsDiv+" li.highlight a").attr("href");return false}else{return true}}};OTS.$=function(id){return $("#"+id)[0]};OTS.getElm=function(id){return(typeof id!="object")?OTS.$(id):id};OTS.hasParent=function(obj,parent){var el=OTS.getElm(obj);var an=OTS.getElm(parent);while(el!=document&&el!=null){if(el==an){return true}el=el.parentNode}return false};OTS.isContained=function(obj,e){e=window.event||e;var c=e.relatedTarget||((e.type=="mouseover")?e.fromElement:e.toElement);while(c&&c!=obj){try{c=c.parentNode}catch(e){c=obj}}if(c==obj){return true}else{return false}};OTS.getPos=function(obj){return{left:OTS.getOffset(obj,"left"),top:OTS.getOffset(obj,"top")}};OTS.getStyle=function(id,s){var o=OTS.getElm(id);if(!o){return}var x;if(o.currentStyle){x=o.currentStyle[s]}else{if(window.getComputedStyle){x=document.defaultView.getComputedStyle(o,null).getPropertyValue(s)}}return x};OTS.getOffset=function(obj,type){var curoffset=(type=="left")?obj.offsetLeft:obj.offsetTop;var elm=obj.offsetParent;while(elm!=null){curoffset+=(type=="left")?elm.offsetLeft:elm.offsetTop;var ml=parseInt(OTS.getStyle(elm,"marginLeft"));if(type=="left"&&ml>0&&document.all){curoffset-=ml}elm=elm.offsetParent}return curoffset};OTS.getPageScroll=function(obj){var o=obj;var y;if(obj==null){if(self.pageYOffset){y=self.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){y=document.documentElement.scrollTop}else{if(document.body){y=document.body.scrollTop}}}}else{if(o.pageYOffset){y=o.pageYOffset}else{if(o.documentElement&&o.documentElement.scrollTop){y=o.documentElement.scrollTop}else{if(o){y=o.scrollTop}}}}return y};OTS.setPageScroll=function(obj,y){var o=obj;if(o.pageYOffset){o.pageYOffset=y}else{if(o.documentElement&&o.documentElement.scrollTop){o.documentElement.scrollTop=y}else{if(o){o.scrollTop=y}}}};OTS.getPageSize=function(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=document.body.scrollWidth;yScroll=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight}}var windowWidth,windowHeight;if(self.innerHeight){windowWidth=self.innerWidth;windowHeight=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight}else{if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight}}}if(yScroll<windowHeight){pageHeight=windowHeight}else{pageHeight=yScroll}if(xScroll<windowWidth){pageWidth=windowWidth}else{pageWidth=xScroll}return{pageWidth:pageWidth,pageHeight:pageHeight,windowWidth:windowWidth,windowHeight:windowHeight}};OTS.setOpacity=function(o,opacity){if(!o){return}o.style.opacity=(opacity/100);o.style.MozOpacity=(opacity/100);o.style.KhtmlOpacity=(opacity/100);o.style.filter="alpha(opacity="+opacity+")"};OTS.getQuery=function(v,s,d1,d2){var q=(!s)?unescape(location.search).substring(1):s;if(!q){return""}var z1=(!d1)?"=":d1;var z2=(!d2)?"&":d2;var j=q.split(z2);for(var i=0;i<j.length;i++){var c=j[i].split(z1);c[0]=c[0].replace(/^\s+|\s+$/g,"");c[1]=c[1].replace(/^\s+|\s+$/g,"");if(v==c[0]){return c[1]}}return""};OTS.setCookie=function(name,value,hours,path,domain){if(!hours){hours=1000000}var d=new Date();d.setTime(d.getTime()+(hours*3600*1000));document.cookie=name+"="+escape(value)+";expires="+d.toGMTString()+";path="+((path)?path:"/")+((domain)?";domain="+domain:"")};OTS.getCookie=function(name){if(name==null){return document.cookie}else{var cArr=document.cookie.split(";");for(var i=0;i<cArr.length;++i){var c=cArr[i].split("=");if(c[0]&&c[1]){c[0]=c[0].replace(/^\s+|\s+$/g,"");c[1]=c[1].replace(/^\s+|\s+$/g,"");if(name==c[0]){return unescape(c[1])}}}return""}};OTS.delCookie=function(name,path,domain){if(OTS.getCookie(name)){document.cookie=name+"="+((path)?";path="+path:"")+((domain)?";domain="+domain:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT"}};OTS.noValue=function(o,c){if(o.value!=o.title){return}o.value="";c=c||"recall";o.className=o.className.replace(c,"")};OTS.reValue=function(o,c){if(o.value!=""){return}o.value=o.title;c=c||"recall";o.className+=" "+c};OTS.isEmail=function(str){return str.match(/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/)};OTS.randArray=function(a){for(var j,x,i=a.length;i;j=parseInt(Math.random()*i),x=a[--i],a[i]=a[j],a[j]=x){}return a};OTS.ajax=function(url,method,post,xml){this.url=url;this.method=method;this.error=this.processErr;this.post=(post==null)?"get":post;this.xml=(xml==null)?"":xml;this.id=null;this.html=""};OTS.ajax.prototype.request=function(){if(window.XMLHttpRequest){this.req=new XMLHttpRequest()}else{if(window.ActiveXObject){this.req=new ActiveXObject("Microsoft.XMLHTTP")}}if(this.req){var _this=this;this.req.onreadystatechange=function(){_this.processReq()};this.req.open(this.post,this.url,true);this.req.send(null)}else{return}};OTS.ajax.prototype.processReq=function(){if(this.req.readyState==4){if(this.req.status==200){var s=(this.xml=="xml")?this.req.responseXML:this.req.responseText;this.method(s,this.id,this.html)}}};OTS.ajax.prototype.processErr=function(s){};OTS.gaTrkImp=function(a){try{if(a){pageTracker._trackPageview(a)}else{pageTracker._trackPageview()}}catch(err){}try{if(a){pageTracker2._trackPageview(a)}else{pageTracker2._trackPageview()}}catch(err){}};OTS.gaTrkEvt=function(a,b,c){try{pageTracker._trackEvent(a,b,c)}catch(err){}try{pageTracker2._trackEvent(a,b,c)}catch(err){}};OTS.popWin=function(url,name,options){return window.open(url,name,options)};OTS.popWinOptions=function(w,h,toolbar,status,scrollbars,resizeable){var sw=screen.width;var sh=screen.height;if(w==null){w=(sw>=1024)?925:625}if(h==null){h=(sw>=1024)?600:500}if(toolbar==null){toolbar="no"}if(status==null){status="yes"}if(scrollbars==null){scrollbars="1"}if(resizeable==null){resizeable="yes"}var cx=(sw*0.5)-(w*0.5);var cy=(sh*0.5)-(h*0.5);var sOptions="toolbar="+toolbar+",menubar=no,status="+status+",scrollbars="+scrollbars+",resizable="+resizeable+",screenX="+cx+",screenY="+cy+",left="+cx+",top="+cy+",width="+w+",height="+h+"";return sOptions};OTS.doArtLnks=function(id){var o=OTS.$("storybody");if(!o){return}var lnks=o.getElementsByTagName("a");for(var i=0,l=lnks.length;i<l;i++){var a=lnks[i];if(a.onclick){continue}a.onclick=function(){var t0=(OTS.$("storyhd"))?(OTS.$("storyhd").innerText||OTS.$("storyhd").textContent):"";var t1=(id)?id:t0;var t2=this.innerText||this.textContent;var t3=this.href;var t=t1+" + "+t2+" + "+t3;OTS.gaTrkEvt("ARTLNKS","open",t)};if((a.href.indexOf("http://")>-1)&&(a.href.indexOf("onthesnow")==-1)){a.target="_blank"}}};OTS.doTAHeight=function(o){var id=o.id;var o1=OTS.$(id);if(!o1){return}var o2=OTS.$(id+"_stmp");if(!o2){o1.ppS=false;o1.ppH=o1.offsetHeight;o2=document.createElement("div");o2.id=id+"_stmp";o2.className="fTxt";o2.style.width=(o1.offsetWidth-26)+"px";o2.style.position="absolute";o2.style.top=0;o2.style.left="-2000px";o2.style.visibility="hidden";document.body.appendChild(o2)}var s=o1.value;s=s.replace(/\n/g,"<br />");$(o2).html(s);var h1=o1.offsetHeight;var h2=o2.offsetHeight;if(h2>h1){if(o1.ppS==false){o1.ppS=true}if(h2>600){h2=600}o1.style.height=(h2+30)+"px"}else{if(o1.ppS==true){if(h2<o1.ppH){h2=o1.ppH-30}o1.style.height=(h2+30)+"px"}}};OTS.doSortLang=function(o){var s=o.options[o.selectedIndex].value;var u=location.href;u=u.substring(0,u.indexOf("?"));if(s!=""){u+="?l="+s}location.href=u};OTS.helpfulReqURL=OTS.baseURL+"/community/ajax/ajax_helpful.html";OTS.helpful={vote:function(id,w){if(w=="up"){OTS.helpful.doUp(id)}else{OTS.helpful.doDown(id)}},doUp:function(id){var o=OTS.$("hpfl_up_"+id);if(!o){return}var r=new OTS.ajax(OTS.helpfulReqURL+"?o=up&id="+id,OTS.helpful.setUp);r.id=id;r.html=o.innerHTML;r.request()},setUp:function(s,id,html){var d=eval("("+s+")");if(d.success==1){OTS.$("hpfl_up_"+id).innerHTML=d.upvote+'<span class="ithmbsup chkd"></span>';OTS.$("hpfl_dn_"+id).innerHTML=d.dnvote+'<span class="ithmbsdn chkdoff"></span>'}else{OTS.$("hpfl_up_"+id).innerHTML=html}},doDown:function(id){var o=OTS.$("hpfl_dn_"+id);if(!o){return}var r=new OTS.ajax(OTS.helpfulReqURL+"?o=dn&id="+id,OTS.helpful.setDown);r.id=id;r.html=o.innerHTML;r.request()},setDown:function(s,id,html){var d=eval("("+s+")");if(d.success==1){OTS.$("hpfl_dn_"+id).innerHTML=d.dnvote+'<span class="ithmbsdn chkd"></span>';OTS.$("hpfl_up_"+id).innerHTML=d.upvote+'<span class="ithmbsup chkdoff"></span>'}else{OTS.$("hpfl_dn_"+id).innerHTML=html}},doLogin:function(){OTS.doLogin("helpful")}};OTS.flagOptions={reportas:"Report Item As",choose:"Choose one",additional:"Additional Comments?",comments:"Comments",report:"Report",flag:["Obscenity/vulgarity","Hate speech","Personal attack","Advertising/Spam","Copyright/Plagiarism","Other"]};OTS.flagReqURL=OTS.baseURL+"/community/ajax/ajax_flag.html";OTS.flag={active:false,report:function(id,target){OTS.flag.oAb=OTS.$("hpfl_ab_"+id);if(!OTS.flag.oAb){return}OTS.flag.target=target;OTS.flag.showMenu(id)},showMenu:function(id){var s='<div class="ttip2" style="width:150px;">';s+='<form id="abuse_form" name="abuse_form" action="" method="post" onsubmit="OTS.flag.doReport(this); return false;" style="width:140px; padding:5px 10px 5px 5px; position:relative;">';s+='<input type="hidden" name="review_id" value="'+id+'" />';s+='<div class="close" style="position:absolute; top:0; right:0;"><a href="#" onclick="OTS.flag.hideMenu(); return false;"><img src="'+OTS.imgURL+'/ots/images/icon_close2.gif" alt="X" border="0" align="absmiddle" /></a></div>';s+='<div id=""><strong>'+OTS.flagOptions.reportas+':</strong><br /><select id="abuse_flag" name="abuse_flag">';s+='<option value="">'+OTS.flagOptions.choose+"</option>";for(var i=0;i<OTS.flagOptions.flag.length;i++){s+='<option value="'+(i+1)+'">'+OTS.flagOptions.flag[i]+"</option>"}s+='</select></div><p id="report_comment_link"><a href="#" onclick="OTS.flag.showComment(); return false;">'+OTS.flagOptions.additional+"</a></p>";s+='<div id="report_comment" style="display:none;"><strong>'+OTS.flagOptions.comments+':</strong><br /><textarea id="abuse_comment" name="abuse_comment"></textarea></div>';s+='<input type="submit" value="'+OTS.flagOptions.report+'" /></form>';s+='</div><b class="marker"></b>';var o=OTS.$("flag_menu");if(!o){o=document.createElement("div");o.id="flag_menu";o.className="ttip";document.body.appendChild(o)}o.innerHTML=s;var p=OTS.getPos(OTS.flag.target);if(document.all){p.left+=20}o.style.position="absolute";o.style.left=p.left+"px";o.style.top=(p.top+20)+"px";OTS.flag.active=true;$(document).bind("click",function(e){OTS.flag.closeMenu(e)})},hideMenu:function(){var o=OTS.$("flag_menu");if(!o){return}o.innerHTML="";o.style.left="-2000px";OTS.flag.active=false},doReport:function(o){var abuse_flag=escape(o.abuse_flag.value);if(abuse_flag==""){return}var abuse_comment=escape(o.abuse_comment.value);OTS.flag.doReq(o.review_id.value,abuse_flag,abuse_comment)},doReq:function(id,abuse_flag,abuse_comment){var o=OTS.$("hpfl_ab_"+id);if(!o){return}var u=OTS.flagReqURL+"?o=ab&id="+id+"&abuse_flag="+abuse_flag+"&abuse_comment="+abuse_comment;var r=new OTS.ajax(u,OTS.flag.doUpdate);r.id=id;r.html=o.innerHTML;o.innerHTML='<span class="iloading"></span>';r.request();OTS.flag.hideMenu()},doUpdate:function(s,id,html){var d=eval("("+s+")");if(d.success==1){OTS.$("hpfl_ab_"+id).innerHTML='<span class="iabuse chkd">Reported</span>'}else{OTS.$("hpfl_ab_"+id).innerHTML=html}},showComment:function(){OTS.$("report_comment_link").style.display="none";OTS.$("report_comment").style.display="block"},closeMenu:function(e){var o=e.target||e.srcElement;if(!OTS.hasParent(o,"flag_menu")&&o.className.indexOf("iabuse")==-1){if(OTS.flag.active==true){OTS.flag.hideMenu();$(document).unbind("click")}}},doLogin:function(){OTS.doLogin("abuse")}};OTS.favoritesTxtObj={t1:"Add to favorites",t2:"Remove"};OTS.favoritesReqURL=OTS.baseURL+"/community/ajax/ajax_favorites.html";OTS.favorites={setup:function(eleId){if(eleId==null){eleId="span[id^=favorite_]"}$(eleId).each(function(){var eleId=$(this).attr("id");var clientId=eleId.replace("favorite_","");var link=$(this).find("a:first");var title=$(link).attr("title");if(title===OTS.Strings.remove_favorites){$(link).bind("click",function(){OTS.favorites.remove(clientId);return false})}else{if(title===OTS.Strings.add_favorites){if($(link).attr("href")!=null){$(link).bind("click",function(){OTS.favorites.doLogin();return false})}else{$(link).bind("click",function(){OTS.favorites.add(clientId);return false})}}}})},showMore:function(id,target,which){OTS.favorites.target=target;var html="<span>"+(which=="r"?OTS.favoritesTxtObj.t2:OTS.favoritesTxtObj.t1)+'</span><b class="marker"></b>';var o=OTS.$("favs_menu");if(!o){o=document.createElement("div");o.id="favs_menu";o.className="ttip_sm";document.body.appendChild(o)}o.innerHTML=html;var p=OTS.getPos(OTS.favorites.target);o.style.position="absolute";o.style.left=(p.left+20)+"px";o.style.top=(p.top-2)+"px"},hideMore:function(){var o=OTS.$("favs_menu");if(!o){return}o.innerHTML="";o.style.left="-2000px"},add:function(id){OTS.favorites.doReq(id,"a")},remove:function(id){OTS.favorites.doReq(id,"r")},doReq:function(id,which){var u=OTS.favoritesReqURL+"?o="+which+"&id="+id+"";var m;if(which=="r"){m=OTS.favorites.doRemove}else{m=OTS.favorites.doAdd}var r=new OTS.ajax(u,m);r.id=id;r.html=$("#favorite_"+id).html();r.request()},doAdd:function(s,id,html){var d=eval("("+s+")");if(d.success==1){$("span[id=favorite_"+id+"]").each(function(){var link=$(this).find("a:first");$(link).unbind("click");$(link).bind("click",function(){OTS.favorites.remove(id);return false});$(link).addClass("active");$(link).attr("title",OTS.Strings.remove_favorites)})}},doRemove:function(s,id,html){var d=eval("("+s+")");if(d.success==1){$("span[id=favorite_"+id+"]").each(function(){var link=$(this).find("a:first");$(link).unbind("click");$(link).bind("click",function(){OTS.favorites.add(id);return false});$(link).removeClass("active");$(link).attr("title",OTS.Strings.add_favorites)})}},doLogin:function(){OTS.doLogin("favorites")}};OTS.litebox={load:function(){var o1=document.createElement("div");o1.id="litebox";o1.style.textAlign="center";o1.style.width="100%";o1.style.display="none";o1.style.position="absolute";o1.style.top="0";o1.style.left="0";o1.style.zIndex="9998";var o2=document.createElement("div");o2.id="litebox_content";o2.style.display="none";o2.style.position="relative";o2.style.margin="0 auto";o1.appendChild(o2);var o=OTS.$("empty");if(!o){return}o.appendChild(o1)},toggleObjects:function(s){var elms1=document.getElementsByTagName("select");if(elms1&&elms1.length>0){for(var i=0,l=elms1.length;i<l;i++){elms1[i].style.visibility=s}}var elms2=document.getElementsByTagName("iframe");if(elms2&&elms2.length>0){for(var i=0,l=elms2.length;i<l;i++){elms2[i].style.visibility=s;elms2[i].style.display=(s=="visible")?"inline":"none"}}var elms3=document.getElementsByTagName("object");if(elms3&&elms3.length>0){for(var i=0,l=elms3.length;i<l;i++){elms3[i].style.visibility=s}}var elms4=document.getElementsByTagName("embed");if(elms4&&elms4.length>0){for(var i=0,l=elms4.length;i<l;i++){elms4[i].style.visibility=s}}}};OTS.loginReg={load:function(){},show:function(s){OTS.litebox.toggleObjects("hidden");OTS.loginReg.showMsgr(s);var o=$("#registration");if(o.length==0){return}o.modal({opacity:80,overlayClose:true})},hide:function(){$.modal.close();OTS.litebox.toggleObjects("visible");OTS.loginReg.hideMsgr()},showMsgr:function(s){var o=OTS.$("login_msgr");if(!o){return}o.innerHTML="";if(!s){return}var t='<div class="login_msgr">';t+=OTS.loginMsgTxtObj[s];t+="</div>";o.innerHTML=t},hideMsgr:function(){var o=OTS.$("login_msgr");if(!o){return}o.innerHTML=""},hideProfiler:function(){var o=OTS.$("registration");if(!o){return}o.innerHTML="";OTS.loginReg.hide()}};OTS.loginMsgTxtObj={generic:"Generic",login:"Login",register:"Register",favorites:"Favorites",helpful:"Helpful",abuse:"Abuse",review:"Review",comment:"Comment",blog:"Blog"};OTS.doLogin=function(s){OTS.loginReg.show(s)};OTS.loginTxtObj={t1:"Username or E-mail",t2:"Password"};OTS.validateLogin=function(){var f=document.user_login;var s="";if(f.user_name&&f.user_name.value==""){s+=OTS.loginTxtObj.t1+"<br />"}if(f.password&&f.password.value==""){s+=OTS.loginTxtObj.t2+"<br />"}if(s!=""){OTS.validateWriteErrs("login_errors",s);return false}else{f.submit()}};OTS.registerTxtObj={t1:"Username",t2:"E-mail Address",t3:"Passord",t4:"Retype Password"};OTS.validateReg=function(){var f=document.user_register;var s="";if(f.user_name&&f.user_name.value==""){s+=OTS.registerTxtObj.t1+"<br />"}if(f.email&&f.email.value==""){s+=OTS.registerTxtObj.t2+"<br />"}if(f.password&&f.password.value==""){s+=OTS.registerTxtObj.t3+"<br />"}if(f.password_check&&f.password_check.value==""){s+=OTS.registerTxtObj.t4+"<br />"}if(s!=""){OTS.validateWriteErrs("reg_errors",s);return false}else{f.submit()}};OTS.validateWriteErrs=function(id,s){s="<h4>Error</h4>"+s+"";var elm=document.getElementById(id);if(elm){elm.innerHTML='<div class="errors">'+s+"</div>";elm.style.display="block"}else{s=s.replace(/<\/h4>/g,"\n\n");s=s.replace(/<br \/>/g,"\n");s=s.replace(/(<([^>]+)>)/ig,"");alert(s)}};OTS.setTimeZone=function(){var d=new Date();var d1=new Date(d.getFullYear(),0,1,0,0,0,0);var t=d1.toGMTString();var d3=new Date(t.substring(0,t.lastIndexOf(" ")-1));var o=(d1-d3)/(1000*60*60);var o1=OTS.$("timezone");if(o1&&o1.value==""||o1.value=="0"){o1.value=o}};if(typeof OTS.FB=="undefined"){OTS.FB={}}OTS.FB.TxtObj={ots_invite:"OnTheSnow Invite",ots_invite_txt:"Invite your friends to use OnTheSnow",ots_invite_con:"I'd like to connect with you at OnTheSnow",ots_invite_url:"http://www.onthesnow.com"};OTS.FB.connect=function(){FB.login(function(response){if(response.authResponse){OTS.setCookie("afb_s",2);location.href=OTS.baseURL+"/community/login_fb?redir="+location.href}})};OTS.FB.logout=function(u){FB.logout(function(response){OTS.setCookie("ots_v","");var r=(u)?"?redir="+u:"";location.href=OTS.baseURL+"/community/logout"+r})};OTS.FB.hideBtn=function(o1,o2){o2=OTS.$(o2);if(o2){o2.style.display="inline"}};OTS.FB.setName=function(s){var o=OTS.$("fb_name");if(!o){return}o.innerHTML=s};OTS.FB.setPic=function(s){var o=OTS.$("fb_pic");if(!o){return}if(s==""){s=OTS.imgURL+"/ots/images/avatars/avatar_lg.jpg"}o.src=s};OTS.FB.setUN=function(){var o=document.user_register.user_name;if(!o){return}FB.api("/me",function(user){if(user!=null){var n=user.name;var un=n.replace(/\s+/g,"");un=un.toLowerCase();if((n!="")&&o.value==""){o.value=un}OTS.FB.setName(n);OTS.FB.setPic("http://graph.facebook.com/"+user.id+"/picture")}})};OTS.FB.setUserFields=function(r){var o=r[0];var o1=OTS.$("avatar_img");if(o1&&o1.src.indexOf("avatars/avatar")>-1){o1.src=o.pic_square}var o2=OTS.$("full_name");if(o2&&o2.value==""){o2.value=o.name}OTS.setTimeZone()};OTS.FB.initUserFields=function(){var v=OTS.getCookie("ots_v");if(v!="fb"){return}FB.getLoginStatus(function(response){if(response.authResponse){FB.api("/me",function(user){if(user!=null){var query=FB.Data.query("SELECT name, pic_square, birthday_date, current_location FROM user WHERE uid="+user.id);query.wait(function(rows){OTS.FB.setUserFields(rows[0])})}})}})};OTS.FB.getInviteFBML=function(){var s="";s='<fb:fbml><fb:request-form action="'+OTS.FB.TxtObj.ots_invite_url+'/community/account" invite="true" type="'+OTS.FB.TxtObj.ots_invite+'" content="'+OTS.FB.TxtObj.ots_invite_con+": <fb:req-choice url='"+OTS.FB.TxtObj.ots_invite_url+"' label='Confirm' />\">";s+='<fb:multi-friend-selector actiontext="'+OTS.FB.TxtObj.ots_invite_txt+'" cols="4" rows="2" bypass="skip" showborder="false" condensed="false" />';s+="</fb:request-form></fb:fbml>";return s};OTS.FB.inviteFriends=function(){FB.getLoginStatus(function(response){if(response.authResponse){FB.ui({method:"apprequests",message:OTS.FB.TxtObj.ots_invite})}})};OTS.FB.setPrefsWall=function(o,k){var v=(o.checked==true)?1:0;var u=OTS.baseURL+"/community/ajax/fb_methods.html?method=updateWallPref&k="+k+"&v="+v;var r=new OTS.ajax(u,function(){return flase});r.request()};OTS.FB.setPrefsAccess=function(v){OTS.setCookie("fb_allow",v);var u=OTS.baseURL+"/community/ajax/fb_methods.html?method=updateAccess&v="+v;var r=new OTS.ajax(u,function(){return false});r.request()};OTS.FB.allowPrefs=function(){FB.login(function(response){if(response.authResponse){OTS.FB.setPrefsAccess(1)}else{OTS.FB.setPrefsAccess(0)}},{scope:"publish_stream"})};OTS.FB.setAlert=function(){var o=OTS.$("membersTease");if(!o){return}var u=OTS.baseURL+"/community/login_fb";o.innerHTML+='<span id="signin_fb"><a href="'+u+'" title="" class="signin"></a></span>'};OTS.FB.loadAlert=function(){if(typeof FB==="undefined"){return false}FB.getLoginStatus(function(response){if(response.status==="connected"){OTS.setCookie("afb_s",2);OTS.FB.setAlert()}else{if(response.status==="appNotAuthorized"){OTS.setCookie("afb_s",1);OTS.FB.setAlert()}else{OTS.setCookie("afb_s",0)}}})};OTS.FB.setAvatar=function(){var o=OTS.$("avatar_xtra");if(o){o.className="avatar_facebook"}};OTS.FB.getAvatar=function(){var o=OTS.$("membersTease_ico");if(!o){return}FB.getLoginStatus(function(response){if(response.authResponse){FB.api("/me",function(user){if(user!=null){var query=FB.Data.query("SELECT pic_square FROM user WHERE uid="+user.id);query.wait(function(rows){var img=rows[0].pic_square;if(img&&img!=""){o.src=img}if(OTS.FB.ots_avatar!=img){OTS.FB.updateAvatar(img)}})}})}})};OTS.FB.updateAvatar=function(v){var u=OTS.baseURL+"/community/ajax/fb_methods.html?method=updateAvatar&v="+v;var r=new OTS.ajax(u,function(){return false});r.request()};OTS.FB.loadTease=function(){var o=OTS.$("membersTease");if(!o){return}var u=OTS.baseURL+"/community/ajax/logged_in_box.html";var r=new OTS.ajax(u,OTS.FB.loadTeaseUpdate);r.id=o;r.request()};OTS.FB.loadTeaseUpdate=function(s,id){if(!id){return}id.innerHTML=s;OTS.FB.setAvatar()};OTS.FB.loadFavs=function(){var o1=OTS.$("rmap_favorites_results");if(o1){OTS.FB.loadFavs1(o1)}var o2=OTS.$("flist");if(o2){OTS.FB.loadFavs2()}};OTS.FB.loadFavs1=function(o){var u=OTS.baseURL+"/ajax/favorites.html";var r=new OTS.ajax(u,OTS.FB.loadFavsUpdate1);r.id=o;r.request()};OTS.FB.loadFavsUpdate1=function(s,id){if(!id){return}id.innerHTML=s};OTS.FB.loadFavs2=function(){if(typeof OTS.HP.favs!="undefined"){OTS.HP.favs.load()}};OTS.imgURL="http://www.onthesnow.com";OTS.zipperOptions={enter:"Enter A Zip Code:",save:"Save",notfound:"No results found."};OTS.zipperReqURL=OTS.baseURL+"/ajax/ajax_zipper.html";OTS.zipper={active:false,w:150,v:0,change:function(id,target,e){OTS.zipper.n=(id)?id:"rnav_nearby_zip";OTS.zipper.obj=OTS.$(OTS.zipper.n+"_value");if(!OTS.zipper.obj){return}if(OTS.zipper.obj.innerHTML.indexOf("<")==0){OTS.zipper.obj.innerHTML=""}OTS.zipper.v=OTS.zipper.obj.innerHTML;OTS.zipper.target=target;OTS.zipper.showMenu(id)},showMenu:function(){var s='<div class="ttip2" style="width:'+(OTS.zipper.w+10)+'px;">';s+='<form id="zip_form" name="zip_form" action="" method="post" onsubmit="OTS.zipper.doChange(this); return false;" style="width:'+OTS.zipper.w+'px; padding:5px 10px 5px 5px; position:relative;">';s+='<div class="close" style="position:absolute; top:0; right:0;"><a href="#" onclick="OTS.zipper.hideMenu(); return false;"><img src="'+OTS.imgURL+'/ots/images/icon_close2.gif" alt="X" border="0" align="absmiddle" /></a></div>';s+="<strong>"+OTS.zipperOptions.enter+"</strong><br />";s+='<input type="text" name="zipper" value="'+OTS.zipper.v+'" size="10" onfocus="this.select();" />';s+='<input type="submit" value="'+OTS.zipperOptions.save+'" /><br />';s+='</form></div><b class="marker_tm"></b>';var o=OTS.$("zipper_menu");if(!o){o=document.createElement("div");o.id="zipper_menu";o.className="ttip";var t=OTS.$("empty");if(!t){return}t.appendChild(o)}o.innerHTML=s;var p=OTS.getPos(OTS.zipper.target);$(o).css("position","absolute");$(o).css("left",(p.left-(OTS.zipper.w-40))+"px");$(o).css("top",(p.top+20)+"px");$(o).css("z-index",9999);if(document.zip_form.zipper.value==""){document.zip_form.zipper.focus()}else{document.zip_form.zipper.select()}OTS.zipper.active=true;OTS.gaTrkEvt("ZipCoder","open",location.href)},hideMenu:function(){var o=OTS.$("zipper_menu");if(!o){return}$(o).html("");$(o).css("left","-2000px");OTS.zipper.active=false},doChange:function(o,w){if(w=="f"){OTS.zipper.n="rmap_nearby_zip";OTS.zipper.obj=OTS.$(OTS.zipper.n+"_value");if(!OTS.zipper.obj){return}OTS.zipper.v=OTS.zipper.obj.innerHTML}var v=(o.zipper.value);if(v==""){return}OTS.zipper.doReq(v)},doReq:function(v,id){var n=(id)?"&id="+id:"";var u=OTS.zipperReqURL+"?z="+v+n+"&c=8&t=1";var r=new OTS.ajax(u,OTS.zipper.doUpdate);r.id=v;r.html=OTS.zipper.obj.innerHTML;r.request();var ico=(OTS.zipper.n=="rnav_nearby_zip")?"_blue":"";$(OTS.zipper.n+"_results").html('<br /><img src="http://images.onthesnow.com/ots/images/icon_loading'+ico+'.gif" alt="" border="0" />');OTS.zipper.hideMenu();OTS.gaTrkEvt("ZipCoder","submit",v+" + "+location.href)},doUpdate:function(s,id,html){$(OTS.zipper.n+"_value").html(id);$(OTS.zipper.n+"_results").html(s);var o=OTS.$("rmap_nearby_zip_lnkc");if(o){o.style.display="inline"}},closeMenu:function(e){var o=e.target||e.srcElement;if(!OTS.hasParent(o,"zipper_menu")&&o.className.indexOf(OTS.zipper.n+"_lnk")==-1){if(OTS.zipper.active==true){OTS.zipper.hideMenu()}}},doLogin:function(){OTS.doLogin("abuse")}};OTS.ratingsReqURL=OTS.baseURL+"/community/ajax/ajax_rating.html";OTS.ratings={t1:null,active:false,showMore:function(id,target){OTS.ratings.clearHide();OTS.ratings.target=target;OTS.ratings.t1=setTimeout("OTS.ratings.doShow("+id+")",500)},hideMore:function(){OTS.ratings.clearHide();if(OTS.ratings.active==true){OTS.ratings.t1=setTimeout("OTS.ratings.doHide()",200)}else{}},doHide:function(){OTS.ratings.clearHide();var o=OTS.$("ratings_menu");if(!o){return}$(o).html("");$(o).css("left","-2000px");OTS.ratings.active=false},doShow:function(id){var o=OTS.$("rev_rating"+id);if(!o){return}var html=o.innerHTML;html='<ul class="rater_min rater_min_sm">'+html+"</ul>";OTS.ratings.doUpdate(html,id);OTS.ratings.active=true},doUpdate:function(s,id){var html='<div class="ttip2">';html+=s;html+='</div><b class="marker"></b>';var o=OTS.$("ratings_menu");if(!o){o=document.createElement("div");o.id="ratings_menu";o.className="ttip";document.body.appendChild(o)}o.innerHTML=html;var p=OTS.getPos(OTS.ratings.target);$(o).css("position","absolute");$(o).css("left",p.left+"px");$(o).css("top",(p.top+25)+"px")},clearHide:function(){clearTimeout(OTS.ratings.t1)}};OTS.rating={showMore:function(target,size){OTS.rating.target=target;var html="<span>";html+=OTS.rating.target.innerHTML;html+='</span><b class="marker"></b>';var o=OTS.$("rating_menu");if(!o){o=document.createElement("div");o.id="rating_menu";o.className="ttip_sm";document.body.appendChild(o)}o.innerHTML=html;var w=80;var h=1;if(size=="sm"){w=52;h=4}var p=OTS.getPos(OTS.rating.target);$(o).css("position","absolute");$(o).css("left",(p.left+w)+"px");$(o).css("top",(p.top-h)+"px")},hideMore:function(){var o=OTS.$("rating_menu");if(!o){return}$(o).html("");$(o).css("left","-2000px")}};OTS.ChartPie=function(elements,options){this.elements=elements;this.opts=$.extend({},this.defaults,options);this.attach()};OTS.ChartPie.prototype={defaults:{size:40,color1:"0079c2",color2:"f4f4f4",colors:[],gcolor1:"017cc2",gcolor2:"19b7e7",google:0,google_size:60},init:function(){this.elm=$(this.elm);this.opts.data=this.elm.attr("data-pie");this.opts.data2=Math.floor(100-this.opts.data);this.opts.dataArr=[this.opts.data,this.opts.data2];this.opts.colors=[this.opts.color1,this.opts.color2];this.canvas=$("<canvas/>");if(!!(this.canvas[0].getContext&&this.canvas[0].getContext("2d"))&&this.opts.google!=1){this.drawCanvas()}else{if($.browser.msie&&this.opts.google!=1){this.drawVML()}else{this.drawGoogle()}}},drawCanvas:function(){var data=this.opts.dataArr;var w=h=this.opts.size;var canvas=this.canvas||$("<canvas/>");var ctx=canvas[0].getContext("2d");ctx.rotate(-90*Math.PI/180);ctx.translate(-40,0);ctx.clearRect(0,0,w,h);var g=ctx.createLinearGradient(0,0,w,h);g.addColorStop(0,"#"+this.opts.gcolor1);g.addColorStop(1,"#"+this.opts.gcolor2);var colors=[g,"#"+this.opts.color2];var s=Math.floor(w*0.5);var r=0;for(var i=0,l=data.length;i<l;i++){var pi=(data[i]/100)*(Math.PI*2);ctx.fillStyle=colors[i];ctx.beginPath();ctx.moveTo(s,s);ctx.arc(s,s,s,r,r+pi,false);ctx.lineTo(s,s);ctx.fill();r+=pi}canvas.width=canvas.height=w;canvas.appendTo(this.elm)},drawVML:function(){var data=this.opts.dataArr;var size=this.opts.size-1;var w=h=size;if(!document.namespaces.v){document.namespaces.add("v","urn:schemas-microsoft-com:vml");document.createStyleSheet().cssText="v\\:*{behavior:url(#default#VML);}"}var canvas=$('<v:group coordsize="'+w+","+h+'" style="width:'+w+"px; height:"+h+'px;" />');var s=Math.floor(size*0.5);var r=90;for(var i=0,l=data.length;i<l;i++){var pi=(data[i]/100*360);var sa=Math.round(r*65535);var ea=-Math.round(pi*65536);var path="M "+s+" "+s+" AE "+s+" "+s+" "+s+" "+s+" "+sa+" "+ea+" X E";var vml=$('<v:shape path="'+path+'" fillcolor="#'+this.opts.colors[i]+'" strokecolor="#ffffff" style="width:'+w+"px; height:"+h+'px; position:absolute;" />');if(i==0){var f=$('<v:fill type="gradient" color="#'+this.opts.gcolor1+'" color2="#'+this.opts.gcolor2+'" />');vml.append(f)}vml.appendTo(canvas);r-=pi}canvas.appendTo(this.elm)},drawGoogle:function(){var w=this.opts.google_size;var h=this.opts.google_size;var url="http://chart.apis.google.com/chart?";var q="&cht=p";q+="&chd=t:"+this.opts.data+","+this.opts.data2;q+="&chp=-1.57";q+="&chco="+this.opts.color1+"|"+this.opts.color2;q+="&chs="+w+"x"+h;var html='<img src="'+url+q+'" width="'+w+'" height="'+h+'" alt="" />';this.elm.html(html)},attach:function(){var self=this;this.elements.each(function(index,element){self.elm=element;self.init()})}};$.fn.ChartPie=function(options){new OTS.ChartPie(this,options);return this};if(!window.console){window.console={};var f=function(){};var methods=["log","debug","info","warn","error","time","timeEnd","group","groupEnd"];$.each(methods,function(i,item){window.console[item]=f})}})(jQuery);if(!Array.prototype.indexOf){Array.prototype.indexOf=function(c,d){for(var b=(d||0),a=this.length;b<a;b++){if(this[b]===c){return b}}return -1}}$(document).ready(function(){OTS.Search.init();OTS.OverlayMap.init();if(OTS.favorites.setup){OTS.favorites.setup()}});$(window).load(function(){$(".scrollable").each(function(){var a=$(this).data("scrollable");if(a==null){return}a.firstScroll=true;a.onSeek(function(){if(!this.firstScroll){OTS.oas.reload()}this.firstScroll=false})})});if(typeof OTS=="undefined"){var OTS={}}(function(a){OTS.resortFinder={_metaRegionName:null,_selectedTab:"ratings",init:function(){OTS.map.init();OTS.resortFinder._initTabs();OTS.resortFinder._showList();OTS.resortFinder._initCategorySelectors();OTS.resortFinder._selectFinderTab("ratings");OTS.resortFinder._initColumnSelectors();a("#region_filters input:checkbox").each(function(){a(this).bind("click",function(){OTS.resortFinder._filterResortResults();OTS.oas.reload()})});var d=document.URL;var b=d.split("/");var c=b[b.length-1];if(c==="map.html"){a("#map_tab").click()}},setMetaRegionNames:function(b){OTS.resortFinder._metaRegionNames=b},resortFinderRedirect:function(e){var b=[];for(var d=0;d<e.length;d++){var g=e[d];if(g==="CA"){e.push("CN");e.push("CS");continue}var c=stateInformationTable[g];if(c!==null){b.push("metaRegionName="+c.title)}}var f=b.join("&");location.href="/resort_finder.html?"+f},regionProfileRedirect:function(c){if(c==="CA"){OTS.resortFinder.resortFinderRedirect(["CN","CS"])}else{var b=stateInformationTable[c];if(b!==null){location.href=b.profile_link}}},linkToMap:function(b){OTS.resortFinder._showMap();var c=OTS.map.findMarker(b);GEvent.trigger(c,"click");return false},_showMap:function(){a("#list_sub_tabs").hide();a("#resort_list_wrap #resort_finder_list_ratings").hide();a("#resort_finder_map").show();a("#map_tab").attr("class","selected");a("#list_tab").attr("class","");a("#tabs_footer").css("bottom","-30px");OTS.map.checkResize()},_showList:function(){a("#list_sub_tabs").show();a("#resort_finder_map").hide();a("#map_tab").attr("class","");a("#list_tab").attr("class","selected");a("#tabs_footer").css("bottom","-382px")},_initTabs:function(){a("#map_tab").bind("click",function(){OTS.resortFinder._showMap()});a("#list_tab").bind("click",function(){OTS.resortFinder._showList()})},_initColumnSelectors:function(){a("#resort_finder_list_terrain th").each(function(){a(this).bind("click",function(){OTS.resortFinder._sortFinderTable("resort_finder_list_terrain","terrain",a(this).attr("id"));OTS.oas.reload()})});a("#resort_finder_list_ratings th").each(function(){a(this).bind("click",function(){OTS.resortFinder._sortFinderTable("resort_finder_list_ratings","reviews",a(this).attr("id"));OTS.oas.reload()})});a("#resort_finder_list_snow_report th").each(function(){a(this).bind("click",function(){OTS.resortFinder._sortFinderTable("resort_finder_list_snow_report","snow",a(this).attr("id"));OTS.oas.reload()})});a("#resort_finder_list_lift th").each(function(){a(this).bind("click",function(){OTS.resortFinder._sortFinderTable("resort_finder_list_lift","lift",a(this).attr("id"));OTS.oas.reload()})})},_initCategorySelectors:function(){a("#compare-metrics li").bind("click",function(){OTS.resortFinder._selectFinderTab(a(this).attr("id"));OTS.oas.reload()});a("div [id^=resort_finder_list_]").each(function(){a(this).hide()})},_buildFilterData:function(){var b="";a("#region_filters input:checkbox:checked").each(function(){var c=a(this).attr("name");var d=a(this).val();b+="&"+c+"="+d});return b},_createMetaRegionNameRequestParam:function(){var d=OTS.resortFinder._metaRegionNames;var b=[];for(var c=0;c<d.length;c++){metaRegionName=d[c];b.push("metaRegionName="+metaRegionName)}var e=b.join("&");return e},loadterrainTable:function(){OTS.resortFinder._sortFinderTable("resort_finder_list_terrain","terrain","elevation_base")},loadsnow_reportTable:function(){OTS.resortFinder._sortFinderTable("resort_finder_list_snow_report","snow","reported_snow_fall")},loadliftTable:function(){OTS.resortFinder._sortFinderTable("resort_finder_list_lift","lift","num_lifts")},loadratingsTable:function(){OTS.resortFinder._sortFinderTable("resort_finder_list_ratings","reviews","review_overall")},_sortFinderTable:function(e,b,c){var d=OTS.resortFinder._createMetaRegionNameRequestParam()+"&tab="+b+"&category="+c;d+=OTS.resortFinder._buildFilterData();a.ajax({url:"/ajax/sort_"+b+"_resort_finder_table.html",context:a("#"+e),data:d,success:function(f){a(this).html(f);OTS.resortFinder._showMap();OTS.map.refreashMapData();OTS.resortFinder._showList();OTS.resortFinder._initColumnSelectors();OTS.favorites.setup()}})},_selectFinderTab:function(b){a("div [id^=resort_finder_list_]").each(function(){a(this).hide()});if(a("#resort_finder_list_"+b).html().length<=1){OTS.resortFinder["load"+b+"Table"]()}a("#resort_finder_list_"+b).show();a("#compare-metrics li").each(function(){a(this).attr("class","")});a("#"+b).attr("class","selected");OTS.resortFinder._selectedTab=b},_filterResortResults:function(){var d="list";if(a("#map_tab").attr("class")=="selected"){d="map"}var b="terrain";a("#compare-metrics li").each(function(){if(a(this).attr("class")=="selected"){b=a(this).attr("id");return false}});var c="elevation_base";a("#resort_finder_list_"+b+" th").each(function(){if(a(this).attr("class")=="selected"||a(this).attr("class")=="alt selected"){c=a(this).attr("id");return false}});var e=OTS.resortFinder._createMetaRegionNameRequestParam();e+=OTS.resortFinder._buildFilterData();a.ajax({url:"/ajax/filter_resort_finder_table.html",context:a("#resort_finder_data_block"),data:e,success:function(f){a(this).html(f);OTS.resortFinder._showMap();OTS.map.refreashMapData();OTS.resortFinder._initTabs();if(d=="list"){OTS.resortFinder._showList()}OTS.resortFinder._initCategorySelectors();OTS.resortFinder._selectFinderTab(b);OTS.resortFinder._initColumnSelectors()}})}}})(jQuery);
/*!
 * jQuery Tools v1.2.6 - The missing UI library for the Web
 *
 * scrollable/scrollable.js
 * scrollable/scrollable.autoscroll.js
 *
 * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
 *
 * http://flowplayer.org/tools/
 *
 */
(function(g){g.tools=g.tools||{version:"v1.2.6"},g.tools.scrollable={conf:{activeClass:"active",circular:!1,clonedClass:"cloned",disabledClass:"disabled",easing:"swing",initialIndex:0,item:"> *",items:".items",keyboard:!0,mousewheel:!1,next:".next",prev:".prev",size:1,speed:400,vertical:!1,touch:!0,wheelSpeed:0}};function f(m,e){var o=parseInt(m.css(e),10);if(o){return o}var n=m[0].currentStyle;return n&&n.width&&parseInt(n.width,10)}function l(a,m){var e=g(m);return e.length<2?e:a.parent().find(m)}var k;function j(z,y){var x=this,w=z.add(x),v=z.children(),u=0,t=y.vertical;k||(k=x),v.length>1&&(v=g(y.items,z)),y.size>1&&(y.circular=!1),g.extend(x,{getConf:function(){return y},getIndex:function(){return u},getSize:function(){return x.getItems().size()},getNaviButtons:function(){return d.add(c)},getRoot:function(){return z},getItemWrap:function(){return v},getItems:function(){return v.find(y.item).not("."+y.clonedClass)},move:function(m,e){return x.seekTo(u+m,e)},next:function(b){return x.move(y.size,b)},prev:function(b){return x.move(-y.size,b)},begin:function(b){return x.seekTo(0,b)},end:function(b){return x.seekTo(x.getSize()-1,b)},focus:function(){k=x;return x},addItem:function(e){e=g(e),y.circular?(v.children().last().before(e),v.children().first().replaceWith(e.clone().addClass(y.clonedClass))):(v.append(e),c.removeClass("disabled")),w.trigger("onAddItem",[e]);return x},seekTo:function(o,C,A){o.jquery||(o*=1);if(y.circular&&o===0&&u==-1&&C!==0){return x}if(!y.circular&&o<0||o>x.getSize()||o<-1){return x}var p=o;o.jquery?o=x.getItems().index(o):p=x.getItems().eq(o);var e=g.Event("onBeforeSeek");if(!A){w.trigger(e,[o,C]);if(e.isDefaultPrevented()||!p.length){return x}}var B=t?{top:-p.position().top}:{left:-p.position().left};u=o,k=x,C===undefined&&(C=y.speed),v.animate(B,C,y.easing,A||function(){w.trigger("onSeek",[o])});return x}}),g.each(["onBeforeSeek","onSeek","onAddItem"],function(e,m){g.isFunction(y[m])&&g(x).bind(m,y[m]),x[m]=function(n){n&&g(x).bind(m,n);return x}});if(y.circular){var s=x.getItems().slice(-1).clone().prependTo(v),r=x.getItems().eq(1).clone().appendTo(v);s.add(r).addClass(y.clonedClass),x.onBeforeSeek(function(m,e,n){if(!m.isDefaultPrevented()){if(e==-1){x.seekTo(s,n,function(){x.end(0)});return m.preventDefault()}e==x.getSize()&&x.seekTo(r,n,function(){x.begin(0)})}});var q=z.parents().add(z).filter(function(){if(g(this).css("display")==="none"){return !0}});q.length?(q.show(),x.seekTo(0,0,function(){}),q.hide()):x.seekTo(0,0,function(){})}var d=l(z,y.prev).click(function(b){b.stopPropagation(),x.prev()}),c=l(z,y.next).click(function(b){b.stopPropagation(),x.next()});y.circular||(x.onBeforeSeek(function(m,e){setTimeout(function(){m.isDefaultPrevented()||(d.toggleClass(y.disabledClass,e<=0),c.toggleClass(y.disabledClass,e>=x.getSize()-1))},1)}),y.initialIndex||d.addClass(y.disabledClass)),x.getSize()<2&&d.add(c).addClass(y.disabledClass),y.mousewheel&&g.fn.mousewheel&&z.mousewheel(function(m,e){if(y.mousewheel){x.move(e<0?1:-1,y.wheelSpeed||50);return !1}});if(y.touch){var a={};v[0].ontouchstart=function(m){var e=m.touches[0];a.x=e.clientX,a.y=e.clientY},v[0].ontouchmove=function(m){if(m.touches.length==1&&!v.is(":animated")){var e=m.touches[0],o=a.x-e.clientX,n=a.y-e.clientY;x[t&&n>0||!t&&o>0?"next":"prev"](),m.preventDefault()}}}y.keyboard&&g(document).bind("keydown.scrollable",function(e){if(!(!y.keyboard||e.altKey||e.ctrlKey||e.metaKey||g(e.target).is(":input"))){if(y.keyboard!="static"&&k!=x){return}var m=e.keyCode;if(t&&(m==38||m==40)){x.move(m==38?-1:1);return e.preventDefault()}if(!t&&(m==37||m==39)){x.move(m==37?-1:1);return e.preventDefault()}}}),y.initialIndex&&x.seekTo(y.initialIndex,0,function(){})}g.fn.scrollable=function(a){var d=this.data("scrollable");if(d){return d}a=g.extend({},g.tools.scrollable.conf,a),this.each(function(){d=new j(g(this),a),g(this).data("scrollable",d)});return a.api?d:this}})(jQuery);(function(d){var c=d.tools.scrollable;c.autoscroll={conf:{autoplay:!0,interval:3000,autopause:!0}},d.fn.autoscroll=function(f){typeof f=="number"&&(f={interval:f});var b=d.extend({},c.autoscroll.conf,f),a;this.each(function(){var e=d(this).data("scrollable"),m=e.getRoot(),l,k=!1;function j(){l=setTimeout(function(){e.next()},b.interval)}e&&(a=e),e.play=function(){l||(k=!1,m.bind("onSeek",j),j())},e.pause=function(){l=clearTimeout(l),m.unbind("onSeek",j)},e.resume=function(){k||e.play()},e.stop=function(){k=!0,e.pause()},b.autopause&&m.add(e.getNaviButtons()).hover(e.pause,e.resume),b.autoplay&&e.play()});return b.api?a:this}})(jQuery);(function(a){a.fn.hoverIntent=function(m,l){var n={sensitivity:7,interval:100,timeout:0};n=a.extend(n,l?{over:m,out:l}:m);var p,o,j,d;var e=function(f){p=f.pageX;o=f.pageY};var c=function(g,f){f.hoverIntent_t=clearTimeout(f.hoverIntent_t);if((Math.abs(j-p)+Math.abs(d-o))<n.sensitivity){a(f).unbind("mousemove",e);f.hoverIntent_s=1;return n.over.apply(f,[g])}else{j=p;d=o;f.hoverIntent_t=setTimeout(function(){c(g,f)},n.interval)}};var k=function(g,f){f.hoverIntent_t=clearTimeout(f.hoverIntent_t);f.hoverIntent_s=0;return n.out.apply(f,[g])};var b=function(q){var g=jQuery.extend({},q);var f=this;if(f.hoverIntent_t){f.hoverIntent_t=clearTimeout(f.hoverIntent_t)}if(q.type=="mouseenter"){j=g.pageX;d=g.pageY;a(f).bind("mousemove",e);if(f.hoverIntent_s!=1){f.hoverIntent_t=setTimeout(function(){c(g,f)},n.interval)}}else{a(f).unbind("mousemove",e);if(f.hoverIntent_s==1){f.hoverIntent_t=setTimeout(function(){k(g,f)},n.timeout)}}};return this.bind("mouseenter",b).bind("mouseleave",b)}})(jQuery);(function(m){var c,b,j,e,f,k,n,l,d,g;c=document.namespaces;has_canvas=!!document.createElement("canvas").getContext;if(!(has_canvas||c)){m.fn.maphilight=function(){return this};return}if(has_canvas){n=function(o){return Math.max(0,Math.min(parseInt(o,16),255))};l=function(p,o){return"rgba("+n(p.substr(0,2))+","+n(p.substr(2,2))+","+n(p.substr(4,2))+","+o+")"};b=function(p){var o=m('<canvas style="width:'+p.width+"px;height:"+p.height+'px;"></canvas>').get(0);o.getContext("2d").clearRect(0,0,o.width,o.height);return o};j=function(r,u,o,s,t){var p,q=r.getContext("2d");q.beginPath();if(u=="rect"){q.rect(o[0],o[1],o[2]-o[0],o[3]-o[1])}else{if(u=="poly"){q.moveTo(o[0],o[1]);for(p=2;p<o.length;p+=2){q.lineTo(o[p],o[p+1])}}else{if(u=="circ"){q.arc(o[0],o[1],o[2],0,Math.PI*2,false)}}}q.closePath();if(s.fill){q.fillStyle=l(s.fillColor,s.fillOpacity);q.fill()}if(s.stroke){q.strokeStyle=l(s.strokeColor,s.strokeOpacity);q.lineWidth=s.strokeWidth;q.stroke()}if(s.fade){m(r).css("opacity",0).animate({opacity:1},100)}};e=function(o){o.getContext("2d").clearRect(0,0,o.width,o.height)}}else{b=function(o){return m('<var style="zoom:1;overflow:hidden;display:block;width:'+o.width+"px;height:"+o.height+'px;"></var>').get(0)};j=function(v,s,r,o,w){var q,p,u,t;q='<v:fill color="#'+o.fillColor+'" opacity="'+(o.fill?o.fillOpacity:0)+'" />';p=(o.stroke?'strokeweight="'+o.strokeWidth+'" stroked="t" strokecolor="#'+o.strokeColor+'"':'stroked="f"');u='<v:stroke opacity="'+o.strokeOpacity+'"/>';if(s=="rect"){t=m('<v:rect name="'+w+'" filled="t" '+p+' style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:'+r[0]+"px;top:"+r[1]+"px;width:"+(r[2]-r[0])+"px;height:"+(r[3]-r[1])+'px;"></v:rect>')}else{if(s=="poly"){t=m('<v:shape name="'+w+'" filled="t" '+p+' coordorigin="0,0" coordsize="'+v.width+","+v.height+'" path="m '+r[0]+","+r[1]+" l "+r.join(",")+' x e" style="zoom:1;margin:0;padding:0;display:block;position:absolute;top:0px;left:0px;width:'+v.width+"px;height:"+v.height+'px;"></v:shape>')}else{if(s=="circ"){t=m('<v:oval name="'+w+'" filled="t" '+p+' style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:'+(r[0]-r[2])+"px;top:"+(r[1]-r[2])+"px;width:"+(r[2]*2)+"px;height:"+(r[2]*2)+'px;"></v:oval>')}}}t.get(0).innerHTML=q+u;m(v).append(t)};e=function(o){m(o).find("[name=highlighted]").remove()}}f=function(p){var q,o=p.getAttribute("coords").split(",");for(q=0;q<o.length;q++){o[q]=parseFloat(o[q])}return[p.getAttribute("shape").toLowerCase().substr(0,4),o]};g=function(o,p){var q=m(o);return m.extend({},p,m.metadata?q.metadata():false,q.data("maphilight"))};d=function(o){if(!o.complete){return false}if(typeof o.naturalWidth!="undefined"&&o.naturalWidth==0){return false}return true};k={position:"absolute",left:0,top:0,padding:0,border:0};var a=false;m.fn.maphilight=function(o){o=m.extend({},m.fn.maphilight.defaults,o);if(!has_canvas&&m.browser.msie&&!a){document.namespaces.add("v","urn:schemas-microsoft-com:vml");var p=document.createStyleSheet();var q=["shape","rect","oval","circ","fill","stroke","imagedata","group","textbox"];m.each(q,function(){p.addRule("v\\:"+this,"behavior: url(#default#VML); antialias:true")});a=true}return this.each(function(){var v,y,r,z,w,u,s,x,t;v=m(this);if(!d(this)){return window.setTimeout(function(){v.maphilight(o)},200)}r=m.extend({},o,m.metadata?v.metadata():false,v.data("maphilight"));t=v.get(0).getAttribute("usemap");z=m('map[name="'+t.substr(1)+'"]');if(!(v.is("img")&&t&&z.size()>0)){return}if(v.hasClass("maphilighted")){var A=v.parent();v.insertBefore(A);A.remove();m(z).unbind(".maphilight").find("area[coords]").unbind(".maphilight")}y=m("<div></div>").css({display:"block",background:'url("'+this.src+'")',position:"relative",padding:0,width:this.width,height:this.height});if(r.wrapClass){if(r.wrapClass===true){y.addClass(m(this).attr("class"))}else{y.addClass(r.wrapClass)}}v.before(y).css("opacity",0).css(k).remove();if(m.browser.msie){v.css("filter","Alpha(opacity=0)")}y.append(v);w=b(this);m(w).css(k);w.height=this.height;w.width=this.width;s=function(F){var C,B;B=g(this,r);if(!B.neverOn&&!B.alwaysOn){C=f(this);j(w,C[0],C[1],B,"highlighted");if(B.groupBy){var D;if(/^[a-zA-Z][-a-zA-Z]+$/.test(B.groupBy)){D=z.find("area["+B.groupBy+'="'+m(this).attr(B.groupBy)+'"]')}else{D=z.find(B.groupBy)}var E=this;D.each(function(){if(this!=E){var G=g(this,r);if(!G.neverOn&&!G.alwaysOn){var H=f(this);j(w,H[0],H[1],G,"highlighted")}}})}if(!has_canvas){m(w).append("<v:rect></v:rect>")}}};m(z).bind("alwaysOn.maphilight",function(){if(u){e(u)}if(!has_canvas){m(w).empty()}m(z).find("area[coords]").each(function(){var C,B;B=g(this,r);if(B.alwaysOn){if(!u&&has_canvas){u=b(v.get());m(u).css(k);u.width=v.width();u.height=v.height();v.before(u)}B.fade=B.alwaysOnFade;C=f(this);if(has_canvas){j(u,C[0],C[1],B,"")}else{j(w,C[0],C[1],B,"")}}})});m(z).trigger("alwaysOn.maphilight").find("area[coords]").bind("mouseover.maphilight",s).bind("mouseout.maphilight",function(B){e(w)});v.before(w);v.addClass("maphilighted")})};m.fn.maphilight.defaults={fill:true,fillColor:"000000",fillOpacity:0.2,stroke:true,strokeColor:"ff0000",strokeOpacity:1,strokeWidth:1,fade:true,alwaysOn:false,neverOn:false,groupBy:false,wrapClass:true}})(jQuery);(function(g){var c=g.browser.msie&&parseInt(g.browser.version)===6&&typeof window.XMLHttpRequest!=="object",a=g.browser.msie&&parseInt(g.browser.version)===7,b=null,e=[];g.modal=function(f,d){return g.modal.impl.init(f,d)};g.modal.close=function(){g.modal.impl.close()};g.modal.focus=function(d){g.modal.impl.focus(d)};g.modal.setContainerDimensions=function(){g.modal.impl.setContainerDimensions()};g.modal.setPosition=function(){g.modal.impl.setPosition()};g.modal.update=function(f,d){g.modal.impl.update(f,d)};g.fn.modal=function(d){return g.modal.impl.init(this,d)};g.modal.defaults={appendTo:"body",focus:true,opacity:50,overlayId:"simplemodal-overlay",overlayCss:{},containerId:"simplemodal-container",containerCss:{},dataId:"simplemodal-data",dataCss:{},minHeight:null,minWidth:null,maxHeight:null,maxWidth:null,autoResize:false,autoPosition:true,zIndex:1000,close:true,closeHTML:'<a class="modalCloseImg" title="Close"></a>',closeClass:"simplemodal-close",escClose:true,overlayClose:false,position:null,persist:false,modal:true,onOpen:null,onShow:null,onClose:null};g.modal.impl={d:{},init:function(f,d){var j=this;if(j.d.data){return false}b=g.browser.msie&&!g.boxModel;j.o=g.extend({},g.modal.defaults,d);j.zIndex=j.o.zIndex;j.occb=false;if(typeof f==="object"){f=f instanceof jQuery?f:g(f);j.d.placeholder=false;if(f.parent().parent().size()>0){f.before(g("<span></span>").attr("id","simplemodal-placeholder").css({display:"none"}));j.d.placeholder=true;j.display=f.css("display");if(!j.o.persist){j.d.orig=f.clone(true)}}}else{if(typeof f==="string"||typeof f==="number"){f=g("<div></div>").html(f)}else{alert("SimpleModal Error: Unsupported data type: "+typeof f);return j}}j.create(f);j.open();g.isFunction(j.o.onShow)&&j.o.onShow.apply(j,[j.d]);return j},create:function(f){var d=this;e=d.getDimensions();if(d.o.modal&&c){d.d.iframe=g('<iframe src="javascript:false;"></iframe>').css(g.extend(d.o.iframeCss,{display:"none",opacity:0,position:"fixed",height:e[0],width:e[1],zIndex:d.o.zIndex,top:0,left:0})).appendTo(d.o.appendTo)}d.d.overlay=g("<div></div>").attr("id",d.o.overlayId).addClass("simplemodal-overlay").css(g.extend(d.o.overlayCss,{display:"none",opacity:d.o.opacity/100,height:d.o.modal?e[0]:0,width:d.o.modal?e[1]:0,position:"fixed",left:0,top:0,zIndex:d.o.zIndex+1})).appendTo(d.o.appendTo);d.d.container=g("<div></div>").attr("id",d.o.containerId).addClass("simplemodal-container").css(g.extend(d.o.containerCss,{display:"none",position:"fixed",zIndex:d.o.zIndex+2})).append(d.o.close&&d.o.closeHTML?g(d.o.closeHTML).addClass(d.o.closeClass):"").appendTo(d.o.appendTo);d.d.wrap=g("<div></div>").attr("tabIndex",-1).addClass("simplemodal-wrap").css({height:"100%",outline:0,width:"100%"}).appendTo(d.d.container);d.d.data=f.attr("id",f.attr("id")||d.o.dataId).addClass("simplemodal-data").css(g.extend(d.o.dataCss,{display:"none"})).appendTo("body");d.setContainerDimensions();d.d.data.appendTo(d.d.wrap);if(c||b){d.fixIE()}},bindEvents:function(){var d=this;g("."+d.o.closeClass).bind("click.simplemodal",function(f){f.preventDefault();d.close()});d.o.modal&&d.o.close&&d.o.overlayClose&&d.d.overlay.bind("click.simplemodal",function(f){f.preventDefault();d.close()});g(document).bind("keydown.simplemodal",function(f){if(d.o.modal&&f.keyCode===9){d.watchTab(f)}else{if(d.o.close&&d.o.escClose&&f.keyCode===27){f.preventDefault();d.close()}}});g(window).bind("resize.simplemodal",function(){e=d.getDimensions();d.o.autoResize?d.setContainerDimensions():d.o.autoPosition&&d.setPosition();if(c||b){d.fixIE()}else{if(d.o.modal){d.d.iframe&&d.d.iframe.css({height:e[0],width:e[1]});d.d.overlay.css({height:e[0],width:e[1]})}}})},unbindEvents:function(){g("."+this.o.closeClass).unbind("click.simplemodal");g(document).unbind("keydown.simplemodal");g(window).unbind("resize.simplemodal");this.d.overlay.unbind("click.simplemodal")},fixIE:function(){var f=this,d=f.o.position;g.each([f.d.iframe||null,!f.o.modal?null:f.d.overlay,f.d.container],function(m,j){if(j){var k=j[0].style;k.position="absolute";if(m<2){k.removeExpression("height");k.removeExpression("width");k.setExpression("height",'document.body.scrollHeight > document.body.clientHeight ? document.body.scrollHeight : document.body.clientHeight + "px"');k.setExpression("width",'document.body.scrollWidth > document.body.clientWidth ? document.body.scrollWidth : document.body.clientWidth + "px"')}else{var l;if(d&&d.constructor===Array){m=d[0]?typeof d[0]==="number"?d[0].toString():d[0].replace(/px/,""):j.css("top").replace(/px/,"");m=m.indexOf("%")===-1?m+' + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"':parseInt(m.replace(/%/,""))+' * ((document.documentElement.clientHeight || document.body.clientHeight) / 100) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"';if(d[1]){l=typeof d[1]==="number"?d[1].toString():d[1].replace(/px/,"");l=l.indexOf("%")===-1?l+' + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"':parseInt(l.replace(/%/,""))+' * ((document.documentElement.clientWidth || document.body.clientWidth) / 100) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"'}}else{m='(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"';l='(document.documentElement.clientWidth || document.body.clientWidth) / 2 - (this.offsetWidth / 2) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"'}k.removeExpression("top");k.removeExpression("left");k.setExpression("top",m);k.setExpression("left",l)}}})},focus:function(f){var d=this;f=f&&g.inArray(f,["first","last"])!==-1?f:"first";var j=g(":input:enabled:visible:"+f,d.d.wrap);setTimeout(function(){j.length>0?j.focus():d.d.wrap.focus()},10)},getDimensions:function(){var d=g(window);return[g.browser.opera&&g.browser.version>"9.5"&&g.fn.jquery<"1.3"||g.browser.opera&&g.browser.version<"9.5"&&g.fn.jquery>"1.2.6"?d[0].innerHeight:d.height(),d.width()]},getVal:function(f,d){return f?typeof f==="number"?f:f==="auto"?0:f.indexOf("%")>0?parseInt(f.replace(/%/,""))/100*(d==="h"?e[0]:e[1]):parseInt(f.replace(/px/,"")):null},update:function(f,d){var j=this;if(!j.d.data){return false}j.d.origHeight=j.getVal(f,"h");j.d.origWidth=j.getVal(d,"w");j.d.data.hide();f&&j.d.container.css("height",f);d&&j.d.container.css("width",d);j.setContainerDimensions();j.d.data.show();j.o.focus&&j.focus();j.unbindEvents();j.bindEvents()},setContainerDimensions:function(){var f=this,d=c||a,p=f.d.origHeight?f.d.origHeight:g.browser.opera?f.d.container.height():f.getVal(d?f.d.container[0].currentStyle.height:f.d.container.css("height"),"h");d=f.d.origWidth?f.d.origWidth:g.browser.opera?f.d.container.width():f.getVal(d?f.d.container[0].currentStyle.width:f.d.container.css("width"),"w");var m=f.d.data.outerHeight(true),n=f.d.data.outerWidth(true);f.d.origHeight=f.d.origHeight||p;f.d.origWidth=f.d.origWidth||d;var o=f.o.maxHeight?f.getVal(f.o.maxHeight,"h"):null,l=f.o.maxWidth?f.getVal(f.o.maxWidth,"w"):null;o=o&&o<e[0]?o:e[0];l=l&&l<e[1]?l:e[1];var k=f.o.minHeight?f.getVal(f.o.minHeight,"h"):"auto";p=p?f.o.autoResize&&p>o?o:p<k?k:p:m?m>o?o:f.o.minHeight&&k!=="auto"&&m<k?k:m:k;o=f.o.minWidth?f.getVal(f.o.minWidth,"w"):"auto";d=d?f.o.autoResize&&d>l?l:d<o?o:d:n?n>l?l:f.o.minWidth&&o!=="auto"&&n<o?o:n:o;f.d.container.css({height:p,width:d});f.d.wrap.css({overflow:m>p||n>d?"auto":"visible"});f.o.autoPosition&&f.setPosition()},setPosition:function(){var f=this,d,j;d=e[0]/2-f.d.container.outerHeight(true)/2;j=e[1]/2-f.d.container.outerWidth(true)/2;if(f.o.position&&Object.prototype.toString.call(f.o.position)==="[object Array]"){d=f.o.position[0]||d;j=f.o.position[1]||j}else{d=d;j=j}f.d.container.css({left:j,top:d})},watchTab:function(f){var d=this;if(g(f.target).parents(".simplemodal-container").length>0){d.inputs=g(":input:enabled:visible:first, :input:enabled:visible:last",d.d.data[0]);if(!f.shiftKey&&f.target===d.inputs[d.inputs.length-1]||f.shiftKey&&f.target===d.inputs[0]||d.inputs.length===0){f.preventDefault();d.focus(f.shiftKey?"last":"first")}}else{f.preventDefault();d.focus()}},open:function(){var d=this;d.d.iframe&&d.d.iframe.show();if(g.isFunction(d.o.onOpen)){d.o.onOpen.apply(d,[d.d])}else{d.d.overlay.show();d.d.container.show();d.d.data.show()}d.o.focus&&d.focus();d.bindEvents()},close:function(){var f=this;if(!f.d.data){return false}f.unbindEvents();if(g.isFunction(f.o.onClose)&&!f.occb){f.occb=true;f.o.onClose.apply(f,[f.d])}else{if(f.d.placeholder){var d=g("#simplemodal-placeholder");if(f.o.persist){d.replaceWith(f.d.data.removeClass("simplemodal-data").css("display",f.display))}else{f.d.data.hide().remove();d.replaceWith(f.d.orig)}}else{f.d.data.hide().remove()}f.d.container.hide().remove();f.d.overlay.hide();f.d.iframe&&f.d.iframe.hide().remove();setTimeout(function(){f.d.overlay.remove();f.d={}},10)}}}})(jQuery);(function(a){var b=0;a.fn.divgrow=function(c){var c=a.extend({},{initialHeight:100,moreText:"+ Show More",lessText:"- Show Less",speed:1000,showBrackets:true},c);return this.each(function(){b++;obj=a(this);var d=obj.height()+10;obj.css("height",c.initialHeight).css("overflow","hidden");obj.addClass("divgrow-wrapper");if(c.showBrackets){obj.after('<p class="divgrow-brackets">[…]</p><a href="#" class="divgrow-showmore divgrow-obj-'+b+'"></a>')}else{obj.after('<a href="#" class="divgrow-showmore divgrow-obj-'+b+'"></a>')}a("a.divgrow-showmore").html(c.moreText);a(".divgrow-obj-"+b).toggle(function(){a(this).prevAll(".divgrow-wrapper:first").animate({height:d+"px"},c.speed,function(){if(c.showBrackets){a(this).nextAll("p.divgrow-brackets:first").fadeOut()}a(this).nextAll("a.divgrow-showmore:first").html(c.lessText)})},function(){a(this).prevAll(".divgrow-wrapper:first").stop(true,false).animate({height:c.initialHeight},c.speed,function(){if(c.showBrackets){a(this).nextAll("p.divgrow-brackets:first").stop(true,false).fadeIn()}a(this).nextAll("a.divgrow-showmore:first").stop(true,false).html(c.moreText)})})})}})(jQuery);(function(c,b){function a(g,j){var e=b.createElement("canvas");e.setAttribute("width",g);e.setAttribute("height",j);return e}var d=c.fn.peity=function(e,f){b.createElement("canvas").getContext&&this.each(function(){c(this).change(function(){var j=c.extend({},f),l=this;c.each(j||{},function(g,m){c.isFunction(m)&&(j[g]=m.call(l))});var k=c(this).html();d.graphers[e].call(this,c.extend({},d.defaults[e],j));c(this).trigger("chart:changed",k)}).trigger("change")});return this};d.graphers={};d.defaults={};d.add=function(g,j,e){d.graphers[g]=e;d.defaults[g]=j};d.add("pie",{colours:["#FFF4DD","#FF9900"],delimeter:"/",radius:16},function(k){var n=c(this),f=k.radius/2,o=n.text().split(k.delimeter),m=parseFloat(o[0]),l=parseFloat(o[1]);o=-Math.PI/2;m=m/l*Math.PI*2;l=a(k.radius,k.radius);var p=l.getContext("2d");p.beginPath();p.moveTo(f,f);p.arc(f,f,f,m+o,m==0?Math.PI*2:o,!1);p.fillStyle=k.colours[0];p.fill();p.beginPath();p.moveTo(f,f);p.arc(f,f,f,o,m+o,!1);p.fillStyle=k.colours[1];p.fill();n.wrapInner(c("<span>").hide()).append(l)});d.add("line",{colour:"#c6d9fd",strokeColour:"#4d89f9",strokeWidth:1,delimeter:",",height:16,max:null,width:32},function(v){var r=c(this),u=a(v.width,v.height),s=r.text().split(v.delimeter),q=Math.max.apply(Math,s.concat([v.max]));q=v.height/q;var n=v.width/(s.length-1),t=[],p,o=u.getContext("2d");o.beginPath();o.moveTo(0,v.height);for(p=0;p<s.length;p++){var l=p*n,f=v.height-q*s[p];t.push({x:l,y:f});o.lineTo(l,f)}o.lineTo(v.width,v.height);o.fillStyle=v.colour;o.fill();o.beginPath();o.moveTo(0,t[0].y);for(p=0;p<t.length;p++){o.lineTo(t[p].x,t[p].y)}o.lineWidth=v.strokeWidth;o.strokeStyle=v.strokeColour;o.stroke();r.wrapInner(c("<span>").hide()).append(u)});d.add("bar",{colour:"#4D89F9",delimeter:",",height:16,max:null,width:32},function(r){var n=c(this),q=a(r.width,r.height),o=n.text().split(r.delimeter),m=Math.max.apply(Math,o.concat([r.max]));m=r.height/m;var f=r.width/o.length,p=q.getContext("2d");p.fillStyle=r.colour;for(var l=0;l<o.length;l++){var k=m*o[l];p.fillRect(l*f,r.height-k,f,k)}n.wrapInner(c("<span>").hide()).append(q)})})(jQuery,document);(function($){$.extend({tablesorter:new function(){var parsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",cssChildRow:"expand-child",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,sortLocaleCompare:true,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:"/.|,/g",onRenderHeader:null,selectorHeaders:"thead th",debug:false};function benchmark(s,d){log(s+","+(new Date().getTime()-d.getTime())+"ms")}this.benchmark=benchmark;function log(s){if(typeof console!="undefined"&&typeof console.debug!="undefined"){console.log(s)}else{alert(s)}}function buildParserCache(table,$headers){if(table.config.debug){var parsersDebug=""}if(table.tBodies.length==0){return}var rows=table.tBodies[0].rows;if(rows[0]){var list=[],cells=rows[0].cells,l=cells.length;for(var i=0;i<l;i++){var p=false;if($.metadata&&($($headers[i]).metadata()&&$($headers[i]).metadata().sorter)){p=getParserById($($headers[i]).metadata().sorter)}else{if((table.config.headers[i]&&table.config.headers[i].sorter)){p=getParserById(table.config.headers[i].sorter)}}if(!p){p=detectParserForColumn(table,rows,-1,i)}if(table.config.debug){parsersDebug+="column:"+i+" parser:"+p.id+"\n"}list.push(p)}}if(table.config.debug){log(parsersDebug)}return list}function detectParserForColumn(table,rows,rowIndex,cellIndex){var l=parsers.length,node=false,nodeValue=false,keepLooking=true;while(nodeValue==""&&keepLooking){rowIndex++;if(rows[rowIndex]){node=getNodeFromRowAndCellIndex(rows,rowIndex,cellIndex);nodeValue=trimAndGetNodeText(table.config,node);if(table.config.debug){log("Checking if value was empty on row:"+rowIndex)}}else{keepLooking=false}}for(var i=1;i<l;i++){if(parsers[i].is(nodeValue,table,node)){return parsers[i]}}return parsers[0]}function getNodeFromRowAndCellIndex(rows,rowIndex,cellIndex){return rows[rowIndex].cells[cellIndex]}function trimAndGetNodeText(config,node){return $.trim(getElementText(config,node))}function getParserById(name){var l=parsers.length;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==name.toLowerCase()){return parsers[i]}}return false}function buildCache(table){if(table.config.debug){var cacheTime=new Date()}var totalRows=(table.tBodies[0]&&table.tBodies[0].rows.length)||0,totalCells=(table.tBodies[0].rows[0]&&table.tBodies[0].rows[0].cells.length)||0,parsers=table.config.parsers,cache={row:[],normalized:[]};for(var i=0;i<totalRows;++i){var c=$(table.tBodies[0].rows[i]),cols=[];if(c.hasClass(table.config.cssChildRow)){cache.row[cache.row.length-1]=cache.row[cache.row.length-1].add(c);continue}cache.row.push(c);for(var j=0;j<totalCells;++j){cols.push(parsers[j].format(getElementText(table.config,c[0].cells[j]),table,c[0].cells[j]))}cols.push(cache.normalized.length);cache.normalized.push(cols);cols=null}if(table.config.debug){benchmark("Building cache for "+totalRows+" rows:",cacheTime)}return cache}function getElementText(config,node){var text="";if(!node){return""}if(!config.supportsTextContent){config.supportsTextContent=node.textContent||false}if(config.textExtraction=="simple"){if(config.supportsTextContent){text=node.textContent}else{if(node.childNodes[0]&&node.childNodes[0].hasChildNodes()){text=node.childNodes[0].innerHTML}else{text=node.innerHTML}}}else{if(typeof(config.textExtraction)=="function"){text=config.textExtraction(node)}else{text=$(node).text()}}return text}function appendToTable(table,cache){if(table.config.debug){var appendTime=new Date()}var c=cache,r=c.row,n=c.normalized,totalRows=n.length,checkCell=(n[0].length-1),tableBody=$(table.tBodies[0]),rows=[];for(var i=0;i<totalRows;i++){var pos=n[i][checkCell];rows.push(r[pos]);if(!table.config.appender){var l=r[pos].length;for(var j=0;j<l;j++){tableBody[0].appendChild(r[pos][j])}}}if(table.config.appender){table.config.appender(table,rows)}rows=null;if(table.config.debug){benchmark("Rebuilt table:",appendTime)}applyWidget(table);setTimeout(function(){$(table).trigger("sortEnd")},0)}function buildHeaders(table){if(table.config.debug){var time=new Date()}var meta=($.metadata)?true:false;var header_index=computeTableHeaderCellIndexes(table);$tableHeaders=$(table.config.selectorHeaders,table).each(function(index){this.column=header_index[this.parentNode.rowIndex+"-"+this.cellIndex];this.order=formatSortingOrder(table.config.sortInitialOrder);this.count=this.order;if(checkHeaderMetadata(this)||checkHeaderOptions(table,index)){this.sortDisabled=true}if(checkHeaderOptionsSortingLocked(table,index)){this.order=this.lockedOrder=checkHeaderOptionsSortingLocked(table,index)}if(!this.sortDisabled){var $th=$(this).addClass(table.config.cssHeader);if(table.config.onRenderHeader){table.config.onRenderHeader.apply($th)}}table.config.headerList[index]=this});if(table.config.debug){benchmark("Built headers:",time);log($tableHeaders)}return $tableHeaders}function computeTableHeaderCellIndexes(t){var matrix=[];var lookup={};var thead=t.getElementsByTagName("THEAD")[0];var trs=thead.getElementsByTagName("TR");for(var i=0;i<trs.length;i++){var cells=trs[i].cells;for(var j=0;j<cells.length;j++){var c=cells[j];var rowIndex=c.parentNode.rowIndex;var cellId=rowIndex+"-"+c.cellIndex;var rowSpan=c.rowSpan||1;var colSpan=c.colSpan||1;var firstAvailCol;if(typeof(matrix[rowIndex])=="undefined"){matrix[rowIndex]=[]}for(var k=0;k<matrix[rowIndex].length+1;k++){if(typeof(matrix[rowIndex][k])=="undefined"){firstAvailCol=k;break}}lookup[cellId]=firstAvailCol;for(var k=rowIndex;k<rowIndex+rowSpan;k++){if(typeof(matrix[k])=="undefined"){matrix[k]=[]}var matrixrow=matrix[k];for(var l=firstAvailCol;l<firstAvailCol+colSpan;l++){matrixrow[l]="x"}}}}return lookup}function checkCellColSpan(table,rows,row){var arr=[],r=table.tHead.rows,c=r[row].cells;for(var i=0;i<c.length;i++){var cell=c[i];if(cell.colSpan>1){arr=arr.concat(checkCellColSpan(table,headerArr,row++))}else{if(table.tHead.length==1||(cell.rowSpan>1||!r[row+1])){arr.push(cell)}}}return arr}function checkHeaderMetadata(cell){if(($.metadata)&&($(cell).metadata().sorter===false)){return true}return false}function checkHeaderOptions(table,i){if((table.config.headers[i])&&(table.config.headers[i].sorter===false)){return true}return false}function checkHeaderOptionsSortingLocked(table,i){if((table.config.headers[i])&&(table.config.headers[i].lockedOrder)){return table.config.headers[i].lockedOrder}return false}function applyWidget(table){var c=table.config.widgets;var l=c.length;for(var i=0;i<l;i++){getWidgetById(c[i]).format(table)}}function getWidgetById(name){var l=widgets.length;for(var i=0;i<l;i++){if(widgets[i].id.toLowerCase()==name.toLowerCase()){return widgets[i]}}}function formatSortingOrder(v){if(typeof(v)!="Number"){return(v.toLowerCase()=="desc")?1:0}else{return(v==1)?1:0}}function isValueInArray(v,a){var l=a.length;for(var i=0;i<l;i++){if(a[i][0]==v){return true}}return false}function setHeadersCss(table,$headers,list,css){$headers.removeClass(css[0]).removeClass(css[1]);var h=[];$headers.each(function(offset){if(!this.sortDisabled){h[this.column]=$(this)}});var l=list.length;for(var i=0;i<l;i++){h[list[i][0]].addClass(css[list[i][1]])}}function fixColumnWidth(table,$headers){var c=table.config;if(c.widthFixed){var colgroup=$("<colgroup>");$("tr:first td",table.tBodies[0]).each(function(){colgroup.append($("<col>").css("width",$(this).width()))});$(table).prepend(colgroup)}}function updateHeaderSortCount(table,sortList){var c=table.config,l=sortList.length;for(var i=0;i<l;i++){var s=sortList[i],o=c.headerList[s[0]];o.count=s[1];o.count++}}function multisort(table,sortList,cache){if(table.config.debug){var sortTime=new Date()}var dynamicExp="var sortWrapper = function(a,b) {",l=sortList.length;for(var i=0;i<l;i++){var c=sortList[i][0];var order=sortList[i][1];var s=(table.config.parsers[c].type=="text")?((order==0)?makeSortFunction("text","asc",c):makeSortFunction("text","desc",c)):((order==0)?makeSortFunction("numeric","asc",c):makeSortFunction("numeric","desc",c));var e="e"+i;dynamicExp+="var "+e+" = "+s;dynamicExp+="if("+e+") { return "+e+"; } ";dynamicExp+="else { "}var orgOrderCol=cache.normalized[0].length-1;dynamicExp+="return a["+orgOrderCol+"]-b["+orgOrderCol+"];";for(var i=0;i<l;i++){dynamicExp+="}; "}dynamicExp+="return 0; ";dynamicExp+="}; ";if(table.config.debug){benchmark("Evaling expression:"+dynamicExp,new Date())}eval(dynamicExp);cache.normalized.sort(sortWrapper);if(table.config.debug){benchmark("Sorting on "+sortList.toString()+" and dir "+order+" time:",sortTime)}return cache}function makeSortFunction(type,direction,index){var a="a["+index+"]",b="b["+index+"]";if(type=="text"&&direction=="asc"){return"("+a+" == "+b+" ? 0 : ("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : ("+a+" < "+b+") ? -1 : 1 )));"}else{if(type=="text"&&direction=="desc"){return"("+a+" == "+b+" ? 0 : ("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : ("+b+" < "+a+") ? -1 : 1 )));"}else{if(type=="numeric"&&direction=="asc"){return"("+a+" === null && "+b+" === null) ? 0 :("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : "+a+" - "+b+"));"}else{if(type=="numeric"&&direction=="desc"){return"("+a+" === null && "+b+" === null) ? 0 :("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : "+b+" - "+a+"));"}}}}}function makeSortText(i){return"((a["+i+"] < b["+i+"]) ? -1 : ((a["+i+"] > b["+i+"]) ? 1 : 0));"}function makeSortTextDesc(i){return"((b["+i+"] < a["+i+"]) ? -1 : ((b["+i+"] > a["+i+"]) ? 1 : 0));"}function makeSortNumeric(i){return"a["+i+"]-b["+i+"];"}function makeSortNumericDesc(i){return"b["+i+"]-a["+i+"];"}function sortText(a,b){if(table.config.sortLocaleCompare){return a.localeCompare(b)}return((a<b)?-1:((a>b)?1:0))}function sortTextDesc(a,b){if(table.config.sortLocaleCompare){return b.localeCompare(a)}return((b<a)?-1:((b>a)?1:0))}function sortNumeric(a,b){return a-b}function sortNumericDesc(a,b){return b-a}function getCachedSortType(parsers,i){return parsers[i].type}this.construct=function(settings){return this.each(function(){if(!this.tHead||!this.tBodies){return}var $this,$document,$headers,cache,config,shiftDown=0,sortOrder;this.config={};config=$.extend(this.config,$.tablesorter.defaults,settings);$this=$(this);$.data(this,"tablesorter",config);$headers=buildHeaders(this);this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);var sortCSS=[config.cssDesc,config.cssAsc];fixColumnWidth(this);$headers.click(function(e){var totalRows=($this[0].tBodies[0]&&$this[0].tBodies[0].rows.length)||0;if(!this.sortDisabled&&totalRows>0){$this.trigger("sortStart");var $cell=$(this);var i=this.column;this.order=this.count++%2;if(this.lockedOrder){this.order=this.lockedOrder}if(!e[config.sortMultiSortKey]){config.sortList=[];if(config.sortForce!=null){var a=config.sortForce;for(var j=0;j<a.length;j++){if(a[j][0]!=i){config.sortList.push(a[j])}}}config.sortList.push([i,this.order])}else{if(isValueInArray(i,config.sortList)){for(var j=0;j<config.sortList.length;j++){var s=config.sortList[j],o=config.headerList[s[0]];if(s[0]==i){o.count=s[1];o.count++;s[1]=o.count%2}}}else{config.sortList.push([i,this.order])}}setTimeout(function(){setHeadersCss($this[0],$headers,config.sortList,sortCSS);appendToTable($this[0],multisort($this[0],config.sortList,cache))},1);return false}}).mousedown(function(){if(config.cancelSelection){this.onselectstart=function(){return false};return false}});$this.bind("update",function(){var me=this;setTimeout(function(){me.config.parsers=buildParserCache(me,$headers);cache=buildCache(me)},1)}).bind("updateCell",function(e,cell){var config=this.config;var pos=[(cell.parentNode.rowIndex-1),cell.cellIndex];cache.normalized[pos[0]][pos[1]]=config.parsers[pos[1]].format(getElementText(config,cell),cell)}).bind("sorton",function(e,list){$(this).trigger("sortStart");config.sortList=list;var sortList=config.sortList;updateHeaderSortCount(this,sortList);setHeadersCss(this,$headers,sortList,sortCSS);appendToTable(this,multisort(this,sortList,cache))}).bind("appendCache",function(){appendToTable(this,cache)}).bind("applyWidgetId",function(e,id){getWidgetById(id).format(this)}).bind("applyWidgets",function(){applyWidget(this)});if($.metadata&&($(this).metadata()&&$(this).metadata().sortlist)){config.sortList=$(this).metadata().sortlist}if(config.sortList.length>0){$this.trigger("sorton",[config.sortList])}applyWidget(this)})};this.addParser=function(parser){var l=parsers.length,a=true;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==parser.id.toLowerCase()){a=false}}if(a){parsers.push(parser)}};this.addWidget=function(widget){widgets.push(widget)};this.formatFloat=function(s){var i=parseFloat(s);return(isNaN(i))?0:i};this.formatInt=function(s){var i=parseInt(s);return(isNaN(i))?0:i};this.isDigit=function(s,config){return/^[-+]?\d*$/.test($.trim(s.replace(/[,.']/g,"")))};this.clearTableBody=function(table){if($.browser.msie){function empty(){while(this.firstChild){this.removeChild(this.firstChild)}}empty.apply(table.tBodies[0])}else{table.tBodies[0].innerHTML=""}}}});$.fn.extend({tablesorter:$.tablesorter.construct});var ts=$.tablesorter;ts.addParser({id:"text",is:function(s){return true},format:function(s){return $.trim(s.toLocaleLowerCase())},type:"text"});ts.addParser({id:"digit",is:function(s,table){var c=table.config;return $.tablesorter.isDigit(s,c)},format:function(s){return $.tablesorter.formatFloat(s)},type:"numeric"});ts.addParser({id:"currency",is:function(s){return/^[Â£$â‚¬?.]/.test(s)},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/[Â£$â‚¬]/g),""))},type:"numeric"});ts.addParser({id:"ipAddress",is:function(s){return/^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s)},format:function(s){var a=s.split("."),r="",l=a.length;for(var i=0;i<l;i++){var item=a[i];if(item.length==2){r+="0"+item}else{r+=item}}return $.tablesorter.formatFloat(r)},type:"numeric"});ts.addParser({id:"url",is:function(s){return/^(https?|ftp|file):\/\/$/.test(s)},format:function(s){return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//),""))},type:"text"});ts.addParser({id:"isoDate",is:function(s){return/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s)},format:function(s){return $.tablesorter.formatFloat((s!="")?new Date(s.replace(new RegExp(/-/g),"/")).getTime():"0")},type:"numeric"});ts.addParser({id:"percent",is:function(s){return/\%$/.test($.trim(s))},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g),""))},type:"numeric"});ts.addParser({id:"usLongDate",is:function(s){return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/))},format:function(s){return $.tablesorter.formatFloat(new Date(s).getTime())},type:"numeric"});ts.addParser({id:"shortDate",is:function(s){return/\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s)},format:function(s,table){var c=table.config;s=s.replace(/\-/g,"/");if(c.dateFormat=="us"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$1/$2")}else{if(c.dateFormat=="uk"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$2/$1")}else{if(c.dateFormat=="dd/mm/yy"||c.dateFormat=="dd-mm-yy"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/,"$1/$2/$3")}}}return $.tablesorter.formatFloat(new Date(s).getTime())},type:"numeric"});ts.addParser({id:"time",is:function(s){return/^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s)},format:function(s){return $.tablesorter.formatFloat(new Date("2000/01/01 "+s).getTime())},type:"numeric"});ts.addParser({id:"metadata",is:function(s){return false},format:function(s,table,cell){var c=table.config,p=(!c.parserMetadataName)?"sortValue":c.parserMetadataName;return $(cell).metadata()[p]},type:"numeric"});ts.addWidget({id:"zebra",format:function(table){if(table.config.debug){var time=new Date()}var $tr,row=-1,odd;$("tr:visible",table.tBodies[0]).each(function(i){$tr=$(this);if(!$tr.hasClass(table.config.cssChildRow)){row++}odd=(row%2==0);$tr.removeClass(table.config.widgetZebra.css[odd?0:1]).addClass(table.config.widgetZebra.css[odd?1:0])});if(table.config.debug){$.tablesorter.benchmark("Applying Zebra widget",time)}}})})(jQuery);(function(b){b.flexiPagination={defaults:{url:"",currentPage:0,totalResults:100,perPage:25,container:"body",pagerVar:"p",loaderImgPath:"images/loader.gif",heightOffset:0,debug:0}};b.fn.extend({flexiPagination:function(a){var a=b.extend({},b.flexiPagination.defaults,a);var d=false;b("body").append("<div id='jqpageflow-block'><img src='"+a.loaderImgPath+"' /><span id='jqpageflow-text'></span></div>");b("#jqpageflow-block").addClass("jqpageflow-loader");b("#jqpageflow-text").addClass("jqpageflow-loadertext");a.container=(a.container!="")?a.container:"body";b(this).scroll(function(){if(a.currentPage>=0&&(a.perPage*(a.currentPage+1)<a.totalResults)&&!d&&b(this).scrollTop()>(b(a.container).height()-a.heightOffset)){d=true;b("#jqpageflow-text").text("Loading results "+(a.perPage*((a.currentPage>0)?a.currentPage:1))+" of "+a.totalResults);b("#jqpageflow-block").show();b.ajax({type:"GET",dataType:"html",context:b(this),url:a.url+(a.url.indexOf("?")!==-1?"&":"?")+a.pagerVar+"="+((a.currentPage+1)*a.perPage),success:function(c){c=b.trim(c);if(c){b(a.container).append(c);a.currentPage++}else{a.currentPage=-1}},complete:function(){b(this).scrollTop(b(this).scrollTop()-a.heightOffset);d=false;b("#jqpageflow-block").hide()}})}});return this}})})(jQuery);(function(a){a.fn.hoverIntent=function(m,l){var n={sensitivity:7,interval:100,timeout:0};n=a.extend(n,l?{over:m,out:l}:m);var p,o,j,d;var e=function(f){p=f.pageX;o=f.pageY};var c=function(g,f){f.hoverIntent_t=clearTimeout(f.hoverIntent_t);if((Math.abs(j-p)+Math.abs(d-o))<n.sensitivity){a(f).unbind("mousemove",e);f.hoverIntent_s=1;return n.over.apply(f,[g])}else{j=p;d=o;f.hoverIntent_t=setTimeout(function(){c(g,f)},n.interval)}};var k=function(g,f){f.hoverIntent_t=clearTimeout(f.hoverIntent_t);f.hoverIntent_s=0;return n.out.apply(f,[g])};var b=function(q){var g=jQuery.extend({},q);var f=this;if(f.hoverIntent_t){f.hoverIntent_t=clearTimeout(f.hoverIntent_t)}if(q.type=="mouseenter"){j=g.pageX;d=g.pageY;a(f).bind("mousemove",e);if(f.hoverIntent_s!=1){f.hoverIntent_t=setTimeout(function(){c(g,f)},n.interval)}}else{a(f).unbind("mousemove",e);if(f.hoverIntent_s==1){f.hoverIntent_t=setTimeout(function(){k(g,f)},n.timeout)}}};return this.bind("mouseenter",b).bind("mouseleave",b)}})(jQuery);
/*!
 * OuterHTML v1.0.0 (Release version)
 *
 * http://www.darlesson.com/
 *
 * Copyright 2010, Darlesson Oliveira
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 * @requires jQuery v1.4.0 or above
 *
 * Reporting bugs, comments or suggestions: http://darlesson.com/contact/
 * Documentation and other jQuery plug-ins: http://darlesson.com/jquery/
 * Donations are welcome: http://darlesson.com/donate/
 */
(function(a){a.fn.extend({outerHTML:function(c){if(typeof c==="string"){var e=a(this),d=e.parent();var b=function(){var g=e.find("img");if(g.length>0){g.remove()}var f;a(c).map(function(){f=a(this);e.replaceWith(f)});return f};return b()}else{return a("<div />").append(a(this).clone()).html()}}})})(jQuery);(function(a){a.Peelback=function(c,b){var d=this;d.$el=a(c);d.el=c;d.$el.data("Peelback",d);d.init=function(){var m,f,l,k,e,g,j;d.settings=a.extend({},a.Peelback.defaultSettings,b);if(typeof(d.settings.adImage)!=="string"||d.settings.adImage===""){if(d.settings.debug===true){console.log("Ad image missing")}return}if(typeof(d.settings.peelImage)!=="string"||d.settings.peelImage===""){if(d.settings.debug===true){console.log("Peel effect image missing")}return}if(typeof(d.settings.clickURL)!=="string"||d.settings.clickURL===""){if(d.settings.debug===true){console.log("Click URL missing")}return}k=d.settings.smallSize+"px";e=d.settings.bigSize+"px";g=(d.settings.smallSize-3)+"px";j=Math.floor((d.settings.bigSize*0.96))+"px";m=a('<div id="peelback"><a href="'+d.settings.clickURL+'" target="_blank"><img src="'+d.settings.peelImage+'" alt="" border="0" /></a><div></div></div>');f=m.find("img");l=m.find("div");a(f).css({width:"0",height:"0","z-index":"6002",position:"absolute",right:"0",top:"0","-ms-interpolation-mode":"bicubic"});a(l).css({width:"0",height:"0",overflow:"hidden",position:"absolute",right:"0",top:"0",background:"url("+d.settings.adImage+") no-repeat right top"});d.$el.prepend(m);if(d.settings.autoAnimate===false){a(f).css({width:k,height:k});a(l).css({width:g,height:g})}else{a(f).delay(500).animate({width:k,height:k},500);a(l).delay(500).animate({width:g,height:g},500)}m.hover(function(){a(f).stop().animate({width:e,height:e},500);a(l).stop().animate({width:j,height:j},500);if(d.settings.gaTrack===true){if(typeof(_gaq)!="undefined"){_gaq.push(["_trackEvent","Ad_Interaction","Peelback",d.settings.gaLabel])}else{if(d.settings.debug===true){console.log("Google Analytics _gaq object undefined")}}}},function(){a(f).stop().animate({width:k,height:k},400);a(l).stop().animate({width:g,height:g},400)})};d.init()};a.Peelback.defaultSettings={adImage:null,peelImage:null,clickURL:null,smallSize:58,bigSize:510,gaTrack:false,gaLabel:"default",autoAnimate:true,debug:false};a.fn.peelback=function(b){return this.each(function(){(new a.Peelback(this,b))})}})(jQuery);var FlashHeed=(function(d){var a=d.document;var c=function(g,l,j){var e="";var k=g;var f;if(k===undefined){return""}while(k.length>0){if(f=k.match(l)){e+=k.slice(0,f.index);e+=j;k=k.slice(f.index+f[0].length)}else{e+=k,k=""}}return e};var b=function(l){if(l===undefined||l===null){var l=a}var x=l.getElementsByTagName("object");var u=x.length;var r;for(r=0;r<u;r++){var k=x[r];if(k==undefined){continue}var p=k.getElementsByTagName("param");var w=p.length;var g=k.getElementsByTagName("embed");var v=null;if(g.length>0){var v=g[0]}if(v){v.setAttribute("wmode","transparent");var t=v.nextSibling,n=v.parentNode;n.removeChild(v);n.insertBefore(v,t)}var e=false;var m=false;for(var q=0;q<w;q++){if(p[q].name==="wmode"){if(/transparent/i.test(p[q].value)||/opaque/i.test(p[q].value)){e=true}else{m=true}}}if(!e||m){var s=$(k).outerHTML();var t=k.nextSibling,n=k.parentNode;s=c(s,/<param name="wmode".*?>/i,"");s=c(s,/<\/object>/i,'<PARAM NAME="WMode" VALUE="Transparent"></object>');n.removeChild(k);var f=a.createElement("div");f.appendChild(k);f.innerHTML="";f.innerHTML=s;n.insertBefore(f,t)}}};return{heed:b}})(window);$(document).ready(function(){if($("#main_wrap").hasClass("fixed_panel")){var a=$(".right_rail").offset().top;var d=$(".right_rail").offset().left;var b=$(document).height()-$("#left_rail").height()+100;var c=$(document).height()-$("#left_rail").height();$(window).scroll(function(){var f=$(window).scrollTop();var g=$(document).height()-$(window).height()-$(window).scrollTop();var e=(b-g)*-1;if(f<a){$(".right_rail").offset({top:a,left:d})}else{if(g<b){}else{$(".right_rail").offset({top:$(window).scrollTop(),left:d})}}})}if($("#empty").has("a").length){$(window).scroll(function(){var g=$(window).scrollTop();var j=$(document).height()-$(window).height()-$(window).scrollTop();var e=285;var k=430;var f=(k-j)*-1;if(g<e){$("body").css("background-attachment","scroll");$("body").css("background-position","50% 0")}else{if(j<k){$("body").css("background-attachment","fixed");$("body").css("background-position","50% "+f+"px")}else{$("body").css("background-attachment","fixed")}}})}});
