﻿function alert1(text)
{
    document.getElementById("alert_screen").style.display = "block";
    height = (getBrowserHeight()/2) - (document.getElementById("alert_wrap").offsetHeight);
    height += getScrollTop();
    document.getElementById("alert_pane").style.paddingTop = (height) +"px";
    title = document.getElementById("alert_title");
    document.getElementById("alert_content").innerHTML = text;
    document.getElementById("ok").onclick = function()
    {
        document.getElementById("alert_screen").style.display = "none";
        return true;
    };
    document.getElementById("cancel").style.display = "none";
    document.getElementById("button_wrap").style.paddingLeft = "80px";
    flashing = false;
}
function confirm1(text)
{
    document.getElementById("alert_screen").style.display = "block";
    height = (getBrowserHeight()/2) - (document.getElementById("alert_wrap").offsetHeight) + getScrollTop();
    document.getElementById("alert_pane").style.paddingTop = (height) +"px";
    title = document.getElementById("alert_title");
    document.getElementById("alert_content").innerHTML = text;
    document.getElementById("ok").onclick = function()
    {
        document.getElementById("alert_screen").style.display = "none";
        return true;
    };
    document.getElementById("cancel").style.display = "block";
    document.getElementById("cancel").onclick = function()
    {
        document.getElementById("alert_screen").style.display = "none";
        return false;
    };
    document.getElementById("button_wrap").style.paddingLeft = "30px";
    flashing = false;
}
function flash()
{
    if(!flashing)
    {
        flashing = true;
        for(i = 0; i < 10; i++)
        { window.setTimeout('flipcolors();', 250 * i); }
        window.setTimeout('flashing = false;', 250 * i);
    }
}
function flipcolors()
{
    title = document.getElementById("alert_title");
    wrap = document.getElementById("alert_wrap");
    
    //alert(title.style.backgroundColor);
    
    if(title.style.backgroundColor == "rgb(255, 255, 255)")
    {
        title.style.backgroundColor = "#2A5077";
        wrap.style.borderColor = "#FF9200";
    }
    else
    {
        title.style.backgroundColor = "#fff";
        wrap.style.borderColor = "#fff";
    }
}
var HeartBeatTimer;

function StartHeartBeat()
{
    // pulse every 10 seconds
    if (HeartBeatTimer == null)
        HeartBeatTimer = setInterval("HeartBeat()", 1000 * 10);
}

function HeartBeat()
{
    // note: ScriptManger must have: EnablePageMethods="true"
    Sys.Debug.trace("Client: Poke Server");
    PageMethods.PokePage();
}