// --- Copyright (c) 2003 Bluemedia - www.bluemedia.at ----------------------
// --- To receive the right to license this code to use on your site the  ---
// --- original code must be received from bluemedia (media@bluechip.at). ---
// --- License is granted if you use the original code and only if this   ---
// --- entire copyright notice is included, and you link from the page on ---
// --- which the code is used to Bluemedia - http://www.bluemedia.at  -------
// --- By Ronald Edermayr 06.11.2003 ----------------------------------------
// --- Code: Edermayr Ronald ------------------------------------------------

function openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function openPictureWindow_Fever(imageName,imageWidth,imageHeight,alt,posLeft,posTop) {
	newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">'); 
	newWindow.document.write('<img src='+imageName+' width='+imageWidth+' height='+imageHeight+' alt='+alt+'>'); 
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}

function popupopen () {
	var args = popupopen.arguments;
	var name   = typeof(args[0]) == "undefined" ? "images/spacer.gif" : args[0];
	var width  = typeof(args[1]) == "undefined" ? 100 : args[1];
	var height = typeof(args[2]) == "undefined" ? 100 : args[2];
	var title  = typeof(args[3]) == "undefined" || args[3] == ''  ? "Details" : args[3];
	var wname  = typeof(args[4]) == "undefined" || args[4] == '' ? "win" : args[4];
	var leftpos= typeof(args[5]) == "undefined" ? false : args[5];
	var toppos = typeof(args[6]) == "undefined" ? false : args[6];
	var closes = typeof(args[7]) == "undefined" ? true : false;
	var printable = typeof(args[8]) == "undefined" ? false : true;
	
	if (!leftpos || !toppos) {
		var leftpos = (screen.height - height)/2;
		var toppos  = (screen.width - width)/2;
	}
	
	if (!printable) {
		win = window.open("","" + wname + "","width=" + width + ",height=" + height + ",left=" + toppos + ",top=" + leftpos);
	}else{
		win = window.open("","" + wname + "","width=" + width + ",height=" + (height + 24) + ",left=" + toppos + ",top=" + leftpos);
	}
	win.document.open();
	win.document.write('<html><head><title>' + title + '</title><link rel="stylesheet" type="text/css" href="styles.css"><meta http-equiv="imagetoolbar" content="no"></head>');
	if (closes) {
		win.document.write('<body class="content" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close();">'); 
	}else{
		win.document.write('<body class="content" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">'); 
	}
	win.document.write('<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%"><tr><td align="center">');

	if (name.substr(name.length - 3, 3) == "swf") {
		win.document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="' + width + '" height="' + height + '">');
		win.document.write('<param name="movie" value="' + name + '">');
		win.document.write('<param name="quality" value="high">');
		win.document.write('<param name="quality" value="high">');
		win.document.write('<param name="menu" value="false">');
		win.document.write('<embed src="' + name + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed>');
		win.document.write('</object>');
	}else{
		var alt = (title != "Details") ? title : "";
		win.document.write('<img src="' + name + '" width="' + width + '" height="' + height + '" alt="' + alt + '">'); 
	}
	
	win.document.write('</td></tr>');
	if (printable) win.document.write('<tr><td align="right" height="20"><a class="printlink" href="javascript:self.print();">Seite drucken / print page</a>&nbsp;&nbsp;&nbsp;</td></tr>');
	win.document.write('</table></body></html>');
	win.document.close();
	win.focus();
}

function popuppage() {
	var args	= popuppage.arguments;
	var url		= typeof(args[0]) == "undefined" ? "index.htm" : args[0];
	var width	= typeof(args[1]) == "undefined" ? 100 : args[1];
	var height	= typeof(args[2]) == "undefined" ? 100 : args[2];
	var	features= typeof(args[3]) == "undefined" || args[3] == '' ? 'scrollbars=yes' : args[3];
	var name	= typeof(args[4]) == "undefined" ? '' : args[4];
	if (features != '') features = "," + features;
	window.open(url,name,'width=' + width + ', height=' + height + features);
}

function external_popup(url) {
	window.open(url,'popupwin','width=960,height=500,scrollbars=yes');
}

function popuppanorama(file) {
	win = window.open("","popup","width=260,height=220,scrollbars=no");
	win.document.open();
	win.document.write('<html><head><title>Panorama</title><link rel="stylesheet" type="text/css" href="styles.css"><meta http-equiv="imagetoolbar" content="no"></head>');
	win.document.write('<body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">');
	win.document.write('<table cellpadding="0" cellspacing="0" border="0"><tr><td>');

	var browser = navigator.appName;
	var version = parseFloat(navigator.appVersion);
	if (browser == 'Netscape' && version < 4.0) {
		win.document.write('<applet name="pano" code="pano.class" archive="360/rspanoNS3.zip" width=260 height=200>');
	} else {
		win.document.write('<applet name="pano" code="pano.class" archive="360/rspano.zip" width=260 height=200>');
	}
	win.document.write('<param name=cabbase value="rspano.cab">');
	win.document.write('<param name=file value="' + file + '">');
	win.document.write('<param name=initialView value="0.000000, 180.000005, 100.000001">');
	win.document.write('</applet>');
	win.document.write('</td></tr>');
	win.document.write('<tr class="line_dotted"><td><img src="images/spacer.gif" height="1"></td></tr>');
	win.document.write('<tr class="table01"><td align="right" height="20" style="font-size:10px">');
	win.document.write('panorama by gfb&nbsp;&nbsp;');
	win.document.write('</td></tr></table></body></html>');
	win.document.close();
	win.focus();
}

function openpano(name){

	urls = {};
	urls["mariaalm1"] = "1000006";	// Abergalm
	urls["mariaalm2"] = "5245";		// Aberg Mittelstation
	urls["mariaalm3"] = "5246";		// Aberg Bergstation
	urls["mariaalm4"] = "5260";		// Mühlbach am Hochkönig
	
	urls["kaprun1"] = "5235";		// Kitzsteinhorn Gipfel
	urls["kaprun2"] = "5237";		// Kitzsteinhorn Alpincenter
	urls["kaprun3"] = "5236";		// Schmiedinger Grat
	urls["kaprun4"] = "5238";		// Langwiedboden
	urls["kaprun5"] = "5239";		// Kaprun
	
	urls["rauris1"] = "5300";		// Rauriser Hochalm
	
	urls["saalbach1"] = "5275";		// Schattberg - West
	urls["saalbach2"] = "5276";		// Kohlmais Tal
	urls["saalbach3"] = "5277";		// Hinterglemm Tal
	urls["saalbach4"] = "5240";		// Leogang

	//urls["zell1"] = "5295";			// Schmittenhöhe
	//urls["zell2"] = "5296";			// Areit Bahnen
	urls["zell1"] = "http://www.bergfex.at/schmittenhoehe-zellamsee/webcams/c1983/";

	url = urls[name];
	
	if (url.substr(0,5) == 'http:') {
		window.open(url,'win','width=950,height=540,scrollbars=yes');
	} else {
		window.open('http://webtv.feratel.com/webtv/?bgcolor=707173&lg=de&c2=0&cam=' + url,'win','width=950,height=540');
	}
}
