﻿var $j = jQuery.noConflict();
$j(document).ready(function() {
    $j("#loading").css("position", "absolute");
    $j("#loading").css("top", ($j(window).height() - $j("#loading").height()) / 2 + $j(window).scrollTop() + "px");
    $j("#loading").css("left", ($j(window).width() - $j("#loading").width()) / 2 + $j(window).scrollLeft() + "px");
    //alert($j("#loading").css("top"));
    var redirectURL = $j("input.redirectURL").val();
    document.cookie = "ppkcookie1=testcookie; expires=Thu, 2 Aug 2090 20:47:11 UTC; path=/";
    //if cookies are disabled, redirect to the default page
    if (document.cookie == "" || document.cookie == null) {
        var url = "/cookies.htm";
        if (librarydirectory != "" && librarydirectory != null)
            url = "/" + librarydirectory + url;
        document.location = url;
        return;
    }
    //if redirectURL is provided, redirect to appropriate URL
    if (redirectURL != "" && redirectURL != null) {
        var url = redirectURL;
        //        if (librarydirectory != "" && librarydirectory != null)
        //            url = "/" + librarydirectory + url;
        document.location = url;
        return;
    }
    else {
        //otherwise, continue loading the page
        $j("#data").show();
        $j("#loading").hide();
    }
});