(function($)
{
	$.dequeue = function( a , b ){
		return $(a).dequeue(b);
	};
})( jQuery ); 
$(document).ready(function(){
		//accordion stuff
		$("#container .block .accContent:gt(0)").hide();				
		$('<img src="/webtop/modules/_repository/ftpUploads/imgs/arrowD.gif" class="arrow" alt="" />').insertAfter('h1 a');
		$('.arrow:eq(0)').attr('src','/webtop/modules/_repository/ftpUploads/imgs/arrowU.gif');
		$(".arrow:eq(0)").addClass('active');
		$('h1 a:eq(0)').toggleClass("active");
		$("h1 a").click(function()
		{
			if($(this).is(".active"))
			{
				$(this).toggleClass("active");
				$('.arrow.active').attr('src','/webtop/modules/_repository/ftpUploads/imgs/arrowD.gif'); // change the image src of the current ACTIVE image to have an INACTIVE state.
				$(this).parent().next(".accContent").slideToggle();
				return false;
			} else {
				$(".accContent:visible").slideUp("slow");					
				$("a.active").removeClass("active");  // remove the class active from all h1's with the class of .active
				$(this).toggleClass("active");
				$('.arrow.active').attr('src','/webtop/modules/_repository/ftpUploads/imgs/arrowD.gif'); // change the image src of the current ACTIVE image to have an INACTIVE state.
				$(".arrow").addClass('active');
				$(this).siblings('.arrow.active').attr('src','/webtop/modules/_repository/ftpUploads/imgs/arrowU.gif'); // change the image src of the new active image to have an active state.
				$(this).parent().next(".accContent").slideToggle();
				return false;
			}
		});
		//window stuff
		$('#windowOpen').bind(
			'click',
			function() {
				if($('#window').css('display') == 'none')
				{
					$(this).TransferTo(
						{
							to:'window',
							className:'transferer2', 
							duration: 400,
							complete: function()
							{
								$('#window').show();
							}
						}
					);
				}
				this.blur();
				return false;
			}
		);
		$('#windowClose').bind(
			'click',
			function()
			{
				$('#window').TransferTo(
					{
						to:'windowOpen',
						className:'transferer2', 
						duration: 400
					}
				).hide();
			}
		);
		
		
	}	
);

