// JavaScript Document

$(document).ready(function() {

    $("#images").css("display", "inline-block");
    $("#images").html("<img src='images/loader.gif' width='100' height='100' title='loading please wait'>");

	var sPath = "get_images.php"; // ?&forceupres=" + getParameterByName('forceupres');

    //alert('sPath ' + sPath);

    $.get(sPath, function(data) {

        //alert("Data Loaded: " + data);
        $("#images").css("display", "inline");
        $("#images").html(data);

    });

});


//window.onscroll = function(){ $("#copyright").css("right", "10"); }
//window.onload = function(){ $("#copyright").css({display : 'block', position:'fixed', top:'5px',right:'5px',z-index:'100'}); }

function swapImages(navclickID, catName) {

    $("#images").css("display", "inline-block");
    $("#images").html("<img src='images/loader.gif' width='100' height='100' title='loading please wait'>");

    var sPath = "get_images.php?cat_id=" + navclickID + '&cat_name=' + catName; //  + "&forceupres=" + getParameterByName('forceupres');

    //alert('sPath ' + sPath);
    
    $.get(sPath, function(data) {

        //alert("Data Loaded: " + data);
        //if (data == '') data = "No photos have been added to this category yet";
        $("#images").css("display", "inline");
        $("#images").html(data);

    });

}

function getParameterByName(name) {
    name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
    var regexS = "[\\?&]" + name + "=([^&#]*)";
    var regex = new RegExp(regexS);
    var results = regex.exec(window.location.href);
    if (results == null) return "";
    else return results[1];
}

