//deployment variables

var deploymode = 0; //0:halubuntu, 1:sweetclarity/dev , 2 localhost/sweet

var applicationurl_divert;
var urlsegment_mode;
var urlsegment_publicationid;
var ajaxurl;
var applicationurl;


function init_deploymode() {

	switch (deploymode) {
		case 0:
			// halubuntu development environment
			applicationurl_divert = '';
			urlsegment_mode = 2;
			urlsegment_publicationid = 3;				
			break;
		case 1:
			// deploy to /dev on sweetclarity
			applicationurl_divert = '/dev';
			urlsegment_mode = 3;
			urlsegment_publicationid = 4;		
			break;
		case 2: 
			applicationurl_divert = '/sweet';
			urlsegment_mode = 3;
			urlsegment_publicationid = 4;		
			break;		
	}	
	
	ajaxurl = jQuery.url.attr('protocol') + '://' + jQuery.url.attr('host') + applicationurl_divert + '/index.php/';
	applicationurl = jQuery.url.attr('protocol') + '://' + jQuery.url.attr('host') + applicationurl_divert + '/system/application/';
}

function init_heights(element1, element2, minheight) {
	
	// this function balances the height of two elements and a minimum height
	// used for assuring an esthetic admin layout of navigation and work area

	element1h = $(element1).outerHeight({margin: true});
	element2h = $(element2).outerHeight({margin: true});
	height = Math.max(element1h, minheight);

	$(element1).css("height", height + "px");				
	
	if (element2h < height) {
		$(element2).css("height", height + "px");		
	}
}

function get_ajaxurl() {

	return ajaxurl;
}

function get_applicationurl() {
	
	return applicationurl;
	
}
