	
	if(path == undefined) var path = "images/background.jpg";
	
	var temp = new Image;
	temp.src = path;
	
	$(window).load(function(){
		
		var div = document.createElement('div');
		div.id = "triquiback";
		div.innerHTML = '<img id = "triquibackimg" src = "'+path+'" alt="" />';
		document.body.appendChild(div);
		
		$("#triquiback").css("left","0px");
		$("#triquiback").css("top","0px");
		$("#triquiback").css("position","fixed");
		$("#triquiback").css("overflow","hidden");
		$("#triquiback").css("zIndex","-9999");
		$("#triquibackimg").css("position","relative");
		resize_bg();
	});
	
	//$("#triquibackimg").load(function(){ resize_bg(); });
	$(window).resize(function(){ resize_bg(); });
	
	function resize_bg(){
		$("#triquibackimg").css("left","0");
		var doc_width = $(window).width();
		var doc_height = $(window).height();
		var image_width = $("#triquibackimg").width();
		var image_height = $("#triquibackimg").height();
		var image_ratio = image_width/image_height;      
		var new_width = doc_width;
		var new_height = Math.round(new_width/image_ratio);
		if(new_height<doc_height){
			new_height = doc_height;
			new_width = Math.round(new_height*image_ratio);
			var width_offset = Math.round((new_width-doc_width)/2);
			$("#triquibackimg").css("left","-"+width_offset+"px");
			$("#triquibackimg").css("top","0px");
		}else{
			var height_offset = Math.round((new_height-doc_height)/2);
			$("#triquibackimg").css("top","-"+height_offset+"px");
		}
		$("#triquibackimg").width(new_width);
		$("#triquibackimg").height(new_height);
	}
