function rawurlencode (str) {
    // URL-encodes string  
    // 
    // version: 1003.2411
    // discuss at: http://phpjs.org/functions/rawurlencode    // +   original by: Brett Zamir (http://brett-zamir.me)
    // +      input by: travc
    // +      input by: Brett Zamir (http://brett-zamir.me)
    // +   bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +      input by: Michael Grier    // +   bugfixed by: Brett Zamir (http://brett-zamir.me)
    // +      input by: Ratheous
    // +      reimplemented by: Brett Zamir (http://brett-zamir.me)
    // +   bugfixed by: Joris
    // +      reimplemented by: Brett Zamir (http://brett-zamir.me)    // %          note 1: This reflects PHP 5.3/6.0+ behavior
    // %        note 2: Please be aware that this function expects to encode into UTF-8 encoded strings, as found on
    // %        note 2: pages served as UTF-8
    // *     example 1: rawurlencode('Kevin van Zonneveld!');
    // *     returns 1: 'Kevin%20van%20Zonneveld%21'    // *     example 2: rawurlencode('http://kevin.vanzonneveld.net/');
    // *     returns 2: 'http%3A%2F%2Fkevin.vanzonneveld.net%2F'
    // *     example 3: rawurlencode('http://www.google.nl/search?q=php.js&ie=utf-8&oe=utf-8&aq=t&rls=com.ubuntu:en-US:unofficial&client=firefox-a');
    // *     returns 3: 'http%3A%2F%2Fwww.google.nl%2Fsearch%3Fq%3Dphp.js%26ie%3Dutf-8%26oe%3Dutf-8%26aq%3Dt%26rls%3Dcom.ubuntu%3Aen-US%3Aunofficial%26client%3Dfirefox-a'
    str = (str+'').toString(); 
    // Tilde should be allowed unescaped in future versions of PHP (as reflected below), but if you want to reflect current
    // PHP behavior, you would need to add ".replace(/~/g, '%7E');" to the following.
    return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28').replace(/\)/g, '%29').replace(/\*/g, '%2A');
}
if (typeof(STHL) == "undefined"){ STHL={}; }

STHL.PageFeatures = {
	recommendToFriendPopup:function(url) {
		url = rawurlencode(url); 
		window.open('/Admin/Public/SendToFriend.aspx?M=SendFriend&url='+url+'&amp;lid=3', 'sendfriend', 'width=322,height=250');
	}
};

STHL.OnlineBooking = {
	loadAccountLoginWindow:function(baseURL, areaID, lang) {
		topids = new Array();

		// da-DK
		topids[71] = '40'; // Fan?
		topids[74] = '79'; // Gr?nh?j
		topids[80] = '39'; // Kattegat
		topids[96] = '33'; // SeaWest
		topids[145] = '91'; // ?er
		topids[164] = '32'; // Marina Fisken?s
		topids[168] = '35'; // R?nbjerg
		// en-GB
		topids[73] = '40'; // Fan?
		topids[76] = '79'; // Gr?nh?j
		topids[82] = '39'; // Kattegat
		topids[100] = '33'; // SeaWest
		topids[146] = '91'; // ?er
		topids[167] = '32'; // Marina Fisken?s
		topids[169] = '35'; // R?nbjerg
		// de-DE
		topids[72] = '40'; // Fan?
		topids[75] = '79'; // Gr?nh?j
		topids[81] = '39'; // Kattegat
		topids[99] = '33'; // SeaWest
		topids[147] = '91'; // ?er
		topids[166] = '32'; // Marina Fisken?s
		topids[1] = '35'; // R?nbjerg

		var url = baseURL;

		if (lang == 'en-GB') {
			url += '?ID=1627';
		} 
		else if (lang == 'de-DE') {
			url += '?ID=1628';
		}
		else {
			url += '?ID=1625';
		}

		url += '&wlstwun=';

		if (lang == 'en-GB') {
			url += '&wlstwLn=en';
			url += '&wlstwCu=eur';
		} 
		else if (lang == 'de-DE') {
			url += '&wlstwLn=ty';
			url += '&wlstwCu=eur';
		}
		else {
			url += '&wlstwLn=dk';
			url += '&wlstwCu=dkk';
		}

		if (topids[areaID] != undefined && topids[areaID] != '') {
			url += '&wlstwid='+topids[areaID];
		}

		loadWebLinkIFramePage(url);
	},

	loadBookingWindow:function(baseURL, frm, areaID, lang) {
		topids = new Array();

		// da-DK
		topids[71] = '40'; // Fan?
		topids[74] = '79'; // Gr?nh?j
		topids[80] = '39'; // Kattegat
		topids[96] = '33'; // SeaWest
		topids[145] = '91'; // ?er
		topids[164] = '32'; // Marina Fisken?s
		topids[168] = '35'; // R?nbjerg
		// en-GB
		topids[73] = '40'; // Fan?
		topids[76] = '79'; // Gr?nh?j
		topids[82] = '39'; // Kattegat
		topids[100] = '33'; // SeaWest
		topids[146] = '91'; // ?er
		topids[167] = '32'; // Marina Fisken?s
		topids[169] = '35'; // R?nbjerg
		// de-DE
		topids[72] = '40'; // Fan?
		topids[75] = '79'; // Gr?nh?j
		topids[81] = '39'; // Kattegat
		topids[99] = '33'; // SeaWest
		topids[147] = '91'; // ?er
		topids[166] = '32'; // Marina Fisken?s
		topids[1] = '35'; // R?nbjerg

		var url = baseURL;

		if (lang == 'en-GB') {
			url += '?ID=1627';
		} 
		else if (lang == 'de-DE') {
			url += '?ID=1628';
		}
		else {
			url += '?ID=1625';
		}

		url += '&wlstwgseek=1&wlstwId=strandhot&wlstwnoerror=1';
		url += '&wlstwPrs='+frm.persons.value;
		url += '&wlstwOvr='+frm.nights.value;
		url += '&wlstwAnk='+frm.day.value+'.'+frm.month.value+'.'+frm.year.value;

		if (lang == 'en-GB') {
			url += '&wlstwLn=en';
			url += '&wlstwCu=eur';
		} 
		else if (lang == 'de-DE') {
			url += '&wlstwLn=ty';
			url += '&wlstwCu=eur';
		}
		else {
			url += '&wlstwLn=dk';
			url += '&wlstwCu=dkk';
		}

		if (topids[areaID] != undefined && topids[areaID] != '') {
			url += '&wlstwtopid='+topids[areaID];
		}

		loadWebLinkIFramePage(url);
	},
	
	setValidDate:function() {
		var years = new Array();
	
		years['2010'] = 0;
		years['2011'] = 1;
		years['2012'] = 2;
		years['2013'] = 3;
	
		var days_in_months = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
	
		var time = new Date();
	
		var org_month = time.getMonth();
		var org_date  = time.getDate();
		var org_hour  = time.getHours();
		var org_year  = time.getFullYear();
	
		var month     = org_month;
		var date      = org_date;
		var hour      = org_hour;
		var year      = org_year;
	
		var days_in_current_month = days_in_months[org_month];
	
		date--;
	
		year = years[year];
	
		document.getElementById("booking:month").options[month].selected = true;
		document.getElementById("booking:date").options[date].selected   = true;
		document.getElementById("booking:year").options[year].selected   = true;
	}
};