function MM_preloadImages () {
    if (document.images) {
        var imgFiles = MM_preloadImages.arguments;
        if (document.preloadArray == null) {
            document.preloadArray = new Array();
        }
        var i = document.preloadArray.length;
        with (document) {
            for (var j = 0; j < imgFiles.length; j++) {
                if (imgFiles[j].charAt(0) != "#") {
                    document.preloadArray[i] = new Image();
                    document.preloadArray[i++].src = imgFiles[j];
                }
            }
        }
    }
}

function onpageload () {
	MM_preloadImages('/images/menu/unterkuenfte.gif',
					 '/images/menu/das_tal.gif',
					 '/images/menu/urlaubsgestaltung.gif',
					 '/images/page/de_.jpg',
					 '/images/page/it_.jpg',
					 '/images/page/en_.jpg');
}

function menuover (menuname) {
	if (!document.images) return;
	var xmenuname = '/images/menu/'+menuname+'.gif';
	if (menuname.length == 2) xmenuname = '/images/page/'+menuname+'_.jpg';
	if (document.all) {
		var elem = document.getElementById(menuname);
		elem.style.filter = "progid:DXImageTransform.Microsoft.Fade(overlap='1', duration='0.1');";
		elem.filters[0].apply();
		elem.src = xmenuname;
		elem.filters[0].play();
	} else {
		document.getElementById(menuname).src = xmenuname;
	}
}

function menuout (menuname) {
	if (!document.images) return;
	var xmenuname = '/images/page/none.gif';
	if (menuname.length == 2) xmenuname = '/images/page/'+menuname+'.jpg';
	if (document.all) {
		var elem = document.getElementById(menuname);
		elem.style.filter = "progid:DXImageTransform.Microsoft.Fade(overlap='1', duration='0.3');";
		elem.filters[0].apply();
		elem.src = xmenuname;
		elem.filters[0].play();
	} else {
		document.getElementById(menuname).src = xmenuname;
	}
}

function show_image1 (location, name)
{
	var width = 500, height = 380;
	var left = 100, top = 100;
	if (screen.availHeight && screen.availWidth)
	{
		left = screen.availWidth / 2 - width / 2;
		top  = screen.availHeight / 2 - height / 2;
	}
	var popuplocation = '/english/'+location+'/'+name+'/'+width+'/'+height+'.html?ttg=imagepopup';
	window.open(popuplocation, location+'_'+name, 'hotkeys=no,toolbar=no,location=no,status=no,directories=no,menubar=no,scrollbars=no,resizable=no,width='+width+',height='+height+',dependent=yes,left='+left+',top='+top);
}

function show_image2 (location, name)
{
	var width = 580, height = 380;
	var left = 100, top = 100;
	if (screen.availHeight && screen.availWidth)
	{
		left = screen.availWidth / 2 - width / 2;
		top  = screen.availHeight / 2 - height / 2;
	}
	var popuplocation = '/english/'+location+'/'+name+'/'+width+'/'+height+'.html?ttg=imagepopup';
	window.open(popuplocation, location+'_'+name, 'hotkeys=no,toolbar=no,location=no,status=no,directories=no,menubar=no,scrollbars=no,resizable=no,width='+width+',height='+height+',dependent=yes,left='+left+',top='+top);
}

function show_image3 (location, name)
{
	var width = 380, height = 580;
	var left = 100, top = 50;
	if (screen.availHeight && screen.availWidth)
	{
		left = screen.availWidth / 2 - width / 2;
		top  = screen.availHeight / 2 - height / 2;
	}
	var popuplocation = '/english/'+location+'/'+name+'/'+width+'/'+height+'.html?ttg=imagepopup';
	window.open(popuplocation, location+'_'+name, 'hotkeys=no,toolbar=no,location=no,status=no,directories=no,menubar=no,scrollbars=no,resizable=no,width='+width+',height='+height+',dependent=yes,left='+left+',top='+top);
}

function preload_images() {
	if (document.images) {
		if (typeof(document.LI) == 'undefined') {
			document.LI = new Object();
		}
		document.LI.loaded_images = new Array();
		var argLength = preload_images.arguments.length;
		number = 1;
		for(arg = 0; arg < argLength; arg++) {
			document.LI.loaded_images[number] = new Image();
			document.LI.loaded_images[number].src = preload_images.arguments[arg];
			number++;
		}
	}
}

function load_image (which, where) {
	if (!document.images) return;
	where = document.getElementById(where);
	if (!where) return;
	if (!which) return;
	if (document.all) {
		where.style.filter = "progid:DXImageTransform.Microsoft.Fade(overlap='1', duration='1.0');";
		where.filters[0].apply();
		where.src = which;
		where.filters[0].play();
	}
	else
		where.src = which;
}

function start_slideshow ()
{
	if (stop_sliding == 1) return;
	if (!images_number) return;
	if (!sliding_images) return;
	if (!current_image) return;
	if (!sliding_interval) return;
	if (!sliding_location) return;
	load_image(sliding_images[current_image], sliding_location);
	current_image++;
	if (current_image > images_number) current_image = 1;
	window.setTimeout("start_slideshow()", sliding_interval);
}
function view (bereich) {
	var i = document.getElementById(bereich);
	if (!i) return;
	if (i.style.display == 'none') {
		i.style.display = '';
	} else {
		i.style.display = 'none'; 
	}
	if (bereich == 'zp_preis') {
		if (i.style.display == '') {
			show_dayname();
		}
	}
}
function check(bereich) {
	var dstar1 = document.getElementById('dstar1');
	var dstar2 = document.getElementById('dstar2');
	var dstar3 = document.getElementById('dstar3');
	var dstar4 = document.getElementById('dstar4');
	var dstar4s = document.getElementById('dstar4s');
	var dstar5 = document.getElementById('dstar5');
	var suns = document.getElementById('suns');
	var hotel = document.getElementById('hotel');
	var pension = document.getElementById('pension');
	var garni = document.getElementById('garni');
	var residence = document.getElementById('residence');
	var wohnung = document.getElementById('wohnung');
	var almhuette = document.getElementById('almhuette');
	var star5 = document.getElementById('star5');
	var star4s = document.getElementById('star4s');
	var star4 = document.getElementById('star4');
	var star3 = document.getElementById('star3');
	var star2 = document.getElementById('star2');
	var star1 = document.getElementById('star1');
	var sun3 = document.getElementById('sun3');
	var sun2 = document.getElementById('sun2');
	var sun1 = document.getElementById('sun1');

	if (bereich == '35stars') {
		dstar3.style.display = '';
		dstar4.style.display = '';
		dstar4s.style.display = '';
		dstar5.style.display = '';
		suns.style.display = 'none';
		wohnung.checked = '';
		almhuette.checked = '';
		sun3.checked = '';
		sun2.checked = '';
		sun1.checked = '';
		star1.checked = '';
		star2.checked = '';
		dstar1.style.display = 'none';
		dstar2.style.display = 'none';
	}
	if (bereich == '24stars') {
		dstar2.style.display = '';
		dstar3.style.display = '';
		dstar4.style.display = '';
		suns.style.display = 'none';
		wohnung.checked = '';
		almhuette.checked = '';
		sun3.checked = '';
		sun2.checked = '';
		sun1.checked = '';
		star1.checked = '';
		star4s.checked = '';
		star5.checked = '';
		dstar1.style.display = 'none';
		dstar4s.style.display = 'none';
		dstar5.style.display = 'none';
	}
	if (bereich == '13stars') {
		dstar1.style.display = '';
		dstar2.style.display = '';
		dstar3.style.display = '';
		suns.style.display = 'none';
		wohnung.checked = '';
		almhuette.checked = '';
		sun3.checked = '';
		sun2.checked = '';
		sun1.checked = '';
		star4.checked = '';
		star4s.checked = '';
		star5.checked = '';
		dstar4.style.display = 'none';
		dstar4s.style.display = 'none';
		dstar5.style.display = 'none';
	}
	if (bereich == 'suns') {
		dstar1.style.display = 'none';
		dstar2.style.display = 'none';
		dstar3.style.display = 'none';
		dstar4.style.display = 'none';
		dstar4s.style.display = 'none';
		dstar5.style.display = 'none';
		suns.style.display = '';
		hotel.checked = '';
		pension.checked = '';
		garni.checked = '';
		residence.checked = '';
		star5.checked = '';
		star4s.checked = '';
		star4.checked = '';
		star3.checked = '';
		star2.checked = '';
		star1.checked = '';
	}
}
var day_name = new Array("Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag");
function get_year(year) {
    var nyear = year.getYear ();
    if (nyear < 1000)  nyear += 1900;
    return (nyear);
}
function get_week_day (type) {
	var from_day = document.getElementById('from_day');
	var to_day = document.getElementById('to_day');
	var from_month = document.getElementById('from_month');
	var to_month = document.getElementById('to_month');
	var from_year = document.getElementById('from_year');
	var to_year = document.getElementById('to_year');
	var from_field = document.getElementById('from_field');
	var to_field = document.getElementById('to_field');
	var from_date = new Date (from_year.value, parseInt(from_month.value)-1, from_day.value);
	var to_date = new Date (to_year.value, parseInt(to_month.value)-1, to_day.value);
	if (type == 'from') {
		if (from_date > to_date) {
			new_day = parseInt(from_day.value);
			new_day++;
			to_date = new Date (from_year.value, parseInt(from_month.value)-1, new_day);
			to_day.value = to_date.getDate();
			to_month.value = to_date.getMonth()+1;
			to_year.value = get_year(to_date);
			to_field.value = day_name[to_date.getDay()];
		}
		from_day.value = from_date.getDate();
		from_month.value = from_date.getMonth()+1;
		from_year.value = get_year(from_date);
		from_field.value = day_name[from_date.getDay()];
	}
	if (type == 'to') {
		/*if (from_date > to_date) {
			new_day = parseInt(from_day.value);
			new_day++;
			to_date = new Date (from_year.value, parseInt(from_month.value)-1, new_day);
			to_day.value = to_date.getDate();
			to_month.value = to_date.getMonth()+1;
			to_year.value = get_year(to_date);
			to_field.value = day_name[to_date.getDay()];
		}*/
		to_day.value = to_date.getDate();
		to_month.value = to_date.getMonth()+1;
		to_year.value = get_year(to_date);
		to_field.value = day_name[to_date.getDay()];
	}
}
function show_dayname() {
	get_week_day('from');
	get_week_day('to');
}

var flash = new Object();
function detectflash ()
{
	flash_versions = 20;
	flash.installed = false;
	flash.version = '0.0';
	if (navigator.plugins && navigator.plugins.length) {
		for (x = 0; x < navigator.plugins.length; x++) {
			if (navigator.plugins[x].name.indexOf('Shockwave Flash') != -1) {
				flash.version = navigator.plugins[x].description.split('Shockwave Flash ')[1];
				flash.installed = true;
				break;
			}
		}
	}
	else if (window.ActiveXObject) {
		for (x = 2; x <= flash_versions; x++) {
			try {
				oFlash = eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash." + x + "');");
				if(oFlash) {
					flash.installed = true;
					flash.version = x + '.0';
				}
			}
			catch(e) {}
		}
	}
	flash.ver = Array();
	for(i = 4; i <= flash_versions; i++) {
		eval("flash.ver[" + i + "] = (flash.installed && parseInt(flash.version) >= " + i + ") ? true : false;");
	}
}
// map24
function map24_removeDefaultValues(){
	if (document.link2map24.sstreet.value == 'Straße') document.link2map24.sstreet.value = '';
	if (document.link2map24.szip.value 	  == 'PLZ') document.link2map24.szip.value = '';
	if (document.link2map24.scity.value   == 'Ort') document.link2map24.scity.value = '';
}