
// check browsertype
var isMinNS4 = (navigator.appName.indexOf("Netscape") >= 0 &&
                parseFloat(navigator.appVersion) >= 4) ? 1 : 0;
var isMinIE4 = (document.all) ? 1 : 0;
var isMinIE5 = (isMinIE4 && navigator.appVersion.indexOf("5.") >= 0) ? 1 : 0;
var isNS6 = (navigator.userAgent.indexOf("Gecko")    > 0) ? 1 : 0;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1);

//if (isMinNS4) {alert ('isMinNS4');};
//if (isMinIE4) {alert ('isMinIE4');};
//if (isMinIE5) {alert ('isMinIE5');};
//if (isNS6) {alert ('isNS6');};
//if (this.opera) {alert ('isOpera');}; 

// bepaald variabelen voor later gebruik
if (isMinNS4 || isNS6) {
	doc="document.";				// document
	val = ".value";					// waarde
	stijl="";						// stijl
	horz=".left";					// horizontale afstand
	vert=".top";					// vertikale afstand
	innerW="window.innerWidth";		// breedte scherm
	innerH="window.innerHeight";	// hoogte scherm
	offsetX="window.pageXOffset";	// offset breedte
	offsetY="window.pageYOffset";	// offset hoogte
};
if (isMinIE4){
	doc="";
	val = ".value";
	stijl=".style";
	horz=".pixelLeft";
	vert=".pixelTop";
	innerW="document.body.clientWidth";
	innerH="document.body.clientHeight";
	offsetX="document.body.scrollLeft";
	offsetY="document.body.scrollTop";
};
 
// functie om form te submitten + verplichte velden controle +disable submitknop
// getest: ie5.5 ok, ie6.0 ok, ns4.7 ok, ns6.2 ok, opera5.12 ok,
// gebruik: in form tag: onSubmit="return checkverplicht('formuliernaam','naam van 
// velden','titel van velden');" 
function checkverplicht(formulier,reqlijstveld,reqlijstnaam) {
var Checkveld = reqlijstveld;
var Checknaam = reqlijstnaam;
var isok ='ja';
form = formulier;
var buttontekst = eval(doc+form+".verstuur"+val);
eval(doc+form+".verstuur"+val+"='Verstuurd'");
eval(doc+form+".verstuur.disabled=true");
if (Checkveld != '') {
var CheckveldArray = Checkveld.split(",");
var ChecknaamArray = Checknaam.split(","); 
for (var i=0; i<CheckveldArray.length; i++)
	{
	var naam = ChecknaamArray[i];
	veld = "."+CheckveldArray[i]+"";
	waarde = eval(doc+form+veld+val);
		if (waarde == ''|| waarde == null) {
		alert(''+naam+' is een verplicht veld!');
		var isok = 'nee';
		};
	};
};
if (isok == 'nee') {
eval(doc+form+".verstuur"+val+"='"+buttontekst+"'");
eval(doc+form+".verstuur.disabled=false");
return false;
} else {
return true};
};


function PopIt(filename, w, h, s){  
	var wp = (screen.width/100)*w;
	var hp = (screen.height/100)*h;
	var midw = (screen.width/2)-(wp/2);
	var midh = (screen.height/2)-(hp/2);
	popup = window.open(filename,"popDialog","left="+midw+" top="+midh+" height="+hp+",width="+wp+",scrollbars=yes resizable=1")  
	if ( popup.document.close() ) {
		popup.document.close()
	}
};

function PopItpx(filename, w, h, s){  
	var wp = w;
	var hp = h;
	var midw = (screen.width/2)-(wp/2);
	var midh = (screen.height/2)-(hp/2);
	popup = window.open(filename,"popDialog","left="+midw+" top="+midh+" height="+hp+",width="+wp+",location=no,menubar=no,scrollbars="+s+",status=no,toolbar=no")  
	if ( popup.document.close() ) {
		popup.document.close()
	}
};



function validemail(field) {
  var str = field.value;
  if (str == "") {
return true;
}
  if (window.RegExp) {
    var reg1str = "(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)";
    var reg2str =
"^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,4})(\\]?)$";
    var reg1 = new RegExp(reg1str);
    var reg2 = new RegExp(reg2str);
    if (!reg1.test(str) && reg2.test(str)) {
      return true;
    }
    field.focus();
    alert('Geen geldig emailadres.');
    return false;
  } else {
    if(str.indexOf("@") >= 0)
      return true;
    field.focus();
    alert('Geen geldig emailadres.');
    return false;
  }
};

function ChangeClass(id,classpassed){
	document.getElementById(id).className=classpassed;
};


/***********************************************
* Gradual Highlight image script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var baseopacity=30

function slowhigh(which2){
imgobj=which2
browserdetect=which2.filters? "ie" : typeof which2.style.MozOpacity=="string"? "mozilla" : ""
instantset(baseopacity)
highlighting=setInterval("gradualfade(imgobj)",50)
}

function slowlow(which2){
cleartimer()
instantset(baseopacity)
}

function instantset(degree){
if (browserdetect=="mozilla")
imgobj.style.MozOpacity=degree/100
else if (browserdetect=="ie")
imgobj.filters.alpha.opacity=degree
}

function cleartimer(){
if (window.highlighting) clearInterval(highlighting)
}

function gradualfade(cur2){
if (browserdetect=="mozilla" && cur2.style.MozOpacity<1)
cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)+0.1, 0.99)
else if (browserdetect=="ie" && cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=10
else if (window.highlighting)
clearInterval(highlighting)
}

function confirmDelete(URL) 
{
   if(confirm('Verwijderen?')) {
      location.href = URL;
   }
};

function navdo(id,total) {
var div1 = "div_"+id+"_sub";
for (i=1; i<total; i++) {
var divthis = "div_"+i+"_sub";
document.getElementById(divthis).style.display = 'none';
}
document.getElementById(div1).style.display = 'block';
};



