window.jQuery = window.$ = jQuery;

jQuery(document).ready(function() {

$(".collapsible-header").click(function() {
	if ($(this).find(".ico").html() == "+") { 
		$(this).find(".ico").html("-") 
	} else  { $(this).find(".ico").html("+") }
	$(this).next(".collapsible-content").toggle(0);
  });

//$("#accordion").accordion();
$(".accordionx").accordion( {header:'h3'} ); 

$('.scroll-pane').jScrollPane({ showArrows: true, horizontalGutter: 10 });

$(".xtab_content").hide();
$("xul.tabsx li:first").addClass("active").show();
$(".xtab_content:first").show();
$("xul.tabsx li").click(function() {
	$("ul.tabsx li").removeClass("active");
	$(this).addClass("active");
	$(".tab_content").hide();
	at = $(this).find("a").attr("href");
	$(at).show();
	return false;
});

$(".tab_content").hide();
$("ul.tabsx li:first-child").addClass("active").show();
$(".tab_container .tab_content:first-child").show();
$("ul.tabsx li").click(function() {
	$(this).parent().find("li").removeClass("active");
	$(this).addClass("active");
	$(this).parent().parent().find(".tab_content").hide();
	at = $(this).find("a").attr("href");
	$(at).show();
	return false;
});
$("a.vc").each(function() { $(this).css('cursor', 'pointer'); } );
$("a.vc").click(function() { 
	src = $(this).attr('src');
	code = $(this).attr('code');
	pnl = $(this).attr('pnl');
	url = "/iw/srv/chart/get?src="+escape(src)+"&code="+escape(code)+"&"+new Date().getTime();
	$(pnl).attr('src', url);
	return false;
});
$("a.dolm").each(function() { $(this).css('cursor', 'pointer'); } );
$("a.dolm").click(function() {
		var parent = $(this).parent().parent();
		var table = $("table", parent);  
		op = $(this).attr('op');
		if (op == '+') {
			$(table).find("tr:gt(10)").show();
			$(this).html("Collapse");
			$(this).attr('op', '-');
		} else {
			$(table).find("tr:gt(10)").hide();
			$(this).html("Expand");
			$(this).attr('op', '+');
		}
	});
//$(".tdolm").find("tr:gt(10)").hide();

$(".featured > ul").tabs({}).tabs("rotate", 5000, true);
$(".featured350 > ul").tabs({fx:{width:"toggle"}}).tabs("rotate", 5000, true);

});
