$(document).ready(function(){
	
	
  /***** ROUNDS SHOW/HIDE ****/
	$("a.fullprofile").click(function () {
  	
  	coverThePage();
  	
  	var fullBio = '../layers/' + $(this).parent('div').attr('id') + '.html';
		
		$("#layer-over").load(fullBio, function() {
		  $.getScript('../js/layers.js');
    });
  	
		return false;
  		
  });
	/***********************/
	
	
	/***** CLOSE LAYERS ****/
	$("a.cancel, a.close").click(function () {
  	
  	$("#layer-over").remove();
  	
    $("#coverpage").fadeTo("medium", 0.00, function() {
    	var cssObj = {
    	  "z-index": "0",
    	  "height": "0px"
    	}
    	$("#coverpage").css(cssObj);
    	$('#coverpage').remove();
    });
    
    return false;
    
  });
  /***********************/
	
	
	/***** COVER PAGE ****/
  function coverThePage() {
  	
  	$('<div id="coverpage"></div>').appendTo('body');
  	$('<div id="layer-over"></div>').appendTo('body');
  	
  	var cssObj = {
      "z-index": "1000"
    }
  	
  	$("#coverpage").css(cssObj);
  	$("#coverpage").fadeTo("fast", 0.60);
  	
  	var getFooterTop = $("#footer").position();
  	var setCoverHeight = getFooterTop.top + $("#footer").height();
  	
  	if (setCoverHeight < $('body').height()) {
  		setCoverHeight = $('body').height() + 100 + 'px';
  		$("#coverpage").height(setCoverHeight);
  	} else{
  		$("#coverpage").height($('body').height());
  	}
  }
  /***********************/
  
  
});
