function new_freecap()
{
	// loads new freeCap image
	if(document.getElementById)
	{
		// extract image name from image source (i.e. cut off ?randomness)
		thesrc = document.getElementById("freecap").src;
		thesrc = thesrc.substring(0,thesrc.lastIndexOf(".")+4);
		// add ?(random) to prevent browser/isp caching
		document.getElementById("freecap").src = thesrc+"?"+Math.round(Math.random()*100000);
	} else {
		alert("Sorry, cannot autoreload freeCap image\nSubmit the form and a new freeCap will be loaded");
	}
}


// scripts 4 pictures layer
function pop_pic_open(pic_name,print) {
	document.getElementById('pop_pic_div').style['visibility']='visible';
 	document.images['pop_pic_img'].src='http://www.hotel-alpenrose.com/grafiken/loading.gif';
	document.getElementById('pop_pic_img').src=pic_name;
	
	document.getElementById('pop_pic_div').style['top'] = getpop_pic_div_top()+'px';;
	
	if(print==1) document.getElementById('print_link').style['visibility']='visible';
	else document.getElementById('print_link').style['visibility']='hidden';
	pop_pic_move();
}

function pop_pic_close () {
	document.getElementById('pop_pic_div').style['visibility']='hidden';
}

function pop_pic_resize() {
	document.getElementById('pop_pic_div').style['width']=document.getElementById('pop_pic_img').width+'px';
	document.getElementById('pop_pic_div').style['height']=getpop_pic_div_height()+'px';
}
function pop_pic_move() {
	document.getElementById('pop_pic_div').style['right']='30px';	
//	document.getElementById('pop_pic_div').style['top']= '30px';
	document.getElementById('pop_pic_div').style['top']= getpop_pic_div_top()+'px';	

}

function getpop_pic_div_top() {
	var scrollPos; 
	if (typeof window.pageYOffset != 'undefined') { 
	   scrollPos = window.pageYOffset; 
	} 
	else if (typeof document.compatMode != 'undefined' && 
	     document.compatMode != 'BackCompat') { 
	   scrollPos = document.documentElement.scrollTop; 
	} 
	else if (typeof document.body != 'undefined') { 
	   scrollPos = document.body.scrollTop; 
	} 
	return scrollPos + 30;
}

function getpop_pic_div_height() {
	return document.getElementById('pop_pic_img').height + document.getElementById('pop_pic_div_content').height;
}

function open_vip(lang) {
	window.open('http://www.hotel-alpenrose.com/index.php?tpl_n=vip_'+lang,'popup','width=710,height=900,toolbar=no,scrollbars=yes');
}

function open_acquarena(lang) {
	window.open('http://www.hotel-alpenrose.com/index.php?tpl_n=acqua_'+lang,'popup','width=500,height=370,toolbar=no,scrollbars=yes');
}