
var cPage = function() {

	this.init = function() {
		
	};
	
	this.block = function() {
		$('#systemWorking').fadeIn();
	};
	this.unblock = function() {
		$('#systemWorking').fadeOut();
	};
	this.throbber = function(id) {
		$(id).html('<center style="padding-top: 50px;"><img src="' + ROOT + 'themes/images/cms/throbber.gif"/></center>');
	}

};
var PAGE = new cPage();

$(function(){
	PAGE.init();
	
	$('a[rel=facebox]').bind('click', function(){
		url = $(this).attr('href');
		$.post(url, null, function(data, textStatus) {
			_body = $(data).find('#text_box').html();
			$.facebox(_body);
		});
		return false;
	}); 
	$('a[rel=facebox-image]').bind('click', function(){
		var url = $(this).attr('href');
		$.facebox(function() {
			data = '<img src="' + url + '"/>';
			$.facebox('<div style="width:600px;"><center>' + data +'</center></div>');
		});
		return false;
			
	}); 

	$('a[rel^=facebox-int]').bind('click', function(){
		url = $(this).attr('href');
		_rel = $(this).attr('rel');
		$.post(url, null, function(data, textStatus) {
			_body = $(data).find('#content').html();
			$.facebox('<div style="height: auto; overflow-y:auto;">' + _body +'</div>');
		});
		return false;
	});
	
	
/*	$('a[rel^=facebox-ext]').bind('click', function(){
		url = $(this).attr('href');
		_rel = $(this).attr('rel');
		tmp = _rel.split('-');
		if (typeof tmp[2] != 'undefined' && typeof tmp[3] != 'undefined') {
			$.facebox('<iframe frameborder="0" src="' + url + '" width="' + tmp[2] + '" height="' + tmp[3] + '"> </iframe>');
		} else {
			$.facebox('<iframe frameborder="0" src="' + url + '" width="100%" height="100%"> </iframe>');
		}
		return false;
	});*/
});