(function($) {
		$(document).ready(function(){
      $('.ajaxPage li a').live('click', function(event) {
        if (event.button != 0)
        return true;
        // Live handler called.
        nonAjaxPage = new Array('#','javascript://','javascript:void(0);','javascript:void(0)',homePage)
        link = $(this).attr('href');
        if(link==null || link=="")
        return true;
        if(in_array(link,nonAjaxPage))
        return true;
        
        event.preventDefault();
        $('#Progress').show();
        $.ajax({
           type: "POST",
           url: link,
           data: "ajax=1",
           error: function(){
            $('#Progress').hide();
            alert("page not found");
           },
           success: function(html){
            $('#Progress').hide();
            $('#contentWrap').html(html);
           }
         });
 
      });
		});
})(jQuery);

function in_array (needle, haystack, argStrict) {

    var key = '', strict = !!argStrict;

    if (strict) {
        for (key in haystack) {
            if (haystack[key] === needle) {
                return true;
            }
        }
    } else {
        for (key in haystack) {
            if (haystack[key] == needle) {
                return true;
            }
        }
    }

    return false;
}
