﻿var userLoggedIn = false;
var showDirections = false;
var geocoder;
var map;
var directionDisplay;
var directionsService = new google.maps.DirectionsService();
var markers = new Array();
var info = new google.maps.InfoWindow();
var placesData = new Array();
var friendsLoaded = false;
var friendJsonList;
    
$().ready(function() {

    $("#btnShare").click(function() {
        if( !friendsLoaded)
        {
            friendsLoaded = true;
            loadFriends();
        }
        jQuery('#dlgShare').dialog('open');
    });
        
    $('#dlgUpdateCurrentLocation').dialog({
	    bgiframe: true,
	    autoOpen: false,
        modal: false,
        height: 300,
        width: 300,

	    buttons: {
		    "Ok": function() { 
                changeAddress( $("#newaddress").val() );
		    }, 
		    "Cancel": function() { 
			    $(this).dialog("close"); 
		    } 
	    }
    });
	
    $("#dlgUpdateCurrentLocation li").live("click",function() {
        $("#progress-indicator").show();
        $('.currentaddress').text($(this).text());
        //$('#dlgUpdateCurrentLocation').dialog('close');
        var url = "/home/setcurrent?" + $(this).attr("params");
        $.post(url, null, function(data) {
            //$("#progress-indicator").hide();
            if (data == "OK")
            {
                changeAddressCallback();
            }
            else{
                alert("There was a problem updating your location.  Please try again in a few minutes.");
            }
        });
    });
    
    $('#dlgUpdateCurrentLocation #newaddress').bind('keypress', function(e) {
        if(e.keyCode==13)
            changeAddress( $("#newaddress").val() );
    });
            
    $(".changeaddress").click(function() {
        $('#dlgUpdateCurrentLocation').dialog('open');
    });
    
    $('#dlgTickets').dialog({
        bgiframe: true,
        autoOpen: false,
        height: 400,
        width: 600,
        modal: true,
        buttons: {
            "Close": function() {
                $(this).dialog("close");
            }
        }
    });
    
    $('#dlgFavorites').dialog({
        bgiframe: true,
        autoOpen: false,
        height: 200,
        width: 400,
        modal: true,
        buttons: {
            "Ok": function() {
                $(this).dialog("close");
            },
            "Cancel": function() {
                $(this).dialog("close");
            }
        }
    });
        
    $('#dlgShare').dialog({
        bgiframe: true,
        autoOpen: false,
        height: 400,
        width: 450,
        modal: true,
        buttons: {
            "Ok": function() {
                var num_people = $("input[@name=people]:checked").length; 
                if (num_people == 0)
                    alert('Please check one or more friends to share this place with.');
                else {
                    $("#frmShare").submit(); 
                    $(this).dialog("close");
                }
            },
            "Cancel": function() {
                $(this).dialog("close");
            }
        }
    });
});

function loadFriends()
{
    $.get("/contacts/getfriendsajax",function(data, textStatus) { 
            friendJsonList = eval(data);
            var html = "";
            
            for (i = 0; i < friendJsonList.length; i++) {
                html += "<li><span><input type='checkbox' name='people' value='" + friendJsonList[i].UserID + "|" + friendJsonList[i].EmailAddress + "'/>" + friendJsonList[i].Name + "</span>";
                html = html + "<div style='clear: both'/></li>";
            }
            
            $("#friends").html(html);
    });        
}
    
function initMap(currentLocation, icon, z) {
    var myOptions = {
        zoom: z,
        disableDefaultUI: false,
        mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
    mapObjects();
    geocoder = new google.maps.Geocoder();
    if(currentLocation != '')
        codeAddress(currentLocation, icon);
        
    centerMap();        
}

function showAddress(lat,lng,idx,name,address,phone) {
    var myLatlng = new google.maps.LatLng(lat, lng)
    var marker = new google.maps.Marker({
      position: myLatlng, 
      map: map, 
      title: showAddress.arguments[3]
    });
    
    google.maps.event.addListener(marker, 'click', function() {
        tip(idx);
      });

    markers[ markers.length] = marker;
    placesData[ placesData.length ] = formatMapTip(showAddress.arguments);
}

function formatMapTip(args)
{
//override this on each page
    return "<b>" +args[3] + "</b><br/>" + args[4] + "<br/>" + args[5];
}
function mapObjects()
{
//override this on each page
}

function codeAddress(address, icon) 
{
    if (geocoder && address == '')
        return;
    
    geocoder.geocode( { 'address': address}, function(results, status) 
    {
        if (status == google.maps.GeocoderStatus.OK) 
        {
            var img = icon;
            
            var marker = new google.maps.Marker({
                map: map, 
                position: results[0].geometry.location,
                icon: img,
                title: "Current Location"
            });
            
            markers[ markers.length] = marker;

        } 
    });
}

function centerMap()
{
    var mapbounds = new google.maps.LatLngBounds();
    for(var i=0; i<this.markers.length; i++){
        mapbounds.extend( this.markers[i].position );
    }

    this.map.setCenter( mapbounds.getCenter() );
    this.map.fitBounds(mapbounds);
}
    
function tip(index)
{
    info.close();
    var data = placesData[index];
    info = new google.maps.InfoWindow({
        content: data
    });

    info.open(map,markers[index]);
}    

function changeAddress(address) 
{
    address = address.replace("'","");
    var geocoder = new google.maps.Geocoder();

    $("#progress-indicator").show();
    $('#changeAddressResults').hide();
    
    geocoder.geocode( { 'address': address}, function(results, status) 
    {
        $("#progress-indicator").hide();
        
        if (status == google.maps.GeocoderStatus.OK) 
        {
            var html = "";
            var params = "";
            var cmpType;
            var comp;
                    
            for (i = 0; i < results.length; i++) {
                params = "add=" + results[i].formatted_address + "&lat=" + results[i].geometry.location.lat() + "&lng=" + results[i].geometry.location.lng();
                
                for (j = 0; j < results[i].address_components.length; j++)
                {
                    comp = results[i].address_components[j];
                    
                    for (k = 0; k < comp.types.length; k++)
                    {
                        cmpType = comp.types[k];

                        if( cmpType == "postal_code")
                        {
                            params += "&zip=" + comp.long_name;
                        }
                        else if( cmpType == "locality")
                        {
                            params += "&city=" + comp.long_name;
                        }
                        else if( cmpType == "country")
                        {
                            params += "&country=" + comp.short_name;
                        }
                        else if( cmpType == "administrative_area_level_1")
                        {
                            params += "&state=" + comp.short_name;
                        }
                        else if( cmpType == "administrative_area_level_2")
                        {
                            params += "&county=" + comp.long_name;
                        }
                    }
                    
                }
                    
                html += "<li params=\"" + params + "\">" + results[i].formatted_address + "</li>";
            }
            
            $('#changeAddressOptions').html(html);
            $('#changeAddressResults').show("slow");
            
        }
        else
        {
            alert("Could not geocode location"); 
            return false;
        }
    });
}

function changeAddressCallback()
{
    //override on page if different function required
    location.reload();
}

function planZvent(zventId)
{
    if(!userLoggedIn)
        alert("You must be logged in to plan an event.");
    else
        window.location = "/newevent/PlanZvent?zventId=" + zventId;
}

function planRest(name,address)
{
    if(!userLoggedIn)
        alert("You must be logged in to plan an event.");
    else
        window.location = "/newevent/PlanRest?address=" + address + "&name=" + name;
}
        
function planTheater(theaterId,movieId,date)
{
    if(!userLoggedIn)
        alert("You must be logged in to plan an event.");
    else
        window.location = "/newevent/PlanTheater?theaterId=" + theaterId + "&movieId=" + movieId + "&date=" + date;
}

function dispTix(zventId)
{
    $.get("/zvents/GetTicketsAjax?zventId=" + zventId,
        function(data) {
            $('#dlgTickets').html(data);
            jQuery('#dlgTickets').dialog('open');
        }
     ); 
}
        
function initDirections(address) 
{
    var myOptions = {
        zoom: 14,
        disableDefaultUI: false,
        mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); 
    
    if (showDirections) 
        display_directions();
    else
        codeDirections(address);
}

function codeDirections(address) 
{  
    geocoder = new google.maps.Geocoder();
    geocoder.geocode( { 'address': address}, function(results, status) 
    {
        if (status == google.maps.GeocoderStatus.OK) 
        {
            map.setCenter(results[0].geometry.location);
            map.setZoom(10);
            
            var marker = new google.maps.Marker({
                map: map, 
                position: results[0].geometry.location
            });
        } 
    });
}

function display_directions()
{
    directionsDisplay = new google.maps.DirectionsRenderer();
    directionsDisplay.setPanel(document.getElementById("text_directions"));
    directionsDisplay.setMap(map); 
        
    var start = document.getElementById("startAddress").value;
    var end = document.getElementById("endAddress").value;

    var request = {
        origin:start, 
        destination:end,
        travelMode: google.maps.DirectionsTravelMode.DRIVING
    };
    directionsService.route(request, function(response, status) {
        if (status == google.maps.DirectionsStatus.OK) {
          directionsDisplay.setDirections(response);
        }
    });
}


////////////////////////////////////////////////////////////////////////////////////////////////////////////

/*
* JTip
* By Cody Lindley (http://www.codylindley.com)
* Under an Attribution, Share Alike License
* JTip is built on top of the very light weight jquery library.
*/

//on page load (as soon as its ready) call JT_init
$(document).ready(JT_init);

function JT_init() {
    $("a.jTip")
		   .hover(function() { JT_show(this.href, this.id, this.name) }, function() { $('#JT').remove() })
           .click(function() { return false });
}

function JT_show(url, linkId, title) {
    if (title == false) title = "&nbsp;";
    var de = document.documentElement;
    var w = self.innerWidth || (de && de.clientWidth) || document.body.clientWidth;
    var hasArea = w - getAbsoluteLeft(linkId);
    var clickElementy = getAbsoluteTop(linkId) - 3; //set y position

    var queryString = url.replace(/^[^\?]+\??/, '');
    var params = parseQuery(queryString);
    if (params['width'] === undefined) { params['width'] = 250 };
    if (params['link'] !== undefined) {
        $('#' + linkId).bind('click', function() { window.location = params['link'] });
        $('#' + linkId).css('cursor', 'pointer');
    }

    if (hasArea > ((params['width'] * 1) + 75)) {
        $("body").append("<div id='JT' style='width:" + params['width'] * 1 + "px'><div id='JT_arrow_left'></div><div id='JT_close_left'>" + title + "</div><div id='JT_copy'><div class='JT_loader'><div></div></div>"); //right side
        var arrowOffset = getElementWidth(linkId) + 11;
        var clickElementx = getAbsoluteLeft(linkId) + arrowOffset; //set x position
    } else {
        $("body").append("<div id='JT' style='width:" + params['width'] * 1 + "px'><div id='JT_arrow_right' style='left:" + ((params['width'] * 1) + 1) + "px'></div><div id='JT_close_right'>" + title + "</div><div id='JT_copy'><div class='JT_loader'><div></div></div>"); //left side
        var clickElementx = getAbsoluteLeft(linkId) - ((params['width'] * 1) + 15); //set x position
    }

    $('#JT').css({ left: clickElementx + "px", top: clickElementy + "px" });
    $('#JT').show();
    $('#JT_copy').load(url);

}

function getElementWidth(objectId) {
    x = document.getElementById(objectId);
    return x.offsetWidth;
}

function getAbsoluteLeft(objectId) {
    // Get an object left position from the upper left viewport corner
    o = document.getElementById(objectId)
    oLeft = o.offsetLeft            // Get left position from the parent object
    while (o.offsetParent != null) {   // Parse the parent hierarchy up to the document element
        oParent = o.offsetParent    // Get parent object reference
        oLeft += oParent.offsetLeft // Add parent left position
        o = oParent
    }
    return oLeft
}

function getAbsoluteTop(objectId) {
    // Get an object top position from the upper left viewport corner
    o = document.getElementById(objectId)
    oTop = o.offsetTop            // Get top position from the parent object
    while (o.offsetParent != null) { // Parse the parent hierarchy up to the document element
        oParent = o.offsetParent  // Get parent object reference
        oTop += oParent.offsetTop // Add parent top position
        o = oParent
    }
    return oTop
}

function parseQuery(query) {
    var Params = new Object();
    if (!query) return Params; // return empty object
    var Pairs = query.split(/[;&]/);
    for (var i = 0; i < Pairs.length; i++) {
        var KeyVal = Pairs[i].split('=');
        if (!KeyVal || KeyVal.length != 2) continue;
        var key = unescape(KeyVal[0]);
        var val = unescape(KeyVal[1]);
        val = val.replace(/\+/g, ' ');
        Params[key] = val;
    }
    return Params;
}

function blockEvents(evt) {
    if (evt.target) {
        evt.preventDefault();
    } else {
        evt.returnValue = false;
    }
}







/**
* Cookie plugin
*
* Copyright (c) 2006 Klaus Hartl (stilbuero.de)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
*/

/**
* Create a cookie with the given name and value and other optional parameters.
*
* @example $.cookie('the_cookie', 'the_value');
* @desc Set the value of a cookie.
* @example $.cookie('the_cookie', 'the_value', {expires: 7, path: '/', domain: 'jquery.com', secure: true});
* @desc Create a cookie with all available options.
* @example $.cookie('the_cookie', 'the_value');
* @desc Create a session cookie.
* @example $.cookie('the_cookie', null);
* @desc Delete a cookie by passing null as value.
*
* @param String name The name of the cookie.
* @param String value The value of the cookie.
* @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
* @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
*                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
*                             If set to null or omitted, the cookie will be a session cookie and will not be retained
*                             when the the browser exits.
* @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
* @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
* @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
*                        require a secure protocol (like HTTPS).
* @type undefined
*
* @name $.cookie
* @cat Plugins/Cookie
* @author Klaus Hartl/klaus.hartl@stilbuero.de
*/

/**
* Get the value of a cookie with the given name.
*
* @example $.cookie('the_cookie');
* @desc Get the value of a cookie.
*
* @param String name The name of the cookie.
* @return The value of the cookie.
* @type String
*
* @name $.cookie
* @cat Plugins/Cookie
* @author Klaus Hartl/klaus.hartl@stilbuero.de
*/
jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        var path = options.path ? '; path=' + options.path : '';
        var domain = options.domain ? '; domain=' + options.domain : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};








//////////////////////////////////////////////////////////////////////////////////////////////////

// jquery.cycle.js - http://malsup.com/jquery/cycle/lite/
(function(D) { var A = "Lite-1.0"; D.fn.cycle = function(E) { return this.each(function() { E = E || {}; if (this.cycleTimeout) { clearTimeout(this.cycleTimeout) } this.cycleTimeout = 0; this.cyclePause = 0; var I = D(this); var J = E.slideExpr ? D(E.slideExpr, this) : I.children(); var G = J.get(); if (G.length < 2) { if (window.console && window.console.log) { window.console.log("terminating; too few slides: " + G.length) } return } var H = D.extend({}, D.fn.cycle.defaults, E || {}, D.metadata ? I.metadata() : D.meta ? I.data() : {}); H.before = H.before ? [H.before] : []; H.after = H.after ? [H.after] : []; H.after.unshift(function() { H.busy = 0 }); var F = this.className; H.width = parseInt((F.match(/w:(\d+)/) || [])[1]) || H.width; H.height = parseInt((F.match(/h:(\d+)/) || [])[1]) || H.height; H.timeout = parseInt((F.match(/t:(\d+)/) || [])[1]) || H.timeout; if (I.css("position") == "static") { I.css("position", "relative") } if (H.width) { I.width(H.width) } if (H.height && H.height != "auto") { I.height(H.height) } var K = 0; J.css({ position: "absolute", top: 0, left: 0 }).hide().each(function(M) { D(this).css("z-index", G.length - M) }); D(G[K]).css("opacity", 1).show(); if (D.browser.msie) { G[K].style.removeAttribute("filter") } if (H.fit && H.width) { J.width(H.width) } if (H.fit && H.height && H.height != "auto") { J.height(H.height) } if (H.pause) { I.hover(function() { this.cyclePause = 1 }, function() { this.cyclePause = 0 }) } D.fn.cycle.transitions.fade(I, J, H); J.each(function() { var M = D(this); this.cycleH = (H.fit && H.height) ? H.height : M.height(); this.cycleW = (H.fit && H.width) ? H.width : M.width() }); J.not(":eq(" + K + ")").css({ opacity: 0 }); if (H.cssFirst) { D(J[K]).css(H.cssFirst) } if (H.timeout) { if (H.speed.constructor == String) { H.speed = { slow: 600, fast: 200}[H.speed] || 400 } if (!H.sync) { H.speed = H.speed / 2 } while ((H.timeout - H.speed) < 250) { H.timeout += H.speed } } H.speedIn = H.speed; H.speedOut = H.speed; H.slideCount = G.length; H.currSlide = K; H.nextSlide = 1; var L = J[K]; if (H.before.length) { H.before[0].apply(L, [L, L, H, true]) } if (H.after.length > 1) { H.after[1].apply(L, [L, L, H, true]) } if (H.click && !H.next) { H.next = H.click } if (H.next) { D(H.next).bind("click", function() { return C(G, H, H.rev ? -1 : 1) }) } if (H.prev) { D(H.prev).bind("click", function() { return C(G, H, H.rev ? 1 : -1) }) } if (H.timeout) { this.cycleTimeout = setTimeout(function() { B(G, H, 0, !H.rev) }, H.timeout + (H.delay || 0)) } }) }; function B(J, E, I, K) { if (E.busy) { return } var H = J[0].parentNode, M = J[E.currSlide], L = J[E.nextSlide]; if (H.cycleTimeout === 0 && !I) { return } if (I || !H.cyclePause) { if (E.before.length) { D.each(E.before, function(N, O) { O.apply(L, [M, L, E, K]) }) } var F = function() { if (D.browser.msie) { this.style.removeAttribute("filter") } D.each(E.after, function(N, O) { O.apply(L, [M, L, E, K]) }) }; if (E.nextSlide != E.currSlide) { E.busy = 1; D.fn.cycle.custom(M, L, E, F) } var G = (E.nextSlide + 1) == J.length; E.nextSlide = G ? 0 : E.nextSlide + 1; E.currSlide = G ? J.length - 1 : E.nextSlide - 1 } if (E.timeout) { H.cycleTimeout = setTimeout(function() { B(J, E, 0, !E.rev) }, E.timeout) } } function C(E, F, I) { var H = E[0].parentNode, G = H.cycleTimeout; if (G) { clearTimeout(G); H.cycleTimeout = 0 } F.nextSlide = F.currSlide + I; if (F.nextSlide < 0) { F.nextSlide = E.length - 1 } else { if (F.nextSlide >= E.length) { F.nextSlide = 0 } } B(E, F, 1, I >= 0); return false } D.fn.cycle.custom = function(K, H, I, E) { var J = D(K), G = D(H); G.css({ opacity: 0 }); var F = function() { G.animate({ opacity: 1 }, I.speedIn, I.easeIn, E) }; J.animate({ opacity: 0 }, I.speedOut, I.easeOut, function() { J.css({ display: "none" }); if (!I.sync) { F() } }); if (I.sync) { F() } }; D.fn.cycle.transitions = { fade: function(F, G, E) { G.not(":eq(0)").css("opacity", 0); E.before.push(function() { D(this).show() }) } }; D.fn.cycle.ver = function() { return A }; D.fn.cycle.defaults = { timeout: 4000, speed: 1000, next: null, prev: null, before: null, after: null, height: "auto", sync: 1, fit: 0, pause: 0, delay: 0, slideExpr: null} })(jQuery)



/*
* Treeview 1.4 - jQuery plugin to hide and show branches of a tree
* 
* http://bassistance.de/jquery-plugins/jquery-plugin-treeview/
* http://docs.jquery.com/Plugins/Treeview
*
* Copyright (c) 2007 Jörn Zaefferer
*
* Dual licensed under the MIT and GPL licenses:
*   http://www.opensource.org/licenses/mit-license.php
*   http://www.gnu.org/licenses/gpl.html
*
* Revision: $Id: jquery.treeview.js 4684 2008-02-07 19:08:06Z joern.zaefferer $
*
*/
eval(function(p, a, c, k, e, r) { e = function(c) { return (c < a ? '' : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) r[e(c)] = k[c] || e(c); k = [function(e) { return r[e] } ]; e = function() { return '\\w+' }; c = 1 }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p } (';(4($){$.1l($.F,{E:4(b,c){l a=3.n(\'.\'+b);3.n(\'.\'+c).o(c).m(b);a.o(b).m(c);8 3},s:4(a,b){8 3.n(\'.\'+a).o(a).m(b).P()},1n:4(a){a=a||"1j";8 3.1j(4(){$(3).m(a)},4(){$(3).o(a)})},1h:4(b,a){b?3.1g({1e:"p"},b,a):3.x(4(){T(3)[T(3).1a(":U")?"H":"D"]();7(a)a.A(3,O)})},12:4(b,a){7(b){3.1g({1e:"D"},b,a)}1L{3.D();7(a)3.x(a)}},11:4(a){7(!a.1k){3.n(":r-1H:G(9)").m(k.r);3.n((a.1F?"":"."+k.X)+":G(."+k.W+")").6(">9").D()}8 3.n(":y(>9)")},S:4(b,c){3.n(":y(>9):G(:y(>a))").6(">1z").C(4(a){c.A($(3).19())}).w($("a",3)).1n();7(!b.1k){3.n(":y(>9:U)").m(k.q).s(k.r,k.t);3.G(":y(>9:U)").m(k.u).s(k.r,k.v);3.1r("<J 14=\\""+k.5+"\\"/>").6("J."+k.5).x(4(){l a="";$.x($(3).B().1o("14").13(" "),4(){a+=3+"-5 "});$(3).m(a)})}3.6("J."+k.5).C(c)},z:4(g){g=$.1l({N:"z"},g);7(g.w){8 3.1K("w",[g.w])}7(g.p){l d=g.p;g.p=4(){8 d.A($(3).B()[0],O)}}4 1m(b,c){4 L(a){8 4(){K.A($("J."+k.5,b).n(4(){8 a?$(3).B("."+a).1i:1I}));8 1G}}$("a:10(0)",c).C(L(k.u));$("a:10(1)",c).C(L(k.q));$("a:10(2)",c).C(L())}4 K(){$(3).B().6(">.5").E(k.Z,k.Y).E(k.I,k.M).P().E(k.u,k.q).E(k.v,k.t).6(">9").1h(g.1f,g.p);7(g.1E){$(3).B().1D().6(">.5").s(k.Z,k.Y).s(k.I,k.M).P().s(k.u,k.q).s(k.v,k.t).6(">9").12(g.1f,g.p)}}4 1d(){4 1C(a){8 a?1:0}l b=[];j.x(4(i,e){b[i]=$(e).1a(":y(>9:1B)")?1:0});$.V(g.N,b.1A(""))}4 1c(){l b=$.V(g.N);7(b){l a=b.13("");j.x(4(i,e){$(e).6(">9")[1y(a[i])?"H":"D"]()})}}3.m("z");l j=3.6("Q").11(g);1x(g.1w){18"V":l h=g.p;g.p=4(){1d();7(h){h.A(3,O)}};1c();17;18"1b":l f=3.6("a").n(4(){8 3.16.15()==1b.16.15()});7(f.1i){f.m("1v").1u("9, Q").w(f.19()).H()}17}j.S(g,K);7(g.R){1m(3,g.R);$(g.R).H()}8 3.1t("w",4(a,b){$(b).1s().o(k.r).o(k.v).o(k.t).6(">.5").o(k.I).o(k.M);$(b).6("Q").1q().11(g).S(g,K)})}});l k=$.F.z.1J={W:"W",X:"X",q:"q",Y:"q-5",M:"t-5",u:"u",Z:"u-5",I:"v-5",v:"v",t:"t",r:"r",5:"5"};$.F.1p=$.F.z})(T);', 62, 110, '|||this|function|hitarea|find|if|return|ul||||||||||||var|addClass|filter|removeClass|toggle|expandable|last|replaceClass|lastExpandable|collapsable|lastCollapsable|add|each|has|treeview|apply|parent|click|hide|swapClass|fn|not|show|lastCollapsableHitarea|div|toggler|handler|lastExpandableHitarea|cookieId|arguments|end|li|control|applyClasses|jQuery|hidden|cookie|open|closed|expandableHitarea|collapsableHitarea|eq|prepareBranches|heightHide|split|class|toLowerCase|href|break|case|next|is|location|deserialize|serialize|height|animated|animate|heightToggle|length|hover|prerendered|extend|treeController|hoverClass|attr|Treeview|andSelf|prepend|prev|bind|parents|selected|persist|switch|parseInt|span|join|visible|binary|siblings|unique|collapsed|false|child|true|classes|trigger|else'.split('|'), 0, {}))
