$(function() { 
//set this to either "ALL" or a number corresponding to 
//the one you want to have open at load time. 
var expandThisStart = "ALL"; 

if (expandThisStart == "ALL") { 
$(".bodyExpandCollapse:hidden").show(); 
$("div.arrow_closed") 
.addClass("arrow_open") 
.removeClass("arrow_closed"); 
} else { 
var thisUn = expandThisStart-1; 
$(".bodyExpandCollapse:visible").hide(); 
$("div.arrow_open") 
.addClass("arrow_closed") 
.removeClass("arrow_open"); 
$(".bodyExpandCollapse").eq(thisUn).show(); 
$("div.arrow_closed").eq(thisUn) 
.addClass("arrow_open") 
.removeClass("arrow_closed"); 
} 
//stripe the tables 
$("tr.detail:odd").addClass("alt"); 
$("span#expandme").click(function(e) { 
$("div.bodyExpandCollapse").show("fast"); 
$("div.arrow_closed") 
.addClass("arrow_open") 
.removeClass("arrow_closed"); 
}); 

$("span#collapseme").click(function(e) { 
$("div.bodyExpandCollapse").hide("fast"); 
$("div.arrow_open") 
.addClass("arrow_closed") 
.removeClass("arrow_open"); 
}); 
$("span#expandmeB").click(function(e) { 
$("div.bodyExpandCollapse").show("fast"); 
$("div.arrow_closed") 
.addClass("arrow_open") 
.removeClass("arrow_closed"); 
}); 

$("span#collapsemeB").click(function(e) { 
$("div.bodyExpandCollapse").hide("fast"); 
$("div.arrow_open") 
.addClass("arrow_closed") 
.removeClass("arrow_open"); 
}); 



$("#wiseBuyButt").click(function(e) { 
if ($(".boxWrap:visible")) {$(".boxWrap").hide();} 
$("div#wiseBuyBox").show(); 
}); 


$("#wavBuyButt").bind('click.wavdefault', function(e) { 
if ($(".boxWrap:visible")) {$(".boxWrap").hide();} 
$("div#wavBuyBox").show(); 
}); 
$("#wssBuyButt").bind('click.wssdefault',function(e) { 
if ($(".boxWrap:visible")) {$(".boxWrap").hide();} 
$("div#wssBuyBox").show(); 
}); 



$("#wiseBottomBuyButt").click(function(e) { 
//determine mouse x,y 
var pos = $(this).position(); 
pos.left = parseInt(pos.left); 
pos.top = parseInt(pos.top); 
var x = e.pageX - pos.left; 
var y = e.pageY - pos.top; 

//height of box 
var curh = $('div#wiseBottomBuyBox').height(); 
var yy = y - (curh-25) + "px"; 
var leftOffset = 222 + "px"; 

$('div#wiseBottomBuyBox').css("top",yy); 
$('div#wiseBottomBuyBox').css("left", leftOffset); 
$(".boxWrap").hide(); 
$("div#wiseBottomBuyBox").show(); 

}); 


$("#wavBottomBuyButt").bind('click.wavdefaultb',function(e) { 

//determine mouse x,y 
var pos = $(this).position(); 
pos.left = parseInt(pos.left); 
pos.top = parseInt(pos.top); 
var x = e.pageX - pos.left; 
var y = e.pageY - pos.top; 

//height of box 
var curh = $('div#wavBottomBuyBox').height(); 
var yy = y - (curh-25) + "px"; 
var leftOffset = 346 + "px"; 
$('div#wavBottomBuyBox').css("top",yy); 
$('div#wavBottomBuyBox').css("left", leftOffset); 
$(".boxWrap").hide(); 
$("div#wavBottomBuyBox").show(); 


}); 



$("#wssBottomBuyButt").bind('click.wssdefaultb',function(e) { 

//determine mouse x,y 
var pos = $(this).position(); 
pos.left = parseInt(pos.left); 
pos.top = parseInt(pos.top); 
var x = e.pageX - pos.left; 
var y = e.pageY - pos.top; 

//height of box 
var curh = $('div#wssBottomBuyBox').height(); 
var yy = y - (curh-25) + "px"; 
var leftOffset = 474 + "px"; 

$('div#wssBottomBuyBox').css("top",yy); 
$('div#wssBottomBuyBox').css("left", leftOffset); 
$(".boxWrap").hide(); 
$("div#wssBottomBuyBox").show(); 


}); 


$(".closer").click(function(e) { 
$(".boxWrap").hide(); 
}); 

$(".closer").hover( 
function(e) { 
if (jQuery.support.opacity) { 
$(".closer").css("background-position","0px -12px"); 
} else { 
$(".closer").css("background-image","url(http://www.webroot.com/shared/img_structure/button5_over.gif)"); 
} 
$(".closer").css("cursor","pointer"); 
}, 
function(e) { 
if (jQuery.support.opacity) { 
$(".closer").css("background-position","0px 0px"); 
} else { 
$(".closer").css("background-image","url(http://www.webroot.com/shared/img_structure/button5_out.gif)"); 
} 
$(".closer").css("cursor","pointer"); 
} 
); 
}); 
function toggleMe(id){ 
var image_id = id + "_arrow"; 
var image_pointer = document.getElementById(image_id); 
var image_class = image_pointer.className; 

if (image_class == "arrow_closed") { 
$(image_pointer) 
.removeClass("arrow_closed") 
.addClass("arrow_open"); 
} else { 
$(image_pointer) 
.removeClass("arrow_open") 
.addClass("arrow_closed"); 
} 

var foo = document.getElementById(id); 
$(foo).toggle("fast"); 
}