function checkRegisterForm() {

	var strErr = '';
	
	if (document.getElementById('name').value == '') {
	strErr = strErr + 'Het naam veld is leeg\n';
	document.getElementById('name').style.backgroundColor = '#FFE8E9';
	} else {
	document.getElementById('name').style.backgroundColor = 'white';
	}
		
	if (document.getElementById('city').value == '') {
		strErr = strErr + 'Het woonplaats veld is leeg\n';
		document.getElementById('city').style.backgroundColor = '#FFE8E9';
	} else {
	document.getElementById('city').style.backgroundColor = 'white';
	}
	
	if (document.getElementById('primcolor').value == '') {
		strErr = strErr + 'Het website kleur veld is leeg\n';
		document.getElementById('primcolor').style.backgroundColor = '#FFE8E9';
	} else {
	document.getElementById('primcolor').style.backgroundColor = 'white';
	}
	
	if (document.getElementById('subdomain').value == '') {
		strErr = strErr + 'Het subdomein veld is leeg\n';
		document.getElementById('subdomain').style.backgroundColor = '#FFE8E9';
	} else {
	document.getElementById('subdomain').style.backgroundColor = 'white';
	}
	
	if (document.getElementById('password').value == '') {
		strErr = strErr + 'Het wachtwoord veld is leeg\n';
		document.getElementById('password').style.backgroundColor = '#FFE8E9';
	} else {
	document.getElementById('password').style.backgroundColor = 'white';
	}	

	if (document.getElementById('password').value == document.getElementById('subdomain').value) {
		strErr = strErr + 'Het wachtwoord veld mag niet gelijk zijn aan je gebruikersnaam\n';
		document.getElementById('password').style.backgroundColor = '#FFE8E9';
	} else {
	document.getElementById('password').style.backgroundColor = 'white';
	}		
		
	if (document.getElementById('hondname').value == '') {
		strErr = strErr + 'Het hond naam veld is leeg\n';
		document.getElementById('hondname').style.backgroundColor = '#FFE8E9';
	} else {
	document.getElementById('hondname').style.backgroundColor = 'white';
	}		
		
	if (document.getElementById('hondage').value == '') {
		strErr = strErr + 'Het hond leeftijd veld is leeg\n';
		document.getElementById('hondage').style.backgroundColor = '#FFE8E9';
	} else {
	document.getElementById('hondage').style.backgroundColor = 'white';
	}		
	if (document.getElementById('sexe').value == '') {
		strErr = strErr + 'Het hond geslacht veld is leeg\n';
		document.getElementById('sexe').style.backgroundColor = '#FFE8E9';
	} else {
	document.getElementById('sexe').style.backgroundColor = 'white';
	}	

	if (document.getElementById('hondcolor').value == '') {
		strErr = strErr + 'Het hond kleur veld is leeg\n';
		document.getElementById('hondcolor').style.backgroundColor = '#FFE8E9';
	} else {
	document.getElementById('hondcolor').style.backgroundColor = 'white';
	}	
	
	if (document.getElementById('captcha').value == '') {
		strErr = strErr + 'Je hebt niet de getallen overgenomen in het veld eronder\n';
		document.getElementById('captcha').style.backgroundColor = '#FFE8E9';
	} else {
	document.getElementById('captcha').style.backgroundColor = 'white';
	}	
	
	var emailFilter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (!(emailFilter.test(document.getElementById("email").value))) 
	{
		document.getElementById('email').style.backgroundColor = '#FFE8E9';
		strErr = strErr + 'Het email adres is niet juist.\n';
	} else {
		document.getElementById('email').style.backgroundColor = 'white';
	}
	
	if (document.getElementById('domaincheck').value == 0) {
		strErr = strErr + 'Het subdomein veld is niet correct.\n';
		document.getElementById('subdomain').style.backgroundColor = '#FFE8E9';
	}

	if (!(strErr == '')) {
		alert(strErr);
	} else {
		document.getElementById('RegisterForm').submit();
	}
}

function checkMyProfileForm() {

	var strErr = '';
	
	if (document.getElementById('txtName').value == '') {
	strErr = strErr + 'Het naam veld is leeg\n';
	document.getElementById('txtName').style.backgroundColor = '#FFE8E9';
	} else {
	document.getElementById('txtName').style.backgroundColor = 'white';
	}
		
	if (document.getElementById('txtCity').value == '') {
		strErr = strErr + 'Het woonplaats veld is leeg\n';
		document.getElementById('txtCity').style.backgroundColor = '#FFE8E9';
	} else {
	document.getElementById('txtCity').style.backgroundColor = 'white';
	}
	
		
	if (document.getElementById('txthondName').value == '') {
		strErr = strErr + 'Het hond naam veld is leeg\n';
		document.getElementById('txthondName').style.backgroundColor = '#FFE8E9';
	} else {
	document.getElementById('txthondName').style.backgroundColor = 'white';
	}		
		
	if (document.getElementById('selhondAge').value == '') {
		strErr = strErr + 'Het hond leeftijd veld is leeg\n';
		document.getElementById('selhondAge').style.backgroundColor = '#FFE8E9';
	} else {
	document.getElementById('selhondAge').style.backgroundColor = 'white';
	}		
	if (document.getElementById('selhondSexe').value == '') {
		strErr = strErr + 'Het hond geslacht veld is leeg\n';
		document.getElementById('selhondSexe').style.backgroundColor = '#FFE8E9';
	} else {
	document.getElementById('selhondSexe').style.backgroundColor = 'white';
	}	

	if (document.getElementById('txthondColor').value == '') {
		strErr = strErr + 'Het hond kleur veld is leeg\n';
		document.getElementById('txthondColor').style.backgroundColor = '#FFE8E9';
	} else {
	document.getElementById('txthondColor').style.backgroundColor = 'white';
	}	
	
	
	var emailFilter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (!(emailFilter.test(document.getElementById("txtEmail").value))) 
	{
		document.getElementById('txtEmail').style.backgroundColor = '#FFE8E9';
		strErr = strErr + 'Het email adres is niet juist.\n';
	} else {
		document.getElementById('txtEmail').style.backgroundColor = 'white';
	}
	
	if (!(strErr == '')) {
		alert(strErr);
		return false;
	} else {
		document.getElementById('myProfileForm').submit();
	}
}

function checkMyhondForm() {

	var strErr = '';

	
		
	if (document.getElementById('txthondName').value == '') {
		strErr = strErr + 'Het hond naam veld is leeg\n';
		document.getElementById('txthondName').style.backgroundColor = '#FFE8E9';
	} else {
	document.getElementById('txthondName').style.backgroundColor = 'white';
	}		
		
	if (document.getElementById('selhondAge').value == '') {
		strErr = strErr + 'Het hond leeftijd veld is leeg\n';
		document.getElementById('selhondAge').style.backgroundColor = '#FFE8E9';
	} else {
	document.getElementById('selhondAge').style.backgroundColor = 'white';
	}		
	if (document.getElementById('selhondSexe').value == '') {
		strErr = strErr + 'Het hond geslacht veld is leeg\n';
		document.getElementById('selhondSexe').style.backgroundColor = '#FFE8E9';
	} else {
	document.getElementById('selhondSexe').style.backgroundColor = 'white';
	}	

	if (document.getElementById('txthondColor').value == '') {
		strErr = strErr + 'Het hond kleur veld is leeg\n';
		document.getElementById('txthondColor').style.backgroundColor = '#FFE8E9';
	} else {
	document.getElementById('txthondColor').style.backgroundColor = 'white';
	}	
		
	if (!(strErr == '')) {
		alert(strErr);
		return false;
	} else {
		document.getElementById('myhondForm').submit();
	}
}

function checkMyhondResponse() {
	var strErr = '';
	
	if (document.getElementById('txtName').value == '') {
	strErr = strErr + 'Het naam veld is leeg\n';
	document.getElementById('txtName').style.backgroundColor = '#FFE8E9';
	} else {
	document.getElementById('txtName').style.backgroundColor = 'white';
	}
	
	if (document.getElementById('elm1').value == '') {
	strErr = strErr + 'Het reactie veld is leeg\n';
	document.getElementById('elm1').style.backgroundColor = '#FFE8E9';
	} else {
	document.getElementById('elm1').style.backgroundColor = 'white';
	}	
	
	if (!(strErr == '')) {
		alert(strErr);
		return false;
	} else {
		document.getElementById('myhondResponseForm').submit();
	}	
	
}


function checkIfUserExists(strUserName)
{

if (!(checkDomainChars(strUserName))) {
	document.getElementById('subdomainValid').innerHTML = '<font color=\"red\">Het gebruik van speciale tekens is niet toegestaan!</font>';
	document.getElementById('domaincheck').value = 0;
	return;
}

var xmlhttp = createXmlHTTP();

var xml = "<xml><node>" + strUserName + "</node></xml>"; 
var url = "ajax/checkIfUserExists.asp?username=" + strUserName; 


xmlhttp.open("POST", url, true); 
  
 xmlhttp.onreadystatechange=function() { 
  if (xmlhttp.readyState==4) { 


	
  if (xmlhttp.responseText==1) {
	document.getElementById('subdomainValid').innerHTML = '<font color=\"green\">Deze naam is nog vrij!</font>';
	document.getElementById('domaincheck').value = 1;
	} else if (xmlhttp.responseText==0) {
	document.getElementById('subdomainValid').innerHTML = '<font color=\"red\">Deze naam is al in gebruik!</font>';
	document.getElementById('domaincheck').value = 0;
	} else {
	document.getElementById('subdomainValid').innerHTML = '<font color=\"red\">Deze naam is uitgesloten van gebruik!</font>';
	document.getElementById('domaincheck').value = 0;	
	
}
}
} 
xmlhttp.send(xml)
}

function checkFrontCaptcha()
{
strKey = document.getElementById('txtChapta').value;

if (strKey == "") {alert('De getallen zijn niet juist overgenomen!'); document.getElementById('txtChapta').style.backgroundColor = '#FFE8E9'; return;}

var xmlhttp = createXmlHTTP();

var xml = "<xml><node>" + strKey + "</node></xml>"; 
var url = "ajax/checkFrontCaptcha.asp";


xmlhttp.open("POST", url, true); 
  
 xmlhttp.onreadystatechange=function() { 
  if (xmlhttp.readyState==4) { 
  
	if (xmlhttp.responseText == 1) {
		checkMyhondResponse();
		document.getElementById('txtChapta').style.backgroundColor = 'white';
	} else {
		alert('De getallen zijn niet juist overgenomen!');
		document.getElementById('txtChapta').style.backgroundColor = '#FFE8E9';
	}
}
} 
xmlhttp.send(xml)
}

function checkCalenderForm()
{

	var strErr = "";

	if (document.getElementById('start_date').value == '') {
		strErr = strErr + 'Het datum veld is leeg\n';
		document.getElementById('start_date').style.backgroundColor = '#FFE8E9';
	} else {
	document.getElementById('start_date').style.backgroundColor = 'white';
	}
	
	if (document.getElementById('txtDescription').value == '') {
		strErr = strErr + 'Het onderwerp veld is leeg\n';
		document.getElementById('txtDescription').style.backgroundColor = '#FFE8E9';
	} else {
	document.getElementById('txtDescription').style.backgroundColor = 'white';
	}	
	
	if (!(strErr == '')) {
		alert(strErr);
		return false;
	} else {
		document.getElementById('calenderForm').submit();
	}		
}

function doLogin()
{
var xmlhttp = createXmlHTTP();

var strUserName = document.getElementById('userLogin').value;
var strPassword = document.getElementById('passLogin').value;

document.getElementById('loginHolder').innerHTML = '<img src=\"image/waitplease.gif\" border=\"0\">';

var xml = "<xml>";
xml = xml + "<node>" + escapeHTML(strUserName) + "</node>";
xml = xml + "<node>" + escapeHTML(strPassword) + "</node>";
xml = xml + "</xml>";

var url = "ajax/checkLogin.asp";


xmlhttp.open("POST", url, true); 
  
 xmlhttp.onreadystatechange=function() { 
  if (xmlhttp.readyState==4) {
  
if (xmlhttp.responseText == '0') {
	alert('Gebruikersnaam of wachtwoord is niet goed!\nKijk extra goed of je geen foutje heb gemaakt.');
	window.location = window.location;
} else if (!(xmlhttp.responseText == '')) {
	
	arrCred = xmlhttp.responseText.split('|');
	
	document.getElementById('GUID').value = arrCred[0];
	document.getElementById('userid').value = arrCred[1];
	document.getElementById('loginForm').action = 'http://' + strUserName + '.ismijnhond.nl';
	document.getElementById('loginForm').submit();
}
} 
}
xmlhttp.send(xml)
}

function escapeHTML (str)
{
   var div = document.createElement('div');
   var text = document.createTextNode(str);
   div.appendChild(text);
   return div.innerHTML;
}

function findLeftPos(obj) {
var curleft = 0;
if (obj.offsetParent) {
curleft = obj.offsetLeft
while (obj = obj.offsetParent) {
curleft += obj.offsetLeft
}
}
return curleft;
}



function findTopPos(obj) {
var curtop = 0;
if (obj.offsetParent) {
curtop = obj.offsetTop
while (obj = obj.offsetParent) {
curtop += obj.offsetTop
}
}
return curtop;
}


function checkDomainChars(strDomain) {
	for(var j=0; j<strDomain.length; j++)
		{
		  var dh = strDomain.charAt(j);
		  var hh = dh.charCodeAt(0);
		  if((hh > 47 && hh<59) || (hh > 64 && hh<91) || (hh > 96 && hh<123) || hh==45 || hh==46)
		  {
			 if((j==0 || j==strDomain.length-1) && hh == 45)	
		  	 {
			      return false;
		 	 }
		  }
		else {
			 return false;
		  }
		}
		return true;
}

function createXmlHTTP() {
var xmlhttp=false; 
 try { 
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
 } catch (e) { 
  try { 
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
  } 
  catch (e) {
      try {
        // Gecko-based browsers, Safari, and Opera.
        xmlhttp = new XMLHttpRequest();
      } 
  catch (e) { 
   xmlhttp = false; 
  } 
 } 
}
if (!xmlhttp && typeof XMLHttpRequest!='undefined') { 
 try { 
  xmlhttp = new XMLHttpRequest(); 
 } catch (e) { 
  xmlhttp=false; 
 } 


} 


if (!xmlhttp && window.createRequest) { 
 try { 
  xmlhttp = window.createRequest(); 
 } catch (e) { 
  xmlhttp=false; 
 } 


} 

return xmlhttp;
}

function checkRoset(strValue) {
if ((strValue == 1) || (strValue == 2) || (strValue == 3)) {
	document.getElementById('rosset').style.display = 'block';
	document.getElementById('rosset').src = 'image/' + strValue + 'prijs.gif';
} else {
	document.getElementById('rosset').style.display = 'none';
}
}

function showHideReport(boolChecked) {
if (boolChecked) {
	document.getElementById('reportLayer').style.display = 'block';
} else {
	document.getElementById('reportLayer').style.display = 'none';
}
}

function checkResultsForm() {

	var strErr = "";

	if (document.getElementById('start_date').value == '') {
	strErr = strErr + 'Het datum veld is leeg\n';
	document.getElementById('start_date').style.backgroundColor = '#FFE8E9';
	} else {
	document.getElementById('start_date').style.backgroundColor = 'white';
	}	

	if (document.getElementById('selPosition').value == '') {
	strErr = strErr + 'Het uitslag veld is leeg\n';
	document.getElementById('selPosition').style.backgroundColor = '#FFE8E9';
	} else {
	document.getElementById('selPosition').style.backgroundColor = 'white';
	}	

	if (document.getElementById('txtPoints').value == '') {
	strErr = strErr + 'Het punten veld is leeg\n';
	document.getElementById('txtPoints').style.backgroundColor = '#FFE8E9';
	} else {
	document.getElementById('txtPoints').style.backgroundColor = 'white';
	}			
	
	if (document.getElementById('txtClass').value == '') {
	strErr = strErr + 'Het klasse veld is leeg\n';
	document.getElementById('txtClass').style.backgroundColor = '#FFE8E9';
	} else {
	document.getElementById('txtClass').style.backgroundColor = 'white';
	}

	if (document.getElementById('selSport').value == '') {
	strErr = strErr + 'Het sport veld is leeg\n';
	document.getElementById('selSport').style.backgroundColor = '#FFE8E9';
	} else {
	document.getElementById('selSport').style.backgroundColor = 'white';
	}		

	if (document.getElementById('txtCity').value == '') {
	strErr = strErr + 'Het plaats veld is leeg\n';
	document.getElementById('txtCity').style.backgroundColor = '#FFE8E9';
	} else {
	document.getElementById('txtCity').style.backgroundColor = 'white';
	}	
	
	if (!(strErr == '')) {
		alert(strErr);
		return false;
	} else {
		document.getElementById('myResultsForm').submit();
	}	
}

function checkLinkForm() {
var strURL = document.getElementById('txtLink').value;
if (isUrl('http://' + strURL)) {
	document.getElementById('LinkForm').submit();
} else {
	document.getElementById('txtLink').style.backgroundColor = '#FFE8E9';
	alert('Ongeldige link ingegeven');
	return false;
}
}

function isUrl(s) {
 	var regexp = /http:\/\/[A-Za-z0-9\.-]{1,}\.[A-Za-z]{1}/;
 	return regexp.test(s);
}


function noimage(obj, iSize)
{
	var image1 = 'image/test.gif';
    if (iSize==1) if (obj.src != image1) { 
        obj.src = image1;
        return true;
    }
}

function sendInventationMail()
{
var xmlhttp = createXmlHTTP();

var xml = "<xml><node>" + document.getElementById('txtName').value + "</node><node>" + document.getElementById('txtEmail').value + "</node></xml>"; 
var url = "ajax/inviteFriend.asp";


xmlhttp.open("POST", url, true); 
  
 xmlhttp.onreadystatechange=function() { 
  if (xmlhttp.readyState==4) { 
//alert(xmlhttp.responseText);
  showThanksBox();
}
} 
xmlhttp.send(xml)
}

function searchForFriends()
{
var xmlhttp = createXmlHTTP();

var xml = "<xml><node>" + document.getElementById('txtName').value + "</node></xml>"; 
var url = "ajax/myFriendsAdd.asp";


xmlhttp.open("POST", url, true); 
  
 xmlhttp.onreadystatechange=function() { 
  if (xmlhttp.readyState==4) { 
//alert(xmlhttp.responseText);
  document.getElementById('searchContentHolder').innerHTML = xmlhttp.responseText;
}
} 
xmlhttp.send(xml)
}

function passwordForgotten()
{
var xmlhttp = createXmlHTTP();

var xml = "<xml><node>" + document.getElementById('txtInput').value + "</node></xml>"; 
var url = "ajax/passwordForget.asp";


xmlhttp.open("POST", url, true); 
  
 xmlhttp.onreadystatechange=function() { 
  if (xmlhttp.readyState==4) { 
//alert(xmlhttp.responseText);
  alert(xmlhttp.responseText);
  document.getElementById('txtInput').value = '';
  document.getElementById('searchContentHolder').style.left = document.getElementById('searchContentHolder').offsetLeft + 170;
  document.getElementById('searchContentHolder').style.display = 'none';
}
} 
xmlhttp.send(xml)
}

function showThanksBox() {
objThanksBox = document.getElementById('thanksBox');
objFormBox = document.getElementById('formBox');

objThanksBox.style.display = 'block';
objThanksBox.style.width = objFormBox.offsetWidth;
objThanksBox.style.height = objFormBox.offsetHeight;



setTimeout ('GlowUpTimeOutDown()', 2000);
document.getElementById('txtName').value = '';
document.getElementById('txtEmail').value = '';
}

function GlowUpTimeOutDown() {

setTimeout ('GlowDown(100)', 2000);
setTimeout ('GlowDown(30)', 101);
setTimeout ('GlowDown(28)', 150);
setTimeout ('GlowDown(20)', 200);
setTimeout ('GlowDown(25)', 250);
setTimeout ('GlowDown(22)', 300);
setTimeout ('GlowDown(20)', 350);
setTimeout ('GlowDown(10)', 400);
setTimeout ('GlowDown(0)', 500);
}

function GlowDown(intOpacity) {
if (intOpacity==0) {
document.getElementById('thanksBox').style.filter='alpha(opacity=100)';
document.getElementById('thanksBox').style.display='none';
clearTimeout();
}

document.getElementById('thanksBox').style.filter='alpha(opacity=' + intOpacity + ')';
}

function showInviteFriend()
{
 document.getElementById('inviteLayer').style.display = "block";
 center(document.getElementById('inviteLayer'));
}
function center(object)
{
 object.style.marginLeft = "-" + parseInt(object.offsetWidth / 2) + "px";
 object.style.marginTop = "-" + parseInt(object.offsetHeight / 2) + "px";
}

function removeFriend(intFriendId) {
	window.location = 'myFriends.asp?delFriend=1&friendId=' + intFriendId;
}


function HighLightStars(strPrefix, intStar)
{
	for (var x = 1; x <= intStar; x++)
		{
			document.getElementById(strPrefix + x).src = 'image/pootjes_on.gif';
		}
	for (var x = intStar+1; x <= 10; x++)
		{
			document.getElementById(strPrefix + x).src = 'image/pootjes.gif';
		}		
	document.getElementById('selectedScore').innerHTML = intStar;	
}

function LowLightStars(strPrefix)
{

if (document.getElementById(strPrefix).value=='')
{
	for (var x = 1; x <= 10; x++)
		{
			document.getElementById(strPrefix + x).src = 'image/pootjes.gif';
		}
} else {
	for (var x = parseInt(document.getElementById(strPrefix).value)+1; x <= 10; x++)
		{
			document.getElementById(strPrefix + x).src = 'image/pootjes.gif';
		}
	for (var x = 1; x <= parseInt(document.getElementById(strPrefix).value); x++)
		{
			document.getElementById(strPrefix + x).src = 'image/pootjes_on.gif';
		}		
}
document.getElementById('selectedScore').innerHTML = document.getElementById('Pres').value;
}

function HighLightVoteStars(strPrefix, intStar, intPicture)
{
	for (var x = 1; x <= intStar; x++)
		{
			document.getElementById(strPrefix + x + '_' + intPicture).src = 'image/fotostar_on.gif';
		}
	for (var x = intStar+1; x <= 10; x++)
		{
			document.getElementById(strPrefix + x + '_' + intPicture).src = 'image/fotostar.gif';
		}		
}

function LowLightVoteStars(strPrefix, intPicture)
{

if (document.getElementById(strPrefix + '_' + intPicture).value=='')
{
	for (var x = 1; x <= 10; x++)
		{
			document.getElementById(strPrefix + x + '_' + intPicture).src = 'image/fotostar.gif';
		}
} else {
	for (var x = parseInt(document.getElementById(strPrefix + '_' + intPicture).value)+1; x <= 10; x++)
		{
			document.getElementById(strPrefix + x + '_' + intPicture).src = 'image/fotostar.gif';
		}
	for (var x = 1; x <= parseInt(document.getElementById(strPrefix  + '_' + intPicture).value); x++)
		{
			document.getElementById(strPrefix + x + '_' + intPicture).src = 'image/fotostar_on.gif';
		}		
}
}

function submitScoreForm() {
	if (confirm('Weet je zeker dat je ' + document.getElementById('Pres').value + ' pootjes wilt geven?')) {
		document.getElementById('scoreSubmit').submit();
		} else {
		return false;
		}
}

function submitVoteScoreForm(intPicture) {
	if (confirm('Weet je zeker dat je ' + document.getElementById('Pres_' + intPicture).value + ' punten wilt geven?')) {
		document.getElementById('scoreSubmit_' + intPicture).submit();
		} else {
		return false;
		}
}

function submitFunctionVoteScoreForm(intPicture) {
	if (confirm('Weet je zeker dat je ' + document.getElementById('Pres_' + intPicture).value + ' punten wilt geven?')) {
		document.getElementById('scoreSubmit_' + intPicture).submit();
		} else {
		return false;
		}
}

function activeQuestion(intPrefix, intSelected) {
	document.getElementById(intPrefix + '-' + intSelected).src = 'image/quiz/' + intSelected + '_on.gif';
	document.getElementById('Answer' + intPrefix).value = intSelected;
	strChoices = 'a|b|c';
	arrDeselect = strChoices.split('|');
	
	for (x in arrDeselect) {
		if (!(arrDeselect[x] == intSelected)) {
			document.getElementById(intPrefix + '-' + arrDeselect[x]).src = 'image/quiz/' + arrDeselect[x] + '.gif';
		}
	}

}

function checkQuizResults() {
	AnswerCorrect1 = 'a';
	AnswerCorrect2 = 'b';
	AnswerCorrect3 = 'a';
	AnswerCorrect4 = 'b';
	AnswerCorrect5 = 'c';
	AnswerCorrect6 = 'a';
	AnswerCorrect7 = 'a';
	AnswerCorrect8 = 'b';
	strVault = '';
	intVault = 0;
	
	if (!(document.getElementById('Answer1').value==AnswerCorrect1))  {
		strVault = strVault + '1|';
		intVault = intVault + 1;
	}
	if (!(document.getElementById('Answer2').value==AnswerCorrect2)) {
		strVault = strVault + '2|';
		intVault = intVault + 1;
	}
	if (!(document.getElementById('Answer3').value==AnswerCorrect3)) {
		strVault = strVault + '3|';
		intVault = intVault + 1;
	}
	if (!(document.getElementById('Answer4').value==AnswerCorrect4)) {
		strVault = strVault + '4|';
		intVault = intVault + 1;
	}
	if (!(document.getElementById('Answer5').value==AnswerCorrect5)) {
		strVault = strVault + '5|';
		intVault = intVault + 1;
	}
	if (!(document.getElementById('Answer6').value==AnswerCorrect6)) {
		strVault = strVault + '6|';
		intVault = intVault + 1;
	}
	if (!(document.getElementById('Answer7').value==AnswerCorrect7)) {
		strVault = strVault + '7|';
		intVault = intVault + 1;
	}
	if (!(document.getElementById('Answer8').value==AnswerCorrect8)) {
		strVault = strVault + '8|';
		intVault = intVault + 1;
	}	
	
	
	if (intVault > 0) {
		alert('Er zijn ' + intVault + ' fouten');
	} else {
		alert('Helemaal goed!\nEr zijn geen fouten.');
	}
}

function getBottomBanner() {

var xmlhttp = createXmlHTTP();

var xml = "<xml><node>null</node></xml>"; 
var url = "/ajax/bottomBannerSub.asp";


xmlhttp.open("POST", url, true); 
  
xmlhttp.onreadystatechange=function() { 
	if (xmlhttp.readyState==4) { 
		//document.getElementById('bannerHolder').innerHTML = xmlhttp.responseText; 
		writeBanner(xmlhttp.responseText);
		//return xmlhttp.responseText;
		
	}
} 
xmlhttp.send(xml)
}

function writeBanner(strBannerHTML) {
	document.writeln(strBannerHTML);
}

function enableEmail(strUsername, strGUID) {
showAjaxLayer('webmailOverlay', 'block');	
var xmlhttp = createXmlHTTP();


var xml = "<xml><node>null</node></xml>"; 
var url = "/ajax/createMail.asp?acname=" + strUsername + "&GUID=" + strGUID;


xmlhttp.open("POST", url, true); 
xmlhttp.onreadystatechange=function() { 
	if (xmlhttp.readyState==4) { 
		//alert(xmlhttp.responseText);
		alert('Jouw e-mail adres is nu aangemaakt!');
		showAjaxLayer('webmailOverlay', 'none');	
		
		window.location = '/';
	}
} 
xmlhttp.send(xml)
}

function disableEmail(strUsername, strGUID) {
showAjaxLayer('webmailOverlay', 'block');	
var xmlhttp = createXmlHTTP();


var xml = "<xml><node>null</node></xml>"; 
var url = "/ajax/deleteMail.asp?acname=" + strUsername + "&GUID=" + strGUID;


xmlhttp.open("POST", url, true); 
xmlhttp.onreadystatechange=function() { 
	if (xmlhttp.readyState==4) { 
		
		alert('Jouw e-mail adres is nu verwijderd!');
		showAjaxLayer('webmailOverlay', 'none');	
		window.location = '/';
	}
} 
xmlhttp.send(xml)
}

function showAjaxLayer(id, strDisplayValue) {
	document.getElementById(id).style.display = strDisplayValue;
}

function checkMail(strUsername, strGUID) {

var xmlhttp = createXmlHTTP();


var xml = "<xml><node>null</node></xml>"; 
var url = "/ajax/checkMail.asp?acname=" + strUsername + "&GUID=" + strGUID;


xmlhttp.open("POST", url, true); 
xmlhttp.onreadystatechange=function() { 
	if (xmlhttp.readyState==4) { 
		var msg = parseInt(xmlhttp.responseText);
		
		if (msg == 1) {
			var varText = '&nbsp;Er is 1 nieuw e-mail bericht';
		} else {
			var varText = '&nbsp;Er zijn ' + msg + ' nieuwe e-mail berichten';	
		}
		
		document.getElementById('checkMail').innerHTML = varText;
		document.getElementById('checkMail').style.display = 'block';
	}
} 
xmlhttp.send(xml)
}

function getX(evt) {
      if (document.all) { return (evt.clientX); }
      return (evt.layerX);
}
function getY(evt) {
      if (document.all) { return (evt.clientY); }
      return (evt.layerY);
}

function getMouseIcon(e) {
	 document.getElementById('mouseImage').style.display = 'none';
     var posx = 0;
     var posy = 0;
     posx= getX(e) + getScrollWidth() + 30;
     posy= getY(e) + getScrollHeight() + 30;
	 
	 

	 mouseX = posx;
	 mouseY = posy;
	 
	 document.getElementById('mouseImage').style.left = mouseX + 'px';
	 document.getElementById('mouseImage').style.top = mouseY + 'px';
	 document.getElementById('mouseImage').style.display = 'block';
}

function getScrollWidth()
{
   var w = window.pageXOffset ||
           document.body.scrollLeft ||
           document.documentElement.scrollLeft;
           
   return w ? w : 0;
} 

function getScrollHeight()
{
   var h = window.pageYOffset ||
           document.body.scrollTop ||
           document.documentElement.scrollTop;
           
   return h ? h : 0;
}

function countDownCal(strSeconds) {
 document.getElementById('miliseconds').value=0;
 document.getElementById('seconds').value=strSeconds;
 
 document.getElementById('counter').innerHTML = '30';
}

function countDown(){ 
 
 if (document.getElementById('miliseconds').value<=0){ 
    document.getElementById('miliseconds').value=9; 
    document.getElementById('seconds').value-=1; 
 } 
 if (document.getElementById('seconds').value<=-1){ 
    document.getElementById('miliseconds').value=0;
    document.getElementById('seconds').value+=1; 
 } else {
    document.getElementById('miliseconds').value-=1; 
    document.getElementById('counter').innerHTML=document.getElementById('seconds').value;
    setTimeout("countDown()",100);
} 
}