function ShowModalBoolean(params, postBackObj) {
	//#function: display a modal dialog box with a yes n o button and the option to browse too a url or
	// execute a postBack function
	$.prompt('<span class="title">' + params['title'] +'</span><p>' +  params['text'] +'</p>',{ 
		buttons:{ Yes:true,No:false},
		prefix:'colsJqi',
		show:'slideDown',
		callback: function(modalResult) {			
			if (modalResult == true) {
				if (params['postBack'] == true) {
					postBack(params['url'], params['xAction'], postBackObj);					
				}
				else {
					document.location=params['url'];
				}
			}
		}
	}); 				
}


function outputErrors(errorObject) {
	//#output ajax returned errors to a form
	if (errorObject != null) {
		for (value in errorObject) {
			var name    = "error_" + value;
			var message = errorObject[value];
			$("#"+name).html(message);
		}					
	}
}

function displayErrors(returnObject) {
	//#diaplay ajax returned errors to a form
	var errors       = returnObject.errors;				
	if (errors != null) {
		for (value in errors) {
			var name    = "error_" + value;
			var message = errors[value];
			$("#"+name).html(message);
		}					
	}	
	if (returnObject.debug == true) {
		var serialisedObject = JSON.stringify(returnObject);					
		alert(serialisedObject);
	}
}

function getIndexFormID(theID) {
	stringArray = theID.split('_');
	index = stringArray.length;
	return(stringArray[index-1]);
}

