
var browsername, browserversion, browserversionsnummer, browserart;
with(navigator) {
	browsername=appName;
	browserversion=userAgent;
	browserversionsnummer=appVersion;
}

function Is() {
	agent  = navigator.userAgent.toLowerCase();
	this.major = 	parseInt(navigator.appVersion);
	this.minor = 	parseFloat(navigator.appVersion);
	this.ns = 	((agent.indexOf('mozilla')	!=   -1) &&
			((agent.indexOf('spoofer')	==   -1) &&
			(agent.indexOf('compatible')	==   -1)));
	this.ns2 = 	(this.ns && (this.major		==    3));
	this.ns3 = 	(this.ns && (this.major		==    3));
	this.ns4b = 	(this.ns && (this.major		==    4) &&
			(this.minor			<= 4.03));
	this.ns4 = 	(this.ns && (this.major		>=    4));
	this.ns6 = 	(this.ns && (this.major		>=    5));
	
	this.ie = 	(agent.indexOf("msie")		!=   -1 );
	this.ie3 = 	(this.ie && (this.major		<     4));
	this.ie4 = 	(this.ie && (this.major		==    4) && (agent.indexOf("msie 5.0")	==   -1));
	this.ie5 = 	(this.ie && (this.major		==    4) && (agent.indexOf("msie 5.0")	!=   -1));
	this.ie55 =	(this.ie && (this.major		==    4) && (agent.indexOf("msie 5.5")	!=   -1));
	this.ie6 =	(this.ie && (this.major		==    4) && (agent.indexOf("msie 6.0")	!=   -1));
	this.ie7 = (this.ie && (this.major		== 	  4) && (agent.indexOf("msie 7.0")	!=	 -1));
	this.ie8 = (this.ie && (this.major		== 	  4) && (agent.indexOf("msie 8.0")	!=	 -1));

	this.ie5mac =	(this.ie && (this.major		==    4) && (agent.indexOf("mac")		!=   -1));
	
	this.ie = 
	this.iealt = ( (this.ie3 || this.ie4 || this.ie5 || this.ie6 || this.ie7) && !this.ie8 );
	
			
	this.op =	(agent.indexOf("opera")		!=   -1);
	this.op6 =	(this.op && (this.major		==    4) && (agent.indexOf("6.0")		!=   -1));
	this.mac =	(agent.indexOf("mac")		!=   -1);

	this.de = 	(agent.indexOf("de-") != -1 || agent.indexOf("[de]") != -1 );
}

var is = new Is();

browserart = 	(is.ns6)?"ns6":(
		(is.ns4)?"ns4":(
		(is.ns3)?"ns3":(
		(is.ns2)?"ns2":(
		(is.ns)?"ns":(
		(is.ie8)?"ie8":(
		(is.ie7)?"ie7":(
		(is.ie6)?"ie6":(
		(is.ie55)?"ie55":(
		(is.ie5mac)?"ie5mac":(
		(is.ie5)?"ie5":(
		(is.ie4)?"ie4":(
		(is.ie3)?"ie3":(
		(is.ie)?"ie":(
		(is.op)?"op":(
		(is.op6)?"op6":"")))))))))))))));
// var ausgabe_browser = 'Name: '+browsername+"\n\nVer: "+is.major+' / '+is.minor+"\n\nVer-Nr: "+browserversionsnummer+"\n\n"+"Erkannt als => "+browserart+'\n\nIE? '+is.ie+'\n\nAlt? '+is.iealt;
function framecheck() {
	if(top.location.href == location.href){
			top.location.href="../index.html";
	}
}

function nofoc() {
	window.focus();
}

function tausch(bildname, bildurl, ebene) {	
	var d_i;

	if (window.document.images) {
		d_i = window.document.images; 
		if ( d_i[bildname] ) { // alert('d_i['+bildname+'] ok!');
			d_i[bildname].src=bildurl;
		} else if (document[ebene]) { 
			if ( document[ebene].document.images[bildname] ) { //alert('document.images[bildname] ok!');
				 window.document[ebene].document.images[bildname].src=bildurl;
			}
		}
	}
	// else alert("JavaScript-Fehler oder ein Objekt fehlt\nBitte diese Information weiterleiten an:\nwebmaster@nzwg.de");
}

function rein (was) {
	if (was) {
		if (document.getElementById('infos')) document.getElementById('infos').style.display = 'none';
		for (i=0;i<rolloverDivs.length;i++) {
			if ( document.getElementById(rolloverDivs[i]) ) document.getElementById(rolloverDivs[i]).style.display = (rolloverDivs[i] == was) ? 'block' : 'none';
		}
	}
}
function iein (was) {
	if (was) {
		if (document.getElementById(was)) document.getElementById(was).style.display = 'block';
		if (document.getElementById('infos')) document.getElementById('infos').style.display = 'none';
		if (document.getElementById('land_o_'+was)) document.getElementById('land_o_'+was).style.display = 'block';
	} 
}
function iaus (was) {
	if (was) {
		if (document.getElementById('infos')) document.getElementById(was).style.display = 'none';
		if (document.getElementById(was)) document.getElementById('infos').style.display = 'block';
		if (document.getElementById('land_o_'+was)) document.getElementById('land_o_'+was).style.display = 'none';
	}
}

function frameLoad (adresse, rahmen) {
	parent[rahmen].location = adresse;
}

function Ein(ebene) {
	var o,v,vvis;
	o = 	(is.ie6 || is.ie55 || is.ie5 || is.ie5mac || is.op|| is.ns6) ?	(document.getElementById(ebene)) ? document.getElementById(ebene).style : "" : (
		(is.ns4) ?	(document.layers[ebene]) ? document.layers[ebene] : "" : (
		(is.ns3) ?	(document[ebene]) ? document[ebene] : "" : (
		(is.ie4 || is.ie3) ?	(document.all[ebene]) ? document.all[ebene].style : "" : "" )));
	if (o == "") {
		// alert('ebene '+ebene+' nicht vorhanden');
	}else{
		o.visibility = "visible";
	}
}

function Aus(ebene) {
	var o,v,vvis;
	o = 	(is.ie6 || is.ie55 || is.ie5 || is.ie5mac || is.op|| is.ns6) ?	(document.getElementById(ebene)) ? document.getElementById(ebene).style : "" : (
		(is.ns4) ?	(document.layers[ebene]) ? document.layers[ebene] : "" : (
		(is.ns3) ?	(document[ebene]) ? document[ebene] : "" : (
		(is.ie4 || is.ie3) ?	(document.all[ebene]) ? document.all[ebene].style : "" : "" )));
	if (o == "") {
		// alert('ebene '+ebene+' nicht vorhanden');
	}else{
		o.visibility = "hidden";
		// alert('melde vollzug\nebene -'+ebene+'-' );
	}
}

// "antiscroll" - funktion: wenn jemand den inhalt "verzieht" 
// (klicken und ziehen, wie markieren), rücken wir es wieder zurecht.
// bevorzugt zu benutzen bei Seiten, die auch keine Scrollbalken haben.
function zurueck() { 
	window.scroll(0,0);
}



function setNav(nav, subnav) {
	if (nav && !subnav) {
		
	} else {
		
	}
}

function NewWindow(URL,Breite,Hoehe) {
/*
    Maße für NewWindow2: 
	width=600
	height=250
*/
	if (!Breite) {
		Window =  window.open(URL, "", "width=550,height=600,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no");
		Window.focus();
	} else if (!Hoehe) {
		Window =  window.open(URL, "", "width="+Breite+",height=600,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no");
		Window.focus();
	} else {
		Window =  window.open(URL, "", "width="+Breite+",height="+Hoehe+",toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no");
		Window.focus();
	}	
}

function NurWindow(Breite,Hoehe) {	
	if (!Breite) {
		Window =  window.open("", "NeuesFenster", "width=550,height=600,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no");
		Window.focus();
	} else if (!Hoehe) {
		Window =  window.open("", "NeuesFenster", "width="+Breite+",height=600,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no");
		Window.focus();
	} else {
		Window =  window.open("", "NeuesFenster", "width="+Breite+",height="+Hoehe+",toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no");
		Window.focus();
	}	
}

function checkFormular() {
/* im Formular vorhandene Felder
Firma
Name_r
Strasse_r
PLZ_r
Ort_r
Telefon_r
Fax
eMail
--- abfragen, ob Telefon und Adresse eingegeben ist ---
	gesamten_Produktordner
	Skateparks
	Walls
	Miniaturgolf
	Tischtennis
	CD_Rom
-------------------------------------------------------
Nachricht
*/

	var zuSchicken = false;
	var nameOK = false;
	var streetOK = false;
	var plzOK = false;
	var ortOK = false;
	var telOK = false;
	var addressFilled = false;
	var fehltNoch = "";
	var nixChecked = false;
	var garNixChecked = false;
	
	zuSchicken = (document.Formular.gesamten_Produktordner.checked || document.Formular.Skateparks.checked || document.Formular.Walls.checked || document.Formular.Miniaturgolf.checked || document.Formular.Tischtennis.checked || document.Formular.CD_Rom.checked);
	nameOK = document.Formular.Name_r.value != "";
	streetOK = document.Formular.Strasse_r.value != "";
	plzOK = document.Formular.PLZ_r.value != "";
	ortOK = document.Formular.Ort_r.value != "";
	telOK = document.Formular.Telefon_r.value != "";
	addressFilled = (nameOK && streetOK && plzOK && ortOK && telOK);
	nixChecked = (!zuSchicken && document.Formular.Nachricht.value == "");
	garNixChecked = (nixChecked && !addressFilled && document.Formular.Firma.value == "" && document.Formular.Fax.value == "" && document.Formular.eMail.value == "" );
	if ( garNixChecked ) { // bist du garNixChecker ?-)
		alert("Tut uns leid, wir können mit dieser Anfrage nichts anfangen. \nBitte geben Sie uns wenigstens einen Namen und tragen etwas in das Feld [ Nachricht ] ein");
		document.Formular.Name_r.focus();
		return false;
	} else if (nixChecked) { // bist du nixChecker ?-))
		// alert("Vielen Dank für alle Ihre persönlichen Daten!\nKönnen wir Ihnen gar nicht weiterhelfen?\nEtwas zuschicken vielleicht?");
		// return false;
	} else if (zuSchicken && !addressFilled) {
		fehltNoch += (nameOK)? "" : "\n[ Name ]";
		fehltNoch += (streetOK)? "" : "\n[ Straße ]";
		fehltNoch += (plzOK)? "" : "\n[ PLZ ]";
		fehltNoch += (ortOK)? "" : "\n[ Ort ]";
		fehltNoch += (telOK)? "" : "\n[ Telefon ]";
		alert("Bitte füllen Sie folgende Felder aus, damit wir Ihnen etwas zuschicken können:"+fehltNoch);
		if (!nameOK) {
			document.Formular.Name_r.focus();
		} else if (!streetOK) {
			document.Formular.Strasse_r.focus();
		} else if (!plzOK) {
			document.Formular.PLZ_r.focus();
		} else if (!ortOK) {
			document.Formular.Ort_r.focus();
		} else {
			document.Formular.Telefon_r.focus();
		}
		return false;
	}
}

function reloadFrames() {
	if (self.location == top.location) {top.location.href="http://www.concrete-sportanlagen.de"}
}


