<!-- Splash -->

$(document).ready(function(){
		var windowHeight = document.documentElement.clientHeight;
		var windowWidth = document.documentElement.clientWidth; 
		var splashHeight = windowHeight - 70;
		
		var contentNativeWidth = 1520;
		var contentNativeHeight = 854;
		
		var aspMultiplierHeight = splashHeight/contentNativeHeight;
		var aspMultiplierWidth = windowWidth/contentNativeWidth;
		
		var frameRatio = windowWidth/splashHeight;
		var nativeRatio = contentNativeWidth/contentNativeHeight
		
		var contentPreWidth = contentNativeWidth * aspMultiplierHeight;
		var contentPreHeight = contentNativeHeight * aspMultiplierWidth;
		
		
		
		if(frameRatio >= nativeRatio){
			var backgroundWidth = windowWidth ;
			var backgroundPositionX = 0 ;
			var backgroundPositionY = splashHeight - contentPreHeight;		
		}
		else if (frameRatio < nativeRatio){
			var backgroundWidth = contentPreWidth ;
			var backgroundPositionX = 0 ;
			var backgroundPositionY = 0 ;	
		}		
		
		
		$("#splash").css({
			"width": windowWidth +"px",
			"height": splashHeight +"px",
			"background-position-x" : backgroundPositionX + "px" ,
			"background-position-y" : backgroundPositionY + "px" ,
			"background-size" : backgroundWidth + "px" ,
			});
		$("#splash-icon").css({
			"left" : windowWidth - 420 + "px"
			});	
		$("#splash-info").css({
			"left" : windowWidth - 420 + "px",
			"top" : splashHeight - 50 + "px"
			});	
	})

$(window).resize(function(){
		var windowHeight = document.documentElement.clientHeight;
		var windowWidth = document.documentElement.clientWidth; 
		var splashHeight = windowHeight - 70;
		
		var contentNativeWidth = 1520;
		var contentNativeHeight = 854;
		
		var aspMultiplierHeight = splashHeight/contentNativeHeight;
		var aspMultiplierWidth = windowWidth/contentNativeWidth;
		
		var frameRatio = windowWidth/splashHeight;
		var nativeRatio = contentNativeWidth/contentNativeHeight
		
		var contentPreWidth = contentNativeWidth * aspMultiplierHeight;
		var contentPreHeight = contentNativeHeight * aspMultiplierWidth;
		
		
		
		if(frameRatio >= nativeRatio){
			var backgroundWidth = windowWidth ;
			var backgroundPositionX = 0 ;
			var backgroundPositionY = splashHeight - contentPreHeight - ((splashHeight - contentPreHeight)/70);		
		}
		else if (frameRatio < nativeRatio){
			var backgroundWidth = contentPreWidth ;
			var backgroundPositionX = 0 ;
			var backgroundPositionY = 0 ;	
		}		
		
		
		$("#splash").css({
			"width": windowWidth +"px",
			"height": splashHeight +"px",
			"background-position-x" : backgroundPositionX + "px" ,
			"background-position-y" : backgroundPositionY + "px" ,
			"background-size" : backgroundWidth + "px" ,
			});
		$("#splash-icon").css({
			"left" : windowWidth - 420 + "px"			
			});	
		$("#splash-info").css({
			"left" : windowWidth - 420 + "px",
			"top" : splashHeight - 50 + "px"
			});	
	})
	
$(function(){ 
		$("#splash").click(function(){
			$("#splash").css('display', 'none')
		});
		 
})
  

				

