
var aUrl = "";
var aClose = "closeAjax()";
var aDataOut = "";
var aDataIn = "";
var aDataType = "text";
var aLocked = false;

function goProdList(page, urlpath) {
    if (!aLocked) {
        $("#pl_content_proces").show();
        aLocked = true;
        aUrl = "http://www.aircoshop.nl/ajax-related-products?page=" + page + "&path=" + urlpath;
        ajax();
        //alert(aUrl);
    }
}

function ajax() {
    window.setTimeout("executeAjax()", 250);
}
function closeAjax() {
    $("#productslistcontainer").html(aDataIn);
    aLocked = false;
    window.setTimeout("hidePreload()", 150);
}
function executeAjax() {
    $.ajax({
        url: aUrl,
        cache: false,
        async: false,
        beforeSend: function() {
        },
        type: "GET",
        data: aDataOut,
        dataType: aDataType,
        error: function(XMLHttpRequest, textStatus, errorThrown) {
            // this; // the options for this ajax request			
        },
        success: function(s) {
            aDataIn = s;
            window.setTimeout(aClose, 150);
        }
    });
    return false;
}
function imgProdList(dir, nr) {
    $("#pl_" + dir + "_img").attr("src", "http://www.aircoshop.nl/images/product-related-list-arrow-" + dir + "-" + nr + ".gif");
}
function hidePreload() {
    $("#pl_content_proces").hide();
}