$(document).ready(
            function () {
				if($("#aspnetForm").action == "")
				{
					$("#aspnetForm").action = "/default.aspx";
				}
			
                $(".tablesorter")
                    .collapsible("td.collapsible", {  collapse: true })
                    .tablesorter({ sortList: [[1, 0]], headers: { 7: { sorter: false} }, widgets: ['zebra'], onRenderHeader: function () {this.wrapInner("<span><\/span>");}, debug: false});
				
				$("ul#CMSListMenu1 li").each(function(index) {
					$(this).addClass("icon");
					if($(this).text().substring(0,3) == "Ame")  { $(this).addClass("iconAmex");}
					if($(this).text().substring(0,3) == "ANZ")  { $(this).addClass("iconANZ");}
					if($(this).text().substring(0,3) == "Aus")  { $(this).addClass("iconAussie");}
					if($(this).text().substring(0,9) == "Bank of M")  { $(this).addClass("iconBoM");}
					if($(this).text().substring(0,9) == "Bank of Q")  { $(this).addClass("iconBoQ");}
					if($(this).text().substring(0,5) == "Bankw")  { $(this).addClass("iconBankwest");}
					if($(this).text().substring(0,5) == "BankS")  { $(this).addClass("iconBankSA");}
					if($(this).text().substring(0,3) == "Ben")  { $(this).addClass("iconBendigo");}
					if($(this).text().substring(0,3) == "Cit")  { $(this).addClass("iconCiti");}
					if($(this).text().substring(0,3) == "Com")  { $(this).addClass("iconCBA");}
					if($(this).text().substring(0,3) == "Col")  { $(this).addClass("iconColes");}
					if($(this).text().substring(0,3) == "CUA")  { $(this).addClass("iconCUA");}
					if($(this).text().substring(0,3) == "Ear")  { $(this).addClass("iconEarth");}
					if($(this).text().substring(0,3) == "GE ")  { $(this).addClass("iconGE");}
					if($(this).text().substring(0,3) == "HSB")  { $(this).addClass("iconHSBC");}
					if($(this).text().substring(0,3) == "IMB")  { $(this).addClass("iconIMB");}
					if($(this).text().substring(0,3) == "Jet")  { $(this).addClass("iconJetstar");}
					if($(this).text().substring(0,3) == "Mac")  { $(this).addClass("iconMacquarie");}
					if($(this).text().substring(0,3) == "Mem")  { $(this).addClass("iconME");}
					if($(this).text().substring(0,3) == "NAB")  { $(this).addClass("iconNAB");}
					if($(this).text().substring(0,3) == "St.")  { $(this).addClass("iconStGeorge");}
					if($(this).text().substring(0,3) == "Sun")  { $(this).addClass("iconSuncorp");}
					if($(this).text().substring(0,3) == "Wes")  { $(this).addClass("iconWestpac");}
					if($(this).text().substring(0,3) == "Vir")  { $(this).addClass("iconVirgin");}
					});
				


				

				$('tr.parent td.clickable-tab')
					.css("cursor", "pointer")
					.click(function () {
						//$(this).parent().siblings('.child-' + $(this).parent().attr('id')).toggle();
						$(this).siblings('td').css('border-bottom-color', '#0079c2');
						$(this).siblings('td').css('background-color', '#fff');
						$(this).css('border-bottom-color', '#eee');
						$(this).css('background-color', '#eee');
						$(this).siblings('td:not(this)').css('border-bottom-color', '#0079c2');
						$(this).siblings('td:not(this)').css('background-color', '#fff');
						
						if ($(this).parent().siblings('.child-' + $(this).parent().attr('id')).children('td').children('div:visible').attr('class') != $(this).attr('name')) 
						{
							$(this).parent().siblings('.child-' + $(this).parent().attr('id')).show();
							
						}
						else
						{
							$(this).parent().siblings('.child-' + $(this).parent().attr('id')).hide();
							$(this).css('border-bottom-color', '#0079c2');
							$(this).css('background-color', '#fff');
						}

						$(this).parent().siblings('.child-' + $(this).parent().attr('id'))
							.children('td')
							.children('div')
							.hide();

						$(this).parent().siblings('.child-' + $(this).parent().attr('id'))
							.children('td')
							.children('div.' + $(this).attr('name'))
							.show();
							
					
					});
					

					/*
				$('tr.parent')
				.css("cursor", "pointer")
				.click(function () {
						$(this).siblings('.child-' + this.id).toggle();
						($("#centreContainer").height() + 50 > $("#leftContainer").height() + 20) ? $("#outerContainer").height($("#centreContainer").height() + 50) : $("#outerContainer").height($("#leftContainer").height()+ 20);
					});					
*/
				
					
				$('tr.expand-child').hide();
			});
			
			
			
$(this).load(function() {
				($("#centreContainer").height() + 50 > $("#leftContainer").height() + 20) ? $("#outerContainer").height($("#centreContainer").height() + 50) : $("#outerContainer").height($("#leftContainer").height()+ 20);
});			
