/*
$(document).ready(function(){
    $("ul.accordion").accordion({ 
        autoHeight: false ,
        collapsible: true ,
        header: 'a.panelHead' ,
        active: '.selected'
        //active: 1
    });

    var immedParent = $('#menu li a.selected').closest("ul");
    immedParent.show();
    immedParent.closest("ul").parent().parent().show();
});
*/

$("html").addClass("js");
$(function() {
    $("#rn1List").accordion({
//        obj: "ul",
//        objID: "menu",
//        wrapper :'li', // the common parent of 'a.trigger' and 'o.next' - 'li', 'div'
//        el : 'li', // the parent of 'a.trigger' - 'li', '.h'
//        head: "a.panelHead", 
        //next: "ul",
        initShow : "a.selected",
        //activeLink : true,
        collapsible: false
    });
  /*
  $("#main").accordion({
      objID: "#acc1", 
      el: ".h", 
      head: "h4, h5", 
      next: "div", 
      initShow : "h4 + div.outer:eq(0) div.outer:eq(0)"
  });
  */
  $("html").removeClass("js");

});

//http://atlantajones.com/software/easy-reusable-image-rollovers-with-jquery/
$(function() {
    var img = $('[id$="imgMyAccount2"]');

    // Preload all rollovers
	$(img).each(function() {
		// Set the original src
		rollsrc = $(this).attr("src");
		rollON = rollsrc.replace(/.png$/ig,"-over.png");
		$("<img>").attr("src", rollON);
	});

    // Navigation rollovers
	$(img).mouseover(function(){
		imgsrc = $(this).attr("src");
		//imgsrc = $(this).children("img").attr("src");
		matches = imgsrc.match(/-over/);
		
		// don't do the rollover if state is already ON
		if (!matches) {
		    imgsrcON = imgsrc.replace(/.png$/ig,"-over.png"); // strip off extension
		    $(this).attr("src", imgsrcON);
		    //$(this).children("img").attr("src", imgsrcON);
        }
	});
	$(img).mouseout(function(){
		$(this).attr("src", imgsrc);
		//$(this).children("img").attr("src", imgsrc);
	});
});  
