﻿/*
بسم الله الرحمن الرحيم
الحمد لله اللذي بنعمته تتم الصالحات
Smart developers always veiw source!
Scripting is soooooooooooooooo fun!
Scripted By: Ahmed EL-Harouny ------
Email: ahmedelharouny@yahoo.com ----
Date: June 2009 --------------------
*/

//temp html indicating loading
var loadingString = "<div class='loading'></div>";



//creates aysync json request to the server taking a url and data object to encode in querystring and a success callback function
function LoadJson(url, data, successCallback) {
    $.ajax({ url: url, dataType: 'json', data: data, success: successCallback, error: OnError
    });
}

//the default error callback
function OnError(XMLHttpRequest, textStatus, errorThrown) {
    alert("Error occurred while requesting data from the server");
}


function ShowLoadingMsg(htmlObject) {
    htmlObject.innerHTML = loadingString;
}