

			/* Cookie tools */

			function createCookie(name, value, days) {
				if (days) {
					var date = new Date();
					date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
					var expires = "; expires=" + date.toGMTString();
				}
				else var expires = "";
				document.cookie = name + "=" + value + expires + "; path=/";
			}

			function readCookie(name) {
				var nameEQ = name + "=";
				var ca = document.cookie.split(';');
				for (var i = 0; i < ca.length; i++) {
					var c = ca[i];
					while (c.charAt(0) == ' ') c = c.substring(1, c.length);
					if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
				}
				return null;
			}

			function eraseCookie(name) {
				createCookie(name, "", -1);
			}

			function storeCookie(sCookieName, sCookieValue) {
				//For backward compat
				createCookie(sCookieName, sCookieValue, 180);
			}

			function getCookieItem(sCookieName) {
				//For backward compat			
				return readCookie(sCookieName);

			}

			function switchMenu(obj) {
				var el = document.getElementById(obj);
				el.style.block = (el.style.display != 'block') ? 'block' : 'none';
			}
			function storeCookieWithFutureExpiry(sCookieName, sCookieValue, iCookieExpiryIncrement) {
				var expireDate = new Date();
				expireDate.setTime(expireDate.getTime() + iCookieExpiryIncrement);
				document.cookie = sCookieName + '=' + escape(sCookieValue) + ';expires=' + expireDate.toGMTString();
			}
			function selectMenu(lID) {
				//alert(lID);
				//return;

				var oEle = document.getElementById(lID);
				if (lID) {
					//Get it the sub menus
					var oCol = document.getElementsByTagName("div");
					var lThisCatID = 0;
					var lThisParentID = 0;
					var sID = '';
					for (var i = 0; i < oCol.length; i++) {
						if (oCol[i].id.indexOf("|") != -1) {
							sID = oCol[i].id;
							lThisCatID = sID.split("|")[0];
							lThisParentID = sID.split("|")[1];
							if (lID == lThisCatID) {
								oCol[i].style.display = (oCol[i].style.display != 'block') ? 'block' : 'none';
							}
						}

					}
				}

}


function showWaitBlocker() {

    return showModalMessage('Please Wait...');
}

function showModalMessage(sHTML) {


    try {


    //Get the screen height and width  
    var maskHeight = $(document).height();

    //Set height and width to mask to fill up the whole screen  
    $('#modal-bg').css({ 'height': maskHeight });

    //transition effect       
    $('#modal-bg').fadeTo("fast", 0.25);

    var id = '#modal-message-container';
   
        var sContent = sHTML;
    
    document.getElementById("model-message-content").innerHTML = sContent;

    var startY = parseInt($(id).css('top'), 10);

    if (startY == 0) {
        startY = 120;
    }
    var scrollY = $(this).scrollTop();

    //Set the popup window to center  
    $(id).css('top', startY + scrollY);

    //transition effect  
    $(id).fadeIn(250);

    //return false;



    }
    catch (err) {
    // Ignore and carry on posting the form.
    }

    return true;


}
