//bg image resize function
function imgSrv(){
	//get window width and height
	var windowWidth = 0, windowHeight = 0;
	if(typeof(window.innerWidth) == 'number'){
		windowWidth = window.innerWidth;
		windowHeight = window.innerHeight;
	}else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)){
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	}else if(document.body && (document.body.clientWidth || document.body.clientHeight)){
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}
	
	//set bg image dimensions
	document.getElementById('bg').style.width = windowWidth + 'px';
	document.getElementById('bg').style.height = windowHeight + 'px';
	
	/*
	//background image dimensions
	var bgWidth = 1920;
	var bgHeight = 1080;
	//background image ratio
	var heightRatio = (bgHeight / windowHeight);
	var widthRatio = (bgWidth / windowWidth);
	
	//adjust background image based on screen resolution (maintain aspect ratio)
	//id = bgHolder
	if(heightRatio > widthRatio){
		//calculate
		document.getElementById('bg').style.width = '100%';
		document.getElementById('bg').style.height = 'auto';
	}else{
		document.getElementById('bg').style.width = 'auto';
		document.getElementById('bg').style.height = '100%';
	}
	*/
}

//call function on load
window.onload = function(){
	imgSrv();
}
//call function on resize
window.onresize = function(){
	imgSrv();
}
