$(document).ready(function()
{
	$('#bannerCntr').cycle({ 
        //fx:     'scrollHorz',
        fx:     'scrollVert', 
        speed:   1000, 
        timeout: 6000, 
        pager:  '#bannerNav', 
        easeIn:	'easeOutSine',
        easeOut:'easeOutSine',
        before: function() {  
            $('#caption').html(this.alt); 
        } 
    }); 
	
	$("div.menuBox").mouseenter(function() {
		$("#menuBoxSub").stop(true,true).delay(10).slideDown(250,'easeOutSine',function() {});
	}).mouseleave(function() {
		$("#menuBoxSub").slideUp(150,'easeInSine');
	});

	/* Menu light-up */
	$("#menuBoxSub li a").hover(function () {
		$(this).stop(true,true).animate({ backgroundColor: "#714c9f" }, 150);
  	}, function () {
  		$(this).animate({ backgroundColor: "#1d1d1d" }, 40);
	});
	
});

$(function() {
	$('.more').live("click",function(){
		var ID = $(this).attr("id");
		if(ID){
			$("#more"+ID).html('<img src="images/newsMoreAjax.jpg" />');
			$.ajax({
				type: "POST",
				url: "ajaxNews.php",
				data: "limit="+ ID, 
				cache: false,
				success: function(html){
					$("#newsCntr").replaceWith(html);
					$("#more"+ID).remove();
					Cufon.refresh();
				}
			});
		}else{
			$(".morebox").html('The End');
		}
	return false;
	});
});

$(function() {
	$('.filter').change(function(){
		var ID = $(this).attr("id");
		if(ID){
			$('#gamesFilterResults').html('<img src="images/loading.gif" />');
			$.ajax({
				type: "POST",
				url: "ajaxGames.php",
				data: "uncheck="+ ID, 
				cache: false,
				success: function(html){
					$("#gamesFilterResults").replaceWith(html);
				}
			});
		}
	});
});

$(function() {
	$('.filterHome').change(function(){
		var ID = $(this).attr("id");
		if(ID){
			$('.gamesAjax').html('<br/><br/><br/><center><img src="images/loading.gif" /></center>');
			$.ajax({
				type: "POST",
				url: "ajaxGamesHome.php",
				data: "uncheck="+ ID, 
				cache: false,
				success: function(html){
					$(".gamesAjax").replaceWith(html);
					var api = $('.gamesAjax').jScrollPane(
						{
							showArrows:false,
							maintainPosition: false
						}
					).data('jsp');
					api.reinitialise();
				}
			});
		}
	});
});

jQuery(document).ready(function(){
	$('#gamesCntr h3').click(function() {
		if($(this).find("span.expand").css('display') == 'none'){
			var obj = $(this);
			$(this).find("span.close").fadeOut('slow',function(){
				obj.find("span.expand").fadeIn('slow',function(){});
			});
		}else{
			var obj = $(this);
			$(this).find("span.expand").fadeOut('slow',function(){
				obj.find("span.close").fadeIn('slow',function(){});
			});
		}
		
		$(this).next().slideToggle("slow",function(){
			
		});
		return false;
	});
});
jQuery(document).ready(function(){
	$('#gameDetails h3').click(function() {
		if($(this).find("span.expand").css('display') == 'none'){
			var obj = $(this);
			$(this).find("span.close").fadeOut('slow',function(){
				obj.find("span.expand").fadeIn('slow',function(){});
			});
		}else{
			var obj = $(this);
			$(this).find("span.expand").fadeOut('slow',function(){
				obj.find("span.close").fadeIn('slow',function(){});
			});
		}
		
		$(this).next().slideToggle("slow",function(){
			
		});
		return false;
	});
});

jQuery(document).ready(function(){
	$('#investHarmon h3').click(function() {
		if($(this).find("span.expand").css('display') == 'none'){
			var obj = $(this);
			$(this).find("span.close").fadeOut('slow',function(){
				obj.find("span.expand").fadeIn('slow',function(){});
			});
		}else{
			var obj = $(this);
			$(this).find("span.expand").fadeOut('slow',function(){
				obj.find("span.close").fadeIn('slow',function(){});
			});
		}
		
		$(this).next().slideToggle("slow",function(){
			
		});
		return false;
	});
});
$(document).ready(function(){
	$(".lightbox").colorbox({transition:"fade",photo:true,maxWidth:"800px"});
});

$(function()
{
	if($('.gamesAjax')[0]){
		var api = $('.gamesAjax').jScrollPane(
			{
				showArrows:false,
				maintainPosition: false
			}
		).data('jsp');
	}
});
$(function() {
	$('#gameFinder input').ezMark();
	$('#gamesCntr input').ezMark({checkboxCls: 'ez-checkbox-green', checkedCls: 'ez-checked-green'});
});	

