/*
 * pilot.cz all rights reserved
 * copyright 2006 pilot.cz
 *
 *  e-mail: admin(at)apilot(dot)cz
 *
*/

//open new windoow as targe="_blank"
function newindow ($link)
{
  var $openNewWindow;
      $openNewWindow = window.open ($link);
      $openNewWindow.focus();	
}

//open window with width and height for some text (function of wysiwyg)
function popupwithtext ($link, $width, $height)
{
  var $setLeftPosition = ((screen.width-$width)/2);
  var $setTopPosition  = ((screen.height-$height)/2);
  var $someNewWindow;
      $someNewWindow = window.open ($link, 'popup', 'left='+$setLeftPosition+', top='+$setTopPosition+', width='+$width+','+
                                    'height='+$height+', toolbar=no, location=no, directories=no,'+
                                    'status=no, menubar=yes, scrollbars=auto, resizable=yes, copyhystory=no');
      $someNewWindow.focus();
}

//open window with width and height for some text with options
function popupwithtextextended ($link, $width, $height, $scrolls, $resize)
{
  var $setLeftPosition = ((screen.width-$width)/2);
  var $setTopPosition  = ((screen.height-$height)/2);
  var $someNewWindow;
      $someNewWindow = window.open ($link, 'popup', 'left='+$setLeftPosition+', top='+$setTopPosition+', width='+$width+','+
                                    'height='+$height+', toolbar=no, location=no, directories=no,'+
                                    'status=no, menubar=yes, scrollbars='+$scrolls+', resizable='+$resize+', copyhystory=no');
      $someNewWindow.focus();
}

//open window with avilable panel for print
function printable ($link, $width, $height)
{
  var $setLeftPosition = ((screen.width-$width)/2);
  var $setTopPosition  = ((screen.height-$height)/2);
  var $someNewWindow;
      $someNewWindow = window.open ($link, 'eshopprint', 'left='+$setLeftPosition+', top='+$setTopPosition+', width='+$width+', height='+$height+','+
                                           'toolbar=no, location=no, directories=no, status=no,'+
                                           'menubar=yes, scrollbars=yes, resizable=no, copyhystory=no');
      $someNewWindow.focus();
}

//open only window with image
function galery ($img, $width, $height, $scrolls, $resize) {
 if ($scrolls == 'true') {
   var $doscrolls = 'yes';
 }
 else {
   var $doscrolls = 'no';
 }
 if ($resize == 'true') {
   var $dresize = 'yes';
 }
 else {
   var $dresize = 'no';
 }
 var $fromLeftPosition = ((screen.width-$width)/2);
 var $fromTopPosition = ((screen.height-$height)/2);
 
 $galeryContent = window.open ('', 'zoom', 'left='+$fromLeftPosition+', top='+$fromTopPosition+', width='+$width+', height='+$height+','+
                              'toolbar=no, location=no, directories=no, status=no,'+
                              'menubar=no, scrollbars='+$doscrolls+', resizable='+$dresize+', copyhistory=no');
  with ($galeryContent.document) {
    open ();
    write ('<?xml version="1.0" encoding="iso-8859-2"?>\n');
    write ('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\n');
    write ('<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs">\n');
    write ('<head>\n\n');
    write (' <title>galery</title>\n\n');
    write (' <meta http-equiv="content-type"  content="application/xhtml+xml; charset=iso-8859-2" />\n');
    write (' <meta http-equiv="pragma"        content="no-cache" />\n');
    write (' <meta http-equiv="cache-control" content="no-cache" />\n');
    write (' <meta http-equiv="expires"       content="-1" />\n\n');
    write ('<style type="text/css">body{margin:0px;padding:0px;overflow:auto;}img{border:none;}</style>');
    write ('</head>\n');
    write ('<body>\n');
    write ('<div class="img-box">');
    write ('<a href="javascript:close();" title="close"><img src="'+$img+'" alt="'+$img+'" widh="'+$width+'" height='+$height+'" title="close this window" /></a>');
    write ('</div>');
    write ('</body>\n');
    write ('</html>');
    close ();
  }
  $galeryContent.focus ();
}
