// Beginn Funktionen für Popups
function newWindow( strURL, intWidth, intHeight )
    {
    var intX  = ( screen.width / 2 ) - ( intWidth / 2 );
    var intY  = ( screen.height / 2 ) - ( intHeight / 2 );
    var xWindow = window.open( strURL, '','left=' + intX + ',top=' + intY +',width=' + intWidth + ',height=' + intHeight + ',channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=0,toolbar=0,status=0,scrollbars=no,border=no');
    }

function newWindowCenter( strURL, intWidth, intHeight )
    {
    var xWindow = window.open( strURL, '','left=' + intX + ',top=' + intY +',width=' + intWidth + ',height=' + intHeight + ',channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=0,toolbar=0,status=0,scrollbars=no,border=no');
    }

function newWindowPos( strURL, intWidth, intHeight, intX, intY )
    {
    var xWindow = window.open( strURL, '','left=' + intX + ',top=' + intY +',width=' + intWidth + ',height=' + intHeight + ',channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=0,toolbar=0,status=0,scrollbars=no,border=no');
    }
// Ende Funktionen für Popups

function swapCellClick( cell )
    {
    if(event.srcElement.tagName=='TD')
        {
        cell.children.tags('A')[0].click();
        }
    }

function fctCheckStartFields( strTextDateFrom, strTextDateTo )
    {
    if( document.getElementById('DTS').value == "" )
        {
        alert( strTextDateFrom );
        document.getElementById('DTS').focus();
        return( false );
        }
    if( document.getElementById('DTE').value == "" )
        {
        alert( strTextDateTo );
        document.getElementById('DTE').focus();
        return( false );
        }
    return( true );
    }

function fctPrintBasket( button )
    {
    var strBasketContent = document.getElementById('divBasketContent').innerHTML;
    if( strBasketContent != "" )
        {
        var xPrint = window.open( "print.html","" );
        }
    else
        {
        alert( "Kein Druck möglich. Leeres Dokument" );
        }
    }

function fctSetValueAndClose( ElementId, NewValue )
    {
    opener.document.getElementById( ElementId ).value = NewValue;
    self.close();
    }

function fctToggleVisibility( ElementId, ImageId )
    {
    var strCurrentState = document.getElementById( ElementId ).style.display;
    if( strCurrentState == "none" )
        {
        document.getElementById( ElementId ).style.display='';
        document.getElementById( ImageId ).innerHTML = "<img src=\"data/images/btnMinus.gif\" border=\"0\"\>";
        }
    else
        {
        document.getElementById( ElementId ).style.display='none';
        document.getElementById( ImageId ).innerHTML = "<img src=\"data/images/btnPlus.gif\" border=\"0\"\>";
        }
    }

function clickButton(e, buttonid){
     var bt = document.getElementById(buttonid);
      if (typeof bt == 'object'){
            if(navigator.appName.indexOf("Netscape")>(-1)){
                  if (e.keyCode == 13){
                        bt.click();
                        return false;
                  }
            }
            if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1)){
                  if (event.keyCode == 13){
                         bt.click();
                        return false;
                  }
            }
      }
}

function startSearch()
{
    document.forms[ 0 ].action = "index.aspx?ACT=20";
}
