// javascripts.js
// Author: Alexander Aberer
// Date: 27.7.2000
// Last modified: 8.6.2001 (Andreas Ritter)

// !!!Wichtig!!! Die folgende Variable muß gesetzt werden wenn über open_window()
// Seiten auf externen/fremden Webservern geöffnet werden sollen.
	var blank_page = "/blank.html"; 

	function SwitchWebservice(switchform,formelement) {
		var fe, dummy;
		if(typeof formelement != "undefined") {
			fe = formelement;
		} else {
			fe = switchform.elements[0];
		}
		if (fe.selectedIndex != 0) {
			var pulldownindex = fe.selectedIndex;
			var url = fe.options[pulldownindex].value;
			locarray = url.split("|");
			if ( locarray.length > 1 ) {
				windata = locarray[0].split(",");
				dummy = open_window(locarray[1],windata[0],windata[1],windata[2],0,0,"scrollbars=" + windata[3] + ",location=no,toolbar=no,status=no,menubar=no,resizable=yes,dependent=yes");
			} else {
				dummy = open_window(url,"",700,480,10,10,"location=yes,toolbar=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,dependent=no");
			}
	 	}
	}
	
	function realmedia(path,name,content) {
		var datestr = new Date();
		url = 'http://www.vol.at/realmedia/embed.asp?cont=' + content + '&title=' + escape(name) + '&file=' + escape(path) + "&" + escape(datestr.toLocaleString());
		if (content=='video') {
			var rc_video=window.open(url,'rc_video','width=230,height=310,resizable=yes');
			rc_video.focus();
		} else {
			var rc_audio=window.open(url,'rc_audio','width=400,height=40');
			rc_audio.focus();
		}
	}
	
// Browser-Abstürze mit IE 5.5
//	function realmedia(path,name,content) {
//		var dummy;
//		var datestr = new Date();
//		var url = "http://www.vol.at/realmedia/embed.asp?cont=" + escape(content) + "&title=" + escape(name) + "&file=" + escape(path) + "&" + escape(datestr.toLocaleString());
//		if (content == "video") {
//			dummy = open_window(url,"rc_video",230,305,10,10,"resizable=yes");
//		} else {
//			dummy = open_window(url,"rc_audio",400,40);
//		}
//		//return false;
//	}
	
	function open_window(target,name,width,height,posx,posy,windowoptions,init_target) {
		var it, wo, px, py, host;

		it = target;
		wo = "location=no,toolbar=no,status=no,statusbar=no,scrollbars=no,resizable=no,dependent=yes";
		px = py = 0;

		if(typeof new_window != "undefined") {
			if(new_window.closed != true) {
				new_window.close();
			}
		}

		if (typeof posx != "undefined") px = posx;
		if (typeof posy != "undefined") py = posy;
		if ((typeof windowoptions != "undefined") && (windowoptions != "")) wo = windowoptions;
		if (typeof init_target != "undefined") {
			it = init_target;
		} else {
			if (target.indexOf("http://") != -1) {
				host = "http://" + window.location.hostname;
				if (target.indexOf(host) == -1) it = blank_page;
			}
		}
		new_window = window.open(it,name,"width=" + width + ",height=" + height + "," + wo);
		new_window.moveTo(px,py);
		new_window.location.replace(target);
		new_window.focus();
		return false;
	}

	function setUrlForPrint() {
		sUrl = document.location.href;
		if ((document.all) || (document.layers)){
			sUrl = sUrl.replace(/\?/, "\\/");
			sUrl = sUrl.replace(/\&/, "//");
		}
		document.printform.url.value = sUrl;
	}
    function wnd_open() {
    	if (navigator.appName == "Netscape")
	  	window.open("http://www.ixportal.com/vienna_online/strasser_nc.html", "map", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0,width=620,height=480,top=100,left=100");
	    else
		window.open("http://www.ixportal.com/vienna_online/strasser.html", "map", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,copyhistory=0,width=620,height=480,top=100,left=100");
    }
  

function openWindow(url,name,sonst) {
  popupWin = window.open(url,name,sonst);
}
function popdl(filename) // Download  Popup
{
handle=window.open("", "Fenster","width=600,height=400,resizable=no,scrollbars=no,menubar=no,directories=no,screenX=0,screenY=0, Left=0, Top=0");
handle.location.href=filename;
}
function NeuFenstereuro(Breite, Hoehe, Adresse)
{
 MeinFenster = window.open(Adresse, "Zweitfenster", "width=" + Breite + ",height=" + Hoehe + ",status=yes"); 
}
function openStrip(){
window.open("http://archiv.vienna.at/tools/erotik/strip_puzzle/welcome.shtm","bla","width=440,height=500,screenX=0,screenY=0");
}
function openStrip2(){
window.open("http://archiv.vienna.at/tools/erotik/strip_puzzle2/welcome.shtm","bla","width=440,height=500,screenX=0,screenY=0");
}
function openStrip3(){
window.open("http://archiv.vienna.at/tools/erotik/strip_puzzle3/welcome.shtm","bla","width=440,height=500,screenX=0,screenY=0");
}
function openStrip4(){
window.open("http://archiv.vienna.at/tools/erotik/strip_puzzle4/welcome.shtm","bla","width=440,height=500,screenX=0,screenY=0");
}
function openJobpilot(){
var begriff=document.formular.keywords.value;
var ort=document.formular.region.value;
URL=('http://www.jobpilot.at/job_suche/search.phtml/at_vienna?region='+ort+'&keywords='+begriff);
window.open(URL,'bla','width=550,height=600,scrollbars=yes,location=yes');
}
function popUnder(){
bildchen=window.open('','bla','width=238,height=400,scrollbars=no');
bildchen.document.write("<html><head><title>Partytipp der Woche</title><script language='JavaScript' src='/vis/v1_javaandstyles/javascripts.js' type='text/javascript'></script></head><body topmargin='0' bottommargin='0' leftmargin='0' rightmargin='0'><a href='http://www.vienna.at/pubs/redaktion/vorschau/Party-Vorschau-78022.shtm' target='_blank' onclick='self.close()'><img src='http://www.vienna.at/feat/diverse/party.jpg' border='0'></a></body></html>");
self.focus()
}
//***************
//Neue Navigation
//***************
var popTest=0;
function openMenu(HTML,name,properties){
	if(popTest==0 || popTest.closed==true){
		popTest=window.open(HTML,name,properties);
	}
	else{
		popTest.focus();
		popTest.close();
	}
	popTest=window.open(HTML,name,properties);
}
//bookmarken
function bookmark(bookmarkUrl,bookmarkTitle){ 
	if(document.all){ 
		window.external.AddFavorite(bookmarkUrl,bookmarkTitle); 
	} 
}
function apaFenster(){
window.open('/night_ticker/night_ticker.shtm','bla','width=400,height=360,resizable=yes');
}
function picPop(bild){
win=window.open('','blabla','');
win.document.write("<body topmargin='0' bottommargin='0' leftmargin='0' rightmargin='0'><head><title>Vienna Online</title></head><body><IMG SRC='http://oewa.vienna.at/cgi-bin/ivw/CP/RedCont/freizeit/christkindl/VIENNA' WIDTH=1 HEIGHT=1 VSPACE=0 HSPACE=0 BORDER=0><img src='"+bild+"' border='0'></body></html>");
}
function picPop2(bild, weite, hoehe){
win=window.open("","blabla","width="+weite+",height="+hoehe);
win.document.write("<body topmargin='0' bottommargin='0' leftmargin='0' rightmargin='0'><head><title>Vienna Online</title></head><body><IMG SRC='http://oewa.vienna.at/cgi-bin/ivw/CP/RedCont/freizeit/christkindl/VIENNA' WIDTH=1 HEIGHT=1 VSPACE=0 HSPACE=0 BORDER=0><img src='"+bild+"' border='0'></body></html>");
}
function winTest(){
	if(document.getElementById("winner").value == "Hofburg" || document.getElementById("winner").value == "hofburg"){
		document.location.href="http://www.vienna.at/tools/surfandwin/gewinnen/gewinnen.asp?saw_action=spargeldinner";
	}
	else {
		alert("Leider falsch.\nVersuchen sie es noch einmal.");
	}
}
//****
//rollover navigation bei flashbannern und selectlisten
//****
function hideVionFlash(){
	if(document.getElementsByTagName("embed")[0]){
		if(navigator.appName=="Netscape"){
			document.getElementsByTagName('embed')[0].style.width=0;
		}
		else{
			document.getElementsByTagName("embed")[0].setAttribute("wmode","opaque");
		}
	}
	if(document.getElementsByTagName("select")){
		liste=document.getElementsByTagName("select").length;
		for(i=0; i<liste; i++){
			document.getElementsByTagName("select")[i].style.visibility="hidden";
		}
	}
	if(document.getElementsByTagName("object")[0]){
		liste=document.getElementsByTagName("object").length;
		for(i=0; i<1; i++){
			if(document.getElementsByTagName("object")[i].parentNode.style.top == ""){
					document.getElementsByTagName("object")[i].style.visibility="hidden";
			}
		}
	}
		if(document.getElementsByTagName("iframe")){
		liste=document.getElementsByTagName("iframe").length;
		for(i=0; i<liste; i++){
			document.getElementsByTagName("iframe")[i].style.visibility="hidden";
		}
	}
}
function showVionFlash(){
	if(document.getElementsByTagName("embed")[0]){
		if(navigator.appName=="Netscape"){
			document.getElementsByTagName('embed')[0].style.width=468;
		}
	}
	if(document.getElementsByTagName("select")){
		liste=document.getElementsByTagName("select").length;
		for(i=0; i<liste; i++){
			document.getElementsByTagName("select")[i].style.visibility="visible";
		}
	}
	if(document.getElementsByTagName("object")[0]){
		liste=document.getElementsByTagName("object").length;
		for(i=0; i<1; i++){
			if(document.getElementsByTagName("object")[i].parentNode.style.top == ""){
					document.getElementsByTagName("object")[i].style.visibility="visible";
			}
		}
	}
	if(document.getElementsByTagName("iframe")){
		liste=document.getElementsByTagName("iframe").length;
		for(i=0; i<liste; i++){
			document.getElementsByTagName("iframe")[i].style.visibility="visible";
		}
	}
}
//maximiertes fenster aufmachen
function resizeOpen(html){
	fenster=window.open("","","");
	fenster.moveTo(-5,0);
	fenster.resizeTo(screen.availWidth + 5,screen.availHeight + 5);
	fenster.focus();
	fenster.location.href=html;
	fenster=false;
}
function winTestSalz(){
	if(document.form1.ans3.value.toLowerCase() == "great voices" || document.form1.ans3.value.toLowerCase() == "greatvoices"){
		document.location.href="http://www.vienna.at/tools/surfandwin/gewinnen/gewinnen.asp?saw_action=salzburg0111";
	}
	else {
		alert("Die Antwort ist leider falsch.\nVersuchen sie es noch einmal!");
	}
}
function winIt(){
	if(document.form.ans3.value == "Royal Swedish Smörgasbord" || document.form.ans3.value == "royal swedish smörgasbord" ){
		document.location.href="http://www.vienna.at/tools/surfandwin/gewinnen/gewinnen2.asp?saw_action=sonntagsbrunchhilton";
	}
	else {
		alert("Die Antwort ist leider falsch.\nVersuchen sie es noch einmal!");
	}
}
function 	menuTable(anfang, mitte, ende) {
	this.anfang = anfang;
	this.mitte = mitte;
	this.ende = ende;
}
tab1=new menuTable("<table cellpadding=\"2\" cellspacing=\"0\" border=\"0\" width=\"150\" height=\"25\">\n<tr>\n<td bgcolor=\"#ededed\" id=\"parent","\" onmouseover=\"this.style.backgroundColor='#f8f8f8'\" onmouseout=\"this.style.backgroundColor='#ededed'\">\n<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tr>\n<td>\n<a href=\"#\" target=\"_top\">\n<span class=\"linkliste\">\n","\n</span>\n</a>\n</td>\n<td align=\"right\"><img src=\"http://www.vienna.at/bilder/pfeil.gif\"></td>\n</tr>\n</table>\n</td>\n</tr>\n</table>");
tab2=new menuTable("<table cellpadding=\"2\" cellspacing=\"0\" border=\"0\" width=\"150\" height=\"25\">\n<tr>\n<td bgcolor=\"#ededed\"><a href=\"","\" target=\"_top\"><span class=\"linkliste\">","</span></a></td>\n</tr>\n</table>");
tab3=new menuTable("<table cellpadding=\"2\" cellspacing=\"0\" border=\"0\" width=\"115\" height=\"25\">\n<tr>\n<td bgcolor=\"#ededed\"><a href=\"","\" target=\"_top\"><span class=\"linkliste\">","</span></a></td>\n</tr>\n</table>");
