﻿jQuery(document).ready(function() {

var list_odd = {
	'background-color' : '#E1E9FF'
}
var list_even = {
	'background-color' : '#F4F8FF'
}

var searchForm = jQuery("form[action*='/Search/Find.ashx']");
searchForm.append("<input type='hidden' name='__ajaxReady' value='1'>");
jQuery(".rounded").corners("4px");

jQuery(".autoSlideDown").hide();
jQuery(".autoSlideDown").slideDown("slow");
//setTimeout(function() { jQuery(".autoSlideUp").slideUp("slow"); }, 3000);
jQuery("#cl").treeview({
    animated: "fast",
    unique: true,
    persist: "cookie",
    cookieId: "/communities"
});
jQuery("#ssmnu").treeview();
jQuery(document).ready(function() {
    jQuery("#cl ul").children("li")
        .not(".collapsable")
        .not(".expandable")
        //.prepend("<span id='treeview-square'></span>");
});

jQuery(".pipeList ul").each(function () {
    jQuery(this).find("li:first").addClass("f");
});
jQuery(".pipeList ul:empty").hide();
jQuery("a:not([href])").css("color", "gray");
//Help popup
var loadHelp = function(hash) {
    var trigger = $(hash.t);
    //Set help dialog's title
    $('#jqmTitleText').text(trigger.attr('title')||'');
    //URLs are specified to open full page when called without javascript; need to recirect to fragment serving
    var url = trigger.attr('href').replace(/\/help/,'/help/fragment').replace(/#/,'/');
    //Call help and insert into dialog
    $(hash.c.target||'#explainContent').load(url);
    hash.w.show();
};
var closeHelp = function(hash) {
    $(hash.o).fadeOut('250', function() { hash.o.remove(); });
    $(hash.w).fadeOut('250');
};
$('#explainWindow').jqm({trigger:'.explain', modal:true, onShow: loadHelp, onHide: closeHelp }); 
});