
//***************************************GLOBAL VARIABELES********************************************************************************************************

//***************************************GLOBAL VARIABELES********************************************************************************************************

//***************************************SIMPLE BROWSERCHECK********************************************************************************************************

ie4 = false;
ns4 = false;
ns5 = false;
unk = false; //unknown

if (document.all) {ie4 = true;}
else if (document.layers) {ns4 = true;}
else if (document.getElementById) {ns5 = true;}
else {unk = true;}

//***************************************SIMPLE BROWSERCHECK********************************************************************************************************



function ZetImageSource(imageId,imageSource){
	if(ie4 || ns5 || opera){
		document.images[imageId].src='images/'+imageSource;
	}else if(ns4){
		document.imgDiv.document.images[imageId].src=eval('images/'+imageSource);
	}
}




//***************************************FORM********************************************************************************************************************

function submitForm(language){
  this.language = language;
  if(validateForm(language)==true){
     //document.forms['infoForm'].method="post" 
     //document.forms['infoForm'].action="mailto:info@nuevenniet.nu"
     //document.forms['infoForm'].action="mailing.php"
     document.forms['infoForm'].submit()
  }else{
     alert(validateForm(language))
  }
}

function validateForm(language){
  if(document.forms['infoForm'].elements['vxemail'].value==""){
	if(language=="nederlands"){
	              	document.forms['infoForm'].elements['vxemail'].focus(); return "Vul uw e-mail adres in.";  
	}else if(language=="duits"){
	              	document.forms['infoForm'].elements['vxemail'].focus(); return "Geben Sie Ihre e-mail in das e-mail Feld.";  
	}else{
	              	document.forms['infoForm'].elements['vxemail'].focus(); return "Fill in your e-mail adres.";  
	}
  }else if(document.forms['infoForm'].elements['vxemail'].value.indexOf('@',1)<1){
	if(language=="nederlands"){
	              	document.forms['infoForm'].elements['vxemail'].focus(); return "Vul uw e-mail adres correct in!"; 
	}else if(language=="duits"){
	              	document.forms['infoForm'].elements['vxemail'].focus(); return "Geben Sie ein richtige e-mail in das e-mail Feld!"; 
	}else{
	              	document.forms['infoForm'].elements['vxemail'].focus(); return "Fill in your email adres correctly!"; 
	}
  }else if(document.forms['infoForm'].elements['vxemail'].value.indexOf('.',1)<1){
	if(language=="nederlands"){
              		document.forms['infoForm'].elements['vxemail'].focus(); return "Vul uw e-mail adres correct in!"; 
	}else if(language=="duits"){
	              	document.forms['infoForm'].elements['vxemail'].focus(); return "Geben Sie ein richtige e-mail in das e-mail Feld!"; 
	}else{
	              	document.forms['infoForm'].elements['vxemail'].focus(); return "Fill in your email adres correctly!"; 
	}
  }else{return true}
}

function setFocus(setthis){
	if (ie4 || ns5){
		setthis.style.backgroundColor="#Ffffff";
	}
}

function loseFocus(setthis){
	if(ie4 || ns5){
		setthis.style.backgroundColor="#C8DFE4";
	}
}



//************************************************************menuTDover**********************************************************

function cOn(td){
	if(document.getElementById||(document.all && !(document.getElementById))){
		td.style.backgroundColor="#D2F1FC";
	}
}
function cOut(td){
	if(document.getElementById||(document.all && !(document.getElementById))){
		td.style.backgroundColor="#7EB4C8";
	}
}

function cOn2(td){
	if(document.getElementById||(document.all && !(document.getElementById))){
		td.style.backgroundColor="#D2F1FC";
	}
}
function cOut2(td){
	if(document.getElementById||(document.all && !(document.getElementById))){
		td.style.backgroundColor="#ADD2DF";
	}
}


var viewimage;
function viewImage(iWidth,iHeight,HTMLPage){

	if(viewimage && !viewimage.closed) {
		viewimage.close();

	}

 	centerWindow(iWidth,iHeight);
	viewimage = window.open(HTMLPage,"","status=0,menubar=0,height="+iHeight+",width="+iWidth+",screenX="+xOffset+",screenY="+yOffset+",top="+yOffset+",left="+xOffset);
}


function centerWindow(widthPopup,heightPopup) {
    if (ie4){
        var xMax = screen.width, yMax = screen.height;
    }else if (ns4 || ns5 || opera){
        var xMax = window.outerWidth, yMax = window.outerHeight;
    }else{
        var xMax = 640, yMax=480;
    }

    xOffset = (xMax - widthPopup)/2;
    yOffset = (yMax - heightPopup)/2;

}
