// this is a fix for the jQuery slide effects
// http://blog.pengoworks.com/index.cfm/2009/4/21/Fixing-jQuerys-slideDown-effect-ie-Jumpy-Animation
function slideToggle(el, bShow){
  var $el = $(el), height = $el.data("originalHeight"), visible = $el.is(":visible");
  
  // if the bShow isn't present, get the current visibility and reverse it
  if( arguments.length == 1 ) bShow = !visible;
  
  // if the current visiblilty is the same as the requested state, cancel
  if( bShow == visible ) return false;
  
  // get the original height
  if( !height ){
    // get original height
    height = $el.show().height();
    // update the height
    $el.data("originalHeight", height);
    // if the element was hidden, hide it again
    if( !visible ) $el.hide().css({height: 0});
  }

  // expand the knowledge (instead of slideDown/Up, use custom animation which applies fix)
  if( bShow ){
    $el.show().animate({height: height}, {duration: 250});
  } else {
    $el.animate({height: 0}, {duration: 250, complete:function (){
        $el.hide();
      }
    });
  }
}

function showScreenshot( element )
	{
		window.open(
			element,
			'Revolt Race Screenshot',
			'width=640,height=480,scrollbars=yes,toolbar=no,location=no'
		);
		return false;
	}

this.showAwards = function(){	
	/* CONFIG */		
		xOffset = 250;
		yOffset = 20;		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		
	/* END CONFIG */		
	$(".showAwards").hover(function(e){											  
		$("#awardsExplanation")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");		
    },
	function(){
		$("#awardsExplanation").fadeOut("fast");	
    });	
	$(".showAwards").mousemove(function(e){
		$("#awardsExplanation")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};

this.showRememberMeInfo = function(){	
	/* CONFIG */		
		xOffset2 = 20;
		yOffset2 = 20;		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		
	/* END CONFIG */		
	$("#rememberMe").hover(function(e){											  
		$("#rememberMeInfo")
			.css("top",(e.pageY - xOffset2) + "px")
			.css("left",(e.pageX + yOffset2) + "px")
			.fadeIn("fast");		
    },
	function(){
		$("#rememberMeInfo").fadeOut("fast");	
    });	
	$("#rememberMe").mousemove(function(e){
		$("#rememberMeInfo")
			.css("top",(e.pageY - xOffset2) + "px")
			.css("left",(e.pageX + yOffset2) + "px");
	});			
};