/* Global variables */

/* - News */
var SalaStampaBaseUrl = '/ApiNews.asp?url=http://apinews.services.ecubecenter.it/Api.svc/';
var CentroStudiBaseUrl = '/ApiNews.asp?url=http://apinews.services.ecubecenter.it/Api.svc/';
var SettoriOperativiBaseUrl = '/ApiNews.asp?url=http://apinews.services.ecubecenter.it/Api.svc/';

/* - Cogito */
var RicercaAssociatiUrl = '/ApiCogito.asp?url=http://apicogito.services.ecubecenter.it/Api.svc/';

/* Common methods */

/* START EMPTY MESSAGE */
function GetEmptyMessage() {
	return '<p style="text-align:center;font-size:small;">NESSUNA NEWS TROVATA</p>';
}
/* END EMPTY MESSAGE */

/* START LOADING */
function GetLoadingDiv(text) {

	var divLoading = '<div id="loading" class="imageLoader"><p>' + text + '</p></div>';
	return divLoading;
}

function ShowLoading() {
	$("#loading").show();
}

function HideLoading() {
	$("#loading").hide();
}
/* END LOADING */

/* START PAGINATION */
function ShowPagination(container) {

	$(document).ready(function(){
		$(container).pajinate({
			num_page_links_to_display : 10,
			items_per_page : 10,
			nav_label_first : "|<",
			nav_label_prev : "<",
			nav_label_next : ">",
			nav_label_last : ">|"
		});
	});	
}
/* END PAGINATION */

/* START UTILS */
function RecursiveReplace(text,charToReplace,replaceWith) {
	
	var indexOfMatch = text.indexOf(charToReplace);
	
	while (indexOfMatch != -1){
		text = text.replace(charToReplace, replaceWith)
		indexOfMatch = text.indexOf(charToReplace);
	}
	
	return text;
}
/* START UTILS */
