var height, width;

function maintainSize( minWidth, minHeight, div ) {
    if ( window.innerHeight ){
        height = parseInt(window.innerHeight);
        width = parseInt(window.innerWidth);			                
    }else {
        height = parseInt(document.body.offsetHeight);
        width = parseInt(document.body.offsetWidth);			                    
    }			
    height = ( height >  minHeight ) ? '100%' : minHeight + 'px';
    width = ( width >  minWidth ) ? '100%' : minWidth + 'px';
    var flash = document.getElementById( div );
    
    flash.style.height= height;
    flash.style.width = width;
}




function esrb(){
document.getElementById("esrbLink").onclick = function(){
    return false;
};
}

function removeBlock(){
document.getElementById("esrbLink").onclick = function(){return true;};
document.getElementById("esrbLink").style.cursor = "Pointer";
document.getElementById("esrbLink").style.backgroundColor = "Transparent";
}

$(document).ready(function(){



var legalVisible = true;
if($("#toggleLegal").get(0)){
	//$("#footer").hide();
}
$("#toggleLegal a.show").click(function(){
	if(legalVisible){
	legalVisible = false;
	$("#footer").slideUp(200);
	$(this).find("img").attr("src", "images/btn_viewlegal.jpg");
	}else{
	legalVisible = true;
	$("#footer").show();
	$(this).find("img").attr("src", "images/btn_hidelegal.jpg");
	}
	
});


//addOnLoadEvent(esrb);


});

function enterSite(){
  $("#footer a.agegate").css("display", "block");
}

function openNewWindow (pageToLoad, width, height) {
    xposition = 0;
    yposition = 0;
		width = width + 20;
    if (parseInt(navigator.appVersion) >= 4) {
			xposition = (screen.width - width) / 2;
			yposition = (screen.height - height) / 2;
    }
    if (openNewWindow.arguments[3]) {
			scrollbarSetting = openNewWindow.arguments[3];
		} else {
			scrollbarSetting = '1';
		}
    args = "width=" + width + "," 
    + "height=" + height + "," 
    + "location=0," 
    + "menubar=0,"
    + "resizable=0,"
    + "scrollbars=" + scrollbarSetting + ","
    + "status=0," 
    + "titlebar=0,"
    + "toolbar=0,"
    + "hotkeys=0,"
    + "screenx=" + xposition + ","  //NN Only
    + "screeny=" + yposition + ","  //NN Only
    + "left=" + xposition + ","     //IE Only
    + "top=" + yposition;           //IE Only
    
    var winNameRandom = "popWin" + Math.round(Math.random()*1000);
    window.open(pageToLoad, winNameRandom, args);
}