function zamowienie_zgoda()
{
   zgoda=document.getElementById("zgoda_box");
   pole1=document.getElementById("inna1");
   if(zgoda.checked==true) 
   {
    pole1.disabled=0;
   } 
   else 
   {
    pole1.disabled=1;
   }
}

function wystaw_fv()
{
   opcja=document.getElementById("chce_fv");
   if(opcja.checked==true)
   {
    pokaz_form("fv_dane",1);
   }
   else
   {
    pokaz_form("fv_dane",0);
   }    
}
function pokaz_form(div,x)
{
	div_=document.getElementById(div);
 	if(x>0) { div_.style.display="block";  }
 	else { div_.style.display="none" ;  }
}
/***********************************************
* DHTML slideshow script-  Ś Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice must stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var photos=new Array()
var photoslink=new Array()
var which=0
var foto=0

//Specify whether images should be linked or not (1=linked)
var linkornot=1

//do NOT edit pass this line

var preloadedimages=new Array()
for (i=0;i<photos.length;i++){
preloadedimages[i]=new Image()
preloadedimages[i].src=photos[i]
}


function applyeffect(){
if (document.all && photoslider.filters){
photoslider.filters.revealTrans.Transition=Math.floor(Math.random()*23)
photoslider.filters.revealTrans.stop()
photoslider.filters.revealTrans.apply()
}
}



function playeffect(){
if (document.all && photoslider.filters)
photoslider.filters.revealTrans.play()
}

function keeptrack(){
window.status="Image "+(which+1)+" of "+photos.length
}

function change_photo(foto){
which=foto
applyeffect()
document.images.photoslider.src=photos[foto]
document.anchors.photoslider.href=photoslink[foto]
playeffect()
keeptrack()
}

function backward(){
if (which>0){
which--
applyeffect()
document.images.photoslider.src=photos[which]
playeffect()
keeptrack()
}
}

function forward(){
if (which<photos.length-1){
which++
applyeffect()
document.images.photoslider.src=photos[which]
playeffect()
keeptrack()
}
}

function transport(){
window.location=photoslink[which]
}


function okno(adres) 
{
   var nazwa = "StayIn.pl";
   var dane= "menubar=no, toolbar=no, location=no, scrollbars=yes, resizable=no, status=no, width=617, height=520";
   noweOkno = window.open(adres, nazwa, dane);
}

function pokaz_div(div,x,t)
{
	div_=document.getElementById(div);
 	if(x>0) { div_.style.visibility="visible";  }
 	else { div_.style.visibility="hidden" ;  }
}
function findObj(n, d) {
		var p,i,x; 
	if(!d) d=document; 
	if((p=n.indexOf("?"))>0&&parent.frames.length) {
			d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
	}
		if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
		for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
		if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function show(n) {
	nObject = findObj (n);
	if (nObject) nObject.style.display='';
}
function hide(n) {
	nObject = findObj (n);
	if (nObject) nObject.style.display='none';
}
function limit_short(text,max)
{
  if(text.value.length>max)
  {
   	text.value=text.value.substring(0,max);
  }
  else text.form.licznik_short.value=(max-text.value.length);
}
function limit(text,max)
{
  if(text.value.length>max)
  {
   	text.value=text.value.substring(0,max);
  }
  else text.form.licznik_opis.value=(max-text.value.length);
}
function limit_slowa(text,max)
{
  if(text.value.length>max)
  {
   	text.value=text.value.substring(0,max);
  }
  else text.form.licznik_slowa.value=(max-text.value.length);
}
function check(text)
{
  if(text.form.temat.value!='' && text.form.podpis_short.value!='' && text.form.podpis.value!='' && text.form.slowa_kluczowe.value!='')
  {
   	text.form.akcja.disabled=0;
  }
  else text.form.akcja.disabled=1;
}

function StarsHighlight(star){
	/*Gwiazdki
	star1=gwiazdka pusta
	star2 wypelniowna
	star3 wypelniona ale wieksza niz zaznaczona
	*/
	var star0=new Image();
  star0.src="gfx/koronka_szara.gif";
  var star1=new Image();
  star1.src="gfx/koronka.gif";
  var star2=new Image();
  star2.src="gfx/koronka.gif";
  var stars=new Array();
  stars[1]=document.getElementById("koronka1");
  stars[2]=document.getElementById("koronka2");
  stars[3]=document.getElementById("koronka3");
  stars[4]=document.getElementById("koronka4");
  stars[5]=document.getElementById("koronka5");
  for(i=5;i>=1;i--)
   {
			if(i<=star)
         {
				if(stars[i].src!=star1.src)
            {
               stars[i].src=star1.src;
            }
			}
         else
         {
				if(stars[i].src!=star0.src)
            {
               stars[i].src=star0.src;
            }
			}
	}
}

