if (/*IsLive=*/true || /*upper=temp/test/live*/false || window.location.href.search(/upper=(temp|test|live)/) > 0)
{
document.write("<link rel='stylesheet' href='http://upper2-beta.profitroom.pl/compat/styles/submodal.css' />");
//INCLUDE submodal.js START
if(!Idea)
	var Idea = {}
if(!Idea.Booking)
	Idea.Booking = {}

Idea.Booking.BookNowWrapper = function(config)
{
	if(!config.monthsNames)
		config.monthsNames = ['sty','lut','mar','kwi','maj','cze','lip','sie','wrz','paz','lis','gru']
	if(!config.daysNames)
		config.daysNames = ['nie','pon','wto','sro','czw','pia','sob']
	if(config.Checkin)
	{
		switch(config.Checkin.Mode)
		{
			case 'dropdowns':
				this.checkinDS = new Idea.DateSelector('dropdowns');
				this.checkinDS.dayDropdown = this.$(config.Checkin.DayID);
				this.checkinDS.yearMonthDropdown = this.$(config.Checkin.YearMonthID);
			break;
			case 'datepicker+dropdowns':
				this.checkinDS = new Idea.DateSelector('datepicker+dropdowns');
				this.checkinDS.dayDropdown = this.$(config.Checkin.DayID);
				this.checkinDS.yearMonthDropdown = this.$(config.Checkin.YearMonthID);
				this.checkinDS.datePickerID = config.Checkin.DatePickerID;
				this.checkinDS.datePickerOpener = this.$(config.Checkin.DatePickerOpenerID);
			break;
			case 'datepicker+txt':
				this.checkinDS = new Idea.DateSelector('datepicker+txt');
				this.checkinDS.textInput = this.$(config.Checkin.TextID);
				this.checkinDS.datePickerID = config.Checkin.DatePickerID;
				this.checkinDS.datePickerOpener = this.$(config.Checkin.DatePickerOpenerID);
			break;
			case 'txt':
				this.checkinDS = new Idea.DateSelector('txt');
				this.checkinDS.textInput = this.$(config.Checkin.TextID);				
			break;
		}
		this.checkinDS.monthsNames = config.monthsNames;
		this.checkinDS.daysNames = config.daysNames;
		this.checkinDS.todayText = config.todayText;
		if(config.yearFormat)
			this.checkinDS.yearFormat = config.yearFormat;
		this.checkinDS.init();
		this.checkinMode = config.Checkin.Mode;
	}
	if(config.Checkout)
	{
		switch(config.Checkout.Mode)
		{
			case 'dropdowns':
				this.checkoutDS = new Idea.DateSelector('dropdowns');
				this.checkoutDS.dayDropdown = this.$(config.Checkout.DayID);
				this.checkoutDS.yearMonthDropdown = this.$(config.Checkout.YearMonthID);
			break;
			case 'datepicker+dropdowns':
				this.checkoutDS = new Idea.DateSelector('datepicker+dropdowns');
				this.checkoutDS.dayDropdown = this.$(config.Checkout.DayID);
				this.checkoutDS.yearMonthDropdown = this.$(config.Checkout.YearMonthID);
				this.checkoutDS.datePickerID = config.Checkout.DatePickerID;
				this.checkoutDS.datePickerOpener = this.$(config.Checkout.DatePickerOpenerID);
			break;
			case 'datepicker+txt':
				this.checkoutDS = new Idea.DateSelector('datepicker+txt');
				this.checkoutDS.textInput = this.$(config.Checkout.TextID);
				this.checkoutDS.datePickerID = config.Checkout.DatePickerID;
				this.checkoutDS.datePickerOpener = this.$(config.Checkout.DatePickerOpenerID);
			break;
			case 'txt':
				this.checkoutDS = new Idea.DateSelector('txt');
				this.checkoutDS.textInput = this.$(config.Checkout.TextID);				
			break;
		}
		this.checkoutDS.monthsNames = config.monthsNames;
		this.checkoutDS.daysNames = config.daysNames;
		this.checkoutDS.todayText = config.todayText;
		if(config.yearFormat)
			this.checkoutDS.yearFormat = config.yearFormat;
		this.checkoutDS.init();
		this.checkoutMode = config.Checkout.Mode;
	}
	if (config.RoomCategory)
	{
		this.RoomCategory = this.$(config.RoomCategory.ID);
	}
  if (config.MinOccupancy)
    this.MinOccupancy = this.$(config.MinOccupancy.ID);
	if(config.Checkin&&config.Nights)
	{
		this.nights = this.$(config.Nights.NightsID);
		this.mode = 'checkInNights';
	}
	if(config.Checkin&&config.Checkout)
	{
		this.mode = 'checkInOut';
		this.checkinDS.setSynchronized(this.checkoutDS);
	}
	else 
		this.mode = 'mixed';
}

Idea.Booking.BookNowWrapper.prototype = 
{
	getURLParams:function()
	{
		var params = '';
		if (this.RoomCategory)
		{
			params += '&RoomCategoryID=' + this.RoomCategory.options[this.RoomCategory.selectedIndex].value; 
		}
    if (this.MinOccupancy)
		params += '&MinOccupancy=' + this.MinOccupancy.options[this.MinOccupancy.selectedIndex].value;	  
		if(this.mode == 'checkInOut')
		{
			var checkinDate = this.checkinDS.getURLDate();
			var checkoutDate = this.checkoutDS.getURLDate();		
			params += '&Checkin='+checkinDate+'&Checkout='+checkoutDate;
		}
		else if(this.mode == 'checkInNights')
		{
			var checkinDate = this.checkinDS.getURLDate();
			var nights = this.nights.options[this.nights.selectedIndex].value;
			params += '&Checkin='+checkinDate+'&Nights='+nights;
		}
		else 
		{
			try{
				var checkinDate = this.checkinDS.getURLDate();
				params += '&Checkin='+checkinDate+'';
			}catch(e){}
			try{
				var checkoutDate = this.checkoutDS.getURLDate();
				params += '&Checkout='+checkoutDate;
			}catch(e){}
			try{
				var nights = this.nights.options[this.nights.selectedIndex].value;
				params += '&Nights='+nights;
			}catch(e){}
		}
		return params;
	},
	$:function(id)
	{
		return document.getElementById(id);
	}
}// JavaScript Document

if(!Idea)
	var Idea = {}
if(!Idea.Booking)
	Idea.Booking = {}

Idea.DateSelector = function(type)
{
	this.currentDate = new Date();
	this.dayDropdown = null;
	this.yearMonthDropdown = null;
	this.textInput = null;
	this.datePicker = null;
	this.datePickerID = null;
	this.datePickerOpener = null;
	this.yearFormat = 'yyyy';
	this.monthsNames = ['sty','lut','mar','kwi','maj','cze','lip','sie','wrz','paz','lis','gru'];
	this.daysNames = ['nie','pon','wto','sro','czw','pia','sob'];
	this.todayText = 'Dzisiaj';
	this.daysNamesAvailable = true;
	this.MonthsNamesAvailable = true;
	this.synchronizedChildren = false;
	this.synchronizedParent = false;
	this.dateType = type;				// dropdowns / datepicker+dropdowns / datepicker+txt / txt
}

Idea.DateSelector.prototype = { 
	init:function()
	{
		this.setDate(this.currentDate);
		this.attachEvents();
	},
	renderDays:function(startDate)
	{
		var curDate = new Date(startDate);
		var daysTab = new Array();
		var daysIndexTab = new Array();
		for(var i=curDate.getDate(); i<=this.chckDaysInMonth(curDate.getFullYear(),curDate.getMonth()); i++)
		{
			if(i<10)
				index = 0;
		    else 
				index = '';
			daysTab.push(index+''+i);
			curDate.setDate(i);
			daysIndexTab.push(curDate.getDay());	
		}
		return [daysTab,daysIndexTab];
	},
	populateMonths:function(year,startIndex,lastIndex)
	{
		var monthTab = new Array();
		if(!lastIndex)
			var lastIndex = 11;
		for(var i=startIndex; i<=lastIndex; i++)
		{			
			if(i<9)
				index = 0;
		    else 
				index = '';
			monthTab.push(year+'-'+index+''+(i+1));
		}
		return monthTab;
	},
	renderYearMonths:function(startDate)
	{
		var parseDate = new Date(startDate);
		var monthTab = this.populateMonths(this.formatYear(parseDate.getFullYear()),parseDate.getMonth());
		if(monthTab.length<12)
		{
			parseDate.setFullYear((parseDate.getFullYear()+1));
			var monthTab1 = this.populateMonths(this.formatYear(parseDate.getFullYear()),0,(11-monthTab.length));
			monthTab = (monthTab+','+monthTab1).split(',');
		}
		return monthTab;
	},
	clearDropdown:function(dropdown)
	{
		for(var i=0; i<dropdown.options.length; i++)
			{
				dropdown.remove(i);
			}
	},
	formatYear:function(fullYear)
	{
		var yr = fullYear.toString();
		if(this.yearFormat.toLowerCase() == 'yy')
		{
			
			return yr.substring(2,4)
		}
		if(this.yearFormat.toLowerCase() == 'yyyy')
		{
			return yr;
		}
	},	
	populateDateDropDown:function(date)
	{
		this.clearDropdown(this.dayDropdown);
		var d = this.renderDays(date);
		var days = d[0];	
		var daysIndex = d[1];
		for (var i=0; i<days.length; i++)
		{
			this.dayDropdown.options[i] = new Option();
			this.dayDropdown.options[i].value = days[i];
			if(this.daysNamesAvailable)
				this.dayDropdown.options[i].text = this.translateDays(days[i],daysIndex[i]);
			else
				this.dayDropdown.options[i].text = days[i];
		}
	},
	populateDropdowns:function(date)
	{
		this.populateDateDropDown(date);
		var monthsYears = this.renderYearMonths(date);
		for (var i=0; i<monthsYears.length; i++)
		{
			this.yearMonthDropdown.options[i] = new Option();
			this.yearMonthDropdown.options[i].value = monthsYears[i];
			if(this.MonthsNamesAvailable)
				this.yearMonthDropdown.options[i].text = this.translateMonths(monthsYears[i])
			else
				this.yearMonthDropdown.options[i].text = monthsYears[i];
		}
	},
	populateInput:function(date)
	{
		var date = new Date(date);
		var m = date.getMonth()+1;
		var d = date.getDate();
		if(m<10)
			m = '0'+m;
		if(d<10)
			d = '0'+d;
		
		this.textInput.currentDate = date;
		if(this.MonthsNamesAvailable)
		{
			this.textInput.value = d+' '+this.translateMonths(this.formatYear(date.getFullYear())+'-'+m);
		}
		else
			this.textInput.value = this.formatYear(date.getFullYear())+'-'+m+'-'+d;
	},
	translateDays:function(day,index)
	{
		return day+' '+this.daysNames[index];
	},
	translateMonths:function(date)
	{
		var year = date.split('-')[0];
		var month = date.split('-')[1];
		return this.monthsNames[(parseFloat(month)-1)]+' '+year;
	},
	zeroDate:function(date)
	{
		return date.setDate(1);
	},
	createDatePicker:function()
	{
		this.datePicker = new CalendarPopup(this.datePickerID);
		this.datePicker.setTodayText(this.todayText);
		this.datePicker.setMonthNames(this.monthsNames);
		this.datePicker.setDayHeaders(this.daysNames);
		var $this = this;
		this.datePickerOpener.onclick = function()
			{
				var didi = $this.formatDate($this.currentDate);
				$this.datePicker.select($this,this.name,'yyyy-MM-dd',didi); return false;
			}
	},
	attachEvents:function()
	{
		var $this = this;
		if(this.dateType == 'dropdowns' || this.dateType == 'datepicker+dropdowns')
		{
			this.yearMonthDropdown.onchange = function()
			{
				var v = this.options[this.selectedIndex].value.split('-');
				if(v[0].length < 4)
					v[0] = '20'+v[0];
				var date = new Date(v[0],(parseFloat(v[1])-1),1);
				$this.populateDateDropDown(date);
				$this.upadteCurrentDate();
				$this.synchronize();
			}
			this.dayDropdown.onchange = function()
			{
				$this.upadteCurrentDate();
				$this.synchronize();
			}
			if(this.datePickerID && this.datePickerOpener)
			{
				this.createDatePicker();
			}
		}
		if(this.dateType == 'datepicker+txt')
		{
			this.textInput.onchange = function()
			{
				$this.upadteCurrentDate();
				if($this.synchronizedObj)
					$this.synchronize()
			}
			if(this.datePickerID && this.datePickerOpener)
			{
				this.createDatePicker();
				this.textInput.onclick = function()
				{
					var didi = $this.formatDate($this.currentDate);
					$this.datePicker.select($this,$this.datePickerOpener.name,'yyyy-MM-dd',didi); return false;
				}
			}
		}
		if(this.dateType == 'txt')
		{
			this.textInput.onchange = function()
			{
				$this.upadteCurrentDate();				
			}
			
			this.textInput.onclick = function()
			{
				var didi = $this.formatDate($this.currentDate);				
			}			
		}
	},
	upadteCurrentDate:function(){
		this.currentDate = this.getDate();
	},
	getDate:function()
	{
		var date = this.getURLDate().split('-');	
		return new Date(date[0],(parseFloat(date[1])-1),date[2])
	},
	getURLDate:function()
	{		
		switch(this.dateType)
		{
			case 'dropdowns':
				var d = this.dayDropdown.options[this.dayDropdown.selectedIndex].value;
				var my = this.yearMonthDropdown[this.yearMonthDropdown.selectedIndex].value.split('-');
				if(my[0].length < 3)
					my[0] = '20'+my[0];
				return my[0]+'-'+my[1]+'-'+d;
			break;
			case 'datepicker+dropdowns':
				var d = this.dayDropdown.options[this.dayDropdown.selectedIndex].value;
				var my = this.yearMonthDropdown[this.yearMonthDropdown.selectedIndex].value.split('-');
				if(my[0].length < 3)
					my[0] = '20'+my[0];
				return my[0]+'-'+my[1]+'-'+d;
			break;
			case 'datepicker+txt':
				var date = this.textInput.currentDate;
				var m = date.getMonth()+1;
				var d = date.getDate();
				if(m<10)
					m = '0'+m;
				if(d<10)
					d = '0'+d;
				return date.getFullYear()+'-'+m+'-'+d;
			break;
			case 'txt':
				return this.textInput.value;
			break;
		}
	},
	setDate:function(date)
	{
		switch(this.dateType)
		{
			case 'dropdowns':
				this.populateDropdowns(date);
			break;
			case 'datepicker+dropdowns':
				this.populateDropdowns(date);
			break;
			case 'datepicker+txt':
				this.populateInput(date);
			break;
			case 'txt':
				this.populateInput(date);
			break;
		}
		this.currentDate = date;
	},
	setSynchronized:function(selector)
	{
		this.synchronizedChildren = selector;
		this.synchronizedChildren.synchronizedParent = this;
		this.synchronize();
	},
	synchronize:function()
	{
		if(this.synchronizedChildren)
		{
      var sync2Date = new Date(this.currentDate),
          syncChildren = this.synchronizedChildren;
          
      sync2Date.setDate(this.currentDate.getDate() + 1);
			syncChildren.setDate(sync2Date);
      
			if(syncChildren.datePicker!=null)
			{
				// syncChildren.datePicker.addDisabledDates(this.formatDate(this.currentDate));
			}
		}
		if(this.synchronizedParent)
		{
			var sp = this.synchronizedParent;
			if(this.currentDate<=sp.currentDate)
			{
				var sd = new Date(sp.currentDate);
				if(this.datePicker!=null)
				{
					// var d = this.formatDate(sd);
					// this.datePicker.addDisabledDates(d);
				}
        sd.setDate(sp.currentDate.getDate()+1);
				this.setDate(sd);
			}
		}
	},
	setDPDate:function(date)
	{
		this.setDate(date);
		this.synchronize();	
	},
	formatDate: function(date,splitter)
	{
		date = new Date(date);
		d = date.getDate();
		m = date.getMonth()+1;
		y = date.getFullYear();
		var sp = '-';
		if(splitter)
		{
			sp = splitter;
		}
		if(d<10)
			d='0'+d;
		if(m<10)
			m='0'+m;
		var formatedDate = y+sp+m+sp+d;
		return formatedDate;
	},
	chckDaysInMonth:function(year,month){
		var intMonth = month;
		var intYear = year;
		
		var dteMonth = new Date(intYear,intMonth);//
		var intDaysInMonth = 28;
		var blnDateFound = false;
		
		while (!blnDateFound)
		{
			dteMonth.setDate(intDaysInMonth+1);
			var intNewMonth = dteMonth.getMonth();
			
			if (intNewMonth != intMonth)
			  blnDateFound = true;
			else
			  intDaysInMonth++;
		}
		return intDaysInMonth;
	}
}

var ds = {};

function getAnchorPosition(a) {
    var c = {},
        b = 0,
        f = 0,
        e = f = b = false;
    if (document.getElementById) b = true;
    else if (document.all) f = true;
    else if (document.layers) e = true;
    if (b && document.all) {
        b = AnchorPosition_getPageOffsetLeft(document.all[a]);
        f = AnchorPosition_getPageOffsetTop(document.all[a])
    } else if (b) {
        a = document.getElementById(a);
        b = AnchorPosition_getPageOffsetLeft(a);
        f = AnchorPosition_getPageOffsetTop(a)
    } else if (f) {
        b = AnchorPosition_getPageOffsetLeft(document.all[a]);
        f = AnchorPosition_getPageOffsetTop(document.all[a])
    } else if (e) {
        for (f =
        b = 0; f < document.anchors.length; f++) if (document.anchors[f].name == a) {
            b = 1;
            break
        }
        if (b == 0) {
            c.x = 0;
            c.y = 0;
            return c
        }
        b = document.anchors[f].x;
        f = document.anchors[f].y
    } else {
        c.x = 0;
        c.y = 0;
        return c
    }
    c.x = b;
    c.y = f;
    return c
}

function getAnchorWindowPosition(a) {
    a = getAnchorPosition(a);
    var c = 0,
        b = 0;
    if (document.getElementById) if (isNaN(window.screenX)) {
        c = a.x - document.body.scrollLeft + window.screenLeft;
        b = a.y - document.body.scrollTop + window.screenTop
    } else {
        c = a.x + window.screenX + (window.outerWidth - window.innerWidth) - window.pageXOffset;
        b = a.y + window.screenY + (window.outerHeight - 24 - window.innerHeight) - window.pageYOffset
    } else if (document.all) {
        c = a.x - document.body.scrollLeft + window.screenLeft;
        b = a.y - document.body.scrollTop + window.screenTop
    } else if (document.layers) {
        c =
        a.x + window.screenX + (window.outerWidth - window.innerWidth) - window.pageXOffset;
        b = a.y + window.screenY + (window.outerHeight - 24 - window.innerHeight) - window.pageYOffset
    }
    a.x = c;
    a.y = b;
    return a
}
function AnchorPosition_getPageOffsetLeft(a) {
    for (var c = a.offsetLeft;
    (a = a.offsetParent) != null;) c += a.offsetLeft;
    return c
}
function AnchorPosition_getWindowOffsetLeft(a) {
    return AnchorPosition_getPageOffsetLeft(a) - document.body.scrollLeft
}

function AnchorPosition_getPageOffsetTop(a) {
    for (var c = a.offsetTop;
    (a = a.offsetParent) != null;) c += a.offsetTop;
    return c
}
function AnchorPosition_getWindowOffsetTop(a) {
    return AnchorPosition_getPageOffsetTop(a) - document.body.scrollTop
}
var MONTH_NAMES = Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"),
    DAY_NAMES = Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");

function LZ(a) {
    return (a < 0 || a > 9 ? "" : "0") + a
}
function isDate(a, c) {
    if (getDateFromFormat(a, c) == 0) return false;
    return true
}

function compareDates(a, c, b, f) {
    a = getDateFromFormat(a, c);
    b = getDateFromFormat(b, f);
    if (a == 0 || b == 0) return -1;
    else if (a > b) return 1;
    return 0
}

function cp_formatDate(a, c) {
    c += "";
    var b = "",
        f = 0,
        e = "",
        d = "";
    e = a.getYear() + "";
    d = a.getMonth() + 1;
    var p = a.getDate(),
        m = a.getDay(),
        k = a.getHours(),
        h = a.getMinutes(),
        i = a.getSeconds(),
        g = {};
    if (e.length < 4) e = "" + (e - 0 + 1900);
    g.y = "" + e;
    g.yyyy = e;
    g.yy = e.substring(2, 4);
    g.M = d;
    g.MM = LZ(d);
    g.MMM = MONTH_NAMES[d - 1];
    g.NNN = MONTH_NAMES[d + 11];
    g.d = p;
    g.dd = LZ(p);
    g.E = DAY_NAMES[m + 7];
    g.EE = DAY_NAMES[m];
    g.H = k;
    g.HH = LZ(k);
    g.h = k == 0 ? 12 : k > 12 ? k - 12 : k;
    g.hh = LZ(g.h);
    g.K = k > 11 ? k - 12 : k;
    g.k = k + 1;
    g.KK = LZ(g.K);
    g.kk = LZ(g.k);
    g.a = k > 11 ? "PM" : "AM";
    g.m = h;
    g.mm = LZ(h);
    g.s = i;
    for (g.ss = LZ(i); f < c.length;) {
        e = c.charAt(f);
        for (d = ""; c.charAt(f) == e && f < c.length;) d += c.charAt(f++);
        b = g[d] != null ? b + g[d] : b + d
    }
    return b
}
function _isInteger(a) {
    for (var c = 0; c < a.length; c++) if ("1234567890".indexOf(a.charAt(c)) == -1) return false;
    return true
}
function _getInt(a, c, b, f) {
    for (f = f; f >= b; f--) {
        var e = a.substring(c, c + f);
        if (e.length < b) return null;
        if (_isInteger(e)) return e
    }
    return null
}

function getDateFromFormat(a, c) {
    a += "";
    c += "";
    var b = 0,
        f = 0,
        e = "",
        d = "",
        p, m, k = new Date,
        h = k.getYear(),
        i = k.getMonth() + 1,
        g = 1,
        j = k.getHours(),
        n = k.getMinutes();
    k = k.getSeconds();
    for (var l = ""; f < c.length;) {
        e = c.charAt(f);
        for (d = ""; c.charAt(f) == e && f < c.length;) d += c.charAt(f++);
        if (d == "yyyy" || d == "yy" || d == "y") {
            if (d == "yyyy") m = p = 4;
            if (d == "yy") m = p = 2;
            if (d == "y") {
                p = 2;
                m = 4
            }
            h = _getInt(a, b, p, m);
            if (h == null) return 0;
            b += h.length;
            if (h.length == 2) h = h > 70 ? 1900 + (h - 0) : 2E3 + (h - 0)
        } else if (d == "MMM" || d == "NNN") {
            for (e = i = 0; e < MONTH_NAMES.length; e++) {
                var o =
                MONTH_NAMES[e];
                if (a.substring(b, b + o.length).toLowerCase() == o.toLowerCase()) if (d == "MMM" || d == "NNN" && e > 11) {
                    i = e + 1;
                    if (i > 12) i -= 12;
                    b += o.length;
                    break
                }
            }
            if (i < 1 || i > 12) return 0
        } else if (d == "EE" || d == "E") for (e = 0; e < DAY_NAMES.length; e++) {
            d = DAY_NAMES[e];
            if (a.substring(b, b + d.length).toLowerCase() == d.toLowerCase()) {
                b += d.length;
                break
            }
        } else if (d == "MM" || d == "M") {
            i = _getInt(a, b, d.length, 2);
            if (i == null || i < 1 || i > 12) return 0;
            b += i.length
        } else if (d == "dd" || d == "d") {
            g = _getInt(a, b, d.length, 2);
            if (g == null || g < 1 || g > 31) return 0;
            b += g.length
        } else if (d == "hh" || d == "h") {
            j = _getInt(a, b, d.length, 2);
            if (j == null || j < 1 || j > 12) return 0;
            b += j.length
        } else if (d == "HH" || d == "H") {
            j = _getInt(a, b, d.length, 2);
            if (j == null || j < 0 || j > 23) return 0;
            b += j.length
        } else if (d == "KK" || d == "K") {
            j = _getInt(a, b, d.length, 2);
            if (j == null || j < 0 || j > 11) return 0;
            b += j.length
        } else if (d == "kk" || d == "k") {
            j = _getInt(a, b, d.length, 2);
            if (j == null || j < 1 || j > 24) return 0;
            b += j.length;
            j--
        } else if (d == "mm" || d == "m") {
            n = _getInt(a, b, d.length, 2);
            if (n == null || n < 0 || n > 59) return 0;
            b += n.length
        } else if (d == "ss" || d == "s") {
            k = _getInt(a, b, d.length, 2);
            if (k == null || k < 0 || k > 59) return 0;
            b += k.length
        } else if (d == "a") {
            if (a.substring(b, b + 2).toLowerCase() == "am") l = "AM";
            else if (a.substring(b, b + 2).toLowerCase() == "pm") l = "PM";
            else
            return 0;
            b += 2
        } else if (a.substring(b, b + d.length) != d) return 0;
        else b += d.length
    }
    if (b != a.length) return 0;
    if (i == 2) if (h % 4 == 0 && h % 100 != 0 || h % 400 == 0) {
        if (g > 29) return 0
    } else if (g > 28) return 0;
    if (i == 4 || i == 6 || i == 9 || i == 11) if (g > 30) return 0;
    if (j < 12 && l == "PM") j = j - 0 + 12;
    else if (j > 11 && l == "AM") j -= 12;
    return (new Date(h, i - 1, g, j, n, k)).getTime()
}

function parseDate(a) {
    var c = arguments.length == 2 ? arguments[1] : false;
    generalFormats = Array("y-M-d", "MMM d, y", "MMM d,y", "y-MMM-d", "d-MMM-y", "MMM d");
    monthFirst = Array("M/d/y", "M-d-y", "M.d.y", "MMM-d", "M/d", "M-d");
    dateFirst = Array("d/M/y", "d-M-y", "d.M.y", "d-MMM", "d/M", "d-M");
    c = Array("generalFormats", c ? "dateFirst" : "monthFirst", c ? "monthFirst" : "dateFirst");
    for (var b = null, f = 0; f < c.length; f++) for (var e = window[c[f]], d = 0; d < e.length; d++) {
        b = getDateFromFormat(a, e[d]);
        if (b != 0) return new Date(b)
    }
    return null
}

function PopupWindow_getXYPosition(a) {
    a = this.type == "WINDOW" ? getAnchorWindowPosition(a) : getAnchorPosition(a);
    this.x = a.x;
    this.y = a.y
}
function PopupWindow_setSize(a, c) {
    this.width = a;
    this.height = c
}
function PopupWindow_populate(a) {
    this.contents = a;
    this.populated = false
}
function PopupWindow_setUrl(a) {
    this.url = a
}
function PopupWindow_setWindowProperties(a) {
    this.windowProperties = a
}

function PopupWindow_refresh() {
    if (this.divName != null) if (this.use_gebi) document.getElementById(this.divName).innerHTML = this.contents;
    else if (this.use_css) document.all[this.divName].innerHTML = this.contents;
    else {
        if (this.use_layers) {
            var a = document.layers[this.divName];
            a.document.open();
            a.document.writeln(this.contents);
            a.document.close()
        }
    } else if (this.popupWindow != null && !this.popupWindow.closed) {
        if (this.url != "") this.popupWindow.location.href = this.url;
        else {
            this.popupWindow.document.open();
            this.popupWindow.document.writeln(this.contents);
            this.popupWindow.document.close()
        }
        this.popupWindow.focus()
    }
}

function PopupWindow_showPopup(a) {
    this.getXYPosition(a);
    this.x += this.offsetX;
    this.y += this.offsetY;
    if (!this.populated && this.contents != "") {
        this.populated = true;
        this.refresh()
    }
    if (this.divName != null) if (this.use_gebi) {
        document.getElementById(this.divName).style.left = this.x + "px";
        document.getElementById(this.divName).style.top = this.y + "px";
        document.getElementById(this.divName).style.visibility = "visible"
    } else if (this.use_css) {
        document.all[this.divName].style.left = this.x;
        document.all[this.divName].style.top =
        this.y;
        document.all[this.divName].style.visibility = "visible"
    } else {
        if (this.use_layers) {
            document.layers[this.divName].left = this.x;
            document.layers[this.divName].top = this.y;
            document.layers[this.divName].visibility = "visible"
        }
    } else {
        if (this.popupWindow == null || this.popupWindow.closed) {
            if (this.x < 0) this.x = 0;
            if (this.y < 0) this.y = 0;
            if (screen && screen.availHeight) if (this.y + this.height > screen.availHeight) this.y = screen.availHeight - this.height;
            if (screen && screen.availWidth) if (this.x + this.width > screen.availWidth) this.x =
            screen.availWidth - this.width;
            this.popupWindow = window.open(window.opera || document.layers && !navigator.mimeTypes["*"] || navigator.vendor == "KDE" || document.childNodes && !document.all && !navigator.taintEnabled ? "" : "about:blank", "window_" + a, this.windowProperties + ",width=" + this.width + ",height=" + this.height + ",screenX=" + this.x + ",left=" + this.x + ",screenY=" + this.y + ",top=" + this.y + "")
        }
        this.refresh()
    }
}

function PopupWindow_hidePopup() {
    if (this.divName != null) if (this.use_gebi) document.getElementById(this.divName).style.visibility = "hidden";
    else if (this.use_css) document.all[this.divName].style.visibility = "hidden";
    else {
        if (this.use_layers) document.layers[this.divName].visibility = "hidden"
    } else if (this.popupWindow && !this.popupWindow.closed) {
        this.popupWindow.close();
        this.popupWindow = null
    }
}

function PopupWindow_isClicked(a) {
    if (this.divName != null) {
        if (this.use_layers) {
            var c = a.pageX;
            a = a.pageY;
            var b = document.layers[this.divName];
            return c > b.left && c < b.left + b.clip.width && a > b.top && a < b.top + b.clip.height ? true : false
        } else if (document.all) {
            b = window.event.srcElement;
            try {
                for (; b.parentElement != null;) {
                    if (b.id == this.divName) return true;
                    b = b.parentElement
                }
                return false
            } catch (f) {}
        } else if (this.use_gebi && a) {
            if (a.originalTarget) b = a.originalTarget;
            if (a.target) b = a.target;
            try {
                for (; b.parentNode != null;) {
                    if (b.id == this.divName) return true;
                    b = b.parentNode
                }
                return false
            } catch (e) {}
        }
        return false
    }
    return false
}
function PopupWindow_hideIfNotClicked(a) {
    this.autoHideEnabled && !this.isClicked(a) && this.hidePopup()
}
function PopupWindow_autoHide() {
    this.autoHideEnabled = true
}
function PopupWindow_hidePopupWindows(a) {
    for (var c = 0; c < popupWindowObjects.length; c++) popupWindowObjects[c] != null && popupWindowObjects[c].hideIfNotClicked(a)
}

function PopupWindow_attachListener() {
    document.layers && document.captureEvents(Event.MOUSEUP);
    window.popupWindowOldEventListener = document.onmouseup;
    document.onmouseup = window.popupWindowOldEventListener != null ? new Function("window.popupWindowOldEventListener(); PopupWindow_hidePopupWindows();") : PopupWindow_hidePopupWindows
}

function PopupWindow() {
    if (!window.popupWindowIndex) window.popupWindowIndex = 0;
    if (!window.popupWindowObjects) window.popupWindowObjects = [];
    if (!window.listenerAttached) {
        window.listenerAttached = true;
        PopupWindow_attachListener()
    }
    this.index = popupWindowIndex++;
    popupWindowObjects[this.index] = this;
    this.popupWindow = this.divName = null;
    this.height = this.width = 0;
    this.parentCaller = this.autoHideEnabled = this.visible = this.populated = false;
    this.url = this.contents = "";
    this.windowProperties = "toolbar=no,location=no,status=no,menubar=no,scrollbars=auto,resizable,alwaysRaised,dependent,titlebar=no";
    if (arguments.length > 0) {
        this.type = "DIV";
        this.divName = arguments[0]
    } else this.type = "WINDOW";
    this.use_layers = this.use_css = this.use_gebi = false;
    if (document.getElementById) this.use_gebi = true;
    else if (document.all) this.use_css = true;
    else if (document.layers) this.use_layers = true;
    else this.type = "WINDOW";
    this.offsetY = this.offsetX = 0;
    this.getXYPosition = PopupWindow_getXYPosition;
    this.populate = PopupWindow_populate;
    this.setUrl = PopupWindow_setUrl;
    this.setWindowProperties = PopupWindow_setWindowProperties;
    this.refresh =
    PopupWindow_refresh;
    this.showPopup = PopupWindow_showPopup;
    this.hidePopup = PopupWindow_hidePopup;
    this.setSize = PopupWindow_setSize;
    this.isClicked = PopupWindow_isClicked;
    this.autoHide = PopupWindow_autoHide;
    this.hideIfNotClicked = PopupWindow_hideIfNotClicked
}
function CP_stop(a) {
    a && a.stopPropagation && a.stopPropagation()
}

function CalendarPopup() {
    var a;
    if (arguments.length > 0) {
        a = new PopupWindow(arguments[0]);
        a.parentCaller = arguments[1]
    } else {
        a = new PopupWindow;
        a.setSize(150, 175)
    }
    a.offsetX = -152;
    a.offsetY = 25;
    a.autoHide();
    a.monthNames = Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
    a.monthAbbreviations = Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
    a.dayHeaders = Array("S", "M", "T", "W", "T", "F", "S");
    a.returnFunction = "CP_tmpReturnFunction";
    a.returnMonthFunction = "CP_tmpReturnMonthFunction";
    a.returnQuarterFunction = "CP_tmpReturnQuarterFunction";
    a.returnYearFunction = "CP_tmpReturnYearFunction";
    a.weekStartDay = 1;
    a.isShowYearNavigation = false;
    a.displayType = "date";
    a.disabledWeekDays = {};
    a.disabledDatesExpression = "";
    a.yearSelectStartOffset = 2;
    a.currentDate = null;
    a.todayText = "Today";
    a.cssPrefix = "";
    a.isShowNavigationDropdowns = false;
    a.isShowYearNavigationInput = false;
    window.CP_calendarObject = null;
    window.CP_targetInput = null;
    window.CP_dateFormat = "MM/dd/yyyy";
    a.copyMonthNamesToWindow = CP_copyMonthNamesToWindow;
    a.setReturnFunction = CP_setReturnFunction;
    a.setReturnMonthFunction = CP_setReturnMonthFunction;
    a.setReturnQuarterFunction = CP_setReturnQuarterFunction;
    a.setReturnYearFunction = CP_setReturnYearFunction;
    a.setMonthNames = CP_setMonthNames;
    a.setMonthAbbreviations = CP_setMonthAbbreviations;
    a.setDayHeaders = CP_setDayHeaders;
    a.setWeekStartDay = CP_setWeekStartDay;
    a.setDisplayType = CP_setDisplayType;
    a.setDisabledWeekDays = CP_setDisabledWeekDays;
    a.addDisabledDates = CP_addDisabledDates;
    a.setYearSelectStartOffset = CP_setYearSelectStartOffset;
    a.setTodayText = CP_setTodayText;
    a.showYearNavigation = CP_showYearNavigation;
    a.showCalendar = CP_showCalendar;
    a.hideCalendar = CP_hideCalendar;
    a.getStyles = getCalendarStyles;
    a.refreshCalendar = CP_refreshCalendar;
    a.getCalendar = CP_getCalendar;
    a.select = CP_select;
    a.setCssPrefix = CP_setCssPrefix;
    a.showNavigationDropdowns = CP_showNavigationDropdowns;
    a.showYearNavigationInput = CP_showYearNavigationInput;
    a.copyMonthNamesToWindow();
    return a
}

function CP_copyMonthNamesToWindow() {
    if (typeof window.MONTH_NAMES != "undefined" && window.MONTH_NAMES != null) {
        window.MONTH_NAMES = [];
        for (var a = 0; a < this.monthNames.length; a++) window.MONTH_NAMES[window.MONTH_NAMES.length] = this.monthNames[a];
        for (a = 0; a < this.monthAbbreviations.length; a++) window.MONTH_NAMES[window.MONTH_NAMES.length] = this.monthAbbreviations[a]
    }
}

function CP_tmpReturnFunction(a, c, b) {
    window.parentCaller != null ? window.parentCaller.setDPDate(new Date(a, c - 1, b, 0, 0, 0)) : alert("Use setReturnFunction() to define which function will get the clicked results!")
}
function CP_tmpReturnMonthFunction(a, c) {
    alert("Use setReturnMonthFunction() to define which function will get the clicked results!\nYou clicked: year=" + a + " , month=" + c)
}

function CP_tmpReturnQuarterFunction(a, c) {
    alert("Use setReturnQuarterFunction() to define which function will get the clicked results!\nYou clicked: year=" + a + " , quarter=" + c)
}
function CP_tmpReturnYearFunction(a) {
    alert("Use setReturnYearFunction() to define which function will get the clicked results!\nYou clicked: year=" + a)
}
function CP_setReturnFunction(a) {
    this.returnFunction = a
}
function CP_setReturnMonthFunction(a) {
    this.returnMonthFunction = a
}

function CP_setReturnQuarterFunction(a) {
    this.returnQuarterFunction = a
}
function CP_setReturnYearFunction(a) {
    this.returnYearFunction = a
}
function CP_setMonthNames(a) {
    for (var c = 0; c < a.length; c++) this.monthNames[c] = a[c];
    this.copyMonthNamesToWindow()
}
function CP_setMonthAbbreviations() {
    for (var a = 0; a < arguments.length; a++) this.monthAbbreviations[a] = arguments[a];
    this.copyMonthNamesToWindow()
}
function CP_setDayHeaders(a) {
    for (var c = 0; c < a.length; c++) this.dayHeaders[c] = a[c]
}

function CP_setWeekStartDay(a) {
    this.weekStartDay = a
}
function CP_showYearNavigation() {
    this.isShowYearNavigation = arguments.length > 0 ? arguments[0] : true
}
function CP_setDisplayType(a) {
    if (a != "date" && a != "week-end" && a != "month" && a != "quarter" && a != "year") {
        alert("Invalid display type! Must be one of: date,week-end,month,quarter,year");
        return false
    }
    this.displayType = a
}
function CP_setYearSelectStartOffset(a) {
    this.yearSelectStartOffset = a
}

function CP_setDisabledWeekDays() {
    this.disabledWeekDays = {};
    for (var a = 0; a < arguments.length; a++) this.disabledWeekDays[arguments[a]] = true
}

function CP_addDisabledDates(a, c) {
    if (arguments.length == 1) c = a;
    if (!(a == null && c == null)) {
        if (this.disabledDatesExpression != "") this.disabledDatesExpression += "||";
        if (a != null) {
            a = parseDate(a);
            a = "" + a.getFullYear() + LZ(a.getMonth() + 1) + LZ(a.getDate())
        }
        if (c != null) {
            c = parseDate(c);
            c = "" + c.getFullYear() + LZ(c.getMonth() + 1) + LZ(c.getDate())
        }
        this.disabledDatesExpression += a == null ? "(ds<=" + c + ")" : c == null ? "(ds>=" + a + ")" : "(ds>=" + a + "&&ds<=" + c + ")"
    }
}
function CP_setTodayText(a) {
    this.todayText = a
}

function CP_setCssPrefix(a) {
    this.cssPrefix = a
}
function CP_showNavigationDropdowns() {
    this.isShowNavigationDropdowns = arguments.length > 0 ? arguments[0] : true
}
function CP_showYearNavigationInput() {
    this.isShowYearNavigationInput = arguments.length > 0 ? arguments[0] : true
}
function CP_hideCalendar() {
    arguments.length > 0 ? window.popupWindowObjects[arguments[0]].hidePopup() : this.hidePopup()
}

function CP_refreshCalendar(a) {
    var c = window.popupWindowObjects[a];
    arguments.length > 1 ? c.populate(c.getCalendar(arguments[1], arguments[2], arguments[3], arguments[4], arguments[5])) : c.populate(c.getCalendar());
    c.refresh()
}
function CP_showCalendar(a) {
    if (arguments.length > 1) this.currentDate = arguments[1] == null || arguments[1] == "" ? new Date : new Date(parseDate(arguments[1]));
    this.populate(this.getCalendar());
    this.showPopup(a)
}

function CP_select(a, c, b) {
    var f = arguments.length > 3 ? arguments[3] : null;
    if (window.getDateFromFormat) if (this.displayType != "date" && this.displayType != "week-end") alert("calendar.select: This function can only be used with displayType 'date' or 'week-end'");
    else {
        window.parentCaller = a;
        window.CP_calendarObject = this;
        this.currentDate = null;
        var e = 0;
        if (f != null) e = getDateFromFormat(f, b);
        if (f != null) this.currentDate = new Date(e);
        window.CP_dateFormat = b;
        this.showCalendar(c)
    } else alert("calendar.select: To use this method you must also include 'date.js' for date formatting")
}

function getCalendarStyles() {
    var a = "",
        c = "";
    if (this != null && typeof this.cssPrefix != "undefined" && this.cssPrefix != null && this.cssPrefix != "") c = this.cssPrefix;
    a += "<STYLE>\n";
    a += "." + c + "cpYearNavigation,." + c + "cpMonthNavigation { background-color:#C0C0C0; text-align:center; vertical-align:center; text-decoration:none; color:#000000; font-weight:bold; }\n";
    a += "." + c + "cpDayColumnHeader, ." + c + "cpYearNavigation,." + c + "cpMonthNavigation,." + c + "cpCurrentMonthDate,." + c + "cpCurrentMonthDateDisabled,." + c + "cpOtherMonthDate,." + c + "cpOtherMonthDateDisabled,." + c + "cpCurrentDate,." + c + "cpCurrentDateDisabled,." + c + "cpTodayText,." + c + "cpTodayTextDisabled,." + c + "cpText { font-family:arial; font-size:8pt; }\n";
    a += "TD." + c + "cpDayColumnHeader { text-align:right; border:solid thin #C0C0C0;border-width:0px 0px 1px 0px; }\n";
    a += "." + c + "cpCurrentMonthDate, ." + c + "cpOtherMonthDate, ." + c + "cpCurrentDate  { text-align:right; text-decoration:none; }\n";
    a += "." + c + "cpCurrentMonthDateDisabled, ." + c + "cpOtherMonthDateDisabled, ." + c + "cpCurrentDateDisabled { color:#D0D0D0; text-align:right; text-decoration:line-through; }\n";
    a += "." + c + "cpCurrentMonthDate, .cpCurrentDate { color:#000000; }\n";
    a += "." + c + "cpOtherMonthDate { color:#808080; }\n";
    a += "TD." + c + "cpCurrentDate { color:white; background-color: #C0C0C0; border-width:1px; border:solid thin #800000; }\n";
    a += "TD." + c + "cpCurrentDateDisabled { border-width:1px; border:solid thin #FFAAAA; }\n";
    a += "TD." + c + "cpTodayText, TD." + c + "cpTodayTextDisabled { border:solid thin #C0C0C0; border-width:1px 0px 0px 0px;}\n";
    a += "A." + c + "cpTodayText, SPAN." + c + "cpTodayTextDisabled { height:20px; }\n";
    a += "A." + c + "cpTodayText { color:black; }\n";
    a += "." + c + "cpTodayTextDisabled { color:#D0D0D0; }\n";
    a += "." + c + "cpBorder { border:solid thin #808080; }\n";
    a += "</STYLE>\n";
    return a
}

function CP_getCalendar() {
    var a = new Date,
        c = this.type == "WINDOW" ? "window.opener." : "",
        b = "";
    if (this.type == "WINDOW") {
        b += "<HTML><HEAD><TITLE>Calendar</TITLE>" + this.getStyles() + "</HEAD><BODY MARGINWIDTH=0 MARGINHEIGHT=0 TOPMARGIN=0 RIGHTMARGIN=0 LEFTMARGIN=0>\n";
        b += "<CENTER><TABLE WIDTH=100% BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>\n"
    } else {
        b += '<TABLE CLASS="' + this.cssPrefix + 'cpBorder" WIDTH=144 BORDER=1 BORDERWIDTH=1 CELLSPACING=0 CELLPADDING=1>\n';
        b += "<TR><TD ALIGN=CENTER>\n";
        b += "<CENTER>\n"
    }
    if (this.displayType == "date" || this.displayType == "week-end") {
        if (this.currentDate == null) this.currentDate = a;
        var f = arguments.length > 0 ? arguments[0] : this.currentDate.getMonth() + 1,
            e = arguments.length > 1 && arguments[1] > 0 && arguments[1] - 0 == arguments[1] ? arguments[1] : this.currentDate.getFullYear(),
            d = Array(0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
        if (e % 4 == 0 && e % 100 != 0 || e % 400 == 0) d[2] = 29;
        var p = e,
            m = f,
            k = 1,
            h = (new Date(e, f - 1, 1)).getDay(),
            i = 0;
        i = h >= this.weekStartDay ? h - this.weekStartDay : 7 - this.weekStartDay + h;
        if (i > 0) {
            m--;
            if (m < 1) {
                m = 12;
                p--
            }
            k = d[m] - i + 1
        }
        i = f + 1;
        var g = e;
        if (i > 12) {
            i = 1;
            g++
        }
        var j = f - 1,
            n = e;
        if (j < 1) {
            j = 12;
            n--
        }
        if (this.type != "WINDOW") b += "<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>";
        b += "<TR>\n";
        h = c + "CP_refreshCalendar";
        var l = "javascript:" + h;
        if (this.isShowNavigationDropdowns) {
            b += '<TD CLASS="' + this.cssPrefix + 'cpMonthNavigation" WIDTH="78" COLSPAN="3"><select CLASS="' + this.cssPrefix + 'cpMonthNavigation" name="cpMonth" onmouseup="CP_stop(event)" onChange="' + h + "(" + this.index + ",this.options[this.selectedIndex].value-0," + (e - 0) + ');">';
            for (g = 1; g <= 12; g++) {
                i = g == f ? "SELECTED" : "";
                b += '<option value="' + g + '" ' + i + ">" + this.monthNames[g - 1] + "</option>"
            }
            b += "</select></TD>";
            b += '<TD CLASS="' + this.cssPrefix + 'cpMonthNavigation" WIDTH="10">&nbsp;</TD>';
            b += '<TD CLASS="' + this.cssPrefix + 'cpYearNavigation" WIDTH="56" COLSPAN="3"><select CLASS="' + this.cssPrefix + 'cpYearNavigation" name="cpYear" onmouseup="CP_stop(event)" onChange="' + h + "(" + this.index + "," + f + ',this.options[this.selectedIndex].value-0);">';
            for (h = e - this.yearSelectStartOffset; h <= e + this.yearSelectStartOffset; h++) {
                i = h == e ? "SELECTED" : "";
                b += '<option value="' + h + '" ' + i + ">" + h + "</option>"
            }
            b += "</select></TD>"
        } else if (this.isShowYearNavigation) {
            b += '<TD CLASS="' + this.cssPrefix + 'cpMonthNavigation" WIDTH="10"><A CLASS="' + this.cssPrefix + 'cpMonthNavigation" HREF="' + l + "(" + this.index + "," + j + "," + n + ');">&lt;</A></TD>';
            b += '<TD CLASS="' + this.cssPrefix + 'cpMonthNavigation" WIDTH="58"><SPAN CLASS="' + this.cssPrefix + 'cpMonthNavigation">' + this.monthNames[f - 1] + "</SPAN></TD>";
            b += '<TD CLASS="' + this.cssPrefix + 'cpMonthNavigation" WIDTH="10"><A CLASS="' + this.cssPrefix + 'cpMonthNavigation" HREF="' + l + "(" + this.index + "," + i + "," + g + ');">&gt;</A></TD>';
            b += '<TD CLASS="' + this.cssPrefix + 'cpMonthNavigation" WIDTH="10">&nbsp;</TD>';
            b += '<TD CLASS="' + this.cssPrefix + 'cpYearNavigation" WIDTH="10"><A CLASS="' + this.cssPrefix + 'cpYearNavigation" HREF="' + l + "(" + this.index + "," + f + "," + (e - 1) + ');">&lt;</A></TD>';
            b += this.isShowYearNavigationInput ? '<TD CLASS="' + this.cssPrefix + 'cpYearNavigation" WIDTH="36"><INPUT NAME="cpYear" CLASS="' + this.cssPrefix + 'cpYearNavigation" SIZE="4" MAXLENGTH="4" VALUE="' + e + '" onBlur="' + h + "(" + this.index + "," + f + ',this.value-0);"></TD>' : '<TD CLASS="' + this.cssPrefix + 'cpYearNavigation" WIDTH="36"><SPAN CLASS="' + this.cssPrefix + 'cpYearNavigation">' + e + "</SPAN></TD>";
            b += '<TD CLASS="' + this.cssPrefix + 'cpYearNavigation" WIDTH="10"><A CLASS="' + this.cssPrefix + 'cpYearNavigation" HREF="' + l + "(" + this.index + "," + f + "," + (e + 1) + ');">&gt;</A></TD>'
        } else {
            b += '<TD CLASS="' + this.cssPrefix + 'cpMonthNavigation" WIDTH="22"><A CLASS="' + this.cssPrefix + 'cpMonthNavigation" HREF="' + l + "(" + this.index + "," + j + "," + n + ');">&laquo;</A></TD>\n';
            b += '<TD CLASS="' + this.cssPrefix + 'cpMonthNavigation" WIDTH="100"><SPAN CLASS="' + this.cssPrefix + 'cpMonthNavigation">' + this.monthNames[f - 1] + " " + e + "</SPAN></TD>\n";
            b += '<TD CLASS="' + this.cssPrefix + 'cpMonthNavigation" WIDTH="22"><A CLASS="' + this.cssPrefix + 'cpMonthNavigation" HREF="' + l + "(" + this.index + "," + i + "," + g + ');">&raquo;</A></TD>\n'
        }
        b += "</TR></TABLE>\n";
        b += "<TABLE WIDTH=120 BORDER=0 CELLSPACING=0 CELLPADDING=1 ALIGN=CENTER>\n";
        b += "<TR>\n";
        for (h = 0; h < 7; h++) b += '<TD CLASS="' + this.cssPrefix + 'cpDayColumnHeader" WIDTH="14%"><SPAN CLASS="' + this.cssPrefix + 'cpDayColumnHeader">' + this.dayHeaders[(this.weekStartDay + h) % 7] + "</TD>\n";
        b += "</TR>\n";
        for (h = 1; h <= 6; h++) {
            b += "<TR>\n";
            for (i = 1; i <= 7; i++) {
                var o = false;
                if (this.disabledDatesExpression != "") {
                    LZ(m);
                    LZ(k);
                    eval("disabled=(" + this.disabledDatesExpression + ")")
                }
                g = "";
                g = m == this.currentDate.getMonth() + 1 && k == this.currentDate.getDate() && p == this.currentDate.getFullYear() ? "cpCurrentDate" : m == f ? "cpCurrentMonthDate" : "cpOtherMonthDate";
                if (o || this.disabledWeekDays[i - 1]) b += '\t<TD CLASS="' + this.cssPrefix + g + '"><SPAN CLASS="' + this.cssPrefix + g + 'Disabled">' + k + "</SPAN></TD>\n";
                else {
                    l = k;
                    j = m;
                    n = p;
                    if (this.displayType == "week-end") {
                        l = new Date(n, j - 1, l, 0, 0, 0, 0);
                        l.setDate(l.getDate() + (7 - i));
                        n = l.getYear();
                        if (n < 1E3) n += 1900;
                        j = l.getMonth() + 1;
                        l = l.getDate()
                    }
                    b += '\t<TD CLASS="' + this.cssPrefix + g + '"><A HREF="javascript:' + c + this.returnFunction + "(" + n + "," + j + "," + l + ");" + c + "CP_hideCalendar('" + this.index + '\');" CLASS="' + this.cssPrefix + g + '">' + k + "</A></TD>\n"
                }
                k++;
                if (k > d[m]) {
                    k = 1;
                    m++
                }
                if (m > 12) {
                    m = 1;
                    p++
                }
            }
            b += "</TR>"
        }
        f = a.getDay() - this.weekStartDay;
        if (f < 0) f += 7;
        b += "<TR>\n";
        b += '\t<TD COLSPAN=7 ALIGN=CENTER CLASS="' + this.cssPrefix + 'cpTodayText">\n';
        if (this.disabledDatesExpression != "") {
            a.getFullYear();
            LZ(a.getMonth() + 1);
            LZ(a.getDate());
            eval("disabled=(" + this.disabledDatesExpression + ")")
        }
        b += o || this.disabledWeekDays[f + 1] ? '\t\t<SPAN CLASS="' + this.cssPrefix + 'cpTodayTextDisabled">' + this.todayText + "</SPAN>\n" : '\t\t<A CLASS="' + this.cssPrefix + 'cpTodayText" HREF="javascript:' + c + this.returnFunction + "('" + a.getFullYear() + "','" + (a.getMonth() + 1) + "','" + a.getDate() + "');" + c + "CP_hideCalendar('" + this.index + "');\">" + this.todayText + "</A>\n";
        b += "\t\t<BR>\n";
        b += "\t</TD></TR></TABLE></CENTER></TD></TR></TABLE>\n"
    }
    if (this.displayType == "month" || this.displayType == "quarter" || this.displayType == "year") {
        e = arguments.length > 0 ? arguments[0] : this.displayType == "year" ? a.getFullYear() - this.yearSelectStartOffset : a.getFullYear();
        if (this.displayType != "year" && this.isShowYearNavigation) {
            b += "<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>";
            b += "<TR>\n";
            b += '\t<TD CLASS="' + this.cssPrefix + 'cpYearNavigation" WIDTH="22"><A CLASS="' + this.cssPrefix + 'cpYearNavigation" HREF="javascript:' + c + "CP_refreshCalendar(" + this.index + "," + (e - 1) + ');">&laquo;</A></TD>\n';
            b += '\t<TD CLASS="' + this.cssPrefix + 'cpYearNavigation" WIDTH="100">' + e + "</TD>\n";
            b += '\t<TD CLASS="' + this.cssPrefix + 'cpYearNavigation" WIDTH="22"><A CLASS="' + this.cssPrefix + 'cpYearNavigation" HREF="javascript:' + c + "CP_refreshCalendar(" + this.index + "," + (e + 1) + ');">&raquo;</A></TD>\n';
            b += "</TR></TABLE>\n"
        }
    }
    if (this.displayType == "month") {
        b += "<TABLE WIDTH=120 BORDER=0 CELLSPACING=1 CELLPADDING=0 ALIGN=CENTER>\n";
        for (a = 0; a < 4; a++) {
            b += "<TR>";
            for (h = 0; h < 3; h++) {
                o = a * 3 + h;
                b += '<TD WIDTH=33% ALIGN=CENTER><A CLASS="' + this.cssPrefix + 'cpText" HREF="javascript:' + c + this.returnMonthFunction + "(" + e + "," + (o + 1) + ");" + c + "CP_hideCalendar('" + this.index + '\');" CLASS="undefined">' + this.monthAbbreviations[o] + "</A></TD>"
            }
            b += "</TR>"
        }
        b += "</TABLE></CENTER></TD></TR></TABLE>\n"
    }
    if (this.displayType == "quarter") {
        b += "<BR><TABLE WIDTH=120 BORDER=1 CELLSPACING=0 CELLPADDING=0 ALIGN=CENTER>\n";
        for (a = 0; a < 2; a++) {
            b += "<TR>";
            for (h = 0; h < 2; h++) {
                o = a * 2 + h + 1;
                b += '<TD WIDTH=50% ALIGN=CENTER><BR><A CLASS="' + this.cssPrefix + 'cpText" HREF="javascript:' + c + this.returnQuarterFunction + "(" + e + "," + o + ");" + c + "CP_hideCalendar('" + this.index + '\');" CLASS="undefined">Q' + o + "</A><BR><BR></TD>"
            }
            b += "</TR>"
        }
        b += "</TABLE></CENTER></TD></TR></TABLE>\n"
    }
    if (this.displayType == "year") {
        b += "<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>";
        b += "<TR>\n";
        b += '\t<TD CLASS="' + this.cssPrefix + 'cpYearNavigation" WIDTH="50%"><A CLASS="' + this.cssPrefix + 'cpYearNavigation" HREF="javascript:' + c + "CP_refreshCalendar(" + this.index + "," + (e - 8) + ');">&laquo;</A></TD>\n';
        b += '\t<TD CLASS="' + this.cssPrefix + 'cpYearNavigation" WIDTH="50%"><A CLASS="' + this.cssPrefix + 'cpYearNavigation" HREF="javascript:' + c + "CP_refreshCalendar(" + this.index + "," + (e + 8) + ');">&raquo;</A></TD>\n';
        b += "</TR></TABLE>\n";
        b += "<TABLE WIDTH=120 BORDER=0 CELLSPACING=1 CELLPADDING=0 ALIGN=CENTER>\n";
        for (a = 0; a < 4; a++) {
            for (h = 0; h < 2; h++) {
                o = e + h * 4 + a;
                b += '<TD WIDTH=50% ALIGN=CENTER><A CLASS="' + this.cssPrefix + 'cpText" HREF="javascript:' + c + this.returnYearFunction + "(" + o + ");" + c + "CP_hideCalendar('" + this.index + '\');" CLASS="undefined">' + o + "</A></TD>"
            }
            b += "</TR>"
        }
        b += "</TABLE></CENTER></TD></TR></TABLE>\n"
    }
    if (this.type == "WINDOW") b += "</BODY></HTML>\n";
    return b
};

/**
 * This derivative version of subModal can be downloaded from http://gabrito.com/files/subModal/
 * Original By Seth Banks (webmaster at subimage dot com)  http://www.subimage.com/
 * Contributions by Eric Angel (tab index code), Scott (hiding/showing selects for IE users), Todd Huss (submodal class on hrefs, moving div containers into javascript, phark method for putting close.gif into CSS), Thomas Risberg (safari fixes for scroll amount), Dave Campbell (improved parsing of submodal-width-height class)
 */
var gSubmodalInitialized = false;
var gPopupMask = null;
var gPopupContainer = null;
var gPopFrame = null;
var gReturnFunc;
var gPopupIsShown = false;
var gHideSelects = false;
var gLoading = "about:blank";

/**
 * Override the loading page from loading.html to something else
 */
function setPopUpLoadingPage(loading)
{
    gLoading = loading;
}

var Submodal = {
    initPopUp: function()
    {
    	if (gSubmodalInitialized) return;
    	
        // Add the HTML to the body
        var body = document.getElementsByTagName('body')[0];
        var popmask = document.createElement('div');
        popmask.id = 'popupMask';
        var popcont = document.createElement('div');
        popcont.id = 'popupContainer';
        popcont.innerHTML = '' +
        '<div id="popupInner">' +
        '<div id="popupTitleBar">' +
        '<div id="popupTitle"></div>' +
        '<div id="popupControls">' +
        '<a onclick="Submodal.hidePopWin(false);"><span>Close</span></a>' +
        '</div>' +
        '</div>' +
        '<iframe src="' +
        gLoading +
        '" style="width:100%;height:100%;background-color:transparent;" scrolling="no" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="100%" height="100%"></iframe>' +
        '</div>';
        body.appendChild(popmask);
        body.appendChild(popcont);
        
        gPopupMask = document.getElementById("popupMask");
        gPopupContainer = document.getElementById("popupContainer");
        gPopFrame = document.getElementById("popupFrame");
        
        // check to see if this is IE version 6 or lower. hide select boxes if so
        // maybe they'll fix this in version 7?
        var brsVersion = parseInt(window.navigator.appVersion.charAt(0), 10);
        if (brsVersion <= 6 && window.navigator.userAgent.indexOf("MSIE") > -1) 
        {
            gHideSelects = true;
        }
        
        gSubmodalInitialized = true;
    },
    showPopWin: function(url, width, height, returnFunc)
    {
    	this.initPopUp();
        gPopupIsShown = true;
        Submodal.disableTabIndexes();
        gPopupMask.style.display = "block";
        gPopupContainer.style.display = "block";
        Submodal.centerPopWin(width, height);
        var titleBarHeight = Math.max(parseInt(gPopupContainer.offsetHeight, 10) - 2, 0);
        gPopupContainer.style.width = width +2 + "px";
        gPopupContainer.style.height = (height + titleBarHeight) + "px";
        //ja	
        //document.getElementById("popupTitleBar").offsetWidth
        //ja
        gPopFrame.style.width = Math.max(parseInt(gPopupContainer.offsetWidth, 10) - 4, 0) + "px";
        gPopFrame.style.height = (height) + "px";
        gPopFrame.src = url;
        gReturnFunc = returnFunc;
        //KK remove scroll from body
        var html = document.documentElement;
        html.style.overflow = 'hidden';
        document.body.style.overflow = 'hidden';
        html.tabIndex = -1;
        // for IE
        if (gHideSelects == true) 
        {
            Submodal.hideSelectBoxes();
        }
        //KK causing browser errors
        //window.setTimeout("setPopTitleAndRewriteTargets();", 100);
    },
    centerPopWin: function(width, height)
    {
        if (gPopupIsShown == true) 
        {
            if (width == null || isNaN(width)) 
            {
                width = gPopupContainer.offsetWidth;
            }
            if (height == null) 
            {
                height = gPopupContainer.offsetHeight;
            }
            var fullHeight = Submodal.getViewportHeight();
            var fullWidth = Submodal.getViewportWidth();
            // scLeft and scTop changes by Thomas Risberg
            var scLeft, scTop;
            if (self.pageYOffset) 
            {
                scLeft = self.pageXOffset;
                scTop = self.pageYOffset;
            }
            else 
                if (document.documentElement && document.documentElement.scrollTop) 
                {
                    scLeft = document.documentElement.scrollLeft;
                    scTop = document.documentElement.scrollTop;
                }
                else 
                    if (document.body) 
                    {
                        scLeft = document.body.scrollLeft;
                        scTop = document.body.scrollTop;
                    }
            gPopupMask.style.height = fullHeight + "px";
            gPopupMask.style.width = fullWidth + "px";
            gPopupMask.style.top = scTop + "px";
            gPopupMask.style.left = scLeft + "px";
            //window.status = " gPopupContainer: "+gPopupContainer.style.height + " gPopupFrame: " + gPopupFrame.style.height;
            var titleBarHeight = parseInt(document.getElementById("popupTitleBar").offsetHeight, 10);
            var topMargin = scTop + ((fullHeight - (height + titleBarHeight)) / 2);
            if (topMargin < 0) 
            {
                topMargin = 0;
            }
            gPopupContainer.style.top = scTop + 15 + "px";
            gPopupContainer.style.left = (scLeft + ((fullWidth - width) / 2)) + "px";
        }
    },
    hidePopWin: function(callReturnFunc)
    {
        stopScripts = false;
        gPopupIsShown = false;
        Submodal.restoreTabIndexes();
        if (gPopupMask == null) 
        {
            return;
        }
        gPopupMask.style.display = "none";
		gPopupMask.style.height = "0px";
        gPopupContainer.style.display = "none";
		gPopupContainer.style.height = "0px";
        if (callReturnFunc == true && gReturnFunc != null) 
        {
            gReturnFunc(window.frames["popupFrame"].returnVal);
        }
        gPopFrame.src = gLoading;
        //KK restore body scrolling
        var html = document.documentElement;
        html.style.overflow = '';
        document.body.style.overflow = '';
        html.tabIndex = 0;
        
        // display all select boxes
        if (gHideSelects == true) 
        {
            Submodal.displaySelectBoxes();
        }
        Booking.RestoreSite();
    },
    setPopTitleAndRewriteTargets: function()
    {
        if (window.frames["popupFrame"].document.title == null) 
        {
            window.setTimeout("Submodal.setPopTitleAndRewriteTargets();", 10);
        }
        else 
        {
            var popupDocument = window.frames["popupFrame"].document;
            document.getElementById("popupTitle").innerHTML = popupDocument.title;
            if (popupDocument.getElementsByTagName('base').length < 1) 
            {
                var aList = window.frames["popupFrame"].document.getElementsByTagName('a');
                for (var i = 0; i < aList.length; i++) 
                {
                    if (aList.target == null) 
                        aList[i].target = '_parent';
                }
                var fList = window.frames["popupFrame"].document.getElementsByTagName('form');
                for (i = 0; i < fList.length; i++) 
                {
                    if (fList.target == null) 
                        fList[i].target = '_parent';
                }
            }
        }
    },
    keyDownHandler: function(e)
    {
        if (gPopupIsShown && e.keyCode == 9) 
            return false;
    },
    disableTabIndexes: function()
    {
        if (document.all) 
        {
            var i = 0;
            for (var j = 0; j < gTabbableTags.length; j++) 
            {
                var tagElements = document.getElementsByTagName(gTabbableTags[j]);
                for (var k = 0; k < tagElements.length; k++) 
                {
                    gTabIndexes[i] = tagElements[k].tabIndex;
                    tagElements[k].tabIndex = "-1";
                    i++;
                }
            }
        }
    },
    restoreTabIndexes: function()
    {
        if (document.all) 
        {
            var i = 0;
            for (var j = 0; j < gTabbableTags.length; j++) 
            {
                var tagElements = document.getElementsByTagName(gTabbableTags[j]);
                for (var k = 0; k < tagElements.length; k++) 
                {
                    tagElements[k].tabIndex = gTabIndexes[i];
                    tagElements[k].tabEnabled = true;
                    i++;
                }
            }
        }
    },
    hideSelectBoxes: function()
    {
        for (var i = 0; i < document.forms.length; i++) 
        {
            for (var e = 0; e < document.forms[i].length; e++) 
            {
                if (document.forms[i].elements[e].tagName == "SELECT") 
                {
                    document.forms[i].elements[e].style.visibility = "hidden";
                }
            }
        }
    },
    displaySelectBoxes: function()
    {
        for (var i = 0; i < document.forms.length; i++) 
        {
            for (var e = 0; e < document.forms[i].length; e++) 
            {
                if (document.forms[i].elements[e].tagName == "SELECT") 
                {
                    document.forms[i].elements[e].style.visibility = "visible";
                }
            }
        }
    },
    addEvent: function(obj, evType, fn)
    {
        if (obj.addEventListener) 
        {
            obj.addEventListener(evType, fn, false);
            return true;
        }
        else 
            if (obj.attachEvent) 
            {
                var r = obj.attachEvent("on" + evType, fn);
                return r;
            }
            else 
            {
                return false;
            }
    },
    getViewportHeight: function()
    {
        if (window.innerHeight != window.undefined) 
            return window.innerHeight;
        if (document.compatMode == 'CSS1Compat') 
            return document.documentElement.clientHeight;
        if (document.body) 
            return document.body.clientHeight;
        return window.undefined;
    },
    getViewportWidth: function()
    {
        if (window.innerWidth != window.undefined) 
            return window.innerWidth;
        if (document.compatMode == 'CSS1Compat') 
            return document.documentElement.clientWidth;
        if (document.body) 
            return document.body.clientWidth;
        return window.undefined;
    },
    ResizeModal: function()
    {
        if (gPopupContainer == null) return;
        //gPopupMask.style.top = parseInt(gPopupMask.style.top)+'px';
        var width = 966;
        var height = Submodal.getViewportHeight() - 50;
        Submodal.centerPopWin(width, height);
        //gPopupContainer.style.width = 796 + "px";
        //gPopupContainer.style.height = (height) + "px";
        //gPopFrame.style.width = Math.max(parseInt(gPopupContainer.offsetWidth, 10) - 4, 0) + "px";
        //gPopFrame.style.height = (height) + "px";
    }
    
}

Submodal.addEvent(window, "load", Submodal.initPopUp);
Submodal.addEvent(window, "resize", Submodal.ResizeModal);
Submodal.addEvent(window, "scroll", Submodal.centerPopWin);

var gi = 0;
var gTabIndexes = new Array();
// Pre-defined list of tags we want to disable/enable tabbing into
var gTabbableTags = new Array("A", "BUTTON", "TEXTAREA", "INPUT", "IFRAME");

// If using Mozilla or Firefox, use Tab-key trap.
if (!document.all) 
{
    document.onkeypress = Submodal.keyDownHandler;
}
//INCLUDE submodal.js END


Submodal.addEvent(window, "load", function() {
	Booking.DHtmlLoadScript('http://res.profitroom.pl/hotelklimczok/scripts/site.js');
});


var Booking = 
{
	ObjectsCollection : new Array(),
	DHtmlLoadScript : function(url)
	{
		var e = document.createElement("script");
		e.src = url;
		e.type = "text/javascript";
		document.getElementsByTagName("body")[0].appendChild(e);
	},

	Open : function(form)
	{
    	var addURL = Booking.GetFormOpts(form); 
		var upper = /upper=(temp|test|live)/.exec(window.location.href);
		if (upper != null)
		{
			addURL += '&upper=' + upper[1];
		}
		else if (false)
		{
			addURL += '&upper=';
		}
		addURL += '&url=' + escape(window.location.href);
    	Booking.FreezeSite();
		var h = Submodal.getViewportHeight()-50; 
		Submodal.showPopWin('http://upper2-beta.profitroom.pl/panel/hotelklimczok?locale=pl&height='+h+'&'+addURL+'', 965, 596, 'Rezerwacje hotelowe ProfitROOM');
		
		if (typeof(pageTracker)!="undefined")
		{
			pageTracker._trackPageview('/otwarcie-uppera');
		} 
	},
    
    FreezeSite : function()
    {
    	Booking.showObejcts('hide');
    	try
        {
        	Booking.FreezeSiteLocal();
        }
        catch(e){
        	//error
        }
    },
    
    RestoreSite : function()
    {
    	Booking.showObejcts();
        try
        {
        	Booking.RestoreSiteLocal();
        }
        catch(e)
		{
        	//error
        }
    },
    GetFormOpts:function(data, mode)
    {
		var params = '';
    	if (!data) return "";
		if (data.tagName == "FORM")
		{
			if(data.bookNow)
				params = data.bookNow.getURLParams();
			else
			{
				try
				{
					switch(mode) 
					{
						case 2:
							params = Booking.getDM2params(data);
							break;
						case 3:
							params = Booking.getDM3params(data);
							break;
						case 4:
							params = Booking.getDM4params(data);
							break;
						default:
							params = Booking.getDM1params(data);
							break;
					}
				}
				catch(e)
				{
				}
			}
		}
		else
		{
			for (var prop in data)
				params += (params.length>0?'&':'') + prop + '=' + data[prop];
		}

		return params;
    },
    getDM1params:function(f)
    {
    	day = f.elements[0].options[f.elements[0].selectedIndex].value;
        month = f.elements[1].options[f.elements[1].selectedIndex].value.split(',');
        nights = f.elements[2].options[f.elements[2].selectedIndex].value;
        return url = '&Checkin='+month[1]+'-'+month[0]+'-'+day+'&Nights='+nights;
    },
    getDM2params:function(f)
    {
    		day1 = f.elements[0].options[f.elements[0].selectedIndex].value;
        	month1 = f.elements[1].options[f.elements[1].selectedIndex].value.split(',');
        
        	day2 = f.elements[2].options[f.elements[2].selectedIndex].value;
       		month2 = f.elements[3].options[f.elements[3].selectedIndex].value.split(',');
 
        	return url = '&Checkin='+month1[1]+'-'+month1[0]+'-'+day1+'&Checkout='+month2[1]+'-'+month2[0]+'-'+day2;
    },
    getDM3params:function(f)
    {
    	date = f.elements[0].value;
        nights = f.elements[1].options[f.elements[1].selectedIndex].value;
        
        return url = '&Checkin='+date+'&Nights='+nights;
    },
    getDM4params:function(f)
    {
    	date1 = f.elements[0].value;
        date2 = f.elements[0].value;
        
        return url = '&Checkin='+date1+'&Checkout='+date2;
    },
    showObejcts:function(sh){
		if(sh=='hide'){
        	var childs;
            if(document.all)
				childs = document.all;
            else 
            	childs = document.getElementsByTagName("body")[0].getElementsByTagName("*");
			for(var i=0; i<childs.length; i++)
				{
					if(childs[i].tagName == 'OBJECT')
					{
						childs[i].style.visibility = 'hidden';					
						Booking.ObjectsCollection[Booking.ObjectsCollection.length] = childs[i]
						
					}	
				}
				for (var i = 0; i < document.embeds.length; i++)
				{
					 document.embeds[i].style.visibility = 'hidden';
					 Booking.ObjectsCollection[Booking.ObjectsCollection.length] = document.embeds[i];
				}
			return;
		}
		else{
			for (var i=0; i<Booking.ObjectsCollection.length; i++)
			{
				Booking.ObjectsCollection[i].style.visibility = 'visible';
			}			
		}	
	}
}

document.write("<link rel='stylesheet' href='http://res.profitroom.pl/hotelklimczok/styles/BookNow.css' />");

//OUTPUT FORM START
document.write("<div class=\"pf_booknow_holder\">	<div id=\"datePickerContainer1\" class=\"datePickerContainer\"></div>	<div id=\"datePickerContainer2\" class=\"datePickerContainer\"></div>	<div class=\"pf_booknow_inner\">		<form id=\"pf_booknow_form\" action=\"#\">			<div id=\"pf_reservation\">Rezerwacja online</div>			<div class=\"pf_checkin\">				<label for='checkin_d'>Data przyjazdu:</label>		        <select id=\"checkin_d\">		        	<option>&nbsp;</option>		        </select>		        <select id=\"checkin_ym\">		        	<option>&nbsp;</option>		        </select>       				<a id=\"datePickerOpener1\" class=\"datePickerOpener\" name=\"datePickerOpener1\" href=\"javascript:var _dp1234\">select</a>			</div>			<div class=\"pf_checkout\">				<label for='checkout_d'>Data wyjazdu:</label>		        <select id=\"checkout_d\">		        	<option>&nbsp;</option>		        </select>		        <select id=\"checkout_ym\">		        	<option>&nbsp;</option>		        </select>       				<a id=\"datePickerOpener2\" class=\"datePickerOpener\" name=\"datePickerOpener2\" href=\"javascript:var _dp2345\">select</a>			</div>			<div class=\"pf_buttons\">				<input type='button' value='sprawdź' onclick='Booking.Open(this.form);return false;' />			</div>			<script language=\"javascript\" type=\"text/javascript\">				document.getElementById('pf_booknow_form').bookNow =  new Idea.Booking.BookNowWrapper({						Checkin: { Mode:'datepicker+dropdowns', 								   YearMonthID:			'checkin_ym', 								   DayID:				'checkin_d',								   DatePickerID:		'datePickerContainer1',								   DatePickerOpenerID:	'datePickerOpener1'},						Checkout: { Mode:'datepicker+dropdowns', 								   YearMonthID:			'checkout_ym', 								   DayID:				'checkout_d',								   DatePickerID:		'datePickerContainer2',								   DatePickerOpenerID:	'datePickerOpener2'},								   						monthsNames:	[\"sty\",\"lut\",\"mar\",\"kwi\",\"maj\",\"cze\",\"lip\",\"sie\",\"wrz\",\"pa\u017a\",\"lis\",\"gru\"],						daysNames: 		[\"ndz.\",\"pn.\",\"wt.\",\"\u015br.\",\"czw.\",\"pt.\",\"sob.\"],						todayText: [\"Dzisiaj\"]  });			</script>		</form>	</div></div>");//OUTPUT FORM END
}
else
{	
	var Booking = 
	{
		Open : function(form)
		{
			alert('Rezerwacja jest chwilowo niedostepna.');
		}
	};
}

Booking.TrackingImage = new Image();
Booking.TrackingImage.src = 'http://tracking.profitroom.pl/trackerimg.php?ts='+((new Date()).getTime())+'&SiteID=1025&url='+escape(window.location.href)+'&ref='+escape(document.referrer);
