﻿function showHelp()
{
    document.getElementById("divhelp").style.display = "";
    document.getElementById("ashowhelp").style.display = "none";
    document.getElementById("ahidehelp").style.display = "";
    customhandler();    
}
function hideHelp()
{
    document.getElementById("divhelp").style.display = "none";
    document.getElementById("ashowhelp").style.display = "";
    document.getElementById("ahidehelp").style.display = "none";
    customhandler();   
}
function hideMessage()
{
    document.getElementById("status").style.visibility = "hidden";
}

//Wenn Enter gedrückt wird, wird der richtigte Button ausgeführt
//vorher Problem mit Anmeldeseite und Login (links)
function SetFocus(e, btnName)
{    
	var btn = $get(btnName);
	
	if (e.keyCode == 13)
	{
	    e.returnValue=false;
	    e.cancelBubble = true;
	    btn.click();
	}
}

//Anzeige des ajax_load divs währen eines AsyncPostBack
//damit der User weiß das etwas geschieht
Sys.Application.add_load(onPageLoading);
Sys.Application.add_unload(onPageUnLoading);

function onPageLoading(sender,args)
{
    //  register for our events
    Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(onBeginRequest);
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(onEndRequest); 
    
}

function onPageUnLoading(sender,args)
{

    $get("ajax_load").style.visibility = "hidden";
    $get("ajax_load").style.display = "none";
}

function onBeginRequest(sender, args)
{
    $get("ajax_load").style.visibility = "visible";
    $get("ajax_load").style.display = "";

    document.body.style.cursor = "progress";
}

function onEndRequest(sender, args)
{
    $get("ajax_load").style.visibility = "hidden";
    $get("ajax_load").style.display = "none";
    
    document.body.style.cursor = "default";
    window.scrollTo(0,0);
}

function hideAjaxLoad()
{


}

//Scroll Position des Saalbildes setzten (z.B. RedBulls - Stadion; NavigatorPic)
function setScrollPosition()
{
    var posX = $get('hidScrollPosX').value    
    
    if (posX > 0)
    {
        var divHall =$get('HallPlanWrapper');
        divHall.scrollLeft = posX;
    }
}

 