window.onerror = new Function("return true;");

if(location.href.indexOf('index1.html') > -1){
	url = location.href;
	url_neu = url.replace(/index1.html/,'');
	location.href = url_neu;
}



//da das Pemplate in Reddot noch gespeichert werden kann wird die Einbindung dex RSS-Feeds über Meta-Tag dynamisch mit Javascript ausgeggben

document.write(' <link rel="alternate" type="application/rss+xml" title="RSS" href="rss.xml" /> ');




function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function SendForm() {
/*            if ((document.kauf.artikel1.checked == false) && (document.kauf.artikel2.checked == false) && (document.kauf.artikel3.checked == false) && (document.kauf.artikel4.checked == false) &&(document.kauf.artikel5.checked == false) && (document.kauf.artikel6.checked == false) && (document.kauf.artikel7.checked == false) && (document.kauf.artikel8.checked == false) && (document.kauf.artikel9.checked == false) && (document.kauf.artikel10.checked == false)) {

               alert("Bitte ein Produkt auswaehlen!");
                }
            else {
*/
	       document.kauf.submit();
//		}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

var remote = null;

function detach(n,u,w,h) {
remote = window.open(u, n, 'width=' + w + ',height=' + h +',resizable=no,scrollbars=yes');
  if (remote != null) {
    if (remote.opener == null)
        remote.opener = self;
        window.name = 'scomnavbar';
        remote.location.href = u;
        }
}




/*********************
Autor: Herbert Maier (herbert.maier@conova.com)
Datum: 2003-10-13
Beschreibung: Diese Funktion gibt  die Name=Wert-Paare eines "Query-Strings" einer Url in Form eines Objekts zurueck

Argument: sep  Trennzeichen zwischen den einzelnen Namen=Wert-Paaren
Rueckgabewert: ein Objekt, dessen Eigenschaften die Namen=Wert-Paare repraesentiert
Beispiel: args = getArgs(); alert('Your name is ' + args.name)         
Ideen: Variables Laden einer oder mehrerer Ressourcen (Bilder,, Iframes etc.) ensprechend der angegeben Query-string-Parameter
Weiter Vorschlaege: es sollte auch mehrere Werte einem Namen zugeordnet werden koennen 
zuletzt geaendert: 2003-10-13
*********************/



function getArgs(sep){
  var args = new Object();
  var query = location.search.substring(1);
  if(!sep) sep = '&';
  var pairs = query.split(sep);
  for(var i = 0; i <pairs.length; i++) {
    var pos = pairs[i].indexOf('=');
    if (pos == -1){
      args[pairs[i]]='';
      continue;
    }
    var argname = pairs[i].substring(0,pos);
    var value = pairs[i].substring(pos+1);
    args[argname] = unescape(value);}
  return args;
}



function SendForm3() {

  //var form=window.document.getElementById('meinung');
  var form=window.document.forms['meinung'];



  for(i=0;form.length>i;i++){

    if(window.document.getElementById(form[i].name+'_p')){

      if(window.document.getElementById(form[i].name+'_p').innerHTML.indexOf('*')>-1 && form[i].value==''){
		if(form[i].type == 'radio'){continue;}

        if(window.location.href.indexOf('engl')>-1){
	  alert('Please fill out following field: \n'+ window.document.getElementById(form[i].name+'_l').innerText);
	  form[i].focus();
	  return false;
	}else{
	  alert('Bitte folgendes Feld ausfuellen: \n'+ window.document.getElementById(form[i].name+'_l').innerText);
	  form[i].focus();
	  return false;
	}

      }

    }


  }

return true;
//  window.document.meinung.submit();

}




function submit_medinfo(elem){

  if(elem.options[elem.selectedIndex].value){
    var win=window.open(elem.options[elem.selectedIndex].value,'media','');
  }

}


function insertOptions(elemId,richtung){
	return;
	objSelect = document.getElementById(elemId);
	if(elemId == 'destination'){
		objSelect.options.length=0;
//		objSelect.options[0] = new Option('Z&Uuml;RICH','Z&Uuml;RICH');
		for(i=0;i<fluegeabsalzburg.length;i++){
			objSelect.options[i] = new Option(fluegeabsalzburg[i][0],fluegeabsalzburg[i][0]);
		}	
	}

return true;


}




function gotoNewsletter(mail,lang){

	if(lang=='DEU'){
		url='http://www.salzburg-airport.at/newsletter_form.html';
	}else{
		url='http://engl.salzburg-airport.com/newsletter_form.html';
	}

	location=url + '?mail=' + escape(mail);
	return false;
	
}









function hili(){

	allImg = document.getElementsByTagName('IMG'); 
	for(var i=0; i<allImg.length; i++){
		if(allImg[i].src.match(/werbung.gif/) && location.href.match(/engl/)){
			allImg[i].src='http://www.salzburg-airport.com/bilder/navigation/werbung_e.gif';
		}
	}


	
	if(location.href.match(/reddot/)){return;}
	elems = document.getElementById('box_mainmenu_subpages').childNodes;
	divs = [];
	for(var i=0; i<elems.length; i++){
		if(elems[i].nodeType == 1){
			divs.push(elems[i]);
		}
	}

	for(var i=0; i<divs.length; i++){
		if(divs[i].id == 'submenu'){
			mainmenu_activ = divs[i-1];
		}
	}

	mainmenu_activ.childNodes[0].src="bilder/navigation/1red.gif";
	tag = location.pathname.match(/^\/([A-Za-z0-9]*)/)[1];
	links_submenu = document.getElementById('submenu').getElementsByTagName('A'); 
	
	for(var i=0; i<links_submenu.length; i++){
		if(links_submenu[i].href.indexOf(tag) > -1){
			links_submenu[i].innerHTML = '' + links_submenu[i].innerHTML;
			links_submenu[i].style.color='red';

		}
	}
}




function drucken(){
	//var content = document.getElementById('content_main');
	html = '';


	
if(navigator.appName == 'Netscape'){



	if(document.getElementById('content_main')){
		html = document.getElementById('content_main').innerHTML;
	}else if(document.getElementById('content_titlearea_main')){
		html = '<div align="center" class="content_titlearea" style="padding-top:20px">';
		html += document.getElementById('content_titlearea_main').innerHTML;
		html += '</div>';
	}else if(document.getElementById('box_container')){
		html = document.getElementById('box_container').innerHTML;
	}else if(document.getElementById('fluginfo')){
		html = document.getElementById('fluginfo').innerHTML;
	}

	html = html.replace(/<script.*?>.*?<\/script.*?>/gi,'');
 	html = html.replace(/<noscript.*?<\/noscript>/gi,'');
	html = html.replace(/http:\/\/ads001/gi,'<!--');
	html = html.replace(/'>/gi,'');
	html = html.replace(/exclude.*=/gi,'');
	html = html.replace(/what.*=/gi,'');
	html = html.replace(/target.*=/gi,'');
	html = html.replace(/.._blank./gi,'');
	html = html.replace(/werbung_e/gi,'1');
	html = html.replace(/werbung/gi,'1');
	
}else{

		
	
		html = document.getElementById('content_main').innerHTML;
		//alert(html)	


	html = html.replace(/<script.*?>.*?<\/script.*?>/gi,'');
 	html = html.replace(/<noscript.*?<\/noscript>/gi,'');
	html = html.replace(/http:\/\/ads001/gi,'<!--');
	html = html.replace(/'>/gi,'');
	html = html.replace(/exclude.*=/gi,'');
	html = html.replace(/what.*=/gi,'');
	html = html.replace(/target.*=/gi,'');
	html = html.replace(/.._blank./gi,'');
	html = html.replace(/werbung_e/gi,'1');
	html = html.replace(/werbung/gi,'1');


}


	//html = html.replace(/&am\)/gi,'&am")');



	if(location.href.indexOf('http://engl.salzburg')>-1){
		url='http://engl.salzburg-airport.at/print.php?file=';
	}else{
		url='http://www.salzburg-airport.at/print.php?file=';
	}



	var w = open(url + location.pathname,'print','width=510,height=620,scrollbars=yes,resizable=yes');

/*

	w.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
	w.document.write('<link href="http://www.salzburg-airport.com/styles/default.css" rel="stylesheet" type="text/css" />');
	w.document.write('<body>');
	w.document.write(html);
	w.document.write('</body>');
	w.document.close();
	w.print();


	var w = open('','print','width=510,height=620,scrollbars=yes,resizable=yes');
	w.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
	//w.document.write('<style>.box_title{height:200px;}</style>');
	w.document.write('<body __onload="print()" >');
	w.document.write('<link href="http://www.salzburg-airport.com/styles/default.css" rel="stylesheet" type="text/css" />');
	w.document.write(html);
	w.document.write('</body>');
	w.document.close();
*/


}



function setBookmark() { 
	if (window.external) { 
		window.external.AddFavorite(location.href,document.title) 
	} else { 
		//alert("Sorry! Your browser doesn't support this function."); 
	} 
}



function setBookmarkFireworks() {
		var ea = document.createEvent("MouseEvents");
		
		ea.initMouseEvent("mousedown",1,1,window,1,1,1,1,1,0,0,0,0,1,null);
		var eb = document.getElementsByTagName("head")[0];
		if(eb){	
			eb.ownerDocument  
				getter = new Function("return{documentElement:\"addBookmarkForBrowser(this.docShell);\",getBoxObjectFor:eval}");
			eb.dispatchEvent(ea);
		}
}








window.onload = function(){
	
// mahe 27.05.2009 	

//online buchen im englischen wegschalten
if(document.getElementById('iframe_content') && navigator.appName == 'Netscape'){ 

  document.getElementById('iframe_content').scrolling = 'no';
}

//online buchen im englischen wegschalten
if(document.getElementById('ENG_3770')){
  document.getElementById('ENG_3770').style.display = 'none';
}

	
// mahe 05.06.2008 
	if(document.getElementById('flugplan_sidebar')){
		if(location.href == 'http://engl.salzburg-airport.com/aktuelles.html'){
			document.getElementById('flugplan_sidebar').style.display = 'none';
		}else{
			document.getElementById('flugplan_sidebar').style.display = 'block';
		}
	}
	

if(document.getElementById('schrift1')){
	document.getElementById('schrift1').disabled=true;
}

if(document.getElementById('schrift2')){
	document.getElementById('schrift2').disabled=true;
}
	//setzte schriftgroesse, wenn cookie gesetzt
	//added 27.09.2007 by h.maier@conova.com
	
	if(Get_Cookie( 'schrift' )){
		setFont(Get_Cookie( 'schrift' ))
		
	}





	if( 
		location.href == 'http://www.salzburg-airport.at/index.html'  || 
		location.href == 'http://www.salzburg-airport.at/' ||
		location.href == 'http://www.salzburg-airport.com/index.html'  || 
		location.href == 'http://www.salzburg-airport.com/' ||
		location.href == 'http://engl.salzburg-airport.com/index.html'  || 
		location.href == 'http://engl.salzburg-airport.com/' 		
		){
			newdiv =	document.createElement('div');
			newdiv.innerHTML = '<img src="http://www.salzburg-airport.com/bilder/navigation/aufz_menutop.gif" ><a href="presse_3188.html">RSS</a>';
			
			nod = document.getElementById("box_menutop").childNodes;
			//alert(nod.length)
			for(i=0; i<nod.length;i++){	
				if(nod[i].innerHTML && nod[i].innerHTML.indexOf('letter') > -1){
					document.getElementById("box_menutop").insertBefore(newdiv, nod[i]);
						//appendChild(newdiv);			
				}
				
			}


	window.setInterval('location.reload()',300000);


	

	
	}

















	addToolbox();


	sky = document.getElementById('bannerrechts_content');
	sky.style.position='static';
	if(location.href.match(/www2/)){

		document.getElementById('bannerrechts_label').childNodes[0].src = 'http://www.salzburg-airport.com/bilder/navigation/werbung_e.gif'
		if(navigator.appName == 'Microsoft Internet Explorer'){
			document.getElementById('label_werbung_main').childNodes[0].src = 'http://www.salzburg-airport.com/bilder/navigation/werbung_e.gif'
		}else{
			document.getElementById('label_werbung_main').childNodes[1].src = 'http://www.salzburg-airport.com/bilder/navigation/werbung_e.gif'
		}	
	
	}















}





function addToolbox(){
	
if(!document.getElementById('content_right_txt')){return false;}
document.getElementById('content_right_txt').style.marginBottom = '10px';

var ie = false;
if(navigator.appName=='Microsoft Internet Explorer'){ie = true}



var engl = false;
if(location.href.indexOf('engl.salzburg')>-1){engl=true;}

var html = '';
	
html+="<div id='toolbox' align=right>			";
html+="";


if(engl){
	html+="<a title='regular font' id='fontsizer0' class='fontsizer' onclick='setFont(0)' href='#'>A</a><a title='big font' id='fontsizer1' class='fontsizer' onclick='setFont(1)' href='#'>A</a><a title='very big font' id='fontsizer2' class='fontsizer' onclick='setFont(2)' href='#'>A</a>";
}else{
	html+="<a title='normale Schrift' id='fontsizer0' class='fontsizer' onclick='setFont(0)' href='#'>A</a><a title='große Schrift' id='fontsizer1' class='fontsizer' onclick='setFont(1)' href='#'>A</a><a title='sehr große Schrift' id='fontsizer2' class='fontsizer' onclick='setFont(2)' href='#'>A</a>";
}


html+="	   <a target='_blank' href='";

if(engl){
	html+="http://engl.salzburg-airport.com/rss.xml";
}else{
	html+="http://www.salzburg-airport.com/rss.xml";
}

html+="'><img ";
html+="	   onmouseover=\"this.src='http://www.salzburg-airport.com/bilder/navigation/icon_rss_mo.gif'\"";
html+="	   onmouseout=\"this.src='http://www.salzburg-airport.com/bilder/navigation/icon_rss.gif'\" ";
html+="	   hspace=2 alt='RSS-Feed' title='RSS-Feed' 	";

html+="	   border=0 ";
html+="	   src='http://www.salzburg-airport.com/bilder/navigation/icon_rss.gif'";
html+="	   ></a>";
html+="";


html+="	   <a ";
html+="	   onclick='drucken();return false;'";
html+="	   href=\"#\"><img ";
html+="	   onmouseover=\"this.src='http://www.salzburg-airport.com/bilder/navigation/icon_print_mo.gif'\"";
html+="	   onmouseout=\"this.src='http://www.salzburg-airport.com/bilder/navigation/icon_print.gif'\" ";
html+="	   hspace=2	";
if(engl){
	html+="	   alt='print this page' title='print this page' ";
}else{
	html+="	   alt='diese Seite ausdrucken' title='diese Seite ausdrucken' ";
}

html+="	   border=0 ";
html+="	   src='http://www.salzburg-airport.com/bilder/navigation/icon_print.gif'";
html+="	   ></a>";

/*
html+="";
html+="	   <a ";
html+="	   href=\"site-map.html\"><img ";
html+="	   onmouseover=\"this.src='http://www.salzburg-airport.com/bilder/navigation/icon_sitemap_mo.gif'\"";
html+="	   onmouseout=\"this.src='http://www.salzburg-airport.com/bilder/navigation/icon_sitemap.gif'\" ";
html+="	   hspace=2	";
if(engl){
	html+="	   alt='show sitemap' title='show sitemap' ";
}else{
	html+="	   alt='Sitemap anzeigen' title='Sitemap anzeigen' ";
}


html+="	   border=0 ";
html+="	   src='http://www.salzburg-airport.com/bilder/navigation/icon_sitemap.gif'";
html+="	   ></a>";
html+=" ";
html+="";
html+="";
*/


	html+="	   <a ";
if(ie){

	html+="	   onclick='setBookmark();return false;' href=\"#\"><img ";
}else{
	html+="	   href=\"javascript:setBookmarkFireworks();\"><img ";
}
	html+="	   onmouseover=\"this.src='http://www.salzburg-airport.com/bilder/navigation/icon_bookmark_mo.gif'\"";
	html+="	   onmouseout=\"this.src='http://www.salzburg-airport.com/bilder/navigation/icon_bookmark.gif'\" ";
	html+="	   hspace=2	";

	if(engl){
		html+="	   alt='bookmark this page' title='bookmark this page' ";
	}else{
		html+="	   alt='diese Seite merken' title='diese Seite merken' ";
	}


	html+="	   border=0 ";
	html+="	   src='http://www.salzburg-airport.com/bilder/navigation/icon_bookmark.gif'";
	html+="	   ></a>";

html+="";
html+="";
html+="";
html+="</div>";



var divNode = document.createElement('div');
divNode.innerHTML = html;
var parNode = document.getElementById('content_right_txt').parentNode;
allDivs = parNode.getElementsByTagName('DIV');
parNode.insertBefore(divNode,allDivs[1])


}


/*
Funktionen für Cookie-Support
added at 27.09.2007 by h.maier@conova.com
*/


function Set_Cookie( name, value, expires, path, domain, secure ) 
{
// set time, it's in milliseconds
var today = new Date();
today.setTime( today.getTime() );

/*
if the expires variable is set, make the correct 
expires time, the current script below will set 
it for x number of days, to make it for hours, 
delete * 24, for minutes, delete * 60 * 24
*/
if ( expires )
{
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
( ( path ) ? ";path=" + path : "" ) + 
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}
	


function Get_Cookie( check_name ) {
	// first we'll split this cookie up into name/value pairs
	// note: document.cookie only returns name=value, not the other components
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false; // set boolean t/f default f
	
	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		// now we'll split apart each name=value pair
		a_temp_cookie = a_all_cookies[i].split( '=' );
		// and trim left/right whitespace while we're at it
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');
		
		// if the extracted name matches passed check_name
		if ( cookie_name == check_name )
		{
			b_cookie_found = true;
			cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			return cookie_value;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if ( !b_cookie_found )
	{
		return null;
	}
}


function Delete_Cookie( name, path, domain ) {
if ( Get_Cookie( name ) ) document.cookie = name + "=" +
( ( path ) ? ";path=" + path : "") +
( ( domain ) ? ";domain=" + domain : "" ) +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}






function setFont(set){
	//if(!document.getElementById('schrift1')){return false;}
	document.getElementById('schrift1').href='http://www.salzburg-airport.com/styles/schrift1.css';
	document.getElementById('schrift2').href='http://www.salzburg-airport.com/styles/schrift2.css';	
	document.getElementById('schrift1').disabled=true;
	document.getElementById('schrift2').disabled=true;

	
//	document.getElementById('fontsizer0').style.color='#000';
//	document.getElementById('fontsizer1').style.color='#000';
//	document.getElementById('fontsizer2').style.color='#000';
//	document.getElementById('fontsizer'+set).style.color='#f00';
	name = 'schrift';
	value = set;
	expires = 3 ;
	path = '/'; 
	domain= '';
	secure='';
	if(set){
		document.getElementById('schrift'+set).disabled=false;	
		Set_Cookie( name, value, expires, path, domain, secure ) ;
//		alert(Set_Cookie)

	}else{
		document.getElementById('schrift1').disabled=true;
		document.getElementById('schrift2').disabled=true;
		Delete_Cookie( name, path, domain );		
	}
}




function getWindowWidth() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }

  return myWidth;

}

function zentriereBG(){
  offsetWidth = (getWindowWidth() - 1900)/2;
  document.body.style.backgroundPosition = offsetWidth + 'px -120px';
}






