var r;

function test1() {}
////////
[].indexOf || (Array.prototype.indexOf = function(v){
	for(var i = 0; i<this.length && this[i] != v;i++);
	return i;
});

function zm_old(co,nazwa)
{

	var str="document.images['" + nazwa + "'].src = " + "\"" + co+"\"";
	setTimeout(str,40);
}

function zm_ob(offset,o){
	var currentIMG=document.images['duzy'].src.substring(document.images['duzy'].src.lastIndexOf('/')+1);
	var currentIndex=-1;
	for (var i=0; i<zdjecia_arr.length; i++){
		if(zdjecia_arr[i]==currentIMG) {
			currentIndex=i;
		}
	}
	
	var nextIndex=0;
	if (currentIndex+offset>zdjecia_arr.length-1){ nextIndex=0; }
	else if (currentIndex+offset<0){ nextIndex=zdjecia_arr.length-1; }
	else { nextIndex=currentIndex+offset; }
	
	r=zdjecia_arr[nextIndex];
	
	$(o).css({ color : '#2C85AC'});
	
	$(document.images['duzy']).animate({opacity: 0.1}, function(){
		document.images['duzy'].src='http://czarna.bieszczady.pl/rezerwacja_online/img/noclegi/'+r;
		$(document.images['duzy']).animate({opacity: 1}, function(){ $(o).css({ color : ''}) });
	});
	
}


preloadIMG = function(src){
	//prealoading zdjêæ obiektu
	var preloadKontener=document.getElementById('preloadKontener');
	if (!preloadKontener){
		preloadKontener = document.createElement('div');
		preloadKontener.id='preloadKontener';
		preloadKontener.style.display='none';
		document.body.appendChild(preloadKontener);
		var img=null;
		var r='';
		
		for (var i=0; i<zdjecia_arr.length; i++){
			img = document.createElement('img');
			img.src='http://czarna.bieszczady.pl/rezerwacja_online/img/noclegi/'+zdjecia_arr[i];;
			preloadKontener.appendChild(img);	
		}		
		
	}
};




$(function(){
	preloadIMG();
});


/********************/

function my_sel_pf(value) {
  obj = document.getElementById("fformy").elements["room"];
  if(obj.length) {
    for(i=0; i<obj.length; i++) {
      if(obj[i].value==value) {
        if (!obj[i].disabled) {
          obj[i].checked=true;
          pf_dalej = true;
        }
       // my_set_innerHTML("pfopis",OPIS[value]);      
      }
    }
  } else {
    if (obj.disabled!=1) {
      obj.checked=true;
      pf_dalej = true;
    } else {
      pf_dalej = false;
    }
    //my_set_innerHTML("pfopis",OPIS[value]);      
  }
}

function my_sel_pf2(value) {
  obj = document.getElementById("fformy").elements["person"];
  if(obj.length) {
    for(i=0; i<obj.length; i++) {
      if(obj[i].value==value) {
        if (!obj[i].disabled) {
          obj[i].checked=true;
          pf_dalej = true;
        }
       // my_set_innerHTML("pfopis",OPIS[value]);      
      }
    }
  } else {
    if (obj.disabled!=1) {
      obj.checked=true;
      pf_dalej = true;
    } else {
      pf_dalej = false;
    }
    //my_set_innerHTML("pfopis",OPIS[value]);      
  }
}


   