function Message(id)
{
 winpix=window.open("druk.php?id=" + id,"previewWin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=700,height=800");
}

function LoadMidPicture(picture)
{						
	document.big_photo.src = picture;
	return;
}		


noweOkienko = null;

function ShowItem(src){
if(noweOkienko){noweOkienko.close();}
if(noweOkienko==null || noweOkienko.closed){
 settings=
 "left=30,"
 +"top=30,"
 +"toolbar=no,"
 +"location=no,"
 +"directories=no,"
 +"status=no,"
 +"menubar=no,"
 +"scrollbars=no,"
 +"width=100"
 +"height=100"
 +"resizable=no"
 noweOkienko = window.open("",'galeria_ah',settings);
}
noweOkienko.document.open();
noweOkienko.document.clear();
noweOkienko.document.write(
"<html>\n"
+"<head>\n"
+"<title>Galleria</title>\n"
+"</head>\n"
+"<script>\n"
+"function resize() {\n"
+"window.resizeTo(document.images[0].width+10, document.images[0].height+30);}\n"
+"</script>\n"
+"<body topmargin=0 leftmargin=0 onLoad=resize(); onclick=window.close(); bgcolor=#FFFFFF>\n"
+"<img src=" + src + " border=0>\n"
+"</body>\n"
+"</html>"
);
noweOkienko.document.close();
noweOkienko.focus();
}

function LoadMidPicture(picture)
{						
	document.big_photo.src = picture;
	return;
}		


noweOkienko = null;

function ShowItemSwf(src, width, height){
if(noweOkienko){noweOkienko.close();}
if(noweOkienko==null || noweOkienko.closed){
 settings=
 "left=30,"
 +"top=30,"
 +"toolbar=no,"
 +"location=no,"
 +"directories=no,"
 +"status=no,"
 +"menubar=no,"
 +"scrollbars=no,"
 +"width=" + width
 +"height=" + height
 +"resizable=no"
 noweOkienko = window.open("",'galeria_ah',settings);
}
noweOkienko.document.open();
noweOkienko.document.clear();
noweOkienko.document.write(
"<html>\n"
+"<head>\n"
+"<title>Galleria</title>\n"
+"</head>\n"
+"<script>\n"
+"function resize() {\n"
+"window.resizeTo(" + width + "+10, " + height + "+30);}\n"
+"</script>\n"
+"<body topmargin=0 leftmargin=0 onLoad=resize(); onclick=window.close(); bgcolor=#FFFFFF>\n"
+ "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"" + width + "\" height=\"" + height + "\" align=\"middle\">"
+"<param name=\"allowScriptAccess\" value=\"sameDomain\" />"
+"<param name=\"movie\" value=\"" + src + "\" />"
+"<param name=\"quality\" value=\"high\" />"
+"<param name=\"bgcolor\" value=\"#cccccc\" />"
+"<embed src=\"" + src + "\" quality=\"high\" bgcolor=\"#2b556a\" width=\"" + width + "\" height=\"" + height + "\" align=\"middle\" allowscriptaccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></embed>"
+"</object>"
+"</body>\n"
+"</html>"
);
noweOkienko.document.close();
noweOkienko.focus();
}

function ShowItemPdf(src){
if(noweOkienko==null){
 settings=
 "left=30,"
 +"top=30,"
 +"toolbar=no,"
 +"location=no,"
 +"directories=no,"
 +"status=no,"
 +"menubar=no,"
 +"scrollbars=no,"
 +"width=100"
 +"height=100"
 +"resizable=no"
 noweOkienko = window.open("src",'galeria_ah',settings);
}
noweOkienko.document.open();
noweOkienko.document.write(
"+src"
);
}

function Pisz(co)
{
 var d=document;
 if(d.layers)with(d.layers["zegar"].document){
 write(co);close();return}
 if(d.getElementById){d.getElementById("zegar").innerHTML=co;return}
 if(d.all)d.all["zegar"].innerHTML=co;
}

function Zegar()
{
 var T,G,M,S,s;
 T=new Date();
 G=T.getHours();
 M=T.getMinutes();
 S=T.getSeconds();
 
 s=(G<10?"0":" ")+G;
 s+=(M<10?":0":":")+M;
 s+=(S<10?":0":":")+S;
 Pisz(s);
}

function go_href(link)
{
 location.href=link;
}

function actual_date()
{
 var dayNames = new Array("Niedziela","Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota");
 var monthNames = new Array("stycznia","lutego","marca","kwietnia","maja","czerwca","lipca","sierpnia","września","października","listopada","grudnia");
 var now = new Date();
 document.write(dayNames[now.getDay()] + ", " + now.getDate() + " " + monthNames[now.getMonth()] + " " + now.getYear());
}


function openwindow(src, w, h)
{
 ustawienia= "left=100," +"top=100," +"width=" + w + "," +"height=" + h + "," +"toolbar=no," +"location=no," +"directories=no," +"status=no," +"menubar=no," +"scrollbars=yes," +"resizable=no";
 NewWindow = window.open(src,'uniwerauto',ustawienia);
 NewWindow.focus();
}


/* Creation date: 4.4.2003 */
  function Confirm(link,text) 
  {
   if (confirm(text))
      window.location=link
  }
  function expw(listID) 
  {
   if (listID.style.display=="none") {listID.style.display="";}
   else {listID.style.display="none";}
   window.event.cancelBubble=true;
  }
  function contw(listID) 
  {
   if (listID.style.display=="show") {listID.style.display="";}
   else {listID.style.display="none";}
   window.event.cancelBubble=true;
  }
  if (document.images) 
  { 
   img1on = new Image();
   img1on.src = "./gfx/but1.jpg"; 
   img1off = new Image(); 
   img1off.src = "./gfx/but2.jpg"; 
  }
  function imgOn(imgName) { if (document.images) { document[imgName].src = eval(imgName + "on.src"); } }
  function imgOff(imgName){ if (document.images) { document[imgName].src = eval(imgName + "off.src"); } }

function put_smiley(smiley,outp)
{
 if(outp == 'preview')
 {
  document.forms['novica'].preview.value += ' ' + smiley + ' ';
  document.forms['novica'].preview.focus();
 }
 if(outp == 'message')
 {
  document.forms['novica'].message.value += ' ' + smiley + ' ';
  document.forms['novica'].message.focus();
 }
}

function insert_tag(mytag,outp)
{
 if(outp == 'preview')
 {
  document.forms['novica'].preview.value += ' [' + mytag + '] ';
  document.forms['novica'].preview.focus();
 }
 if(outp == 'message')
 {
  document.forms['novica'].message.value += ' [' + mytag + '] ';
  document.forms['novica'].message.focus();
 }	
}
var winnew,ret;
winnew = 0;
winpix = 0;
ret = 0;
function PixWindow(handle)
{
 ret = handle;
 winpix=window.open("newspix.php","previewWin","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=650,height=400");
}

function PreviewWindow()
{
  winnew=window.open("","previewWin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=400,height=400");

 winnew.document.write('<html>');
 winnew.document.write('<head>');
 winnew.document.write('<title><?=_PREVIEW;?></title>');
 winnew.document.write('<link rel="stylesheet" type="text/css" href="css/preview.css" />');
 winnew.document.write('<meta http-equiv="Content-Type" content="text/html; charset=<?=_CHARSET;?>" />');
 winnew.document.write('</head>');
 winnew.document.write('<body bgcolor="#999999">');
 winnew.document.write('<table width="99%" bgcolor="#000000" cellspacing="1" cellpadding="3" align="center" class="MojText"><tr><td bgcolor="#ffffff">');
 winnew.document.write('<p id="tiph" style="width:99%; text-align:justify;"></p>');
 winnew.document.write('<p id="tipp" style="width:99%; text-align:justify;"></p>');
 winnew.document.write('<p id="tipm" style="width:99%; text-align:justify;"></p>');
 winnew.document.write('</td></tr></table></body></html>')
 if (winnew.focus) {winnew.focus()}
}

function ResetPreview()
{
  tiph.innerHTML = '';
  tipp.innerHTML = '';
  tipm.innerHTML = '';
}

function checkAll(field)
{
  for(i = 0; i < field.elements.length; i++)
     field[i].checked = true ;
}

function uncheckAll(field)
{
 for(i = 0; i < field.elements.length; i++)
    field[i].checked = false ;
}


function storeCaret (textEl)
{
 if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
}

function insertAtCaret (textEl, text)
{
 if (textEl.createTextRange && textEl.caretPos)
  {
   var caretPos = textEl.caretPos;
   caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
  }
 else
  textEl.value  = text;
}

