var PmsUrl = {
	getBaseUrl : function()
	{
		 // loc is the relative path your wish to redirect to
		 var b = document.getElementsByTagName('base');
		 var loc = '' ;
		 if (b && b[0] && b[0].href) {
		   if (b[0].href.substr(b[0].href.length-1) == '/' && loc.charAt(0) == '/')
		     loc = loc.substr(1);
		   loc = b[0].href + loc;
		 }
		 return loc;
	}
}

var CaBrochure ={
	completeSave : function(request){
		var result = eval('(' + request.responseText + ')');
	
		$('profil_wait').style.display = 'none';
		if (result.isValid)
		{
			Modalbox.show('', 'profil_save.html', {width:380, height:250, afterHide:function(){window.location.href=PmsUrl.getBaseUrl() + 'index.html'}});
		}
		else
		{
			$('profil_error').innerHTML = result.message;
			$('profil_error').style.display = 'block';
		}
	},
	/**
	 * the post method
	 */
	send: function(form){
		TB_show("","","");
		/*
		var ajax = new Ajax.Request(PmsUrl.getBaseUrl() + 'cra/member/save', 
		{
			method: 'post', 
			parameters: Form.serialize(form),
			onComplete: CraMember.completeSave
		});
		*/
		return false;
	}
}
