var $j = jQuery.noConflict();


$j(document).ready(function(){
       $j("div.blueBar").each(function(i){                
	//alert($j(this).html());
              $j(this).click(function () {
		//alert($j(this).html());
                  var box = $j("~ .box", this);
		//alert($j(this.parentNode.parentNode).html());
                     if (box.attr("rel") == "open")
                     {
                           //content is visible - close it now
                           box.slideUp('fast', function() {   
				 //alert($j(".blueBar div img", this.parentNode).attr("src"));
                                  $j(".blueBar div img", this.parentNode).attr('src','/images/expressinn/open.gif');
                           });
                           box.attr("rel","close");

                     }
                     else
                     {
                           //content is hidden - open it now
                           box.slideDown('fast', function() {
				//alert($j(".blueBar", this.parentNode).html());
                                  $j(".blueBar div img", this.parentNode).attr('src','/images/expressinn/close.gif');
                           });
                           box.attr("rel","open");
                     }
              });
       });


var secid = "activities";
if(location.search.length !=0) 
{ 
    // create an array 
    var qs = location.search.substr(1).split("&"); 
    // get first parameter value 
    //alert(qs[0].split("=")[1]); 
	for (i=0; i<qs.length; i++)
	{
		a=qs[0].split("=");
		if (a[0] == "section") secid = a[1];
	}			
} 
var x = $j("#" + secid);
if (x)
{
	$j(".blueBar div img", x).attr('src','/images/expressinn/close.gif');
	var box = $j(".box", x);
        box.show();	
        box.attr("rel","open");		
}


});

