function UIFullscreenBackground(src, loading_img, o_ratio, fixed) {
	
	this.ratio = Number(o_ratio.height)/Number(o_ratio.width);
	this.fixed = (fixed) ? fixed : false;
	
	this.c = document.createElement('div');
	var s = this.c.style;
	s.width = "100%";
	s.height = "100%";
	s.position = "fixed";
	s.top = "0px";
	s.left = "0px";
	s.overflow = "hidden";
	s.zIndex = "0";
	s.background = "url('"+loading_img+"') center no-repeat";
	
	this.img = document.createElement('img');
	this.img.src = src;
	
	this.c.appendChild(this.img);
	document.body.style.margin = "0px";
	document.body.insertBefore(this.c,document.body.firstChild);
	
	this.resize();
	
	return this;
}
UIFullscreenBackground.prototype = {
	resize : function(){
		var img = this.img;
		var cont = this.c.style;
		var ratio = this.ratio;
		var de = document.documentElement;
		
		var browserwidth	= window.innerWidth || (de && de.clientWidth);
		var browserheight	= window.innerHeight || (de && de.clientHeight);
		var documentheight	= document.height || document.body.clientHeight;
		var documentwidth	= document.width || document.body.clientWidth;
		var resizewidth 	= 0;
		var resizeheight	= 0;
		
		if(documentwidth > browserwidth && this.fixed == false){
			resizewidth = documentwidth;
		} else {
			resizewidth = browserwidth;
		}
		if(documentheight > browserheight && this.fixed == false){
			resizeheight = documentheight;
		} else {
			resizeheight = browserheight;
		}
		if((resizeheight/resizewidth) > ratio){
			img.height = resizeheight;
			img.width = (resizeheight / ratio);
		} else {
			img.width = resizewidth;
			img.height = (resizewidth * ratio);
		}
	}	
}