var sLoadingImageURL = "images/img_loading.gif";

//var oImagePreloader = new Image();
//oImagePreloader.src = sLoadingImageURL;
	
var oLightBoxLoading = null;

function LightBoxLoading(){
		this.show = function(){
		this.oBgBox.show();
		this.oLightBox.show();
	}
	
	this.hide = function(){
		this.oBgBox.hide();
		this.oLightBox.hide();
	}
	
	this.remove = function(){
		this.oBgBox.remove();
		this.oLightBox.remove();
	}
	
	this.oBgBox = new LightBox( 'loadingBg', '' );
	this.oBgBox.maximize();
	
	if(! oImagePreloader.complete){
		return;
	}
	
	this.oLightBox = new LightBox( 'loadingImg', '<img alt="www.Metalcon.de" src="'+sLoadingImageURL+'" >' );
	this.oLightBox.resize( oImagePreloader.width, oImagePreloader.height );
	this.oLightBox.center();
}

function startLoading(){
	document.body.style.cursor="wait";
	/*
	var aoElements = document.getElementsByTagName( 'a' );
	for( var i = 0 ; i < aoElements.length ; i++ ){
		var oElement = aoElements[i];
		oElement.oldHref= oElement.href;
		oElement.oldOnclick = oElement.onclick;
		oElement.removeAttribute("href");
		oElement.removeAttribute("onclick");
	}
	
	var aoElements = document.getElementsByTagName( 'button' );
	for( var i = 0 ; i < aoElements.length ; i++ ){
		var oElement = aoElements[i];
		oElement.oldDisabled = oElement.disabled;
		oElement.disabled = true;
	}*/
	
	//oLightBoxLoading = new LightBoxLoading();
	//oLightBoxLoading.show();
}

function stopLoading(){
	document.body.style.cursor="auto";
	/*
	var aoElements = document.getElementsByTagName( 'a' );
	for( var i = 0 ; i < aoElements.length ; i++ ){
		var oElement = aoElements[i];
		if(oElement.oldHref)
			oElement.href = oElement.oldHref;
		if(oElement.oldOnclick)
			oElement.onclick = oElement.oldOnclick;
	}
	
	var aoElements = document.getElementsByTagName( 'button' );
	for( var i = 0 ; i < aoElements.length ; i++ ){
		var oElement = aoElements[i];
		oElement.disabled = oElement.oldDisabled;
	}*/
	
	//oLightBoxLoading.remove();
}