home_slide = {
		a:null,
		n:null,
		o:null,
		t:null,
		next:function(){
			home_slide.a = home_slide.o.filter('.active');
			if (home_slide.a.length == 0 ){ home_slide.a = home_slide.o.filter(':last'); }
			home_slide.n =  home_slide.a.next().length ? home_slide.a.next() : home_slide.o.filter(':first');
			home_slide.a.addClass('last-active')
			home_slide.n.css({opacity: 0.0}).addClass('active').animate({opacity:1}, 500, function() { home_slide.a.removeClass('active last-active'); });
		},
		start:function(){
			var $o = $("#side_ads > ul li");
			home_slide.o = $o;
			$("#side_ads").hover(function(){ window.clearInterval(home_slide.t); },function(){ home_slide.t = window.setInterval("home_slide.next()", 3000 ); });
			home_slide.t = window.setInterval("home_slide.next()", 3000 );
		}
	};



$(function() {
 	$("body").addClass("js")
	
	if ($.browser.msie && $.browser.version < 7) {
		$("img[src='.png']").ifixpng();
		$("#banner").ifixpng();
	}
	
	
	home_slide.start();
	
	var logos_pos = 0, $logos;
	function logos_next(){
		window.setTimeout(function(){
			$logos.eq( logos_pos++ ).fadeOut(500, function(){
				if(logos_pos == $logos.length){ logos_pos = 0; }
				$logos.eq( logos_pos ).fadeIn(500, logos_next )
			})
		},2000);
	};
	$logos = $("#logos img");
	$logos.eq(logos_pos).fadeIn(500, logos_next );
	
	/*$("#navigation li").each(function() {
		if($(this).children("ul").length>0){
			$submenu = $(this).children("ul").eq(0)
			$clone = $(this).clone();
			$clone.prependTo($submenu).children("ul").eq(0).remove();
			$("<strong></strong>").appendTo($clone);
			$clone.children("a").appendTo($clone.children("strong").eq(0))
		}
	});*/
	
	$("#navigation > ul").superfish({delay: 500, speed: 'fast', dropShadows: false });
	
	$("a[title^='New Window: ']").each(function(){
		var newtitle = String($(this).attr('title')).substring(String("New Window: ").length);
		$(this).attr('title',newtitle);
		$(this).click(function(){ var newwin = window.open($(this).attr('href'),'newbinkcentralwin'); newwin.focus(); return false; });
	});
	
 });
