var oHead = document.getElementsByTagName('head')[0];
var searchResults = null;
function getScript(name,callback_function){
if(oHead!==undefined){
var oScript = document.createElement('script');
oScript.setAttribute('src',name);
oScript.setAttribute('type','text/javascript');
var loadFunction = function()
{if (this!==undefined && this!==null){
if (this.readyState !== undefined) {
if (this.readyState == 'complete' || this.readyState == 'loaded')
{
if (callback_function!==undefined){
callback_function();
}
}
}
}
};
oScript.onreadystatechange = loadFunction;
oScript.onload = callback_function;
oHead.appendChild(oScript);
}
}
if(typeof String.prototype.trim !== 'function') {
String.prototype.trim = function() {
return this.replace(/^\s+|\s+jQuery/g, '');
}
}
var goBack = function(){
//jQuery.history.load(historyToken);
history.back(-1);
}
var performSearchPopup = null;
var oldToken = null;
var datePreset = false;
var historyToken = null;
var min_map = null;
var automatic_date_search = false;
var siteoverride = null;
var external = false;
var pageload = null;
var mainPopupstatus=0;
var openMainPopup = null;
function getCSS(name){
var fileref=document.createElement("link");
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", name);
oHead.appendChild(fileref);
}
getCSS('http://res.synthense.pl//media/css/custom_SARMATA1.css');
if (siteoverride!=null){
getCSS('http://res.synthense.pl//media/css/custom_'+siteoverride+'.css');
}
function extraLoad(){
jQuery("embed,object").hide();
}
function extraClose(){
jQuery("embed,object").show();
}
var popupStatus = 0;
var currentPopup = null;
var currentBackground = null;
var disablePopup = function disablePopup(mainId,backgroundId ){
if(popupStatus==1){
//extraClose();
currentBackground.fadeOut("fast");
currentPopup.fadeOut("fast",function(){ if (currentPopup!=null) currentPopup.css({
"width": ""});
});
if (jQuery.browser.msie){
jQuery('select').css({'visibility':'visible'});
}
popupStatus = 0;
}
};
var loadPopup = function loadPopup(mainId, backgroundId){
if (mainId===undefined){
mainId = 'popupContact';
backgroundId = 'backgroundPopup';
}
extraLoad();
currentPopup = jQuery("#"+mainId );
currentBackground = jQuery("#"+backgroundId);
var zindex= parseInt(jQuery('#contentHotelInPopup').css('z-index'));
currentPopup.css('z-index',zindex+2);
currentBackground.css('z-index',zindex+1);
if(popupStatus===0){
currentBackground.css({
"opacity": "0.95"
});
currentBackground.fadeIn("fast");
currentPopup.fadeIn("fast");
if (jQuery.browser.msie){
jQuery('select').not('#id_currency_popup').not('#'+mainId).css({'visibility':'hidden'});
jQuery('#contentHotelInPopup select, .ui-widget select').css({'visibility':'visible'});
}
popupStatus = 1;
}
};
var centerPopup = function centerPopup(mainId,backgroundId ){
if (mainId ===undefined){
mainId = 'popupContact';
backgroundId = 'backgroundPopup';
}
var win = jQuery(window);
var popup = jQuery("#"+mainId);
var addLeft = 0;
if (popup.css('position')=='absolute'){
var addTop = win.scrollTop();
}
else{
addTop = 0;
}
var windowWidth = win.width();
var windowHeight = win.height();
var popupHeight = popup.height();
var popupWidth = popup.width();
if (mainId=='contentHotelInPopup'){
popup .css({"top": windowHeight/2-popupHeight/2-10+addTop,"left": windowWidth/2-popupWidth/2-addLeft});
}
else{
popup .css({"top": win.scrollTop()+windowHeight/2-popupHeight/2,"left": win.scrollLeft()+windowWidth/2-popupWidth/2-addLeft});
}
jQuery("#"+backgroundId ).css({
'height':jQuery(window).height()+'px','top':addTop
});
if (jQuery.browser.msie){
if (backgroundId!='backgroundcontentHotelInPopup'){
jQuery("#"+backgroundId ).css({'width':windowWidth+'px','top':addTop,'left':'0px'});
}
}
};
var applyNoConflict = true;
function readystateCallFunc(){
if (applyNoConflict) jQuery.noConflict();
jQuery(document).ready(function(){
if (jQuery('#searchBox').length==0){
jQuery("body").append('
');
min_map = {1:'default',2:[new Date(2011,3,28),new Date(2011,4,2)]};
setSynthRezer = function(d1,d2,lo){
try
{
if (d1!='undefined'){
var startDate = jQuery.datepicker.parseDate('d-m-yy',d1);
var today = new Date();
if (startDate4) loInt=4;
jQuery('#id_people, #id_people_popup').attr('value',loInt);
}
else{
jQuery('#id_people, #id_people_popup').attr('value',0);
}
}
catch(err)
{}
performSearchStart(null);
}
}
if (jQuery.browser.msie){
getCSS('http://www.res.synthense.pl/media/css/searchPage.css');
getCSS('http://www.res.synthense.pl/media/css/searchresult-ie.css');
if (jQuery.browser.version.charAt(0)=='6'){
getCSS('http://www.res.synthense.pl/media/css/searchresult-ie6.css');
}
}
function afterLoad(){
if (mainPopupstatus==0){
performSearchPopup = function(){
var hotel_choices = jQuery('#id_hotel_choices_popup');
if (hotel_choices.length===0){
var hotel = '0';
}
else{
var hotel = jQuery('#id_hotel_choices_popup > option:selected')[0].value;
}
var startDate = jQuery('#id_start_date_popup').attr('value');
var endDate = jQuery('#id_end_date_popup').attr('value');
var currency = jQuery('#id_currency_popup').attr('value');
var people = jQuery('#id_people_popup option:selected').attr('value');
var token = "search/"+startDate+"/"+endDate+"/"+hotel+"/"+currency+"/"+people;
jQuery.history.load(token);
}
jQuery('#idSearchButton_popup').click(function(e) {
performSearchPopup();
});
jQuery('#idSearchEventButton_popup').click(function(e) {
var categories = jQuery('#id_category_popup');
if (categories.length===0){
var category = '0';
}
else{
var category = jQuery('#id_category_popup > option:selected')[0].value;
}
var startDate = jQuery('#id_start_date_event_popup').attr('value');
var endDate = jQuery('#id_end_date_event_popup').attr('value');
var token = "eventSearch/"+startDate+"/"+endDate+"/"+category;
jQuery.history.load(token);
});
jQuery('#idRetrieveButton_popup').click(function(e) {
var rc = jQuery('#recLoc_popup').attr('value');
var ln = jQuery('#lastName_popup').attr('value');
var token = "retrieve/"+rc+"/"+ln;
jQuery.history.load(token);
});
openMainPopup();
}
}
jQuery('#whiteBackgroundPopup').remove();
jQuery('body').append('');
jQuery('#backgroundPopup').remove();
jQuery('body').append('');
jQuery('#popupContact').remove();
jQuery('body').append('');
jQuery('#popupCondition').remove();
jQuery('body').append('');
jQuery('#loadingPopup').remove();
jQuery('body').append('');
jQuery('#contentHotelInPopup').remove();
jQuery('body').append('');
jQuery('#backgroundcontentHotelInPopup').remove();
jQuery('body').append('');
jQuery('#popupContactClose').click(function(){
disablePopup('popupContact','backgroundPopup');
});
jQuery('#popupChoosePaymentClose').click(function(){
disablePopup('popupChoosePaymentClose','backgroundPopup');
});
openMainPopup = function(){
if (typeof(customMainPopupOpen)!=='undefined'){
customMainPopupOpen();
}
extraLoad();
var bck = jQuery('#backgroundcontentHotelInPopup');
var main = jQuery('#contentHotelInPopup');
bck.css({
"opacity": "0.95"
});
if (jQuery.browser.msie){
jQuery('select').not('#id_currency_popup').not('#id_people_popup').css({'visibility':'hidden'});
jQuery('select.roomNumberSelect').show().css('visibility','visible');
}
mainPopupstatus= 1;
var windowHeight = jQuery(window).height();
main.width(810);
main.height(parseInt(0.88*windowHeight));
jQuery('#backgroundcontentHotelInPopup').height(jQuery(window).height());
bck.fadeIn("fast");
main.fadeIn("fast");
var window_width = jQuery(window).width();
if (window_width>800){
centerPopup('contentHotelInPopup','backgroundcontentHotelInPopup');
jQuery("body").css("overflow", "hidden");
}
else{
jQuery("body").css("overflow-y", "hidden");
jQuery('#contentHotelInPopup').css('position','absolute');
}
}
jQuery(window).resize(function() {
if (mainPopupstatus==1){
openMainPopup();
}
//centerPopup('contentHotelInPopup','backgroundcontentHotelInPopup');
});
jQuery("#contentHotelInPopupClose").click(function(){
if (typeof(customMainPopupClose)!=='undefined'){
customMainPopupClose();
}
extraClose();
jQuery('#backgroundcontentHotelInPopup').fadeOut("fast");
jQuery('#contentHotelInPopup').fadeOut("fast",function(){ if (currentPopup!=null) currentPopup.css({
"width": ""});
});
if (jQuery.browser.msie){
jQuery('select').css({'visibility':'visible'});
}
mainPopupstatus=0;
jQuery("body").css("overflow", "auto");
jQuery.history.load('close');
});
jQuery('#searchBox')[0].innerHTML = '';
jQuery("#id_hotel_choices option:first").remove();
var initialLoad = true;
String.prototype.startsWith = function(str){
try{
return (this.match("^"+str)==str);
}
catch(e){
return false;
}
};
jQuery.getScriptCache = function(url, callback, cache){
var siteInfo = 'site=SARMATA1';
if (url.indexOf('site=')<0){
url+='&'+siteInfo;
}
if (siteoverride!=null){
if (url.indexOf('siteoverride=')<0){
url+='&siteoverride='+siteoverride;
}
}
url+='&sessionid=84dbf41feac06693e5bf07a8e94150a0';
var updated_callback = function(){
if (typeof(callback)=='function') callback();
jQuery("embed,object").hide();
}
jQuery.ajax({ type: "GET", url: url, success: updated_callback, dataType: "script", cache: cache });
};
Date.format = 'yyyy-mm-dd';
getScript("http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js",function(){
jQuery('#contentHotelInPopup').append('This
');
if(jQuery.browser.msie && jQuery.browser.version.charAt(0)=='6'){
if (jQuery("#accordion").length>0){
jQuery(jQuery("#accordion").children()[2]).remove();
jQuery("#retrieveForm").remove();
}
}
jQuery('#accordion').css({'display':'block'});
jQuery("#accordion").accordion({
icons: {
header:"ui-icon-circle-arrow-e",
headerSelected:"ui-icon-circle-arrow-s"
},
autoHeight: false,
clearStyle: true
});
if(jQuery.browser.msie && jQuery.browser.version.charAt(0)=='6'){
jQuery(jQuery("#accordion_popup").children()[2]).remove();
jQuery("#retrieveFormPopup").remove();
}
jQuery('#accordion_popup').css({'display':'block'});
jQuery("#accordion_popup").accordion({
icons: {
header:"ui-icon-circle-arrow-e",
headerSelected:"ui-icon-circle-arrow-s"
},
autoHeight: false,
clearStyle: true
});
(function(jQuery){var locationWrapper={put:function(hash,win){(win||window).location.hash=this.encoder(hash)},get:function(win){var hash=((win||window).location.hash).replace(/^#/,'');try{return jQuery.browser.mozilla?hash:decodeURIComponent(hash)}catch(error){return hash}},encoder:encodeURIComponent};var iframeWrapper={id:"__jQuery_history",init:function(){var html='';jQuery("body").prepend(html);return this},_document:function(){return jQuery("#"+this.id)[0].contentWindow.document},put:function(hash){var doc=this._document();doc.open();doc.close();locationWrapper.put(hash,doc)},get:function(){return locationWrapper.get(this._document())}};function initObjects(options){options=jQuery.extend({unescape:false},options||{});locationWrapper.encoder=encoder(options.unescape);function encoder(unescape_){if(unescape_===true){return function(hash){return hash}}if(typeof unescape_=="string"&&(unescape_=partialDecoder(unescape_.split("")))||typeof unescape_=="function"){return function(hash){return unescape_(encodeURIComponent(hash))}}return encodeURIComponent}function partialDecoder(chars){var re=new RegExp(jQuery.map(chars,encodeURIComponent).join("|"),"ig");return function(enc){return enc.replace(re,decodeURIComponent)}}}var implementations={};implementations.base={callback:undefined,type:undefined,check:function(){},load:function(hash){},init:function(callback,options){initObjects(options);self.callback=callback;self._options=options;self._init()},_init:function(){},_options:{}};implementations.timer={_appState:undefined,_init:function(){var current_hash=locationWrapper.get();self._appState=current_hash;self.callback(current_hash);setInterval(self.check,100)},check:function(){var current_hash=locationWrapper.get();if(current_hash!=self._appState){self._appState=current_hash;self.callback(current_hash)}},load:function(hash){if(hash!=self._appState){locationWrapper.put(hash);self._appState=hash;self.callback(hash)}}};implementations.iframeTimer={_appState:undefined,_init:function(){var current_hash=locationWrapper.get();self._appState=current_hash;iframeWrapper.init().put(current_hash);self.callback(current_hash);setInterval(self.check,100)},check:function(){var iframe_hash=iframeWrapper.get(),location_hash=locationWrapper.get();if(location_hash!=iframe_hash){if(location_hash==self._appState){self._appState=iframe_hash;locationWrapper.put(iframe_hash);self.callback(iframe_hash)}else{self._appState=location_hash;iframeWrapper.put(location_hash);self.callback(location_hash)}}},load:function(hash){if(hash!=self._appState){locationWrapper.put(hash);iframeWrapper.put(hash);self._appState=hash;self.callback(hash)}}};implementations.hashchangeEvent={_init:function(){self.callback(locationWrapper.get());jQuery(window).bind('hashchange',self.check)},check:function(){self.callback(locationWrapper.get())},load:function(hash){locationWrapper.put(hash)}};var self=jQuery.extend({},implementations.base);if(jQuery.browser.msie&&(jQuery.browser.version<8||document.documentMode<8)){self.type='iframeTimer'}else if("onhashchange"in window){self.type='hashchangeEvent'}else{self.type='timer'}jQuery.extend(self,implementations[self.type]);jQuery.history=self})(jQuery);
jQuery("#id_hotel_choices option[value=0], #id_hotel_choices_popup option[value=0]").attr('selected','selected');
if (typeof(hotelForced) !== 'undefined'&&hotelForced!=0) {
jQuery('#id_hotel_choices option, #id_hotel_choices_popup option').remove();
jQuery('#id_hotel_choices, #id_hotel_choices_popup').append('');
}
if (typeof(afterScriptLoad)!='undefined') afterScriptLoad();
var retrieve = function(recLoc,lastName){
loadPopup('loadingPopup','whiteBackgroundPopup');
centerPopup('loadingPopup','whiteBackgroundPopup');
var src = 'http://res.synthense.pl/client/retrieve/?rc='+recLoc+'&ln='+lastName;
jQuery.getScriptCache(src,function(){disablePopup('loadingPopup','whiteBackgroundPopup');afterLoad();},false);
}
pageload = function(hash) {
if (oldToken==hash || hash=='undefined' || hash=='') {
return;
}
historyToken = oldToken;
oldToken = hash;
if(hash!==undefined&&hash!=null&&hash!='') {
if (popupStatus == 1){
disablePopup();
}
initialLoad = false;
var a = hash.split('/');
if (hash.startsWith('search')){
var index = window.location.href.indexOf('?');
if (index>=0 && typeof(hotelForced) == 'undefined'){
var end_idnex = window.location.href.indexOf('#');
window.location.href = window.location.href.substring(0,index)+window.location.href.substring(end_idnex);
}
else{
searchResults(a[3],a[1],a[2],a[4],a[5],a[6],a[7]);
var hotel_choices = jQuery('#id_hotel_choices');
if (hotel_choices.length===0){
jQuery('#id_currency').val(a[4]);
jQuery('#id_people').val(a[5]);
jQuery('#id_start_date').val(a[1]);
jQuery('#id_end_date').val(a[2]);
if (a.length>6) {
if (jQuery('#id_promotion_code').length>0){
jQuery('#id_promotion_code').val(a[6]);
}
}
jQuery('#id_people_popup').val(a[5]);
jQuery('#id_currency_popup').val(a[4]);
jQuery('#id_start_date_popup').val(a[1]);
jQuery('#id_end_date_popup').val(a[2]);
}
else{
jQuery('#id_currency').val(a[4]);
jQuery('#id_hotel_choices').val(a[3]);
jQuery('#id_start_date').val(a[1]);
jQuery('#id_end_date').val(a[2]);
jQuery('#id_currency_popup').val(a[4]);
jQuery('#id_hotel_choices_popup').val(a[3]);
jQuery('#id_start_date_popup').val(a[1]);
jQuery('#id_end_date_popup').val(a[2]);
}
}
}
else if (hash.startsWith('eventSearch')){
loadPopup('loadingPopup','whiteBackgroundPopup');
centerPopup('loadingPopup','whiteBackgroundPopup');
var src = 'http://res.synthense.pl/client/searchEvent/?site=SARMATA1&start_date_event='+a[1]+'&end_date_event='+a[2]+'&category='+a[3];
if (typeof(pageTracker)!="undefined") pageTracker._trackPageview("impreza/wyszukiwanie/start: "+a[1]+" koniec: "+a[2]+" kategoria: "+a[3]);
jQuery.getScriptCache(src,function(){disablePopup('loadingPopup','whiteBackgroundPopup');afterLoad();},false);
}
else if (hash.startsWith('retrieve')){
retrieve(a[1],a[2]);
jQuery('#recLoc').val(a[1]);
jQuery('#lastName').val(a[2]);
}
else if (hash.startsWith('reserve')){
performSearchStart(null);
}
else if (hash.startsWith('rate')){
loadPopup('loadingPopup','whiteBackgroundPopup');
centerPopup('loadingPopup','whiteBackgroundPopup');
var src = 'http://res.synthense.pl/client/rate/?rc='+a[1]+'&ln='+a[2];
jQuery.getScriptCache(src,function(){disablePopup('loadingPopup','whiteBackgroundPopup');afterLoad();},false);
}
else if (hash.startsWith('servicing')){
loadPopup('loadingPopup','whiteBackgroundPopup');
centerPopup('loadingPopup','whiteBackgroundPopup');
var src = 'http://res.synthense.pl/client/search/results/servicing/?site=SARMATA1&'+a[1];
if (typeof(pageTracker)!="undefined") pageTracker._trackPageview("pokój/dodatkowe usługi");
jQuery.getScriptCache(src,function(){disablePopup('loadingPopup','whiteBackgroundPopup');afterLoad();},false);
}
else if (hash.startsWith('addequipment')){
loadPopup('loadingPopup','whiteBackgroundPopup');
centerPopup('loadingPopup','whiteBackgroundPopup');
var src = 'http://res.synthense.pl/client/search/results/addequipment/?site=SARMATA1&'+a[1];
jQuery.getScriptCache(src,function(){disablePopup('loadingPopup','whiteBackgroundPopup');afterLoad();},false);
}
else if (hash.startsWith('traveler')){
loadPopup('loadingPopup','whiteBackgroundPopup');
centerPopup('loadingPopup','whiteBackgroundPopup');
if (typeof(pageTracker)!="undefined") pageTracker._trackPageview("klient");
jQuery.getScriptCache('http://res.synthense.pl/client/search/results/servicing/traveler/?site=SARMATA1&'+a[1],function(){disablePopup('loadingPopup','whiteBackgroundPopup');},false);
}
else if (hash.startsWith('formreserve')){
loadPopup('loadingPopup','whiteBackgroundPopup');
centerPopup('loadingPopup','whiteBackgroundPopup');
var src = 'http://res.synthense.pl/client/reserveform/?site=SARMATA1&package='+a[1];
jQuery.getScriptCache(src,function(){disablePopup('loadingPopup','whiteBackgroundPopup');openMainPopup();},false);
}
else if (hash.startsWith('payment')){
loadPopup('loadingPopup','whiteBackgroundPopup');
centerPopup('loadingPopup','whiteBackgroundPopup');
if (typeof(pageTracker)!="undefined") pageTracker._trackPageview("płatność");
var src = 'http://res.synthense.pl/client/search/results/traveler/payment/?site=SARMATA1&'+a[1];
jQuery.getScriptCache(src,function(){disablePopup('loadingPopup','whiteBackgroundPopup');},false);
}
else if (hash.startsWith('package')){
loadPopup('loadingPopup','whiteBackgroundPopup');
centerPopup('loadingPopup','whiteBackgroundPopup');
var src = 'http://res.synthense.pl/client/package/?site=SARMATA1&'+a[1];
if (typeof(pageTracker)!="undefined") pageTracker._trackPageview("impreza/wyświetl/"+a[1]);
if (a.length>2) src+='&year='+a[2]+'&month='+a[3]+'&day='+a[4]+'&display=true';
jQuery.getScriptCache(src,function(){disablePopup('loadingPopup','whiteBackgroundPopup');afterLoad();},false);
}
else if (hash.startsWith('joinEvent')){
loadPopup('loadingPopup','whiteBackgroundPopup');
centerPopup('loadingPopup','whiteBackgroundPopup');
var src = 'http://res.synthense.pl/client/joinEvent/?site=SARMATA1';
if (typeof(pageTracker)!="undefined") pageTracker._trackPageview("joinEvent");
jQuery.getScriptCache(src,function(){disablePopup('loadingPopup','whiteBackgroundPopup');afterLoad();},false);
}
else if (hash.startsWith('addeventcomment')){
loadPopup('loadingPopup','whiteBackgroundPopup');
centerPopup('loadingPopup','whiteBackgroundPopup');
var src = 'http://res.synthense.pl/client/package/addcomment/?site=SARMATA1&'+a[1];
jQuery.getScriptCache(src,function(){disablePopup('loadingPopup','whiteBackgroundPopup');afterLoad();},false);
}
else if (hash.startsWith('selectpackage')){
loadPopup('loadingPopup','whiteBackgroundPopup');
centerPopup('loadingPopup','whiteBackgroundPopup');
if (typeof(pageTracker)!="undefined") pageTracker._trackPageview("impreza/wybierz imprezę/"+a[1]);
var src = 'http://res.synthense.pl/client/package/selectpackage/?site=SARMATA1&'+a[1];
jQuery.getScriptCache(src,function(){disablePopup('loadingPopup','whiteBackgroundPopup');afterLoad();},false);
}
}
else if (hash.startsWith('close')){
return;
}
else {
if (!initialLoad){
window.location.reload();
}
else{
}
}
}
jQuery.history.init(pageload);
var min_date = new Date();
min_date.setDate(min_date.getDate()+0);
var max_date = new Date();
max_date.setDate(max_date.getDate()+30);
var max_start_date = new Date();
max_start_date.setDate(max_start_date.getDate()+1000);
var dateFormatString = 'dd-mm-yy';
jQuery('.vDateField').datepicker( "destroy" );
jQuery('.vDateField').attr('readonly','true');
jQuery('.vDateField').datepicker({altFormat:dateFormatString,beforeShow: function(input, inst){
inst.dpDiv.css({marginTop: input.offsetHeight + 'px', marginLeft: -input.offsetWidth + 'px'});
jQuery('#id_end_date').datepicker('option', 'maxDate', max_date);
}, dateFormat: dateFormatString,minDate: min_date,maxDate:max_start_date,numberOfMonths: 2,showOn: 'both', buttonImageOnly: true,buttonImage: 'http://res.synthense.pl/media/css/images/icon_datepicker.gif',buttonText: 'Zmień datę' });
jQuery('#id_start_date').datepicker('option','onSelect',
function(dateText, inst)
{min_date = jQuery(this).datepicker('getDate');
max_date = jQuery(this).datepicker('getDate');
var delta = 1;
if (min_map!=null){
jQuery.each(min_map,function(key,value){
if (value=='default' && delta == 1){
delta = parseInt(key);
}
else{
var temp_start = value[0];
var temp_end = value[1];
if (min_date>=temp_start && min_date<=temp_end){
delta = parseInt(key);
}
}
})
}
min_date.setDate(min_date.getDate()+delta);
jQuery('#id_end_date').datepicker('option', 'minDate', min_date);
max_date.setDate(max_date.getDate()+30-1);
jQuery('#id_end_date').datepicker('option', 'maxDate', max_date);
});
jQuery('#id_start_date_popup').datepicker('option','onSelect',
function(dateText, inst)
{
min_date = jQuery(this).datepicker('getDate');
max_date = jQuery(this).datepicker('getDate');
var delta = 1;
jQuery('#id_start_date_popup').attr('value',dateText);
if (min_map!=null){
jQuery.each(min_map,function(key,value){
if (value=='default' && delta == 1){
delta = parseInt(key);
}
else{
var temp_start = value[0];
var temp_end = value[1];
if (min_date>=temp_start && min_date<=temp_end){
delta = parseInt(key);
}
}
})
}
min_date.setDate(min_date.getDate()+delta);
jQuery('#id_end_date_popup').datepicker('option', 'minDate', min_date);
max_date.setDate(max_date.getDate()+30-1);
jQuery('#id_end_date_popup').datepicker('option', 'maxDate', max_date);
jQuery('#id_end_date_popup').attr('value',jQuery.datepicker.formatDate( dateFormatString, jQuery('#id_end_date_popup').datepicker('getDate') ) );
if (automatic_date_search) {jQuery('#idSearchButton_popup').click();};
});
jQuery('#id_end_date_popup').datepicker('option','onSelect',
function(dateText, inst){
jQuery('#id_end_date_popup').attr('value',dateText);
if (automatic_date_search) jQuery('#idSearchButton_popup').click();
});
jQuery('#id_start_date_event').datepicker('option','onSelect',
function(dateText, inst)
{min_date = jQuery(this).datepicker('getDate');
min_date.setDate(min_date.getDate()+1);
jQuery('#id_end_date_event').datepicker('option', 'minDate', min_date);
});
jQuery('#id_start_date_event_popup').datepicker('option','onSelect',
function(dateText, inst)
{min_date = jQuery(this).datepicker('getDate');
min_date.setDate(min_date.getDate()+1);
jQuery('#id_end_date_event_popup').datepicker('option', 'minDate', min_date);
});
if ('pl'!='en'){
getScript("http://res.synthense.pl/media/js/localization-dp-pl.js",function(){});
}
jQuery("#dialog_ssr").dialog({autoOpen: false,modal:true,width:500,close: function(event, ui) {if (!dialogVerified && currentInput!=null)currentInput.attr('checked',false);} });
},true);
var result= new RegExp('[\\?&]action=([^]*)').exec(window.location.href);
if (result!== null && result.length > 0){
var index = window.location.href.indexOf('?');
var req_mark = '';
if (index==-1){
index = window.location.href.indexOf('#')+1;
req_mark = '?';
}
var input = window.location.href.substring(index);
jQuery.getScript('http://res.synthense.pl/client/pnrdispatcher/'+req_mark+input+'&site=SARMATA1',function(){},true);
}
searchResults = function(hotel,startDate,endDate,currency,people,code,promotion){
loadPopup('loadingPopup','whiteBackgroundPopup');
centerPopup('loadingPopup','whiteBackgroundPopup');
var code = code==undefined?'':code;
var promotion = promotion==undefined?jQuery('#promotionID').attr('value'):promotion;
var language = 'pl';
if (language=='') language='pl';
var src = 'http://res.synthense.pl/client/search/results/?site=SARMATA1&hotel='+hotel+'&start='+startDate+
'&end='+endDate+'&code='+code+'&language='+language+'&promotion='+promotion;
if (currency!=="undefined"){
src+='¤cy='+currency;
}
if (people!=="undefined"){
src+='&people='+people;
}
if (typeof(pageTracker)!="undefined") pageTracker._trackPageview("pokój/wyszukiwanie/start: "+startDate+" koniec: "+endDate+" hotel: "+hotel);
jQuery.getScriptCache(src,function(){disablePopup('loadingPopup','whiteBackgroundPopup');afterLoad();},false);
}
jQuery('#searchBox').append('')
function performSearchStart(e, start, end){
oldToken = null;
var hotel_choices = jQuery('#id_hotel_choices');
if (hotel_choices.length===0){
var hotel = '0';
}
else{
var hotel = jQuery('#id_hotel_choices > option:selected')[0].value;
}
if (start==undefined){
var startDate = jQuery('#id_start_date').attr('value');
var endDate = jQuery('#id_end_date').attr('value');
}
else{
var startDate = jQuery.datepicker.formatDate( 'dd-mm-yy', start) ;
var endDate = jQuery.datepicker.formatDate( 'dd-mm-yy', end) ;
}
var currency = jQuery('#id_currency').attr('value');
var people = jQuery('#id_people').attr('value');
var token = "search/"+startDate+"/"+endDate+"/"+hotel+"/"+currency+"/"+people;
if (jQuery('#id_promotion_code').length>0){
var promotion_code = jQuery('#id_promotion_code').attr('value');
token+='/'+promotion_code;
}
jQuery.history.load(token);
}
window.reserve = performSearchStart;
jQuery('#idSearchButton').click(function(e) {
performSearchStart(e);
});
jQuery('#idSearchEventButton').click(function(e) {
oldToken = null;
var categories = jQuery('#id_category');
if (categories.length===0){
var category = '0';
}
else{
var category = jQuery('#id_category > option:selected')[0].value;
}
var startDate = jQuery('#id_start_date_event').attr('value');
var endDate = jQuery('#id_end_date_event').attr('value');
if (startDate==undefined){
startDate = jQuery('#id_start_date').attr('value');
endDate = jQuery('#id_end_date').attr('value');
}
var token = "eventSearch/"+startDate+"/"+endDate+"/"+category;
if (jQuery.browser.msie){
loadPopup('loadingPopup','whiteBackgroundPopup');
centerPopup('loadingPopup','whiteBackgroundPopup');
var src = 'http://res.synthense.pl/client/searchEvent/?site=SARMATA1&start_date_event='+startDate+'&end_date_event='+endDate+'&category='+0;
if (typeof(pageTracker)!="undefined") pageTracker._trackPageview("impreza/wyszukiwanie/start: "+a[1]+" koniec: "+a[2]+" kategoria: "+a[3]);
jQuery.getScriptCache(src,function(){disablePopup('loadingPopup','whiteBackgroundPopup');afterLoad();},false);
}
else{
jQuery.history.load(token);
}
});
jQuery('#idRetrieveButton').click(function(e) {
oldToken = null;
var rc = jQuery('#recLoc').attr('value');
var ln = jQuery('#lastName').attr('value');
var token = "retrieve/"+rc+"/"+ln;
jQuery.history.load(token);
});
if (jQuery('#packages, #packagesPopup').length>0){
jQuery.getScript('http://res.synthense.pl/client/packagelist/?site=SARMATA1&language=pl&sessionid=84dbf41feac06693e5bf07a8e94150a0',function(){});
}
});
};
if (typeof jQuery != 'function' || parseInt(jQuery.fn.jquery.substring(2,3))<4){
getScript('http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js',readystateCallFunc);
}
else{
applyNoConflict = false;
readystateCallFunc();
}