/* These following methods requires that the page imports the JQuery library - START */

// Ajax function used to call simple pages. Can return the HTML response.
function CallPage(URL, Data, Method) {	// Overload method.
	CallPage(URL, Data, Method, false);
}

function CallPage(URL, Data, Method, ReturnResponse) {
	// Define SendMethod, default GET.
	var SendMethod = "GET";
	// If SendMethod is get, then the provided data has to be added as QueryString.
	if (Data != null && Data != undefined) {
		if (Method != null && Method != undefined)
			SendMethod = Method;

		if (SendMethod == "GET") {
			URL = URL + "?" + Data;
			Data = "";
		}
	}
	// Make Ajax call.
	var html = $.ajax({
		type: SendMethod,
		url: URL,
		data: Data,
		async: false
	}).responseText;
	if (ReturnResponse) {
		// Return HTML response.
		return html;
	}
}

/* These following methods requires that the page imports the JQuery library - END */
