var AjaxObjectFilter = {

	handleSuccess:function(o){
		loadingDiv('false');
		var script = o.responseXML.getElementsByTagName("cms")[0].getElementsByTagName("script")[0].firstChild.nodeValue;
		var content = o.responseXML.getElementsByTagName("cms")[0].getElementsByTagName("content")[0].firstChild.nodeValue;
		//alert(script);
		document.getElementById('right-page').innerHTML = content;
		eval(script);
		
	},

	handleFailure:function(o){
		alert("erreur d'appel au cms");
		loadingDiv('false');
	},

	processResult:function(o){
		alert("processResult");
	},

	startRequest:function(zurl,limit_page,limit) {
		currentUrl =  document.location.href;
		if(currentUrl.indexOf('#', 0)>-1){
			document.location.href = document.location.href;
		}else{
			document.location.href = document.location.href+'#haut_page';
		}
		loadingDiv('true');
		if(zurl.indexOf('?', 0)>-1){
			zurl += '&ajax=1&limit='+limit+'&limit_page='+limit_page
		}else{
			zurl += '?ajax=1&limit='+limit+'&limit_page='+limit_page
		}
		YAHOO.util.Connect.asyncRequest('POST', zurl, callbackAjaxObjectFilter, "");
	}

};

var callbackAjaxObjectFilter =
{
	success:AjaxObjectFilter.handleSuccess,
	failure:AjaxObjectFilter.handleFailure,
	scope: AjaxObjectFilter
};

var AjaxObject = {

	handleSuccess:function(o){
		loadingDiv('false');
		var script = o.responseXML.getElementsByTagName("cms")[0].getElementsByTagName("script")[0].firstChild.nodeValue;
		var content = o.responseXML.getElementsByTagName("cms")[0].getElementsByTagName("content")[0].firstChild.nodeValue;
		//alert(script);
		document.getElementById('right-page').innerHTML = content;
		eval(script);
		

	},

	handleFailure:function(o){
		alert("erreur");
		loadingDiv('false');
	},

	processResult:function(o){
		alert("processResult");
	},

	startRequest:function(zurl) {
		currentUrl =  document.location.href;
		if(currentUrl.indexOf('#', 0)>-1){
			document.location.href = document.location.href;
		}else{
			document.location.href = document.location.href+'#haut_page';
		}
		loadingDiv('true');
		if(zurl.indexOf('?', 0)>-1){
			zurl += '&ajax=1';
		}else{
			zurl += '?ajax=1';
		}
		YAHOO.util.Connect.asyncRequest('POST', zurl, callbackAjaxObject, "");
	}

};

var callbackAjaxObject =
{
	success:AjaxObject.handleSuccess,
	failure:AjaxObject.handleFailure,
	scope: AjaxObject
};