var topPosition = 0;
var mailIsTrue = false;
var blzIsTrue = false;

var kontoinhaber = "";
var kontonummer = "";
var blz = "";
var bank = "";

var xmlHttp = false;
	try {
	   xmlHttp  = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e) {
	   try {
		  xmlHttp  = new ActiveXObject("Microsoft.XMLHTTP");
	   }
	   catch(e) {
		  xmlHttp  = false;
	   }
}
if (!xmlHttp  && typeof XMLHttpRequest != 'undefined') {
   xmlHttp = new XMLHttpRequest();
}

function postEntry() {
   if (xmlHttp) {
	  xmlHttp.open('POST', 'postEntry.php');
	  xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	  xmlHttp.send('subject='+document.form.subject.value+'number='+document.form.number.value);
   }
   showOverlay("contactSend");
}

function checkEntries() {
	if (document.form.subject.value == '') {
		alert("Bitte geben Sie einen Betreff an!");
	}
	else if (document.form.number.value == '') {
		alert("Bitte geben Sie eine Telefonnummer an!");
	}
	else {
		postEntry();
	}
}



function kontaktcheck(){

	if(document.getElementById('phoneleft').value == ""){
		document.getElementById('phoneleft').style.border = "1px solid #c62e63";
		document.getElementById('phoneleft').focus();
	}else{
		document.getElementById('phoneleft').style.border = "1px solid white";
	}

	if(document.getElementById('nameleft').value == ""){
		document.getElementById('nameleft').style.border = "1px solid #c62e63";
		document.getElementById('nameleft').focus();
	}else{
	document.getElementById('nameleft').style.border = "1px solid white";
	}

}

function kontaktcheck2(){

	if(document.getElementById('message').value == ""){
		document.getElementById('message').style.border = "1px solid #c62e63";
		document.getElementById('message').focus();
	}else{
	document.getElementById('message').style.border = "1px solid white";
	}

	if(document.getElementById('email').value == ""){
		document.getElementById('email').style.border = "1px solid #c62e63";
		document.getElementById('email').focus();
	}else{
	document.getElementById('email').style.border = "1px solid white";
	}

	if(document.getElementById('phone').value == ""){
		document.getElementById('phone').style.border = "1px solid #c62e63";
		document.getElementById('phone').focus();
	}else{
		document.getElementById('phone').style.border = "1px solid white";
	}

	if(document.getElementById('firstname').value == ""){
		document.getElementById('firstname').style.border = "1px solid #c62e63";
		document.getElementById('firstname').focus();
	}else{
	document.getElementById('firstname').style.border = "1px solid white";
	}
	
	if(document.getElementById('name').value == ""){
		document.getElementById('name').style.border = "1px solid #c62e63";
		document.getElementById('name').focus();
	}else{
	document.getElementById('name').style.border = "1px solid white";
	}

}




function showOverlay(content) {

	/*document.getElementById('overlayText').innerHTML="<a href='javascript:hideOverlay();'><img style='border: 0px; margin-top: 0px; margin-right: 0px;' align='right' src='./images/close_button.png' /></a>";
	*/
	if (content == 'action') {
		document.getElementById('overlayText').innerHTML+="<div style='margin-top: -100px; margin-left: -22px;'><iframe src=\"http://www.szeneshooting.de/aktion/\" style=\"border:0px;\" name=\"fotos\" scrolling=\"no\" frameborder=\"0\" marginheight=\"0px\" marginwidth=\"0px\" height=\"550\" width=\"900\"></iframe></div>";
	}
	
	if (content == 'impressum') {
		document.getElementById('overlayText').innerHTML+="<div class='overlayInnerText'><div class=\"close\" onclick=\"hideOverlay();\" onmouseover=\"this.style.cursor='pointer'\" omouseout=\"\"></div><div class=\"textarea\" style=\"margin-top: 30px;\"><br /><br /><br /><img src=\"./design_imgs/headline_impressum.png\" style=\"border: 0px;margin-top:15px;\"><br /><br /><br />Szeneshooting.de ist ein Angebot der<br />DIE KAPIT&Auml;NE media GmbH<br />Prager Str. 10<br />01069 Dresden<br />Deutschland<br /><br />E-Mail: <a href='mailto:Fotograf@szeneshooting.de'>Fotograf@szeneshooting.de</a><br /><br />USt.IdNr: DE262584435<br />Amstgericht Dresden<br />Gesch&auml;ftsf&uuml;hrer: Bj&ouml;rn Bak<br /><br /></div></div>";
		document.getElementById('overlayText').innerHTML+="<div class='overlayInnerTextRight'>Alle Urheber-, Nutzungs- und sonstigen Schutzrechte am Inhalt dieser Webseite verbleiben bei KAPIT&Auml;NE MEDIA GmbH..<br /><br /><strong>Links und Inhalte von Dritten:</strong><br />Soweit durch Verlinkung auf andere Server bzw. andere Webseites zus&auml;tzliche Informationen zug&auml;nglich gemacht werden, wird ausdr&uuml;cklich darauf hingewiesen, dass keine Inhaltskontrolle stattfindet. KAPIT&Auml;NE MEDIA GmbH distanziert sich daher ausdr&uuml;cklich von den dort dargestellten Inhalten und &uuml;bernimmt f&uuml;r diese keine Verantwortung. Soweit bei redaktionellen Artikeln auf den Internetseiten von KAPIT&Auml;NE MEDIA GmbH Dritte als Urheber benannt sind wird darauf hingewiesen, dass diese nicht unbedingt die Meinung von KAPIT&Auml;NE MEDIA GmbH wiedergeben.<br /><br /><strong>Copyright</strong><br />Inhalte und Gestaltung der Internetseiten von KAPIT&Auml;NE MEDIA GmbH sind durch urheberrechtlich gesch&uuml;tzt und verwenden gesch&uuml;tzte Marken und gesch&auml;ftliche Bezeichnungen. Einige Bereiche enhalten au&szlig;erdem Inhalte, welche Urheberrechten und/oder sonstiger Schutzrechte Dritter unterliegen. Reproduktion, Modifikation oder sonstige Verwertung der Inhalte, gleich in welcher Form, ganz oder teilweise, sind ohne vorherige schriftliche Genehmigung des Rechteinhabers untersagt.</div>";
		document.getElementById('overlayText').style.backgroundImage="url('./images_new/overlay_frame.png')";
	}
	
	if (content == 'studio') {
		document.getElementById('overlayText').innerHTML+="<div class='overlayInnerText'><div class=\"close\" onclick=\"hideOverlay();\" onmouseover=\"this.style.cursor='pointer'\" omouseout=\"\"></div><div class=\"textarea\"><br /><br /><br />Mitten auf der beliebtesten Dresdner Einkaufsmeile Prager Stra&szlig;e und direkt gegen&uuml;ber der Zentrum Galerie liegt sehr zentral unser Studio. Kommen Sie doch spontan vorbei und lassen Sie sich unverbindlich von uns beraten!<br /><br />Das aufgeschlossene Team rund um die Fotografin ist bem&uuml;ht Ihnen alle W&uuml;nsche von den Augen abzulesen und nimmt Ihnen Ihre erste Unsicherheit schnell ab. Das schicke Fotostudio beinhaltet verschiedene Kulissen, farbige Hintergr&uuml;nde, einen Stylingbereich und den Arbeitsplatz der Fotografin an dem Sie anschlie&szlig;end die digitalen Bilder ansehen und bearbeiten lassen k&ouml;nnen.<br /></div></div>";
		document.getElementById('overlayText').style.backgroundImage="url('./images_new/overlay_frame.png')";
		document.getElementById('overlayText').innerHTML+="<div style='float: right; margin-right: 52px; margin-top: 52px;'><object width=\"365\" height=\"300\" data=\"./slider_studio.swf\" style=\"margin-top: 7px;\" type=\"application/x-shockwave-flash\"><param name=\"movie\" value=\"./slider_studio.swf\"><param name=\"wmode\" value=\"transparent\" /><param name=\"bgcolor\" value=\"#000000\"></object></div>";
	}
	
	if (content == 'business') {
		document.getElementById('overlayText').innerHTML+="<div class='overlayInnerText'><div class=\"close\" onclick=\"hideOverlay();\" onmouseover=\"this.style.cursor='pointer'\" omouseout=\"\"></div><div class=\"textarea\"><br /><br />Eine werbewirksame und professionelle Pr&auml;sentation Ihrer Waren und Dienstleistungen ist in hohem Ma&szlig;e entscheidend f&uuml;r ein effizientes Marketing und einen erfolgreichen Vertrieb. Wir erstellen f&uuml;r Sie aussagekr&auml;ftige Produktaufnahmen f&uuml;r Ihren Online-Shop oder Visualisieren Ihren Service. Wir unterst&uuml;tzen Sie bei der Erstellung Ihrer Corporate Identity und erschaffen erstklassige Aufnahmen Ihres Unternehmensstandortes und Ihrer Mitarbeiter.<br /><br /> Ob Messeauftritte, Tagungen oder Firmenjubil&auml;en – unser Fotograf begleitet Sie gern und h&auml;lt besondere Firmenereignisse f&uuml;r Sie fest. Ebenso geh&ouml;ren Bilder f&uuml;r Presseportraits und Pressemitteilungen zu unserem Repertoire.<br /><br /></div></div>";
		document.getElementById('overlayText').style.backgroundImage="url('./images_new/overlay_frame.png')";
		document.getElementById('overlayText').innerHTML+="<div style='float: right; margin-right: 52px; margin-top: 52px;'><object width=\"365\" height=\"300\" data=\"./slider_business.swf\" style=\"margin-top: 7px;\" type=\"application/x-shockwave-flash\"><param name=\"movie\" value=\"./slider_business.swf\"><param name=\"wmode\" value=\"transparent\" /><param name=\"bgcolor\" value=\"#000000\"></object></div>";
	}
	
	if (content == 'anfahrt') {
		document.getElementById('overlayText').innerHTML+="<div class='overlayInnerText'><div class=\"close\" onclick=\"hideOverlay();\" onmouseover=\"this.style.cursor='pointer'\" omouseout=\"\"></div><div class=\"textarea\"><img src=\"./design_imgs/headline_find_us.png\" style=\"border: 0px;margin-top:15px;\"><br /><br /><br /><br /><strong>Szeneshooting.de</strong><br />ist ein Angebot der<br />DIE KAPIT&Auml;NE media GmbH<br /><br />Prager Str. 10<br />01069 Dresden<br /><strong>Besuchereingang:</strong> Trompeterstr. 1<br /><br />E-Mail: <a href='mailto:Fotograf@szeneshooting.de'>Fotograf@szeneshooting.de</a><br /><br /><br /><br /></div></div>";
		document.getElementById('overlayText').innerHTML+="<div style='float: right; margin-top: 80px; margin-right: 75px;'><!-- Google Maps Element Code --><iframe frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" border=\"0\" style=\"border:0;margin:0;width:400px;height:260px;\" src=\"http://www.google.com/uds/modules/elements/mapselement/iframe.html?maptype=roadmap&amp;latlng=51.04959612524969%2C13.73514175415039&amp;mlatlng=51.043551%2C13.735086&amp;maddress1=Prager%20Stra%C3%9Fe&amp;maddress2=01069%20Dresden%2C%20Germany&amp;zoom=13&amp;mtitle=Szeneshooting.de\" scrolling=\"no\" allowtransparency=\"true\"></iframe></div>";
		document.getElementById('overlayText').style.backgroundImage="url('./images_new/overlay_frame.png')";
	}
	
	/*if (content == 'contact') {
		document.getElementById('overlayText').innerHTML+="<div class='overlayInnerText'><div class=\"close\" onclick=\"hideOverlay();\" onmouseover=\"this.style.cursor='pointer'\" omouseout=\"\"></div><div class=\"textarea\"><img src=\"./design_imgs/headline_kontakt.png\" style=\"border: 0px;margin-top:15px;\"><br /><br /><br /><strong>Telefon:</strong> 0351 - 37 48 529<br /><strong>E-Mail:</strong> <a href='mailto:Fotograf@szeneshooting.de'>Fotograf@szeneshooting.de</a><br /><br /><strong>Unser kostenfreier R&uuml;ckrufservice</strong><br /><br /><form method='post' name='form' onsubmit='checkEntries(); return false;' action=''><input type='text' name='subject' style='background-color: #fff; border: 1px solid #CF3067; margin-bottom: 5px;' value='Betreff ...' onfocus='this.value=\"\"' /><br /><input type='text' name='number' style='background-color: #fff; border: 1px solid #CF3067; margin-bottom: 5px;' value='Telefonnummer ...' onfocus='this.value=\"\"' /><br /><input type='image' src='./design_imgs/btn_senden_passive.png' value='absenden' onmouseout=\"this.src='./design_imgs/btn_senden_passive.png'\" onmouseover=\"this.src='./design_imgs/btn_senden_active.png'\" style='margin-top: 40px;' /></form><br /><br /></div></div>";	
		document.getElementById('overlayText').innerHTML+="<div style=\"float: right; margin-top: 52px; margin-right: 50px;\"><img src=\"./design_imgs/konktakt_pic.png\" style=\"\" /></div>";
		document.getElementById('overlayText').style.backgroundImage="url('./images_new/overlay_frame.png')";
	}*/
	
	if (content == 'contact') {
		document.getElementById('overlayText').innerHTML+="<div class='overlayInnerText'><div class=\"close\" onclick=\"hideOverlay();\" onmouseover=\"this.style.cursor='pointer'\" omouseout=\"\"></div></div>";	
		document.getElementById('overlayText').style.backgroundImage="url('./images_new/overlay_frame.png')";
		document.getElementById('overlayText').innerHTML+="<div class='background_left' id='background_left' style='background: url(\"./images_new/schrift.png\") no-repeat; width: 468px; height: 274px; float:left; position: relative; top: 80px; left: 72px;'><div style='float:left; width: 220px; height: 270px;'><form name='kontaktform1' action='javascript:showOverlay(\"contact\")' method='post'><input type='text' id='nameleft' name='name_left' style='border:1px solid white; position: relative; top: 167px; left: 65px;'><br /><input type='text' id='phoneleft' name='phone_left' style='border:1px solid white; position: relative; top: 179px; left: 65px;'><br /><input type='button' onclick='kontaktcheck();senden()' name='kontakt_submit_left' value='' class='kontakt_submit' style='position: relative; top: 196px; left: 62px;'></form></div><div style='float:right; width: 240px; height: 270px;'><form name='kontaktform2' action='javascript:showOverlay(\"contact\")' method='post'><input type='text' id='name' name='name_right' style='border:1px solid white; position: relative; top: 37px; left: 80px;'><br /><input type='text' id='firstname' name='firstname_right' style='border:1px solid white; position: relative; top: 49px; left: 80px;'><br /><input type='text' id='phone' name='phone_right' style='border:1px solid white; position: relative; top: 61px; left: 80px;'><br /><input type='text' id='email' name='email_right' style='border:1px solid white; position: relative; top: 73px; left: 80px;'><br /><textarea name='message_right' id='message' cols='23' rows='2' style='border:1px solid white; padding-bottom: 3px; padding-right: 4px; position: relative; top: 85px; left: 17px;'></textarea><br /><input type='button' onclick='kontaktcheck2();senden2()' value='' class='kontakt_submit' style='position: relative; top: 101px; left: 75px;'></form><div id='ausgabe' style='margin-top: 125px; width: 300px; font-weight: bold; font-size: 1.5em;'></div></div></div>";
		document.getElementById('overlayText').innerHTML+="<div class='background_right' id='background_right' style='background: url(\"./images_new/background_girl.jpg\") no-repeat; width: 242px; height: 259px; float: right; position: relative; top: 100px; right: 52px;'></div>";
	} 
	
	if (content == 'contactSend') {
		document.getElementById('overlayText').innerHTML+="<div class='overlayInnerText'><strong>Telefon:</strong> 0351 - 37 48 529<br /><strong>E-Mail:</strong> <a href='mailto:Fotograf@szeneshooting.de'>Fotograf@szeneshooting.de</a><br /><br /><strong>Unser kostenfreier R&uuml;ckrufservice</strong><br /><br />Die Anfrage wurde erfolgreich versendet!<br /><br />Wir werden Sie sobald wie m&ouml;glich zur&uuml;ck rufen!<br /><br /><a href='javascript:hideOverlay();'>schlie&szlig;en</a></div>";
		document.getElementById('overlayText').style.backgroundImage="url('./images_new/overlay_frame.png')";
	}
	
	if (content == 'testf') {
		document.getElementById('overlayText').innerHTML+="<div class='overlayInnerText'><div class=\"close\" onclick=\"hideOverlay();\" onmouseover=\"this.style.cursor='pointer'\" omouseout=\"\"></div><div class=\"textarea\">hiernochtext?</div><div class=\"overlaybild\"><img src=\"./images_new/pop_up_pic.png\" border=\"0\"></div></div>";
		document.getElementById('overlayText').style.backgroundImage="url('./images_new/overlay_frame.png')";
	}
	
	if (content == 'youtubeVideo') {
		document.getElementById('overlayText').innerHTML+="<div class='overlayInnerText'><div class=\"close\" onclick=\"hideOverlay();\" onmouseover=\"this.style.cursor='pointer'\" omouseout=\"\"></div><div class=\"textarea\" style=\"padding-left: 100px;\"><object width=\"450\" height=\"280\"><param name=\"movie\" value=\"http://www.youtube.com/v/KW_7ArxkGBw&hl=en&fs=1\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/KW_7ArxkGBw&hl=en&fs=1\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"450\" height=\"280\"></embed></object></div></div>";
		document.getElementById('overlayText').style.backgroundImage="url('./images_new/overlay_frame.png')";
	}
	
	if (content == 'fotosFashion') {
		document.getElementById('overlayText').innerHTML="<div class=\"close\" onclick=\"hideOverlay();\" onmouseover=\"this.style.cursor='pointer'\" omouseout=\"\" style=\"margin-left: -45px;\"></div>";
		document.getElementById('overlayText').innerHTML+="<div style='width: 957px; height: 600px; margin-left: -60px; background-image: url(./design_imgs/bg_slideshow.png);'><div style='margin-top: 0px; margin-left: 0px;'><iframe src=\"http://www.szeneshooting.de/fotos/fashion/\" style=\"border:0px; margin-top: 55px; margin-left: 60px;\" name=\"fotos\" scrolling=\"no\" frameborder=\"0\" marginheight=\"0px\" marginwidth=\"0px\" height=\"480\" width=\"835\"></iframe></div></div>";
	}
	
	if (content == 'fotosAkt') {
		document.getElementById('overlayText').innerHTML="<div class=\"close\" onclick=\"hideOverlay();\" onmouseover=\"this.style.cursor='pointer'\" omouseout=\"\" style=\"margin-left: -45px;\"></div>";
		document.getElementById('overlayText').innerHTML+="<div style='width: 957px; height: 600px; margin-left: -60px; background-image: url(./design_imgs/bg_slideshow.png);'><div style='margin-top: 0px; margin-left: 0px;'><iframe src=\"http://www.szeneshooting.de/fotos/akt/\" style=\"border:0px; margin-top: 55px; margin-left: 60px;\" name=\"fotos\" scrolling=\"no\" frameborder=\"0\" marginheight=\"0px\" marginwidth=\"0px\" height=\"480\" width=\"835\"></iframe></div></div>";
	}
	
	if (content == 'fotosFamilie') {
		document.getElementById('overlayText').innerHTML="<div class=\"close\" onclick=\"hideOverlay();\" onmouseover=\"this.style.cursor='pointer'\" omouseout=\"\" style=\"margin-left: -45px;\"></div>";
		document.getElementById('overlayText').innerHTML+="<div style='width: 957px; height: 600px; margin-left: -60px; background-image: url(./design_imgs/bg_slideshow.png);'><div style='margin-top: 0px; margin-left: 0px;'><iframe src=\"http://www.szeneshooting.de/fotos/familie/\" style=\"border:0px; margin-top: 55px; margin-left: 60px;\" name=\"fotos\" scrolling=\"no\" frameborder=\"0\" marginheight=\"0px\" marginwidth=\"0px\" height=\"480\" width=\"835\"></iframe></div></div>";
	}
	
	if (content == 'fotosOutdoor') {
		document.getElementById('overlayText').innerHTML="<div class=\"close\" onclick=\"hideOverlay();\" onmouseover=\"this.style.cursor='pointer'\" omouseout=\"\" style=\"margin-left: -45px;\"></div>";
		document.getElementById('overlayText').innerHTML+="<div style='width: 957px; height: 600px; margin-left: -60px; background-image: url(./design_imgs/bg_slideshow.png);'><div style='margin-top: 0px; margin-left: 0px;'><iframe src=\"http://www.szeneshooting.de/fotos/outdoor/\" style=\"border:0px; margin-top: 55px; margin-left: 60px;\" name=\"fotos\" scrolling=\"no\" frameborder=\"0\" marginheight=\"0px\" marginwidth=\"0px\" height=\"480\" width=\"835\"></iframe></div></div>";
	}
	
	if (content == 'fotosHochzeit') {
		document.getElementById('overlayText').innerHTML="<div class=\"close\" onclick=\"hideOverlay();\" onmouseover=\"this.style.cursor='pointer'\" omouseout=\"\" style=\"margin-left: -45px;\"></div>";
		document.getElementById('overlayText').innerHTML+="<div style='width: 957px; height: 600px; margin-left: -60px; background-image: url(./design_imgs/bg_slideshow.png);'><div style='margin-top: 0px; margin-left: 0px;'><iframe src=\"http://www.szeneshooting.de/fotos/hochzeit/\" style=\"border:0px; margin-top: 55px; margin-left: 60px;\" name=\"fotos\" scrolling=\"no\" frameborder=\"0\" marginheight=\"0px\" marginwidth=\"0px\" height=\"480\" width=\"835\"></iframe></div></div>";
	}
	
	if (content == 'fotosBusiness') {
		document.getElementById('overlayText').innerHTML="<div class=\"close\" onclick=\"hideOverlay();\" onmouseover=\"this.style.cursor='pointer'\" omouseout=\"\" style=\"margin-left: -45px;\"></div>";
		document.getElementById('overlayText').innerHTML+="<div style='width: 957px; height: 600px; margin-left: -60px; background-image: url(./design_imgs/bg_slideshow.png);'><div style='margin-top: 0px; margin-left: 0px;'><iframe src=\"http://www.szeneshooting.de/fotos/business/\" style=\"border:0px; margin-top: 55px; margin-left: 60px;\" name=\"fotos\" scrolling=\"no\" frameborder=\"0\" marginheight=\"0px\" marginwidth=\"0px\" height=\"480\" width=\"835\"></iframe></div></div>";
	}
	
	document.getElementById('overlay').style.visibility="visible";
	document.getElementById('overlayText').style.visibility="visible";
	document.getElementById('overlayTextContainer').style.visibility="visible";
	/*
	if (navigator.appName.indexOf("Opera") != -1) {
		topPosition = document.documentElement.scrollTop;
		document.getElementById('overlay').style.height=document.body.clientHeight+topPosition+"px";
	}
	else if (navigator.appName.indexOf("Explorer") != -1) {
		topPosition = document.documentElement.scrollTop;
		document.getElementById('overlay').style.height=document.body.clientHeight+topPosition+"px";
		document.getElementById('overlay').style.left="0px";
		document.getElementById('overlayTextContainer').style.left="0px";
	}
	else if (navigator.appName.indexOf("Netscape") != -1) {
		topPosition = window.pageYOffset;
		document.getElementById('overlay').style.height=window.innerHeight+topPosition+"px";
	}
	
	if (content == 'fotosAkt' || content == 'fotosFashion' || content == 'fotosFamilie' || content == 'fotosOutdoor' || content == 'fotosHochzeit' || content == 'fotosBusiness') {
		var innerTop = topPosition+50;
		var innerTextTop = topPosition+75;
		document.getElementById('overlayText').style.backgroundImage="";
	}
	else if (content == 'anfahrt') {
		var innerTop = topPosition+50;
		var innerTextTop = topPosition+75
		document.getElementById('overlayText').style.height="455px";
		document.getElementById('overlayInner').style.height="455px";
	}
	else if (content == 'action') {
		var innerTop = topPosition+100;
		var innerTextTop = topPosition+125
		document.getElementById('overlayText').style.height="0px";
		document.getElementById('overlayInner').style.height="0px";
	}
	else {
		var innerTop = topPosition+100;
		var innerTextTop = topPosition+125;
		document.getElementById('overlayText').style.height="355px";
		document.getElementById('overlayInner').style.height="355px";
	}
		
	document.getElementById('overlayInner').style.marginTop=innerTop+"px";
	document.getElementById('overlayText').style.marginTop=innerTextTop+"px";
	*/
}

function hideOverlay() {
	document.getElementById('overlayText').innerHTML = "";
	document.getElementById('overlayText').style.backgroundImage = "none";
	document.getElementById('overlay').style.visibility="hidden";
	document.getElementById('overlayText').style.visibility="hidden";
	document.getElementById('overlayTextContainer').style.visibility="hidden";
}
/*
function scrollListener (e) {
	if (document.getElementById('overlay').style.visibility == "visible") {
		if (navigator.appName.indexOf("Opera") != -1) {
			topPosition = document.documentElement.scrollTop;
			document.getElementById('overlay').style.height=document.body.clientHeight+topPosition+"px";
			var innerTop = topPosition+100;
			var innerTextTop = topPosition+125;
		}
		else if (navigator.appName.indexOf("Explorer") != -1) {
			topPosition = document.documentElement.scrollTop;
			document.getElementById('overlay').style.height=document.body.clientHeight+topPosition+"px";
			document.getElementById('overlay').style.left="0px";
			var innerTop = topPosition+100;
			var innerTextTop = topPosition+125;
		}
		else if (navigator.appName.indexOf("Netscape") != -1) {
			topPosition = window.pageYOffset;
			document.getElementById('overlay').style.height=window.innerHeight+topPosition+"px";
			var innerTop = topPosition+100;
			var innerTextTop = topPosition+125;725
		}
		document.getElementById('overlayInner').style.marginTop=innerTop+"px";
		document.getElementById('overlayText').style.marginTop=innerTextTop+"px";
	}
}
*/
function changeBoxImage(element, bg, mouse) {
	element.style.backgroundImage="url('./design_imgs/" + bg + "')";
	element.style.cursor = mouse;
}

function changeInactiveBoxImage(element, bg) {
	document.getElementById(element).style.backgroundImage="url('./images/"+element+"Inactive.jpg')";
}

function changeActiveBoxImagePNG(element) {
	document.getElementById(element).style.backgroundImage="url('./images/"+element+"active.png')";
}

function changeInactiveBoxImagePNG(element) {
	document.getElementById(element).style.backgroundImage="url('./images/"+element+"Inactive.png')";
}

function personalizeGS()
{
	vorname = document.getElementById("vorname").value;
	nachname = document.getElementById("nachname").value;
	document.getElementById("gs-textbox").innerHTML = vorname + " " + nachname + "<br />G&uuml;ltig bis: " + getDatum();
}

function getDatum()
{
	zeit = document.getElementById("zeit").innerHTML;
	return zeit;
}

function checkPersonalisieren()
{
	if(document.getElementById("vorname").value == "")
	{
		document.getElementById("vorname").style.borderColor = "red";
		return false;
	} else {
		document.getElementById("vorname").style.borderColor = "#cccccc";
	}
	if(document.getElementById("nachname").value == "")
	{
		document.getElementById("nachname").style.borderColor = "red";
		return false;
	} else {
		document.getElementById("nachname").style.borderColor = "#cccccc";
	}
	return true;
}

function CheckInput(chkmail, chkblz) 
{
	for (i = 0; i < document.forms[0].elements.length; ++i)
	{
		if (document.forms[0].elements[i].value == "") 
		{
			document.forms[0].elements[i].style.borderColor = "red";
			document.forms[0].elements[i].focus();
			return false;
	    } else {
			document.forms[0].elements[i].style.borderColor = "#cccccc";
	    }
	}
	if(chkmail == true)
	{
		if(mailIsTrue == true)
		{
			return true;
		} else {
			document.getElementById("email").style.borderColor = "red";
			return false;
		}
	}
	
	if(chkblz == true)
	{
		if(document.getElementById("last").selected == true)
		{
			if(blzIsTrue == true)
			{
				return true;
			} else {
				document.getElementById("blz").style.borderColor = "red";
				return false;
			}
		}
	}
	
	if(document.getElementById("checktable").style.visibility == "visible" || document.getElementById("checktable").style.visibility == "")
	{
		if(document.getElementById("chk").checked == false)
		{
			document.getElementById("checktext").style.backgroundColor = "#FF0000";
			return false;
		} else {
			return true;
		}
	} else {
		return true;
	}
}

function checkBox()
{
	if(document.getElementById("checktable").style.visibility == "visible" || document.getElementById("checktable").style.visibility == "")
	{
		return false;
	} else {
		return true;
	}
}

function checkEmail(ele) 
{
	var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (!filter.test(ele.value)) 
	{
		ele.style.borderColor = "red";
		mailIsTrue = false;
	} else {
		ele.style.borderColor = "#cccccc";
		mailIsTrue = true;
	}
}

function checkEmailStr(st) 
{
	var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (!filter.test(st)) 
	{
		return false;
	} else {
		return true;
	}
}


function checkblz(ele)
{
	if(ele.value.length == 8)
	{
		ele.style.borderColor = "#cccccc";
		blzIsTrue = true;
	} else {
		ele.style.borderColor = "red";
		blzIsTrue = false;
	}
}

function changeZahlungsart(ele)
{
	if(ele.value == "2")
	{
		inhalt = document.getElementById("tab").innerHTML;
		document.getElementById("tab").innerHTML = "<br /><br /><br /><br /><br /><br /><br /><br />";
		document.getElementById("checktable").style.visibility = "hidden";
		document.getElementById("dimg").style.visibility = "visible";
	} else {
		document.getElementById("tab").innerHTML = inhalt;
		document.getElementById("checktable").style.visibility = "visible";
		document.getElementById("dimg").style.visibility = "hidden";
	}
}

var pAnz = 5;
var lGSVorname = "";
var lGSNachname = "";
var lGSWert = 100;

var lREVorname = "";
var lRENachname = "";
var lREStrasse = "";
var lREPlz = "";
var lREOrt = "";
var lREMail = "";
var lRETelefon = "";

var lZahlArt = 1;
var lZahlInhaber = "";
var lZahlNummer = "";
var lZahlBLZ = "";
var lzahlBank = "";

var lZahlExtra = 5;

var lZahlVersand = 1;

var lMotiv = "1";

var heads = new Array();

heads[1]= "Wählen Sie den Wert und das Design Ihres Gutscheins";
heads[2] = "Individualisieren Sie Ihren Gutschein";
heads[3] = "Individualisieren Sie Ihren Gutschein";
heads[4] = "Wählen Sie die gewünschte Zahlungsmethode";
heads[5] = "Schließen Sie Ihre Bestellung ab";
heads[6] = "Vielen Dank für Ihre Bestellung";

function hidePages()
{
	for(i = 1; i <= pAnz; i++)
	{
		$('page-' + i).style.display = "none";
		$('page-tab-' + i).src = "./_sz_landingpage/steps_topmenue/navi_step00" + i + "_InActive.png";
	}
}

function setVersand(v)
{
	lZahlVersand = v;
}

function showPage(page)
{
	hidePages();
	$('page-' + page).style.display = "block";
	$('page-tab-' + page).src = "./_sz_landingpage/steps_topmenue/navi_step00" + page + "_Active.png";
	$('boverlay-h').innerHTML = heads[page];
}

function sGsTxt()
{
	var strrr = $('inp-name').value + " " + $('inp-vorname').value;
	
	strrr += "<br />G&uuml;ltig bis: ";
	
	 var Heute   = new Date()
	 var Tage = Heute.getDate();
	 var Monate = Heute.getMonth()+1;
 	 var Jahre = Heute.getFullYear()+1;
  	 var dat = Tage + "." + Monate + "." + Jahre ;
	 
	 strrr += dat;
	
	$('gstxt').innerHTML = strrr;
	
	lGSNachname = $('inp-vorname').value;
	lGSVorname = $('inp-name').value;
}


var Rerr = 0;
function checkRechnung()
{
	if($('inp-vorname-rech').value == "")
	{
		$('inp-vorname-rech').style.borderColor = "red";
		Rerr = 1;
	} else {
		$('inp-vorname-rech').style.borderColor = "gray";
	}
	
	if($('inp-name-rech').value == "")
	{
		$('inp-name-rech').style.borderColor = "red";
		Rerr = 1;
	} else {
		$('inp-name-rech').style.borderColor = "gray";
	}
	
	if($('inp-strasse-rech').value == "")
	{
		$('inp-strasse-rech').style.borderColor = "red";
		Rerr = 1;
	} else {
		$('inp-strasse-rech').style.borderColor = "gray";
	}
	
	if($('inp-plz-rech').value == "")
	{
		$('inp-plz-rech').style.borderColor = "red";
		Rerr = 1;
	} else {
		$('inp-plz-rech').style.borderColor = "gray";
	}
	
	if($('inp-ort-rech').value == "")
	{
		$('inp-ort-rech').style.borderColor = "red";
		Rerr = 1;
	} else {
		$('inp-ort-rech').style.borderColor = "gray";
	}
	
	if($('inp-mail-rech').value == "")
	{
		$('inp-mail-rech').style.borderColor = "red";
		Rerr = 1;
	} else {
		$('inp-mail-rech').style.borderColor = "gray";
	}
		
	if(!checkEmailStr($('inp-mail-rech').value))
	{
		$('inp-mail-rech').style.borderColor = "red";
		Rerr = 1;
	} else {
		$('inp-mail-rech').style.borderColor = "gray";
	}
	
	if($('inp-tele-rech').value == "")
	{
		$('inp-tele-rech').style.borderColor = "red";
		Rerr = 1;
	} else {
		$('inp-tele-rech').style.borderColor = "gray";
	}
	
	if(Rerr == 0)
	{
		lREVorname = $('inp-vorname-rech').value;
		lRENachname = $('inp-name-rech').value;
		lREStrasse = $('inp-strasse-rech').value;
		lREPlz = $('inp-plz-rech').value;
		lREOrt = $('inp-ort-rech').value;
		lREMail = $('inp-mail-rech').value;
		lRETelefon = $('inp-tele-rech').value;
		
		showPage(4);
	}
	else {
		Rerr = 0
	}
}

function showPage5()
{
	showPage(5);
	$('lGSName').innerHTML = lGSVorname + " " + lGSNachname;
	$('lREVorname').innerHTML = lREVorname;
	$('lRENachname').innerHTML = lRENachname;
	$('lREStrasse').innerHTML = lREStrasse;
	$('lREPlz').innerHTML = lREPlz + " " + lREOrt;
	$('lREMail').innerHTML = lREMail;
	$('lRETelefon').innerHTML = lRETelefon;
	
	if(lZahlVersand == 1)
	{
		$('lGSWert').innerHTML = lGSWert + " Euro";
	} else {
		$('lGSWert').innerHTML = (lGSWert + lZahlExtra) + " Euro";
	}
		
	if(lZahlArt == 1)
	{
		var st = "Lastschrift";
		var tableZahlung = "<table class='inp-table' style='margin-top: 0;'><tr><td>Zahlungsart:</td><td>Lastschrift</td></tr><tr><td>Kontonummer:</td><td>" + lZahlNummer + "</td></tr><tr><td>Kontoinhaber:</td><td>" + lZahlInhaber + "</td></tr><tr><td>Bankleitzahl:</td><td>" + lZahlBLZ + "</td></tr><tr><td>Kreditinstitut:</td><td>" + lzahlBank + "</td></tr></table>";
	} else {
		var st = "Überweisung";
		var tableZahlung = "<table class='inp-table' style='margin-top: 0;'><tr><td>Zahlungsart:</td><td>&Uuml;berweisung</td></tr>";
	}
	
	$('tableZahlung').innerHTML = tableZahlung;
	//$('zahlArtT').innerHTML = st + "";
}

function chZahlungsArt(ele)
{
	if(ele.value == 2)
	{
		$('lasttable').style.display = "none";
		lZahlArt = 2;
	} else {
		$('lasttable').style.display = "block";
		lZahlArt = 1;
	}
}

function checkGSName()
{
	var strrr = $('inp-name').value + " " + $('inp-vorname').value;
	
	strrr += "<br />G&uuml;ltig bis: ";
	
	var Heute = new Date()
	var Tage = Heute.getDate();
 	var Monate = Heute.getMonth()+1;
 	var Jahre = Heute.getFullYear()+1;
  	var dat = Tage + "." + Monate + "." + Jahre ;
	 
	strrr += dat;
	
	$('gstxt').innerHTML = strrr;
	
	lGSNachname = $('inp-vorname').value;
	lGSVorname = $('inp-name').value;
	showPage(3);
}

var Zerr = 0;
function checkZahlung()
{
	if(lZahlArt == 2)
	{
		showPage5();
	} else {
		
		
		if($('inp-ktn-inhaber').value == "")
		{
			$('inp-ktn-inhaber').style.borderColor = "red";
			Zerr = 1;
		} else {
			$('inp-ktn-inhaber').style.borderColor = "gray";
		}
		
		if($('inp-ktn-nummer').value == "")
		{
			$('inp-ktn-nummer').style.borderColor = "red";
			Zerr = 1;
		} else {
			$('inp-ktn-nummer').style.borderColor = "gray";
		}
		
		if($('inp-ktn-blz').value == "")
		{
			$('inp-ktn-blz').style.borderColor = "red";
			Zerr = 1;
		} else {
			$('inp-ktn-blz').style.borderColor = "gray";
		}
		
		if($('inp-ktn-bank').value == "")
		{
			$('inp-ktn-bank').style.borderColor = "red";
			Zerr = 1;
		} else {
			$('inp-ktn-bank').style.borderColor = "gray";
		}
		
		
		if(Zerr == 0)
		{
			lZahlInhaber =$('inp-ktn-inhaber').value;
			lZahlNummer = $('inp-ktn-nummer').value;
			lZahlBLZ = $('inp-ktn-blz').value;
			lzahlBank = $('inp-ktn-bank').value;
			showPage5();
		}
		else {
			Zerr = 0
		}
	}
}

function sendIt()
{
	
	var data = $H({'GSVorname': lGSVorname, 'GSNachname':lGSNachname, 'GSWert':lGSWert, 'ZahlExtra':lZahlExtra, 'ZahlVersand':lZahlVersand, 'REVorname':lREVorname, 'RENachname':lRENachname, 'REStrasse':lREStrasse, 'REPlz':lREPlz, 'REOrt':lREOrt, 'REMail':lREMail, 'RETelefon':lRETelefon, 'ZahlArt':lZahlArt, 'ZahlInhaber':lZahlInhaber, 'ZahlNummer':lZahlNummer, 'ZahlBLZ':lZahlBLZ, 'zahlBank':lzahlBank, 'Motiv':lMotiv}).toJSON();
	
	
	new Ajax.Request('./buchen_neu/ajax.php',
	  {
	    method:'post',
	    parameters: '&rs=send_gs&page=home,absenden&rsargs[]='+ data,
	    onSuccess: function(transport){
			var response = transport.responseText || "no response text";
			//alert("Success! \n\n" + response);

	    },
	    onFailure: function(){ alert('Something went wrong...') }
	  });
	
	
	
	
	
	var txt = "Ihre Bestellung wurde erfolgreich an unseren Fotografen weitergeleitet. Ihre Bestelldaten wurden Ihnen noch einmal per E-Mail zugesendet. <br /><br />";
	
	if(lZahlArt == 1)
	{
		txt += "Der Rechnungsbetrag in Höhe von " + lGSWert + " Euro wird innerhalb der nächsten 1- 3 Werktage von Ihrem Konto abgebucht. <br />Anschließend sendet Ihnen unser Fotograf den Gutschein per E-Mail zu.";
	} else {
		txt += "Bitte überweisen Sie den Rechnungsbetrag in Höhe von " + lGSWert + " Euro innerhalb von 10 Werktagen auf folgendes Konto:<br /><br />Kontoinhaber: Szeneshooting.de<br />Kontonummer: 0130097002<br />Bankleitzahl: 85080000<br />Kreditinstitut: Dresdner Bank <br /><br />Anschließend sendet Ihnen unser Fotograf den Gutschein per E-Mail zu.";
	}
	
	$('sendit-text').innerHTML = txt;
	showPage(6);
}


function setMotivNew(id)
{
	$('gutimg').src = "./_sz_landingpage/step001/pics/pic00" + id + ".png";
	lMotiv = id;
}

function hideOrderLayer()
{
	$('boverlay').style.display = "none";
}


function hideOrderLayer2()
{
	$('overlayText').style.display = "none";
}

function showOrderLayer()
{
	showFlashGal();
	$('boverlay').style.display = "block";
}

function showBVideo()
{
	$('boverlay-header').style.backgroundImage = "url(./szene_landingpage/Gutscheingenerator_NEU/staff/header_alternativ.jpg)";
	$('vlink').style.display = "none";
	$('yvid').style.display = "block";
}


function preloadImages() {
	var picArray = new Array();
	picArray[0] = "./design_imgs/box_001_aktionActive.jpg";
	picArray[1] = "./design_imgs/box_002_bookingActive.jpg";
	picArray[2] = "./design_imgs/box_003_dateActive.jpg";
	picArray[3] = "./design_imgs/box_004_businessActive.jpg";
	picArray[4] = "./design_imgs/box_005_studioActive.jpg";
	picArray[5] = "./design_imgs/buttons/btn_buchen_akt_active.png";
	picArray[6] = "./design_imgs/buttons/btn_buchen_fashion_active.png";
	picArray[7] = "./design_imgs/buttons/btn_buchen_baby_active.png";
	picArray[8] = "./design_imgs/buttons/btn_buchen_bewerbung_active.png";
	picArray[9] = "./design_imgs/buttons/btn_buchen_individuell_active.png";
	picArray[10] = "./design_imgs/buttons/btn_buchen_outdoor_active.png";
	
	for (i=0; i < picArray.length; i++) {
		var picture = new Image();
		picture.src = picArray[i];
	}
}

preloadImages();
