﻿var _ContainerHeight = 762;

function S4() {
   return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
}
function GenerateGuid() {
   return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4()+S4());
}

$(window).load(function() {
    SetupLayout();
});


function SetupLayout() {
    var height = $(document).height() - $("#divFooter").height();
    if (height < _ContainerHeight) 
        height = _ContainerHeight;
    $("#Container").height(height);
    
    if ($(".DivDoveWithPattern"))
    {
        var dove = $(".DivDoveWithPattern")
        var marginTop = height - $(dove).offset().top - $(dove).height();
        //alert(marginTop);
        $(dove).css( {paddingTop:marginTop} );
    }
    if ($(".DivDoveWithOutPattern"))
    {
        var dove = $(".DivDoveWithOutPattern")
        var marginTop = height - $(dove).offset().top - $(dove).height();
        //alert(marginTop);
        $(dove).css( {paddingTop:marginTop} );
    }
}

var resizeTimer = null;
$(window).bind('resize', function() {
    if (resizeTimer) clearTimeout(resizeTimer);
    resizeTimer = setTimeout(SetupLayout, 100);
});

function QueryString(ji) {
    hu = window.location.search.substring(1);
    gy = hu.split("&");
    for (i=0;i<gy.length;i++) {
        ft = gy[i].split("=");
        if (ft[0] == ji) {
            return ft[1];
        }
    }
    return "";
}
