//browsererkennung
var ie4 = ((document.all) && (navigator.appVersion.indexOf('MSIE 4')!=-1)) ? true:false;
var ie5 = ((document.getElementById) && (navigator.appVersion.indexOf('MSIE 5')!=-1)) ? true:false;
var ie6 = ((document.getElementById) && (navigator.appVersion.indexOf('MSIE 6')!=-1)) ? true:false;
var ns4 = ((document.layers) && (navigator.appVersion.indexOf('4')!=-1))? true:false;
var ns6 = ((document.getElementById) && (navigator.appName == 'Netscape')) ? true:false;
var opera = (navigator.appName == 'Opera') ? true:false;
var LayerAktiv = false;

var neu = null;


//   ******* BILDERWECHSEL
function changer(imgid, imgurl)
{
	eval('document.images.' + imgid + '.src = "' + imgurl + '"');
}

//macht entsprechende container sicht- oder unsichtbar
function ShowLayer(LayerName)
 {  if ((ns6)||(ie5)||(ie6)||(opera))
       { document.getElementById(LayerName).style.visibility="visible"; 
       }
    if (ns4)
       { document.layers[ LayerName ].visibility="visible";
       }
    if (ie4)
       { document.all[ LayerName ].style.visibility="visible";
       }
 }

function HideLayer(LayerName)
 {  if ((ns6)||(ie5)||(ie6)||(opera))
       { document.getElementById(LayerName).style.visibility="hidden";
       }
    if (ns4)
       { document.layers[ LayerName ].visibility="hidden";
       }
    if (ie4)
       { document.all[ LayerName ].style.visibility="hidden";
       }
 }
		
//reload when ns4
function NSreload(init)
{  
  	if (init==true) with (navigator) 
  	{
	   if ((appName=="Netscape")&&(parseInt(appVersion)==4))
	   {
    	document.PW=innerWidth; 
		document.PH=innerHeight; 
		onresize=NSreload;
		}
	}
  	else if (innerWidth!=document.PW || innerHeight!=document.PH) 
  	{
  	document.location.reload();
	}
}

NSreload(true);


//OPEN MOVIE-WIN, old version, unchanged
function movieOpenOLD(URL)	{
	window.open(URL, "", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=420,height=340,top=100,left=100");
}

//open movie window from portfolio, implemented 28-09-05
function movieOpen(ID,URL) {
        windowWidth = 360;
        windowHeight = 325;
    //dynamic version, moviename und pfad wird uebergebn
	//var popupURL = "/de/portfolio/projects/popupmovie.asp?project_id=" + ID + "&URL=" + URL;
	var popupURL = "/de/portfolio/projects/popupmovie.php?id=" + ID + "&URL=" + URL;
	//static version for testing
	//var popupURL = "/de/portfolio/projects/popupmovie.html";
	var popup = window.open(popupURL,"moviewindow","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,screenX=4,screenY=4,top=4,left=4,resizable=1,width="+windowWidth+",height="+windowHeight+"");

}

//open movie window from portfolio, implemented 18-12-09
function movieOpen2010(ID,URL) {
        windowWidth = 550;
        windowHeight = 373;
    //dynamic version, moviename und pfad wird uebergebn
	//var popupURL = "/de/portfolio/projects/popupmovie.asp?project_id=" + ID + "&URL=" + URL;
	var popupURL = "/de/portfolio/projects/popupmovie2010.php?id=" + ID + "&URL=" + URL;
	//static version for testing
	//var popupURL = "/de/portfolio/projects/popupmovie.html";
	var popup = window.open(popupURL,"moviewindow2","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,screenX=4,screenY=4,top=4,left=4,resizable=1,width="+windowWidth+",height="+windowHeight+"");

}

function validateForm() {
// Prueft ob die email-Adresse eingegeben wurde.   
       if (document.form.email.value == "") {
        alert("Bitte Ihre E-Mail-Adresse eingeben!");
        document.form.email.focus();
        return false;
        }
        
        if (document.form.email.value.indexOf('@') == -1) {
        alert("Keine E-Mail-Adresse!");
        document.form.email.focus();
        return false;
       	} else {
		document.form.submit();
	}
}

	//browsererkennung
	var isMinNS4 = (navigator.appName.indexOf("Netscape") >= 0 && parseFloat(navigator.appVersion) >= 4&&parseFloat(navigator.appVersion) < 5) ? 1 : 0;
	var isMinNS6 = (isMinNS4 && navigator.userAgent.indexOf("Gecko")>=0) ? 1 : 0;
	var isMinIE4 = (document.all) ? 1 : 0;
	var isMinIE5 = (isMinIE4 && navigator.appVersion.indexOf("5.")) >= 0 ? 1 : 0;
	var isDOM = (document.getElementById) ? 1 : 0;

	if (document.images) { 
		// preloading right images
		pic1on=new Image();
		pic1on.src="/images/startpage/hamburg_hi.gif";
		pic1off=new Image();
		pic1off.src="/images/startpage/hamburg_lo.gif";
		
		pic2on=new Image();
		pic2on.src="/images/startpage/toronto_hi.gif";
		pic2off=new Image();
		pic2off.src="/images/startpage/toronto_lo.gif";

		pic3on=new Image();
		pic3on.src="/images/startpage/dubai_hi.gif";
		pic3off=new Image();
		pic3off.src="/images/startpage/dubai_lo.gif";

		pic4on=new Image();
		pic4on.src="/images/startpage/kreation_hi.gif";
		pic4off=new Image();
		pic4off.src="/images/startpage/kreation_lo.gif";

/*		pic3on=new Image();*/
/*		pic3on.src="/images/startpage/hd_hi.gif";*/
/*		pic3off=new Image();*/
/*		pic3off.src="/images/startpage/hd_lo.gif";*/

	}
	
	// function to activate images
	function imgOn(imgName) {
		if (isDOM) {
		//alert('dom');
		document.getElementById(imgName).src = eval(imgName+"on.src");
		} else {
		//alert('nodom');
		document[imgName].src=eval(imgName+"on.src");
		}
	}
	
	// function to deactivate images
	function imgOff(imgName) {
		if (isDOM) {
		document.getElementById(imgName).src = eval(imgName+"off.src");
		} else {
		document[imgName].src=eval(imgName+"off.src");
		}
	}




