// JavaScript Document
function kontaktlink(text,user,domain,subject)	{
document.write('<a href="mailto:'+user+'@'+domain+'?Subject='+subject+'">'+text+'</a>');
}

// Login
function login() {
  var Passwort = "newyorkde";
  var Eingabe = window.prompt("Bitte geben Sie das Passwort ein", "");
  if (Eingabe != Passwort) {
    alert("Falsches Passwort!");
  } else {
    location.href = "expedienten.html";
  }
}

//Bildernavigation onmouseover und onmouseout
function umschaltenOn(navNummer) {
		document.getElementById("nav_jazz" + navNummer).src = "img/navi/nav_jazz" + navNummer +"_hover.jpg" ;
}
function umschaltenOff(navNummer) {
		 document.getElementById("nav_jazz" + navNummer).src = "img/navi/nav_jazz" + navNummer + ".jpg";
}

function kunstOn(navNummer) {
		document.getElementById("nav_kunst" + navNummer).src = "img/navi/nav_kunst" + navNummer +"_hover.jpg" ;
}
function kunstOff(navNummer) {
		 document.getElementById("nav_kunst" + navNummer).src = "img/navi/nav_kunst" + navNummer + ".jpg";
}

//Bildernavigation onclick
function neueSeite(navNummer) {
			if (navNummer == "1") {
			window.location.href = "jazzdinner-newyork.html";
			}
			if (navNummer == "2") {
			window.location.href = "jazzreise-chicago.html";
			}
			if (navNummer == "3") {
			window.location.href = "harlemjazztour-newyork.html";
			}
			if (navNummer == "4") {
			window.location.href = "kunstreise-newyork.html";
			}
			if (navNummer == "5") {
			window.location.href = "kunstreise-chicago.html";
			}
			if (navNummer == "6") {
			window.location.href = "silvester-newyork.html";
			}
			if (navNummer == "7") {
			window.location.href = "fototour-newyork.html";
			}
}

/*
//Email
function postage(one,two,three) { 
   window.location = 'mailto:'+one+two+three;
}
*/

 /* KONTAKTFORMULAR */
function sendFormular(docForm,email,weite,hoehe)
{
  if (docForm.Email.value.indexOf("@") == -1) {
    alert("Bitte geben Sie eine gültige E-Mail-Adresse an!");
    docForm.Email.focus();
    return false;
  	}
// if (navigator.appName != "Microsoft Internet Explorer") return true;
  var t = new Array();
  t[0] = "Formular: " + docForm.FormName.value;
  t[1] = "- [Name]: " + docForm.Name.value;
  t[2] = "- [Meinung]: " + docForm.Meinung.value;
  t[3] = "- [Ich bin mit einer Veroeffentlichung]: ";
  if (docForm.einverstanden[0].checked == true)
    t[3] += "einverstanden";
  else if (docForm.einverstanden[1].checked == true)
    t[3] += "nicht einverstanden";
  t[4] = "- [veroeffentlicht werden darf]:";
  if (docForm.veroeffentlichen[0].checked == true)
    t[4] += " Mein Name,";
  if (docForm.veroeffentlichen[1].checked == true)
    t[4] += " Meine eMail-Adresse";
  var x = (screen.width - weite - 10) / 2;
  var y = (screen.height - hoehe - 32) / 2;
  var fenster = "width=" + weite + ",height=" + hoehe;
  fenster += ",left=" + x + ",top=" + y + ",scrollbars=yes";
  var Formular = window.open("","PopUp",fenster); Formular.focus();
  Formular.document.open();
  Formular.document.write("<html><head><title>Formular<\/title><\/head>");
  Formular.document.write("<body style=\"font:91% Verdana,sans-serif;\"");
// Formular.document.write(" onload=\"document.links[0].click();\"");
  Formular.document.writeln("><p>");
  var m = "";
  for (var i = 0; i <= 4; i++) /* Formularfelder 0 - 4 */
  {
    var z = ""; var cr = 0;
    for (var y = 0; y < Number(t[i].length); y++)
    {
      switch(t[i].charCodeAt(y))
      {
        case 13: z += "¦"; cr = 1; break;
        case 10: if (!cr) z += "¦"; break;
        case 32: z += "&#32;"; break;
        case 34: z += "&#34;"; break;
        case 38: z += "+"; break;
        case 60: z += "&#60;"; break;
        case 61: z += "&#61;"; break;
        case 62: z += "&#62;"; break;
        case 64: z += "&#64;"; break;
        case 196: z += "&#196;"; break;
        case 214: z += "&#214;"; break;
        case 220: z += "&#220;"; break;
        case 223: z += "&#223;"; break;
        case 228: z += "&#228;"; break;
        case 246: z += "&#246;"; break;
        case 252: z += "&#252;"; break;
        case 8364: z += "EUR"; break;
        default:
        if (t[i].charCodeAt(y) > 32 && t[i].charCodeAt(y) < 127)
          z += t[i].charAt(y);
        else z += "&#191;";
      }
    }
    t[i] = z; z = ""; var e = "";
    for (y = 0; y < Number(t[i].length); y++)
    {
      if (t[i].charAt(y) == "¦") {
        z += "<br>"; e += "%0D%0A";
      }
      else {
        z += t[i].charAt(y);
        if (t[i].charAt(y) == "?") e += "%3F";
        else {
          e += t[i].charAt(y);
          if (t[i].charAt(y) == "%") e += "25";
        }
      }
    }
    Formular.document.writeln(z + "<br>"); t[i] = e;
    if (i > 0) m += t[i] + "%0D%0A";
    if (i < 3)
    {
      Formular.document.writeln("<br>"); m += "%0D%0A";
    }
  }
  Formular.document.writeln("<\/p>");
  if (m.length > 1750)
  {
    Formular.document.write("<hr><p><b><i>Sie haben sehr viel Text ");
    Formular.document.write("eingegeben,<br>so dass eine automatische ");
    Formular.document.write("Uebernahme leider nicht moeglich ist.<br>");
    Formular.document.write("Bitte kopieren Sie Ihren obenstehenden Text ");
    Formular.document.write("(Strg-C) und<br>uebertragen ihn anschliessend ");
    Formular.document.writeln("in Ihr eMail-Programm (Strg-V).<\/b><\/i><\/p>");
    m = "- hier bitte Ihren Text einfuegen -";
  }
  Formular.document.write("<p><a href=\"mailto:" + email);
  Formular.document.write("?subject=" + t[0] + "&amp;body=" + m + "\"");
  Formular.document.write(" onclick=\"window.setTimeout('self.close()',100)\"");
  Formular.document.writeln(">eMail versenden<\/a><\/p><\/body><\/html>");
  Formular.document.close();
  return false;
}

/*FORMULARFELD FOKUSSIEREN */
function setzefokus(elementid) {
	var element;
	if (element = document.getElementById(elementid)) {
	element.focus();
	}
}

/*LINKMENUE */
function linkNavi(navid) {
	var link = document.getElementById(navid);
	if (navid == 'impressum') {
	link.style.textDecoration = 'none';
	
	var agb = document.getElementById('agb');
	agb.style.textDecoration = "underline";
	
	var textfeldImpressum = document.getElementById('feld_impressum');
	textfeldImpressum.style.backgroundColor = "#F9E1B5";	
	
	var textfeldImpressum = document.getElementById('feld_agb');
	textfeldImpressum.style.backgroundColor = "transparent";
	}
	if (navid == 'agb') {
	link.style.textDecoration = "none";
	
	var impressum = document.getElementById('impressum');
	impressum.style.textDecoration = "underline";
	
	var textfeldImpressum = document.getElementById('feld_agb');
	textfeldImpressum.style.backgroundColor = "#F9E1B5";
	
	var textfeldImpressum = document.getElementById('feld_impressum');
	textfeldImpressum.style.backgroundColor = "transparent";
	}
	if (navid == 'kontakt') {
	link.style.textDecoration = "none";
	
	var news = document.getElementById('news');
	news.style.textDecoration = "underline";
	
	var incentives = document.getElementById('incentives');
	incentives.style.textDecoration = "underline";
	
	var info = document.getElementById('info');
	info.style.textDecoration = "underline";
	
	var textfeldKontakt = document.getElementById('feld_kontakt');
	textfeldKontakt.style.backgroundColor = "#F9E1B5";
	
	var textfeldNews = document.getElementById('feld_news');
	textfeldNews.style.backgroundColor = "transparent";
	
	var textfeldIncentives = document.getElementById('feld_incentives');
	textfeldIncentives.style.backgroundColor = "transparent";
	
	var textfeldInfo = document.getElementById('feld_info');
	textfeldInfo.style.backgroundColor = "transparent";
	
	setzefokus('Name');
	}
	if (navid == 'news') {
	link.style.textDecoration = "none";
	
	var news = document.getElementById('kontakt');
	news.style.textDecoration = "underline";
	
	var incentives = document.getElementById('incentives');
	incentives.style.textDecoration = "underline";
	
	var info = document.getElementById('info');
	info.style.textDecoration = "underline";
	
	var textfeldKontakt = document.getElementById('feld_news');
	textfeldKontakt.style.backgroundColor = "#F9E1B5";
	
	var textfeldNews = document.getElementById('feld_kontakt');
	textfeldNews.style.backgroundColor = "transparent";
	
	var textfeldIncentives = document.getElementById('feld_incentives');
	textfeldIncentives.style.backgroundColor = "transparent";
	
	var textfeldInfo = document.getElementById('feld_info');
	textfeldInfo.style.backgroundColor = "transparent";
	
	setzefokus('Name');
	}
	if (navid == 'incentives') {
	link.style.textDecoration = "none";
	
	var news = document.getElementById('news');
	news.style.textDecoration = "underline";
	
	var incentives = document.getElementById('kontakt');
	incentives.style.textDecoration = "underline";
	
	var info = document.getElementById('info');
	info.style.textDecoration = "underline";
	
	var textfeldKontakt = document.getElementById('feld_incentives');
	textfeldKontakt.style.backgroundColor = "#F9E1B5";
	
	var textfeldNews = document.getElementById('feld_news');
	textfeldNews.style.backgroundColor = "transparent";
	
	var textfeldIncentives = document.getElementById('feld_kontakt');
	textfeldIncentives.style.backgroundColor = "transparent";
	
	var textfeldInfo = document.getElementById('feld_info');
	textfeldInfo.style.backgroundColor = "transparent";
	
	setzefokus('Name');
	}
	if (navid == 'info') {
	link.style.textDecoration = "none";
	
	var news = document.getElementById('news');
	news.style.textDecoration = "underline";
	
	var incentives = document.getElementById('incentives');
	incentives.style.textDecoration = "underline";
	
	var info = document.getElementById('kontakt');
	info.style.textDecoration = "underline";
	
	var textfeldKontakt = document.getElementById('feld_info');
	textfeldKontakt.style.backgroundColor = "#F9E1B5";
	
	var textfeldNews = document.getElementById('feld_news');
	textfeldNews.style.backgroundColor = "transparent";
	
	var textfeldIncentives = document.getElementById('feld_incentives');
	textfeldIncentives.style.backgroundColor = "transparent";
	
	var textfeldInfo = document.getElementById('feld_kontakt');
	textfeldInfo.style.backgroundColor = "transparent";
	
	setzefokus('Name');
	}
}

/* STARTTEXT FADE IN */
$(document).ready(function(){
   // jQuery-Beispiele hier einfügen
$("div").filter("#startbild_1").mouseenter(function () {
	$("div").filter(".bild_1").fadeIn(1000); 
     }); 

$("div").filter("#startbild_1").mouseleave(function () {
	$("div").filter(".bild_1").slideUp(500, function() {
    // Animation complete.
 		 });
     });
     
$("div").filter("#startbild_2").mouseenter(function () {
	$("div").filter(".bild_2").fadeIn(1000); 
     }); 

$("div").filter("#startbild_2").mouseleave(function () {
	$("div").filter(".bild_2").slideUp(500, function() {
    // Animation complete.
 		 });
     });
    
$("div").filter("#startbild_3").mouseenter(function () {
	$("div").filter(".bild_3").fadeIn(1000); 
     }); 

$("div").filter("#startbild_3").mouseleave(function () {
	$("div").filter(".bild_3").slideUp(500, function() {
    // Animation complete.
 		 });
     });
     
$("div").filter("#startbild_4").mouseenter(function () {
	$("div").filter(".bild_4").fadeIn(1000); 
     }); 

$("div").filter("#startbild_4").mouseleave(function () {
	$("div").filter(".bild_4").slideUp(500, function() {
    // Animation complete.
 		 });
     });
     
$("div").filter("#startbild_5").mouseenter(function () {
	$("div").filter(".bild_5").fadeIn(1000); 
     }); 

$("div").filter("#startbild_5").mouseleave(function () {
	$("div").filter(".bild_5").slideUp(500, function() {
    // Animation complete.
 		 });
     });
     
$("div").filter("#startbild_6").mouseenter(function () {
	$("div").filter(".bild_6").fadeIn(1000); 
     }); 

$("div").filter("#startbild_6").mouseleave(function () {
	$("div").filter(".bild_6").slideUp(500, function() {
    // Animation complete.
 		 });
     });    
 });


/* IPHONE HOVER */
var myLinks = document.getElementsByTagName('a');
for(var i = 0; i < myLinks.length; i++){
	myLinks[i].addEventListener('touchstart', function(){this.className = "hover";}, false);
	myLinks[i].addEventListener('touchend', function(){this.className = "";}, false);
}



