// JavaScript Document
function addDays(myDate,days) {
    return new Date(myDate.getTime() + days*24*60*60*1000);
}

var date = addDays(new Date(),7);

var mday = date.getDate()
var month = date.getMonth() + 1;
var year = date.getFullYear()

if(mday < 10) {
 mday = '0'+mday;
}
if(month < 10) {
 month = '0'+month;
}

newDate = year + "-"+month+"-"+mday;

function linkHostelCity(country, city) {
             url = 'http://www.reservations.bookhostels.com/lesedar/findabed.php?ChosenCountry='+country+'&ChosenCity='+city+'&DateStart='+newDate+'&NumNights=1&Currency=EUR&OrderBy=price';
             location.href=url;
}

function linkHostelIndex() {
  location.href='http://reservations.bookhostels.com/lesedar/';
}


function linkTourIndex() {
  location.href='http://reservations.bookhostels.com/tours/lesedar/';
}

function linkPartners(site, parentDir, dir, page ) {
   url = 'http://www.stay-in-europe.org/'+site+'-'+parentDir+'-'+dir+'-'+page+'.htm';
   location.href=url;
}

function specialOffers(country) {
   url = 'http://www.activehotels.com/specialoffers/?country='+country+'&trkref=SYE';
   location.href=url;
}

function paging(city, country, page) {
   url = 'http://www.stay-in-europe.org/all-'+city+'-hotels-'+country+'-'+page+'.htm';
   location.href=url;
}

function goToHostel(id) {
   url = 'http://reservations.bookhostels.com/lesedar/hostel.php?HostelNumber='+id;
   location.href=url;
}


