/***********************************************
* functions.cs
*
* Author      :   A. Seifried
* Copyright   :   Grünbeck Wasseraufbereitung GmbH
* Version	     : 	1.0
* Created     :   2006-05-17
************************************************/

function _OpenBrWindow( theURL, winName, features )
{
  window.open( theURL, winName, features );
}

/***********************************************
* display picture in new window
* window-size is resized to picture-size
*
* usage: <a href="javascript:_ShowPicture('test.jpg',800,600,'Test','#FFFFFF','#000000')">
* 1. parameter           : URL of the picture
* 2. parameter           : width of image  
* 3. parameter           : height of image
* 4. parameter (optional): Title of window, and text above picture
* 5. parameter (optional): Backgroundcolor
* 6. parameter (optional): Textcolor
************************************************/
function _ShowPicture( _Picture, _ImgWidth, _ImgHeight, _Title, _BGColor, _FGColor )
{
    tmpImage     = new Image();
    tmpImage.src = _Picture;

    if ( ! _Title )
        _Title = "";
    if ( ! _BGColor )
        _BGColor = "#CCCCCC";        //grey
    if ( ! _FGColor )
        _FGColor = "#000000";        //black

    var ScreenWidth = screen.width;
    var ScreenHeight = screen.height;

    var xsize = _ImgWidth  + 35;
    var ysize = _ImgHeight + 130;

    var xpos = (ScreenWidth/2)-(xsize/2);
    var ypos = (ScreenHeight/2)-(ysize/2);

    NewWindow=window.open("","Picture","height="+ysize+",width="+xsize+",scrollbars=no,resizable=yes,top="+ypos+",left="+xpos+"");
    NewWindow.document.write("<html><head><title>");
    NewWindow.document.write(_Title);
    NewWindow.document.write("</title></head>");
    NewWindow.document.write("<body bgcolor='");
    NewWindow.document.write(_BGColor);
    NewWindow.document.write("' text='");
    NewWindow.document.write(_FGColor);
    NewWindow.document.write("' onload='focus()'>");
    NewWindow.document.write("<table align='center'><tr>");
    NewWindow.document.write("<td align='center' style='text-align:center; font-weight:bold; font-size:12pt; font-family:lithograph, Tahoma, sans-serif; color:");
    NewWindow.document.write(_FGColor);
    NewWindow.document.write(";'>");
    NewWindow.document.write(_Title);
    NewWindow.document.write("</td></tr><tr<td align='center' valign='top'>");
    NewWindow.document.write("<table border='1' bgcolor='#000000' cellpadding='0' cellspacing='1'><tr><td align='center'>");
    NewWindow.document.write("<img src='");
    NewWindow.document.write(tmpImage.src);
    NewWindow.document.write("'>");
    NewWindow.document.write("</tr></table>");
    NewWindow.document.write("</td></tr><tr>");
    NewWindow.document.write("<td align='center' valign='bottom'>");
    NewWindow.document.write("<br><center><form><input type='button' value='FENSTER SCHLIESSEN' style='font-family: Verdana; font-size: 10px' onClick='self.close()'>");
    NewWindow.document.write("</td></tr></table>");
    NewWindow.document.write("</form></body></html>");
    NewWindow.document.close();
}
