
var BOOKMARKS=function(){this.bookmarksList=[];this.selectedBookmarksList=[];this.contentElementsList=[];this.getBookmarkElements=function(containerID,bookmarkClassName,selectedBookmarkClassName,contentClassName){if(this.bookmarksList.length!=0)
return;var children=document.getElementById(containerID).getElementsByTagName('div');var i=0;for(i=0;i<children.length;i++){if(children[i].className.indexOf(bookmarkClassName)!=-1){this.bookmarksList[this.bookmarksList.length]=children[i];}
if(children[i].className.indexOf(selectedBookmarkClassName)!=-1){this.selectedBookmarksList[this.selectedBookmarksList.length]=children[i];}
if(children[i].className.indexOf(contentClassName)!=-1){this.contentElementsList[this.contentElementsList.length]=children[i];}}}
this.selectBookmark=function(bookmarkNumber){var bookmark=null;var i=0;for(i=0;i<this.bookmarksList.length;i++){if(i==bookmarkNumber){this.bookmarksList[i].style.display="none";this.selectedBookmarksList[i].style.display="block";this.contentElementsList[i].style.display="block";}else{this.bookmarksList[i].style.display="block";this.selectedBookmarksList[i].style.display="none";this.contentElementsList[i].style.display="none";}}}}

var ROLLMENU=function(varName){this.varName=varName;this.timer=null;this.selectedBookmarkNumber=-1;this.elementHeight=120;this.rollTime=250;this.pixelsPerFrame=10;this.bookmarkIDList=[];this.selectedBookmarkIDList=[];this.contentIDList=[];this.getBookmarkElements=function(containerID,bookmarkClassName,selectedBookmarkClassName,contentClassName){if(this.bookmarkIDList.length!=0)
return;var children=document.getElementById(containerID).getElementsByTagName('div');var i=0;for(i=0;i<children.length;i++){if(children[i].className.indexOf(bookmarkClassName)!=-1){this.bookmarkIDList[this.bookmarkIDList.length]=children[i].id;}
if(children[i].className.indexOf(selectedBookmarkClassName)!=-1){this.selectedBookmarkIDList[this.selectedBookmarkIDList.length]=children[i].id;}
if(children[i].className.indexOf(contentClassName)!=-1){this.contentIDList[this.contentIDList.length]=children[i].id;}}}
this.selectBookmark=function(bookmarkNumber){if((this.selectedBookmarkNumber==bookmarkNumber)||(this.timer==true)){return;}
this.showSelectedBookmark(bookmarkNumber);this.animateBookmarks(bookmarkNumber);this.selectedBookmarkNumber=bookmarkNumber;}
this.showSelectedBookmark=function(bookmarkNumber){document.getElementById(this.bookmarkIDList[bookmarkNumber]).style.display="none";document.getElementById(this.selectedBookmarkIDList[bookmarkNumber]).style.display="block";if(document.getElementById(this.bookmarkIDList[this.selectedBookmarkNumber])){document.getElementById(this.bookmarkIDList[this.selectedBookmarkNumber]).style.display="block";document.getElementById(this.selectedBookmarkIDList[this.selectedBookmarkNumber]).style.display="none";}}
this.animateBookmarks=function(bookmarkNumber){this.timer=true;var i=1;var frameTime=(this.rollTime*this.pixelsPerFrame)/this.elementHeight;while((i*this.pixelsPerFrame)<=this.elementHeight){setTimeout('document.getElementById("'+this.contentIDList[bookmarkNumber]+'").style.height="'+(i*this.pixelsPerFrame)+'px"',Math.floor(i*frameTime));setTimeout('document.getElementById("'+this.contentIDList[bookmarkNumber]+'").style.display="block"',Math.floor(i*frameTime));if(document.getElementById(this.bookmarkIDList[this.selectedBookmarkNumber]))
setTimeout('document.getElementById("'+this.contentIDList[this.selectedBookmarkNumber]+'").style.height="'+(this.elementHeight-(i*this.pixelsPerFrame))+'px"',Math.floor(i*frameTime));i++;}
setTimeout(this.varName+'.timer=null',this.rollTime);if(document.getElementById(this.bookmarkIDList[this.selectedBookmarkNumber]))
setTimeout('document.getElementById("'+this.contentIDList[this.selectedBookmarkNumber]+'").style.display="none"',this.rollTime);}};

var ROTATEBOOKMARKS=function(varName){this.intervalID=null;this.contentElements=[];this.pagingElements=[];this.varName=varName;this.rotateTime=2000;this.selectedElementNumber=0;this.pagingElementClassName='pagingElement';this.selectedPagingElementClassName='selectedPagingElement';this.additionalAction=function(nr){};this.startRotate=function(){this.stopRotate();this.intervalID=setInterval(this.varName+'.selectBookmark("next")',this.rotateTime);}
this.stopRotate=function(){clearInterval(this.intervalID);}
this.getBookmarkElements=function(containerID){var x;var i=0;var children=document.getElementById(containerID).childNodes;while((x=children[i++])){if(x.nodeType==1){this.contentElements[this.contentElements.length]=x;}}}
this.getPagingElements=function(containerID){var x;var i=0;var children=document.getElementById(containerID).childNodes;while((x=children[i++])){if(x.nodeType==1){this.pagingElements[this.pagingElements.length]=x;}}}
this.selectBookmark=function(nr){if(nr=='next'){this.selectNextBookmark();}else if(nr=='previous'){this.selectPreviousBookmark();}else{this.stopRotate();this.displayContent(nr);this.additionalAction(nr);this.startRotate();}}
this.displayContent=function(nr){var i;for(i=0;i<this.contentElements.length;i++){if(i!=nr){this.contentElements[i].style.display='none';this.pagingElements[i].className=this.pagingElementClassName;}else{this.contentElements[i].style.display='block';this.pagingElements[i].className=this.selectedPagingElementClassName;}}
this.selectedElementNumber=nr;}
this.selectNextBookmark=function(){var nextNumber=this.selectedElementNumber+1;if(nextNumber>=this.contentElements.length){nextNumber=0;}
this.selectBookmark(nextNumber);}
this.selectPreviousBookmark=function(){var previousNumber=this.selectedElementNumber-1;if(previousNumber<0){previousNumber=this.contentElements.length-1;}
this.selectBookmark(previousNumber);}};

function validDate(date){var re=/^[0-9]{2}[.][0-9]{2}[.][0-9]{4}$/;return(re.test(date));}
var CALENDAR=function(destElementID,pozX,pozY,startDate,selectedMonth,selectedDay){this.destElementID=destElementID;this.pozX=pozX;this.pozY=pozY;if(!startDate){this.startDate=new Date();}else{this.startDate=startDate;}
if(!selectedMonth){this.selectedMonth=0;}else{this.selectedMonth=selectedMonth;}
if(!selectedDay){this.selectedDay=1;}else{this.selectedDay=selectedDay;}
this.startMonth=this.startDate.getMonth();this.startYear=this.startDate.getYear();this.calendarContainerID="calendar";this.monthCount=16;if(this.startYear<1000){this.startYear=1900+this.startYear;}
this.months=[];this.monthsHTML=[];this.returnDate=function(elementID,date){document.getElementById(elementID).value=date;}
this.showCalendar=function(){this.closeCalendar();this.generateMonthList();this.calendarDiv=document.createElement('div');this.calendarDiv.className="calendar";this.calendarDiv.id="calendar";this.calendarDiv.innerHTML='xxx';this.calendarDiv.style.left=pozX+'px';this.calendarDiv.style.top=pozY+'px';this.calendarDiv.innerHTML=this.HTML;document.getElementsByTagName('body')[0].appendChild(this.calendarDiv);this.selectMonth(this.selectedMonth);this.setSelects();}
this.returnSelectsDate=function(elementID){day=document.getElementById('calendarDay').value;monthName=document.getElementById('calendarMonth').options[document.getElementById('calendarMonth').selectedIndex].innerHTML;year=document.getElementById('calendarYear').options[document.getElementById('calendarYear').selectedIndex].innerHTML;switch(monthName)
{case'Styczeń':month='01';break;case'Luty':month='02';break;case'Marzec':month='03';break;case'Kwiecień':month='04';break;case'Maj':month='05';break;case'Czerwiec':month='06';break;case'Lipiec':month='07';break;case'Sierpień':month='08';break;case'Wrzesień':month='09';break;case'Październik':month='10';break;case'Listopad':month='11';break;case'Grudzień':month='12';break;default:month='01';}
if((day*1)<10){day='0'+(day*1);}
var date=day+'.'+month+'.'+year;document.getElementById(elementID).value=date;}
this.setSelects=function(){this.generateMonthList();day=this.selectedDay;month=this.months[this.selectedMonth].month;year=this.months[this.selectedMonth].year;startYear=this.months[0].year;endYear=this.months[this.monthCount-1].year;i=0;document.getElementById('calendarYear').innerHTML='';for(y=startYear;y<=endYear;y++){if(y==year){document.getElementById('calendarYear').options[i++]=new Option(y,y-year,true);document.getElementById('calendarYear').options[i-1].setAttribute('selected','selected');}else{document.getElementById('calendarYear').options[i++]=new Option(y,y-year);}}
i=0;document.getElementById('calendarMonth').innerHTML='';for(m=0;m<this.monthCount;m++){if(m==this.selectedMonth){if(this.months[m].year==year){document.getElementById('calendarMonth').options[i++]=new Option(this.months[m].monthName,m,true);document.getElementById('calendarMonth').options[i-1].setAttribute('selected','selected');}}else{if(this.months[m].year==year){document.getElementById('calendarMonth').options[i++]=new Option(this.months[m].monthName,m);}}}
i=0;daysInMonths=[31,28,31,30,31,30,31,31,30,31,30,31];if(((year%4==0)&&(year%100!=0))||(year%400==0))
daysInMonths[1]=29;else
daysInMonths[1]=28;days=daysInMonths[month];document.getElementById('calendarDay').innerHTML='';for(d=1;d<=days;d++){if(d==day){document.getElementById('calendarDay').options[i++]=new Option(d,d,true);document.getElementById('calendarDay').options[i-1].setAttribute('selected','selected');}else{document.getElementById('calendarDay').options[i++]=new Option(d,d);}}}
this.generateMonthList=function(){var i;var m=this.startMonth;var y=this.startYear;for(i=0;i<this.monthCount;i++){if(m>11){m-=12;y+=1;}
this.months[i]=new MONTH(this.destElementID,m,y);this.monthsHTML[i]=this.months[i].generateTable();m+=1;}
this.HTML='<iframe frameborder="0" style="border:none;width:380px;height:200px;" src="">x</iframe>'+'<div style="margin-top:-200px;width:380px;height:200px;overflow:hidden;position:relative;">'+'<div id="months" style="overflow:hidden;">'+'<div id="calendar_next" onclick="(new CALENDAR(\'\',\'\',\'\',\'\')).nextCalendar()" style="cursor:pointer;position:absolute;right:5px;top:3px;width:17px;height:17px;background: url(http://static.wakacje.pl/wakacje/images/mini/cal_next.gif)">&nbsp;</div>'+'<div id="calendar_previous" onclick="(new CALENDAR(\'\',\'\',\'\',\'\')).previousCalendar()" style="display:none;cursor:pointer;position:absolute;left:5px;top:3px;width:17px;height:17px;background: url(http://static.wakacje.pl/wakacje/images/mini/cal_previous.gif)">&nbsp;</div>'+'<table style="text-align:center" cellspacing="0" cellpadding="0">'+'<tr class="monthNames" style="background:#8db7dd url(http://static.wakacje.pl/wakacje/images/tla/boksy/center_oferty_top.gif)">';for(i=0;i<this.monthCount;i++){this.HTML+='<td><div style="width:190px;height:24px;font-size:13px;color:#ffffff"><div style="padding-top:4px">'+this.months[i].monthName+' '+this.months[i].year+'</div></div></td>';}
this.HTML+='</tr>';this.HTML+='<tr>';for(i=0;i<this.monthCount;i++){this.HTML+='<td style="border-right:1px solid #dcdcdc"><div style="width:190px;height:133px;">'+this.monthsHTML[i]+'</div></td>';}
this.HTML+='</tr>'+'</table>'+'</div>'+'<table cellspacing="0" cellpadding="0" style="width:100%;background:#9cb9dd;color:#ffffff;">'+'<tr>'+'<td style="font-size:10px;text-align:left;color:#ffffff;vertical-align:bottom;padding-left:5px">'+'Dzień'+'</td>'+'<td style="font-size:10px;text-align:left;color:#ffffff;vertical-align:bottom;padding-left:5px">'+'Miesiąc'+'</td>'+'<td style="font-size:10px;text-align:left;color:#ffffff;vertical-align:bottom;padding-left:5px">'+'Rok'+'</td>'+'<td rowspan="2" style="font-size:10px;text-align:right;color:#ffffff;vertical-align:bottom;padding-left:5px;">'+'<div style="width:110px;font-size:12px;padding-bottom:5px" >'+'<span style="cursor:pointer;margin-right:5px" onclick="(new CALENDAR(\'\',\'\',\'\',\'\')).closeCalendar()" onmouseover="this.style.textDecoration=\'underline\'" onmouseout="this.style.textDecoration=\'none\'">Zamknij</span>'+'</div>'+'</td>'+'</tr>'+'<tr>'+'<td style="vertical-align:top;text-align:left;color:#ffffff;padding-left:5px;padding-bottom:6px">'+'<select id="calendarDay" style="width:40px;font-size:11px;">'+'</select>'+'</td>'+'<td style="vertical-align:top;text-align:left;color:#ffffff;padding-left:5px;padding-bottom:6px">'+'<select onchange="(new CALENDAR(\'\',\'\',\'\',\'\')).selectMonth(this.value);(new CALENDAR(\''+this.destElementID+'\','+this.pozX+','+this.pozY+',new Date('+this.startYear+','+this.startMonth+','+1+'),this.value,document.getElementById(\'calendarDay\').value)).setSelects();" id="calendarMonth" style="width:85px;font-size:11px;">'+'</select>'+'</td>'+'<td style="vertical-align:top;text-align:left;color:#ffffff;padding-left:5px;padding-bottom:6px;white-space:nowrap">'+'<div style="width:120px"><select onchange="(new CALENDAR(\'\',\'\',\'\',\'\')).selectMonth(Math.max(Math.min(document.getElementById(\'calendarMonth\').value*1+(12*this.value),'+(this.monthCount-1)+'),0));(new CALENDAR(\''+this.destElementID+'\','+this.pozX+','+this.pozY+',new Date('+this.startYear+','+this.startMonth+','+1+'),Math.max(Math.min(document.getElementById(\'calendarMonth\').value*1+(12*this.value),'+(this.monthCount-1)+'),0),document.getElementById(\'calendarDay\').value)).setSelects();" id="calendarYear" style="width:60px;font-size:11px;float:left;margin-right:5px">'+'</select>'+'<div style="text-align:center;float:left;font-weight:bold;color:#757575;width:27px;height:20px;background:url(http://static.wakacje.pl/wakacje/images/mini/calendarButton.gif) no-repeat" onclick="(new CALENDAR(\'\',\'\',\'\',\'\')).returnSelectsDate(\''+this.destElementID+'\');(new CALENDAR(\'\',\'\',\'\',\'\')).closeCalendar()"><div style="padding-top:2px;">ok</div></div></div>'+'</td>'+'</tr>'+'</table>'+'</div>'+'</div>';}
this.closeCalendar=function(){var cal=document.getElementById('calendar');if(cal)
cal.parentNode.removeChild(cal);}
this.previousCalendar=function(){var marginLeft=document.getElementById('months').style.marginLeft;var ml=marginLeft.slice(0,marginLeft.length-2);ml=ml*1;document.getElementById('calendar_next').style.display='block';if(ml<0){document.getElementById('months').style.marginLeft=ml+382+"px";}
if(ml>=(-382)){document.getElementById('calendar_previous').style.display='none';}}
this.nextCalendar=function(){var marginLeft=document.getElementById('months').style.marginLeft;var ml=marginLeft.slice(0,marginLeft.length-2);ml=ml*1;document.getElementById('calendar_previous').style.display='block';if(ml>(-(this.monthCount/2-2)*382)){document.getElementById('months').style.marginLeft=ml-382+"px";}
if(ml<=(-(this.monthCount/2-3)*382)){document.getElementById('calendar_next').style.display='none';}}
this.selectMonth=function(monthNumber){var marginLeft=document.getElementById('months').style.marginLeft;var ml=marginLeft.slice(0,marginLeft.length-2);ml=ml*1;document.getElementById('calendar_previous').style.display='block';document.getElementById('calendar_next').style.display='block';if((monthNumber==0)||(monthNumber==1)){document.getElementById('calendar_previous').style.display='none';}else if((monthNumber==(this.monthCount-1))||(monthNumber==(this.monthCount-2))){document.getElementById('calendar_next').style.display='none';}
document.getElementById('months').style.marginLeft=-Math.floor(monthNumber/2)*382+"px";}
this.scrollCalendar=function(px){document.getElementById('months').style.marginLeft=px+"px";}}
var MONTH=function(destElementID,month,year){this.today=new Date();if((this.today.getFullYear()==year)&&(this.today.getMonth()==month)){this.currentMonth=true;}
this.destElementID=destElementID;this.month=month;this.year=year;var monthNames=['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec','Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'];this.monthName=monthNames[this.month];this.daysInMonths=[31,28,31,30,31,30,31,31,30,31,30,31];if(((this.year%4==0)&&(this.year%100!=0))||(this.year%400==0))
this.daysInMonths[1]=29;else
this.daysInMonths[1]=28;this.days=this.daysInMonths[this.month];this.validDate=function(day){var m;if(((this.month*1)+1)<10){m='0'+((this.month*1)+1);}else{m=(this.month*1)+1;}
if((day*1)<10){day='0'+(day*1);}
var date=day+'.'+m+'.'+this.year;return date;};this.generateTable=function(){this.previousMonth=this.month-1;this.previousYear=this.year;this.nextMonth=(this.month*1)+1;this.nextYear=this.year;if(this.previousMonth<0){this.previousMonth=11;this.previousYear--;}
if(this.nextMonth>11){this.nextMonth=0;this.nextYear++;}
this.previousMonth=new MONTH(this.destElementID,this.previousMonth,this.previousYear);this.nextMonth=new MONTH(this.destElementID,this.nextMonth,this.nextYear);var firstDay=new Date(this.year,this.month,1);var startDay=firstDay.getDay()-1;if(startDay<0)startDay=6;this.numberOfWeeks=Math.ceil((this.daysInMonths[this.month]+startDay)/7);this.output='<tr>'+'<td class="dayName">'+'Pn'+'</td>'+'<td class="dayName">'+'Wt'+'</td>'+'<td class="dayName">'+'Śr'+'</td>'+'<td class="dayName">'+'Cz'+'</td>'+'<td class="dayName">'+'Pt'+'</td>'+'<td class="dayName">'+'So'+'</td>'+'<td class="sunday">'+'Ni'+'</td>'+'</tr>';this.day=1;for(var i=1;i<=this.numberOfWeeks;i++){this.output+='<tr>';if(i==1){this.generateFirstWeek(startDay);}else if(i==this.numberOfWeeks){this.generateLastWeek();}else{this.generateWeek();}
this.output+='</tr>';}
return'<table class="monthTable" cellspacing="0" cellpadding="0">'+this.output+'</table>';}
this.generateFirstWeek=function(startDay){var z;var pastDay=false;var currentDay=false;for(z=0;z<startDay;z++){if((this.currentMonth)&&(this.day<this.today.getDate())){pastDay=true;}else{pastDay=false;}
if((this.currentMonth)&&(this.day==this.today.getDate())){currentDay=true;}else{currentDay=false;}
if(this.month==0){if(pastDay){this.output+='<td class="disabled past">';}else{this.output+='<td class="disabled" onclick="document.getElementById(\''+this.destElementID+'\').value=\''+this.previousMonth.validDate(this.previousMonth.days-(startDay-z)+1)+'\';(new CALENDAR(\'\',\'\',\'\',\'\')).closeCalendar()"    onmouseover="this.style.backgroundColor=\'#ffe259\'" onmouseout="this.style.backgroundColor=\'#ffffff\'">';}}else{if(pastDay){this.output+='<td class="disabled past">';}else{this.output+='<td class="disabled" onclick="document.getElementById(\''+this.destElementID+'\').value=\''+this.previousMonth.validDate(this.previousMonth.days-(startDay-z)+1)+'\';(new CALENDAR(\'\',\'\',\'\',\'\')).closeCalendar()"     onmouseover="this.style.backgroundColor=\'#ffe259\'" onmouseout="this.style.backgroundColor=\'#ffffff\'">';}}
this.output+=this.previousMonth.days-(startDay-z)+1;this.output+='</td>';}
for(z=1;z<=(7-startDay);z++){if((this.currentMonth)&&(this.day<this.today.getDate())){pastDay=true;}else{pastDay=false;}
if((this.currentMonth)&&(this.day==this.today.getDate())){currentDay=true;}else{currentDay=false;}
if(z==(7-startDay)){if(pastDay){this.output+='<td class="sunday past">';}else{if(currentDay){this.output+='<td class="sunday current" onclick="document.getElementById(\''+this.destElementID+'\').value=\''+this.validDate(this.day)+'\';(new CALENDAR(\'\',\'\',\'\',\'\')).closeCalendar()"    onmouseover="this.style.backgroundColor=\'#ffe259\'" onmouseout="this.style.backgroundColor=\'#ffffff\'">';}else{this.output+='<td class="sunday" onclick="document.getElementById(\''+this.destElementID+'\').value=\''+this.validDate(this.day)+'\';(new CALENDAR(\'\',\'\',\'\',\'\')).closeCalendar()"    onmouseover="this.style.backgroundColor=\'#ffe259\'" onmouseout="this.style.backgroundColor=\'#ffffff\'">';}}}else{if(pastDay){this.output+='<td class="past">';}else{if(currentDay){this.output+='<td class="current" onclick="document.getElementById(\''+this.destElementID+'\').value=\''+this.validDate(this.day)+'\';(new CALENDAR(\'\',\'\',\'\',\'\')).closeCalendar()"    onmouseover="this.style.backgroundColor=\'#ffe259\'" onmouseout="this.style.backgroundColor=\'#ffffff\'">';}else{this.output+='<td onclick="document.getElementById(\''+this.destElementID+'\').value=\''+this.validDate(this.day)+'\';(new CALENDAR(\'\',\'\',\'\',\'\')).closeCalendar()"    onmouseover="this.style.backgroundColor=\'#ffe259\'" onmouseout="this.style.backgroundColor=\'#ffffff\'">';}}}
this.output+=(this.day)++;this.output+='</td>';}};this.generateLastWeek=function(){var z;var m=1;var pastDay=false;var currentDay=false;for(z=1;z<=7;z++){if((this.currentMonth)&&(this.day<this.today.getDate())){pastDay=true;}else{pastDay=false;}
if((this.currentMonth)&&(this.day==this.today.getDate())){currentDay=true;}else{currentDay=false;}
if(this.day<=this.daysInMonths[this.month]){if(z==7){if(pastDay){this.output+='<td class="sunday past">';}else{if(currentDay){this.output+='<td class="sunday current" onclick="document.getElementById(\''+this.destElementID+'\').value=\''+this.validDate(this.day)+'\';(new CALENDAR(\'\',\'\',\'\',\'\')).closeCalendar()"    onmouseover="this.style.backgroundColor=\'#ffe259\'" onmouseout="this.style.backgroundColor=\'#ffffff\'">';}else{this.output+='<td class="sunday" onclick="document.getElementById(\''+this.destElementID+'\').value=\''+this.validDate(this.day)+'\';(new CALENDAR(\'\',\'\',\'\',\'\')).closeCalendar()"    onmouseover="this.style.backgroundColor=\'#ffe259\'" onmouseout="this.style.backgroundColor=\'#ffffff\'">';}}}else{if(pastDay){this.output+='<td class="past">';}else{if(currentDay){this.output+='<td class="current" onclick="document.getElementById(\''+this.destElementID+'\').value=\''+this.validDate(this.day)+'\';(new CALENDAR(\'\',\'\',\'\',\'\')).closeCalendar()"    onmouseover="this.style.backgroundColor=\'#ffe259\'" onmouseout="this.style.backgroundColor=\'#ffffff\'">';}else{this.output+='<td onclick="document.getElementById(\''+this.destElementID+'\').value=\''+this.validDate(this.day)+'\';(new CALENDAR(\'\',\'\',\'\',\'\')).closeCalendar()"    onmouseover="this.style.backgroundColor=\'#ffe259\'" onmouseout="this.style.backgroundColor=\'#ffffff\'">';}}}
this.output+=(this.day)++;}else{if(this.month==11){if(pastDay){this.output+='<td class="disabled past">';}else{this.output+='<td class="disabled" onclick="document.getElementById(\''+this.destElementID+'\').value=\''+this.nextMonth.validDate(m)+'\';(new CALENDAR(\'\',\'\',\'\',\'\')).closeCalendar()"    onmouseover="this.style.backgroundColor=\'#ffe259\'" onmouseout="this.style.backgroundColor=\'#ffffff\'">';}}else{if(pastDay){this.output+='<td class="disabled past">';}else{this.output+='<td class="disabled" onclick="document.getElementById(\''+this.destElementID+'\').value=\''+this.nextMonth.validDate(m)+'\';(new CALENDAR(\'\',\'\',\'\',\'\')).closeCalendar()"    onmouseover="this.style.backgroundColor=\'#ffe259\'" onmouseout="this.style.backgroundColor=\'#ffffff\'">';}}
this.output+=m++;}
this.output+='</td>';}};this.generateWeek=function(){var z;var pastDay=false;var currentDay=false;for(z=1;z<=7;z++){if((this.currentMonth)&&(this.day<this.today.getDate())){pastDay=true;}else{pastDay=false;}
if((this.currentMonth)&&(this.day==this.today.getDate())){currentDay=true;}else{currentDay=false;}
if(z==7){if(pastDay){this.output+='<td class="sunday past">';}else{if(currentDay){this.output+='<td class="sunday current" onclick="document.getElementById(\''+this.destElementID+'\').value=\''+this.validDate(this.day)+'\';(new CALENDAR(\'\',\'\',\'\',\'\')).closeCalendar()"    onmouseover="this.style.backgroundColor=\'#ffe259\'" onmouseout="this.style.backgroundColor=\'#ffffff\'">';}else{this.output+='<td class="sunday" onclick="document.getElementById(\''+this.destElementID+'\').value=\''+this.validDate(this.day)+'\';(new CALENDAR(\'\',\'\',\'\',\'\')).closeCalendar()"    onmouseover="this.style.backgroundColor=\'#ffe259\'" onmouseout="this.style.backgroundColor=\'#ffffff\'">';}}}else{if(pastDay){this.output+='<td class="past">';}else{if(currentDay){this.output+='<td class="current" onclick="document.getElementById(\''+this.destElementID+'\').value=\''+this.validDate(this.day)+'\';(new CALENDAR(\'\',\'\',\'\',\'\')).closeCalendar()"    onmouseover="this.style.backgroundColor=\'#ffe259\'" onmouseout="this.style.backgroundColor=\'#ffffff\'">';}else{this.output+='<td onclick="document.getElementById(\''+this.destElementID+'\').value=\''+this.validDate(this.day)+'\';(new CALENDAR(\'\',\'\',\'\',\'\')).closeCalendar()"    onmouseover="this.style.backgroundColor=\'#ffe259\'" onmouseout="this.style.backgroundColor=\'#ffffff\'">';}}}
this.output+=(this.day)++;}};}
function findPos(obj){var curleft=curtop=0;if(obj.offsetParent){do{curleft+=obj.offsetLeft;curtop+=obj.offsetTop;}while(obj=obj.offsetParent);}
return[curleft,curtop];}

function findPos(obj){var curleft=curtop=0;if(obj.offsetParent){do{curleft+=obj.offsetLeft;curtop+=obj.offsetTop;}while(obj=obj.offsetParent);}
return[curleft,curtop];}
if(typeof SEARCHBOX=="undefined")
{var SEARCHBOX={showAdvancedSearch:function(){document.getElementById('searchbox').className=document.getElementById('searchbox').className.replace(" simple","");document.getElementById('searchbox').className+=" advanced";document.getElementById('searchbox').className=document.getElementById('searchbox').className.replace(" splBoxLeftSearchShort","");document.getElementById('searchbox').className+=" advBoxLeftSearchShort";},showSimpleSearch:function(){if(document.getElementById('panstwo')){if(document.getElementById('panstwo').getAttribute('multiple')){SEARCHBOX.chooseOneDestination();}}
document.getElementById('searchbox').className=document.getElementById('searchbox').className.replace(" advanced","");document.getElementById('searchbox').className+=" simple";document.getElementById('searchbox').className=document.getElementById('searchbox').className.replace(" advBoxLeftSearchShort","");document.getElementById('searchbox').className+=" splBoxLeftSearchShort";},showAdvancedSearchHotels:function(){document.getElementById('hotelSearchbox').className=document.getElementById('hotelSearchbox').className.replace(" splVersion","");document.getElementById('hotelSearchbox').className+=" advVersion";},showSimpleSearchHotels:function(){if(document.getElementById('panstwo')){if(document.getElementById('panstwo').getAttribute('multiple')){SEARCHBOX.chooseOneDestination();}}
document.getElementById('hotelSearchbox').className=document.getElementById('hotelSearchbox').className.replace(" advVersion","");document.getElementById('hotelSearchbox').className+=" splVersion";},displayRegions:function(panstwo,param){var additionalParam='';if(param)
{param='&'+param;}
else
{param='';}
var callback={success:function(o){var regions=o.responseXML.getElementsByTagName('region');var i,regionName,regionValue;var id_destynacje=document.getElementById('id_destynacje');id_destynacje.setAttribute('disabled','disabled');id_destynacje.innerHTML='';for(i=0;i<regions.length;i++){regionValue=regions[i].getAttribute('value');regionName=regions[i].firstChild.nodeValue;id_destynacje.options[i]=new Option(regionName,regionValue);}
if(regions.length==1){id_destynacje.setAttribute('disabled','disabled');id_destynacje.innerHTML="<option>\n"+"-- dowolny --\n"+"</option>";}else{id_destynacje.removeAttribute('disabled');}},failure:function(o){}};YAHOO.util.Connect.asyncRequest('GET','/?page=search_regionsAjax&type=text/xml&panstwo='+panstwo+param,callback,null);},displayRegionsNarty:function(panstwo){var callback={success:function(o){var regions=o.responseXML.getElementsByTagName('region');var i,regionName,regionValue;var id_destynacje=document.getElementById('id_destynacje');id_destynacje.setAttribute('disabled','disabled');id_destynacje.innerHTML='';for(i=0;i<regions.length;i++){regionValue=regions[i].getAttribute('value');regionName=regions[i].firstChild.nodeValue;id_destynacje.options[i]=new Option(regionName,regionValue);}
if(regions.length==1){id_destynacje.setAttribute('disabled','disabled');id_destynacje.innerHTML="<option>\n"+"-- dowolny --\n"+"</option>";}else{id_destynacje.removeAttribute('disabled');}},failure:function(o){}};YAHOO.util.Connect.asyncRequest('GET','/?page=search_regionsAjax&type=text/xml&panstwo='+panstwo+'&narty=on',callback,null);},displayRegionsHOT:function(panstwo){var callback={success:function(o){var regions=o.responseXML.getElementsByTagName('region');var i,regionName,regionValue;var id_destynacje=document.getElementById('id_destynacje');id_destynacje.setAttribute('disabled','disabled');id_destynacje.innerHTML='';for(i=0;i<regions.length;i++){regionValue=regions[i].getAttribute('value');regionName=regions[i].firstChild.nodeValue;id_destynacje.options[i]=new Option(regionName,regionValue);}
if(regions.length==1){id_destynacje.setAttribute('disabled','disabled');}else{id_destynacje.removeAttribute('disabled');}},failure:function(o){}};YAHOO.util.Connect.asyncRequest('GET','/?page=search_regionsHotAjax&type=text/xml&panstwo='+panstwo,callback,null);},chooseFewDestinations:function(){document.getElementById('chooseOneDestination').className='';document.getElementById('chooseFewDestinations').className='hidden';var id_destynacje=document.getElementById('id_destynacje');id_destynacje.setAttribute('disabled','disabled');id_destynacje.innerHTML="<option>\n"+"- wybierz kierunek aby określia region -\n"+"</option>";var panstwa=document.getElementById('panstwo');panstwa.setAttribute('multiple','multiple');panstwa.setAttribute('size','7');panstwa.setAttribute('tabindex','1');panstwa.setAttribute('name','panstwo[]');panstwa.className='select_panstwo multiple';var clonedPanstwa=panstwa.cloneNode(true);clonedPanstwa.onchange=function(){};var parent=panstwa.parentNode;parent.replaceChild(clonedPanstwa,panstwa);},chooseOneDestination:function(){document.getElementById('chooseFewDestinations').className='';document.getElementById('chooseOneDestination').className='hidden';var panstwa=document.getElementById('panstwo');panstwa.removeAttribute('multiple');panstwa.removeAttribute('size');panstwa.setAttribute('name','panstwo');panstwa.className='select_panstwo';var clonedPanstwa=panstwa.cloneNode(true);clonedPanstwa.onchange=function(){SEARCHBOX.displayRegions(this.value)};var parent=panstwa.parentNode;parent.replaceChild(clonedPanstwa,panstwa);},chooseFewDepartures:function(){document.getElementById('chooseOneDeparture').className='';document.getElementById('chooseFewDepartures').className='hidden';var departure=document.getElementById('id_okol');departure.setAttribute('multiple','multiple');departure.setAttribute('size','7');departure.setAttribute('tabindex','1');departure.setAttribute('name','id_okol[]');departure.className='select_id_okol multiple';var clonedDeparture=departure.cloneNode(true);var parent=departure.parentNode;parent.replaceChild(clonedDeparture,departure);},chooseOneDeparture:function(){document.getElementById('chooseOneDeparture').className='hidden';document.getElementById('chooseFewDepartures').className='';var departure=document.getElementById('id_okol');departure.removeAttribute('multiple');departure.removeAttribute('size');departure.setAttribute('name','id_okol');departure.className='select_id_okol';var clonedDeparture=departure.cloneNode(true);var parent=departure.parentNode;parent.replaceChild(clonedDeparture,departure);},clearSearchForm:function(){var form=document.getElementById('form_wyszukaj');var inputs=form.getElementsByTagName('input');var selects=form.getElementsByTagName('select');var input;var select;for(i=0,input;input=inputs.item(i++);){if(input.getAttribute('type')=="text"){input.value='';}else if(input.getAttribute('type')=="checkbox"){input.checked=false;}}
for(i=0,select;select=selects.item(i++);){select.value="";select.value="0";}},validateHotelCategory:function(){minCategory=document.getElementById('kategoria_hotelu__gte');maxCategory=document.getElementById('kategoria_hotelu__lte');if(minCategory.value==50){maxCategory.value=0;maxCategory.setAttribute('disabled','disabled');}else{maxCategory.removeAttribute('disabled');}},showDepartureCalendar:function(posX,posY){startDate=null;selectedMonth=null;wyjazd=document.getElementById('dzien__gte');if(validDate(wyjazd.value)){currentMonth=(new Date()).getMonth()+1;pickedMonth=wyjazd.value.split('.')[1];if(currentMonth<=pickedMonth){selectedMonth=pickedMonth-currentMonth;}else{selectedMonth=pickedMonth-currentMonth+12;}}
(new CALENDAR('dzien__gte',posX,posY,startDate,selectedMonth)).showCalendar();},showReturnCalendar:function(posX,posY){startDate=null;wyjazd=document.getElementById('dzien__gte');powrot=document.getElementById('dzien_zak__lte');if(validDate(wyjazd.value)){startDate=new Date(wyjazd.value.split('.')[2],wyjazd.value.split('.')[1]-1,wyjazd.value.split('.')[0]);}
(new CALENDAR('dzien_zak__lte',posX,posY,startDate)).showCalendar();}}}

var PAGING=function(varName,pageNum,numberOfPages){this.varName=varName;this.centerElementsID=[];this.pagingElementsID=[];this.numberOfPages=numberOfPages;this.selectedPage=pageNum;this.numberOfDisplayedPages=20;this.centerElementsID[0]='pagingList1';this.pagingElementsID[0]='paging1';this.hideLastPage=false;this.hideFirstPage=false;this.pagingHTML='<div class="paging">'+'<div class="pagingLeft">'+'{pagingLeft}'+'</div>'+'<div class="pagingRight">'+'{pagingRight}'+'</div>'+'<div id="{centerElementID}" class="pagingCenter">'+'{pagingCenter}'+'</div>'+'<div style="font-size:0px;line-height:0px;clear:both">&nbsp;</div>'+'</div>';this.pagingLeftDisabledHTML='<div class="firstDisabled">&nbsp;</div>'+'<div class="previousDisabled">&nbsp;</div>';this.pagingLeftHTML='<div class="firstEnabled" onclick="{actionFirst}">&nbsp;</div>'+'<div class="previousEnabled" onclick="{actionPrevious}">&nbsp;</div>';this.pagingRightDisabledHTML='<div class="nextDisabled">&nbsp;</div>'+'<div class="lastDisabled">&nbsp;</div>';this.pagingRightHTML='<div class="nextEnabled" onclick="{actionNext}">&nbsp;</div>'+'<div class="lastEnabled" onclick="{actionLast}">&nbsp;</div>';this.pagingElementHTML='<div class="page {className}" onclick="{action}">{number}</div>';this.pagingDotsHTML='<div class="page dots selected">...</div>';this.collapse=function(id){var width=0;var children=document.getElementById(id).childNodes;for(var i=0;i<children.length;i++){width+=children[i].offsetWidth;}
document.getElementById(id).style.width=width+'px';}
this.actionFunction=function(number){var pageNumber=number-1;return"alert("+pageNumber+")";}
this.replaceContent=function(text,vars){returnText=text;for(var key in vars){returnText=returnText.replace('{'+key+'}',vars[key]);}
return returnText;}
this.generatePagingHTML=function(){var listHTML=this.pagingElementHTML;var vars;if(this.numberOfPages<=this.numberOfDisplayedPages){for(i=1;i<=this.numberOfPages;i++){vars=[];vars['number']=i;vars['action']='';if(i==this.selectedPage){if(i==1){vars['className']='selected first';}else if(i==this.numberOfPages){vars['className']='selected last';}else{vars['className']='selected';}}else{if(i==1){vars['className']='first';}else if(i==this.numberOfPages){vars['className']='last';}else{vars['className']='';}
vars['action']=this.actionFunction(i);}
if(this.numberOfPages==1){vars['className']="selected first last";}
listHTML=this.replaceContent(listHTML,vars);if(i<this.numberOfPages){listHTML+=this.pagingElementHTML;}}}else{if(this.selectedPage<=(this.numberOfDisplayedPages-4)){for(i=1;i<=(this.numberOfDisplayedPages-3);i++){vars=[];vars['number']=i;vars['action']='';if(i==this.selectedPage){if(i==1){vars['className']='selected first';}else if(i==this.numberOfPages){vars['className']='selected last';}else{vars['className']='selected';}}else{if(i==1){vars['className']='first';}else if(i==this.numberOfPages){vars['className']='last';}else{vars['className']='';}
vars['action']=this.actionFunction(i);}
listHTML=this.replaceContent(listHTML,vars);if(i<(this.numberOfDisplayedPages-3)){listHTML+=this.pagingElementHTML;}else{if(!this.hideLastPage){listHTML+=this.pagingDotsHTML+this.pagingElementHTML;}else{listHTML+=this.pagingDotsHTML;}}}
vars=[];vars['number']=this.numberOfPages;vars['className']='last';vars['action']=this.actionFunction(this.numberOfPages);listHTML=this.replaceContent(listHTML,vars);}else if(this.selectedPage>=(this.numberOfPages-(this.numberOfDisplayedPages-5))){vars=[];vars['number']=1;vars['action']='';if(1==this.selectedPage){vars['className']='selected first';}else{vars['className']='first';vars['action']=this.actionFunction(1);}
if(!this.hideFirstPage){listHTML=this.replaceContent(listHTML,vars);}else{listHTML='';}
listHTML+=this.pagingDotsHTML+this.pagingElementHTML;for(i=(this.numberOfPages-(this.numberOfDisplayedPages-4));i<=this.numberOfPages;i++){vars=[];vars['number']=i;vars['action']='';if(i==this.selectedPage){if(i==this.numberOfPages){vars['className']='selected last';}else{vars['className']='selected';}}else{if(i==this.selectedPage){vars['className']='last';}else{vars['className']='';}
vars['action']=this.actionFunction(i);}
listHTML=this.replaceContent(listHTML,vars);if(i<this.numberOfPages){listHTML+=this.pagingElementHTML;}}}else{vars=[];vars['number']=1;vars['action']='';if(1==this.selectedPage){vars['className']='selected first';}else{vars['className']='first';vars['action']=this.actionFunction(1);}
if(!this.hideFirstPage){listHTML=this.replaceContent(listHTML,vars);}else{listHTML='';}
listHTML+=this.pagingDotsHTML+this.pagingElementHTML;var margin=Math.floor(((this.numberOfDisplayedPages-6)/2));if(margin<0)margin=0;i=0;for(i=(this.selectedPage-margin);i<=(this.selectedPage+margin);i++){vars=[];vars['number']=i;vars['action']='';if(i==this.selectedPage){vars['className']='selected';}else{vars['className']='';vars['action']=this.actionFunction(i);}
listHTML=this.replaceContent(listHTML,vars);if(i<(this.selectedPage+margin)){listHTML+=this.pagingElementHTML;}else{if(!this.hideLastPage){listHTML+=this.pagingDotsHTML+this.pagingElementHTML;}else{listHTML+=this.pagingDotsHTML;}}}
vars=[];vars['number']=this.numberOfPages;if(this.numberOfPages==this.selectedPage){vars['className']='selected last';}else{vars['className']='last';vars['action']=this.actionFunction(this.numberOfPages);}
listHTML=this.replaceContent(listHTML,vars);}}
return listHTML;}
this.displayPaging=function(){if(this.numberOfPages>1){var vars=[];if(this.selectedPage==1)
vars['pagingLeft']=this.replaceContent(this.pagingLeftDisabledHTML,vars);else{vars['actionFirst']=this.actionFunction(1);vars['actionPrevious']=this.actionFunction(this.selectedPage-1);vars['pagingLeft']=this.replaceContent(this.pagingLeftHTML,vars);}
if(this.selectedPage==this.numberOfPages)
vars['pagingRight']=this.replaceContent(this.pagingRightDisabledHTML,vars);else{vars['actionLast']=this.actionFunction(this.numberOfPages);vars['actionNext']=this.actionFunction(this.selectedPage+1);vars['pagingRight']=this.replaceContent(this.pagingRightHTML,vars);}
vars['pagingCenter']=this.generatePagingHTML();var pagingDest=null;var i=0;for(i=0;i<this.centerElementsID.length;i++){vars['centerElementID']=this.centerElementsID[i];pagingDest=document.getElementById(this.pagingElementsID[i]);pagingDest.innerHTML=this.replaceContent(this.pagingHTML,vars);this.collapse(this.centerElementsID[i]);}}}}

function isArray(obj){if(obj.constructor.toString().indexOf("Array")==-1)
return false;else
return true;}
if(typeof URL=="undefined")
{var URL={hash:window.location.hash,pathname:window.location.pathname,search:window.location.search,host:window.location.host,protocol:window.location.protocol,hashTable:null,searchTable:null,getHashTable:function()
{var start;var z=0;var getList=[];var getTable=[];var tableValues;var name="";var value="";var unescapedName;getList=location.hash.substring(1).split('&');for(var i=0;i<getList.length;i++){if(getList[i].indexOf('=')!=-1){name=getList[i].split('=')[0];unescapedName=unescape(name);name=escape(unescapedName.replace('[]',''));value=getList[i].split('=')[1];if(unescapedName.indexOf('[]')!=-1){if(getTable[name]){getTable[name][getTable[name].length]=value;}else{getTable[name]=[];getTable[name][0]=value;}}else{getTable[name]=value;}}}
URL.hashTable=getTable;},getSearchTable:function()
{var start;var z=0;var getList=[];var getTable=[];var tableValues;var name="";var value="";var unescapedName;if(URL.search)
getList=location.search.substring(1).split('&');for(var i=0;i<getList.length;i++){if(getList[i].indexOf('=')!=-1){name=getList[i].split('=')[0];unescapedName=unescape(name);name=escape(unescapedName.replace('[]',''));value=getList[i].split('=')[1];if(unescapedName.indexOf('[]')!=-1){if(getTable[name]){getTable[name][getTable[name].length]=value;}else{getTable[name]=[];getTable[name][0]=value;}}else{getTable[name]=value;}}}
URL.searchTable=getTable;},setNewSearchValue:function(key,value){URL.searchTable[key]=value;URL.createNewSearch();},removeSearchKey:function(key){if(typeof URL.searchTable[key]!="undefined")
delete(URL.searchTable[key]);URL.createNewSearch();},createNewSearch:function(){URL.search='';var i;for(var key in URL.searchTable){if(isArray(URL.searchTable[key])){i=0;while(URL.searchTable[key][i])
URL.search+=key+'[]='+URL.searchTable[key][i++]+'&';}else{URL.search+=key+'='+URL.searchTable[key]+'&';}}
if(URL.search!='')
URL.search=URL.search.substring(0,URL.search.length-1);},setNewHashValue:function(key,value){URL.hashTable[key]=value;URL.createNewHash();},createNewHash:function(){URL.hash='';var i;for(var key in URL.hashTable){if(isArray(URL.hashTable[key])){i=0;while(URL.hashTable[key][i])
URL.hash+=key+'[]='+URL.hashTable[key][i++]+'&';}else{URL.hash+=key+'='+URL.hashTable[key]+'&';}}
if(URL.hash!='')
URL.hash=URL.hash.substring(0,URL.hash.length-1);},createNewURL:function(){URL.newURL=URL.protocol+'//'+URL.host;if((URL.pathname)&&(URL.pathname!='/'))URL.newURL+=URL.pathname;if(URL.search)URL.newURL+='?'+URL.search;if(URL.hash)URL.newURL+=URL.hash;},restoreURL:function(){URL.getHashTable();URL.getSearchTable();}};URL.getHashTable();URL.getSearchTable();}

function clipboardAdd(id_term,id_biura){var terminy_cookie=YAHOO.util.Cookie.get('clipboardOffers');terminy_cookie=""+terminy_cookie+"";if(terminy_cookie)
{var tab=terminy_cookie.split("=true&");if(tab.length>=25){return(3);}
for(i=0;i<tab.length;i++)
{if(tab[i].indexOf("=true")>0)
{var dl=tab[i].length-5;tab[i]=tab[i].substr(0,dl);}
if((tab[i]==id_term+":"+id_biura)||(tab[i]==id_term+escape(':')+id_biura))
{return(2);}}
YAHOO.util.Cookie.setSub('clipboardOffers',id_term+':'+id_biura,"true",{path:"/",expires:new Date("January 12, 2025"),domain:".wakacje.pl"});updateClipboardOffersCount();return(1);}
else
{YAHOO.util.Cookie.setSub('clipboardOffers',id_term+':'+id_biura,'true',{path:"/",expires:new Date("January 12, 2025"),domain:".wakacje.pl"});updateClipboardOffersCount();return(1);}}
function clipboardRemove(id_term,id_biura){YAHOO.util.Cookie.removeSub('clipboardOffers',id_term+':'+id_biura,{path:"/",domain:".wakacje.pl"});updateClipboardOffersCount();}
function clipboardTest(id_term,id_biura){var terminy_cookie=readCookie('clipboardOffers');if(terminy_cookie)
{terminy_cookie=""+terminy_cookie+"";var tab=terminy_cookie.split("=true&");for(i=0;i<tab.length;i++)
{if(tab[i].indexOf("=true")>0)
{var dl=tab[i].length-5;tab[i]=tab[i].substr(0,dl);}
if((tab[i]==id_term+":"+id_biura)||(tab[i]==id_term+escape(':')+id_biura))
{return(0);}}}
return(1);}
function addTermToCookie(){document.getElementById('dodaj_do_schowka').style.display='none';document.getElementById('dodaj_do_schowka_selected').style.display='block';var id_term=false;if(document.getElementById('clipboard_id_terminy')){id_term=document.getElementById('clipboard_id_terminy').value;}
if(document.getElementById('clipboard_id_terminy').value>0){id_term=document.getElementById('clipboard_id_terminy').value;}
if(document.getElementById('id_biura')){var id_biura=document.getElementById('id_biura').value;}
if(id_term&&id_biura){var callback={success:function(o){document.getElementById('clipboardTerm1').innerHTML=o.responseText;document.getElementById('clipboardTerm2').innerHTML=o.responseText;},failure:function(o){}};var ajaxTermUrl="/?page=schowekAjax&id_terminy="+id_term+"&id_biura="+id_biura;YAHOO.util.Connect.asyncRequest('GET',ajaxTermUrl,callback,null);ret=clipboardAdd(id_term,id_biura);if(ret==1){document.getElementById('schowekInfo').className='dodano';}else if(ret==3){document.getElementById('schowekInfo').className='zaDuzo';}else{document.getElementById('schowekInfo').className='nieDodano';}
document.getElementById('schowekInfo').style.display='block';}}
function refreshNavigClipboard(){var clipboardCallback={success:function(o){document.getElementById('navigClipboard').innerHTML=o.responseText;},failure:function(o){}};document.getElementById('navigClipboard').innerHTML='Mój schowek: <b>...</b>';var navigClipboardUrl="/?page=navigClipboardContainer&rand="+Math.random();YAHOO.util.Connect.asyncRequest('GET',navigClipboardUrl,clipboardCallback,null);}
function hideClipboard(){if(document.getElementById('schowekInfo')){document.getElementById('schowekInfo').style.display='none';}}
function centerOfferDescrShortClipboardRemove(){var id_term=window.URL.hashTable['id_terminy'];if(!id_term){id_term=window.URL.searchTable['id_terminy'];}
var idOfertyIdBiura=document.location.href.match(/([0-9]{1,},[0-9]{1,})(\.html)/)[1].split(',');var id_biura=idOfertyIdBiura[1];clipboardRemove(id_term,id_biura);var callback={success:function(o){document.getElementById('clipboardTerm3').innerHTML=o.responseText;},failure:function(o){}};var ajaxTermUrl="/?page=schowekAjax&id_terminy="+id_term+"&id_biura="+id_biura;YAHOO.util.Connect.asyncRequest('GET',ajaxTermUrl,callback,null);document.getElementById('schowekInfo').className='usunieto';document.getElementById('schowekInfo').style.display='block';document.getElementById('dodaj_do_schowka').style.display='block';document.getElementById('dodaj_do_schowka_selected').style.display='none';}
var offersToRemove=[];function showCheck()
{var nazwa_cookie='clipboardOffers';var checkboxes=document.getElementById('tablicaOfert').getElementsByTagName('input');var reload=false;for(i=0;i<checkboxes.length;i++)
{if(checkboxes[i].checked)
{var id_term_id_biura=checkboxes[i].value;YAHOO.util.Cookie.removeSub(nazwa_cookie,id_term_id_biura,{domain:".wakacje.pl"});reload=true;}}
if(reload){window.location.reload(true);}else{showMonit('Zaznacz oferty, które chcesz usunąć');}}
function compareOffers()
{var nazwa_cookie='clipboardCompare';YAHOO.util.Cookie.remove(nazwa_cookie,{domain:".wakacje.pl"});var selected=0;var checkboxes=document.getElementById('tablicaOfert').getElementsByTagName('input');var id_term_id_biura=0;for(i=0;i<checkboxes.length;i++)
{if(checkboxes[i].checked)
{id_term_id_biura=checkboxes[i].value;YAHOO.util.Cookie.setSub(nazwa_cookie,id_term_id_biura,'true',{path:"/",domain:".wakacje.pl"});selected++;}
if(checkboxes[i].className=="nieaktualny"){showMonit('Nie można porównywac nieaktualnych ofert.');exit;}}
if(selected<2){showMonit('Wybierz z listy od 2 do 4 ofert');YAHOO.util.Cookie.remove(nazwa_cookie,{domain:".wakacje.pl"});}else if(selected>4){showMonit('Do porównania można wybrać maksymalnie 4 oferty');YAHOO.util.Cookie.remove(nazwa_cookie,{domain:".wakacje.pl"});}else{var min=1;var max=9999999;var ran=Math.floor(Math.random()*(max-min+1))+min;window.location="/?page=schowekCompare&r="+ran;}}
function showMonit(tresc){document.getElementById('monit').style.display='block';document.getElementById('monitTresc').innerHTML=tresc;window.scrollTo(0,findPos(document.getElementById('clipboardHeader'))[1]);}
function redirectToClipboard(){if(document.getElementById('redirectClipboard')&&document.getElementById('redirectClipboard').value==1){window.location.reload(1);}}
function writeOrderInCookie(order){YAHOO.util.Cookie.set('clipboardCompareOrder',order,"true",{path:"/",expires:new Date("January 12, 2025"),domain:".wakacje.pl"});}
function setOrder()
{var ord=document.getElementById('orderBy').value;var min=1;var max=9999999;var ran=Math.floor(Math.random()*(max-min+1))+min;if(ord!="")
{writeOrderInCookie(ord);window.location="/?page=schowekCompare&r="+ran+"&order="+ord;}}
function removeFromClipboard(id_term)
{nazwa_cookie='clipboardCompare';clipboardCompare=YAHOO.util.Cookie.get(nazwa_cookie,{domain:".wakacje.pl"});offers=clipboardCompare.split("&").length;if(offers>2){var nazwa_cookie='clipboardCompare';YAHOO.util.Cookie.removeSub(nazwa_cookie,id_term,{domain:".wakacje.pl"});window.location.reload(true);}}

var googleAnalytics=function(pageCode,domain){this.pageCode=pageCode;this.domain=domain;this.resId="";this.commission="";this.finalPrice="";this.hotelName="";this.country="";this.person="";this.init=function(){this.pageTracker=_gat._getTracker(this.pageCode);this.pageTracker._setDomainName(this.domain);this.pageTracker._initData();}
this.setStep=function(step){this.pageTracker._trackPageview(step);}
this.getTransParam=function(){if(document.getElementById('seoResId')){this.resId=document.getElementById('seoResId').value;}
if(document.getElementById('seoCommission')){this.commission=document.getElementById('seoCommission').value;}
if(document.getElementById('seoFinalPrice')){this.finalPrice=document.getElementById('seoFinalPrice').value;}
if(document.getElementById('seoOfferCode')){this.offerCode=document.getElementById('seoOfferCode').value;}
if(document.getElementById('seoHotelName')){this.hotelName=document.getElementById('seoHotelName').value;}
if(document.getElementById('seoCountry')){this.country=document.getElementById('seoCountry').value;}
if(document.getElementById('seoPerson')){this.person=document.getElementById('seoPerson').value;}}
this.setTransaction=function(){this.getTransParam();this.pageTracker._addTrans(this.resId,"",this.commission,this.finalPrice,"","","","");this.pageTracker._addItem(this.resId,this.offerCode,this.hotelName,this.country,this.commission,this.person);this.pageTracker._trackTrans();}
this.init();}
