ecommerce.ajaxmask = {
	show: function(title,withloader) {
		
		withloader = ( typeof(withloader) != 'undefined' ) ? withloader : true;
		
		var bgmask = $('cssid_mask');
		var zbody  = bgmask.up('body');
		
		bgmask.setStyle( { width: document.viewport.getWidth()+'px', height: Math.max(document.viewport.getHeight(),zbody.getHeight()+90)+'px' } );
		
		if (withloader==true) {
			ecommerce.ajaxmask.showLoader(title);
		}
		bgmask.show();
	},
	
	showLoader: function(title) {
		var bgmask = $('cssid_mask');
		var zdiv   = bgmask.next('div.cssclass_active');
		if (title!=null) zdiv.down('div.cssclass_message').update(title);
		zdiv.setStyle( { top: document.viewport.getScrollOffsets().top+document.viewport.getHeight()/2-Math.max(zdiv.getHeight(),35)/2+'px', left: document.viewport.getScrollOffsets().left+document.viewport.getWidth()/2-Math.max(zdiv.getWidth(),168)/2+'px' } );
		zdiv.show();
	},
	
	hideLoader: function() {
		var bgmask = $('cssid_mask');
		var zdiv   = bgmask.next('div.cssclass_active');
		zdiv.down('div.cssclass_message').update('');
		zdiv.hide();
	},
	
	hide: function() {
		var bgmask = $('cssid_mask');
		ecommerce.ajaxmask.hideLoader();
		bgmask.hide();
	}
} ;