
// JavaScript Funktionen für dynamisches CSS Popup Fenster

function open_css_window( name, url, width, height, posX, posY, nojump, initialsrc ) {
  var win   = 'css_window_'+name;

  if( ! posX   ) posX   = 40;
  if( ! posY   ) posY   = 40;

  if( posX ) xLeft( win, posX );
  if( posY )  xTop( win, posY );

  clear_css_window( name, url, initialsrc );

  if( width  ) xWidth(win, width);
  if( height ) xHeight(win, height);

  xShow( win );
  
  if( ! nojump )
    location.href = '#css_window_target_' + name;
}

function close_css_window( name ) {
  var win = 'css_window_' + name;
  clear_css_window( name );
  xHide( win );
}

function resize_css_window( name, width, height ) {
  var win   = 'css_window_' + name;
  var title = 'css_window_title_' + name;
  var iframe_id = 'css_window_iframe_' + name;
  var title_height = xHeight( title );
  
  xWidth(  win, width + 14 );
  xHeight( win, height + title_height + 14 );
  xWidth(  iframe_id, width + 10);
  xHeight( iframe_id, height + 10);

}

function clear_css_window( name, url, initialsrc ) {
  var iframe_object = eval('css_window_iframe_' + name);
  if( iframe_object ) {
    if( ! initialsrc ) initialsrc = '<html><body bgcolor="white"></body></html>';
    iframe_object.document.open();
    iframe_object.document.write( initialsrc );
    iframe_object.document.close();
    if( url ) window.setTimeout(
       "css_window_iframe_" + name + ".document.location.href ='" + url + "'" 
      ,50 );
  }
}
