var newWindow = null
function makeNewWindow(name,width,height) {
  var rozmery = null
  
rozmery = "HEIGHT=" + height + ",WIDTH=" + width
  //if (text==undefined) text = ""
 // store new window object in global variable
 newWindow = window.open("","",rozmery)
 if (newWindow != null) {
  // assemble content for new window
  var newContent = "<HTML><HEAD><TITLE>Lyžařská střediska - foto</TITLE></HEAD>"
  newContent += "<BODY LEFTMARGIN=0 TOPMARGIN=0 MARGINHEIGHT=0 MARGINWIDTH=0 BGCOLOR='#C0C0CC'>"
  newContent += "<IMG SRC=" + name + " BORDER=0 ALIGN='CENTER' VSPACE=0 onclick='self.close()'>"
     

  newContent += "</BODY></HTML>"
  // write HTML to new window document
  newWindow.document.write(newContent)
  newWindow.document.close()
 }
}

function ImageLauncher(url)
{ window.open(url,"","toolbar=no,scrollbars=no,location=no,status=no,width=480,height=500,resizable=0");
};

function ImageLauncher1(url)
{ window.open(url,"","toolbar=yes,scrollbars=no,location=no,status=no,width=320,height=550,resizable=0");
};


var rotate_delay = 3000; // delay in milliseconds
current = 1;

function next() {
  if (current<imagesCount) {
    current++;
    self.document['gallery'].src = eval("imageNahled"+current+".src");
    //document.imageNumber.innerHTML = current;
    document.getElementById('imageNumber').innerHTML = current;
  }
}

function previous() {
  if (current > 1) {
    current--;
    document.images.gallery.src = eval("imageNahled"+current+".src");
    document.getElementById('imageNumber').innerHTML = current;
  }  
}

function first() {
  current = 1;
  document.images.gallery.src = eval("imageNahled"+current+".src");
  document.getElementById('imageNumber').innerHTML = current;
}

function last() {
  current = imagesCount;
  document.images.gallery.src = eval("imageNahled"+current+".src");
  document.getElementById('imageNumber').innerHTML = current;
}

function ap(text) {
  document.slideform.slidebutton.value = (text == "Stop") ? "Start" : "Stop";
  rotate();
}

function change() {
  current = document.slideform.slide.selectedIndex;
  document.images.show.src = document.slideform.slide[current].value;
}

function rotate() {
  if (document.slideform.slidebutton.value == "Stop") {
    current = (current == document.slideform.slide.length-1) ? 0 : current+1;
    document.images.show.src = document.slideform.slide[current].value;
    document.slideform.slide.selectedIndex = current;
    window.setTimeout("rotate()", rotate_delay);
   }
}

function showImageNewWindow() {
  var image = eval("image"+current);
  makeNewWindow(image.src,image.width,image.height);
}




/*
<!-- STEP TWO: Copy this code into the BODY of your HTML document  -->

<BODY>

<center>
<form name=slideform>
<table cellspacing=1 cellpadding=4 bgcolor="#000000">
<tr>
<td align=center bgcolor="white">
<b>Image Slideshow</b>
</td>
</tr>
<tr>
<td align=center bgcolor="white" width=200 height=150>
<img src="cart.gif" name="show">
</td>
</tr>
<tr>
<td align=center bgcolor="#C0C0C0">
<select name="slide" onChange="change();">
<option value="cart.gif" selected>Cart
<option value="aat.gif">AAT
<option value="boat.gif">Boat
<option value="enterprise.gif">Enterprise
<option value="ewing.gif">E-Wing
<option value="f18.gif">F-18
<option value="klingon.gif">Klingon
<option value="landingcraft.gif">Landing Craft
<option value="hoverracer.gif">Hover Racer
<option value="sith.gif">Sith
</select>
</td>
</tr>
<tr>
<td align=center bgcolor="#C0C0C0">
<input type=button onClick="first();" value="|<<" title="Beginning">
<input type=button onClick="previous();" value="<<" title="Previous">
<input type=button name="slidebutton" onClick="ap(this.value);" value="Start" title="AutoPlay">
<input type=button onClick="next();" value=">>" title="Next">
<input type=button onClick="last();" value=">>|" title="End">
</td>
</tr>
</table>
</form>
</center>

<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>

<!-- Script Size:  3.24 KB -->
*/

