﻿/// <reference path="JQuery/jquery-1.3.1.js" />
var timeout;

//Render the content part (between the first and last <!--Content--> comment)of a page into a div 
function renderPageIntoContainerCallback(response,a,b, options) {
    var responseText = response;
    var cleanedResponseText = responseText.substring(responseText.indexOf('<!--Content-->'), responseText.lastIndexOf('<!--Content-->'));

    if (options.indicator) options.indicator.hide();
    options.targetContainer.innerHTML = cleanedResponseText;

    if (options.callAfterSuccess)
        options.callAfterSuccess();
}

function renderPageIntoContainer(pageUrl, container, callback, delay, indicatorElement) {
    //Ext.Ajax.on("abort", renderPageFailure, null, { indicator: indicatorElement });
    if (delay) {
        window.clearTimeout(timeout);
        timeout = window.setTimeout(function() {
         $(container).load(pageUrl +"#content", null, callback);
        }, delay);
    } else {
        $(container).load(pageUrl + "#content", null, callback);
    }
}

function renderControl(control, container, parameters, callback, delay, indicator) {
   if (indicator) indicator.show();

   renderPageIntoContainer(baseUrl + "AJAX/RenderControl?control=" + control + "&" + parameters + "&originator=" + document.location, container, callback, delay, indicator);
}
/*$(document).ready(function () {
    setTimeout(function () {
        $('.tomobile').slideUp('slow');
    }, 5000);
});*/
//End of file...
