function SetAllCheckBoxes(FormName, FieldName, Boxname) {
	if(!document.forms[FormName])
		return;
	var objCheckBoxes = document.forms[FormName].elements[FieldName];
	if(!objCheckBoxes)
		return;
	var countCheckBoxes = objCheckBoxes.length;
	if(!countCheckBoxes)
		objCheckBoxes.checked = CheckValue;
	else
		var flag;
		//check boxes values
		//for(var i = 0; i < countCheckBoxes; i++) {
		var objCheckBoxesBox = document.forms[FormName].elements[Boxname];
		if (objCheckBoxesBox.checked == true) {
			flag = true;
		}
		//}
		//if one is true 
		var CheckV;
		if (flag == true) {
			CheckV = true;
		} else {
			CheckV = false;
		}
		//set the check value for all check boxes
		for(var i = 0; i < countCheckBoxes; i++) {
			objCheckBoxes[i].checked = CheckV;
		}
}

function Mailme(old) {
	var old = old.replace("R", "i"); var old = old.replace("t", "n");
	var old = old.replace("t", "n"); var old = old.replace("u", "fo");
	var old = old.replace(" ", ""); var old = old.replace("Q", "@");
	var old = old.replace("U", "c"); var old = old.replace("x", "v");
	var old = old.replace("a", "h"); var old = old.replace("s", "a");
	var old = old.replace("y", "l"); var old = old.replace("y", "l");
	var old = old.replace("k", ".");
  document.write('<a href="mailto:'); document.write(old); 
	document.write('">'); document.write(old); document.write('</a>');
}

//$(document).ready(function() {
// // hides the slickbox as soon as the DOM is ready
// // (a little sooner than page load)
//  $('#slickbox').hide();
// // shows the slickbox on clicking the noted link  
//  $('a#slick-show').click(function() {
//    $('#slickbox').show('slow');
//    return false;
//  });
// // hides the slickbox on clicking the noted link  
//  $('a#slick-hide').click(function() {
//    $('#slickbox').hide('fast');
//    return false;
//  });
//  
// // toggles the slickbox on clicking the noted link  
//  $('a#slick-toggle').click(function() {
//    $('#slickbox').toggle(400);
//    return false;
//  });
//});

function ClearInput(id,inputvalue){
	if (id == 'login_emailadres' && inputvalue == 'emailadres') {
		var input = document.getElementById(id);
		input.value = '';
	} else if (id == 'email_address' && inputvalue == 'emailadres') {
		var input = document.getElementById(id);
		input.value = '';
	} else if (id == 'keyword' && inputvalue == 'zoekwoord') {
		var input = document.getElementById(id);
		input.value = '';
	} else if (id == 'password' && inputvalue == 'wachtwoord') {
		var input = document.getElementById(id);
		input.value = '';
	} else if (id == 'login_wachtwoord' && inputvalue == 'wachtwoord') {
		var input = document.getElementById(id);
		input.value = '';
	}
}

function toggleDiv(id,flagit) {
	if (flagit=="1"){
		if (document.layers) document.layers[''+id+''].visibility = "show"
		else if (document.all) document.all[''+id+''].style.visibility = "visible"
		else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "visible"
	} else
	if (flagit=="0"){
		if (document.layers) document.layers[''+id+''].visibility = "hide"
		else if (document.all) document.all[''+id+''].style.visibility = "hidden"
		else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "hidden"
	}
}

function SwapImage(imageId,imageNew) { 
  if (document.getElementById) { 
		imagetoswap = document.getElementById(imageId); 
		imagetoswap.src = imageNew;  
}}
function SwapClass(div_id,classnew) {
  menutoswap = document.getElementById(div_id); 
	menutoswap.className = classnew;  
}

function SetInnerById(divid,s,extra) { 
	if (extra == 'before') { 
  	var newHtml = s + document.getElementById(divid).innerHTML; 
    document.getElementById(divid).innerHTML = newHtml;
	} else if (extra == 'true' || extra == 'after') { 
    document.getElementById(divid).innerHTML+= s; 
  } else {
    document.getElementById(divid).innerHTML = s; 
}}
function SetValueById(divid,s) { document.getElementById(divid).value = s; }

function ChangeRatingReview(RatingGiven,actionType) {
	if(actionType == 'click') { 
		rating_clicked = 'clicked';
		SwapClass('rating_box','main rating_box-std');
	}
	if(actionType == 'out') { 
		var CurrentValue = document.getElementById('rating_field').value;
		if (CurrentValue == '') { CurrentValue = '5'; }
		ChangeRatingReview(CurrentValue,'');
	} else {
		SetInnerById('rating_rate','&nbsp;&nbsp;'+RatingGiven+'/5');
		if (actionType == 'click') { 
			SetValueById('rating_field',RatingGiven);
		}
		SwapImage('rating_1','images/icons/stars_on.png');
		SwapImage('rating_2','images/icons/stars_on.png');
		SwapImage('rating_3','images/icons/stars_on.png');
		SwapImage('rating_4','images/icons/stars_on.png');
		SwapImage('rating_5','images/icons/stars_on.png');
		if (RatingGiven == '1') { 
			SwapImage('rating_2','images/icons/stars_off.png');
			SwapImage('rating_3','images/icons/stars_off.png');
			SwapImage('rating_4','images/icons/stars_off.png');
			SwapImage('rating_5','images/icons/stars_off.png');
		} else if (RatingGiven == '2') { 
			SwapImage('rating_3','images/icons/stars_off.png');
			SwapImage('rating_4','images/icons/stars_off.png');
			SwapImage('rating_5','images/icons/stars_off.png');
		} else if (RatingGiven == '3') { 
			SwapImage('rating_4','images/icons/stars_off.png');
			SwapImage('rating_5','images/icons/stars_off.png');
		} else if (RatingGiven == '4') { 
			SwapImage('rating_5','images/icons/stars_off.png');
		}
	}
}

function ChangeBigRating(RatingGiven,actionType,prefix) {
	if(actionType == 'click') { 
		rating_clicked = 'clicked';
		SwapClass(prefix+'rating_box','main rating_box-std');
	}
	if(actionType == 'out') { 
		var CurrentValue = document.getElementById(prefix+'rating_field').value;
		if (CurrentValue == '') { CurrentValue = '0'; }
		ChangeBigRating(CurrentValue,'',prefix);
	} else {
		SetInnerById(prefix+'rating_rate','&nbsp;&nbsp;'+RatingGiven+'/10');
		if (actionType == 'click') { 
			SetValueById(prefix+'rating_field',RatingGiven);
		}
		SwapImage(prefix+'rating_1','images/icons/stars_on.png');
		SwapImage(prefix+'rating_2','images/icons/stars_on.png');
		SwapImage(prefix+'rating_3','images/icons/stars_on.png');
		SwapImage(prefix+'rating_4','images/icons/stars_on.png');
		SwapImage(prefix+'rating_5','images/icons/stars_on.png');
		SwapImage(prefix+'rating_6','images/icons/stars_on.png');
		SwapImage(prefix+'rating_7','images/icons/stars_on.png');
		SwapImage(prefix+'rating_8','images/icons/stars_on.png');
		SwapImage(prefix+'rating_9','images/icons/stars_on.png');
		SwapImage(prefix+'rating_10','images/icons/stars_on.png');
		if (RatingGiven == '0') { 
			SwapImage(prefix+'rating_1','images/icons/stars_off.png');
			SwapImage(prefix+'rating_2','images/icons/stars_off.png');
			SwapImage(prefix+'rating_3','images/icons/stars_off.png');
			SwapImage(prefix+'rating_4','images/icons/stars_off.png');
			SwapImage(prefix+'rating_5','images/icons/stars_off.png');
			SwapImage(prefix+'rating_6','images/icons/stars_off.png');
			SwapImage(prefix+'rating_7','images/icons/stars_off.png');
			SwapImage(prefix+'rating_8','images/icons/stars_off.png');
			SwapImage(prefix+'rating_9','images/icons/stars_off.png');
			SwapImage(prefix+'rating_10','images/icons/stars_off.png');
		} else if (RatingGiven == '1') { 
			SwapImage(prefix+'rating_2','images/icons/stars_off.png');
			SwapImage(prefix+'rating_3','images/icons/stars_off.png');
			SwapImage(prefix+'rating_4','images/icons/stars_off.png');
			SwapImage(prefix+'rating_5','images/icons/stars_off.png');
			SwapImage(prefix+'rating_6','images/icons/stars_off.png');
			SwapImage(prefix+'rating_7','images/icons/stars_off.png');
			SwapImage(prefix+'rating_8','images/icons/stars_off.png');
			SwapImage(prefix+'rating_9','images/icons/stars_off.png');
			SwapImage(prefix+'rating_10','images/icons/stars_off.png');
		} else if (RatingGiven == '2') { 
			SwapImage(prefix+'rating_3','images/icons/stars_off.png');
			SwapImage(prefix+'rating_4','images/icons/stars_off.png');
			SwapImage(prefix+'rating_5','images/icons/stars_off.png');
			SwapImage(prefix+'rating_6','images/icons/stars_off.png');
			SwapImage(prefix+'rating_7','images/icons/stars_off.png');
			SwapImage(prefix+'rating_8','images/icons/stars_off.png');
			SwapImage(prefix+'rating_9','images/icons/stars_off.png');
			SwapImage(prefix+'rating_10','images/icons/stars_off.png');
		} else if (RatingGiven == '3') { 
			SwapImage(prefix+'rating_4','images/icons/stars_off.png');
			SwapImage(prefix+'rating_5','images/icons/stars_off.png');
			SwapImage(prefix+'rating_6','images/icons/stars_off.png');
			SwapImage(prefix+'rating_7','images/icons/stars_off.png');
			SwapImage(prefix+'rating_8','images/icons/stars_off.png');
			SwapImage(prefix+'rating_9','images/icons/stars_off.png');
			SwapImage(prefix+'rating_10','images/icons/stars_off.png');
		} else if (RatingGiven == '4') { 
			SwapImage(prefix+'rating_5','images/icons/stars_off.png');
			SwapImage(prefix+'rating_6','images/icons/stars_off.png');
			SwapImage(prefix+'rating_7','images/icons/stars_off.png');
			SwapImage(prefix+'rating_8','images/icons/stars_off.png');
			SwapImage(prefix+'rating_9','images/icons/stars_off.png');
			SwapImage(prefix+'rating_10','images/icons/stars_off.png');
		} else if (RatingGiven == '5') { 
			SwapImage(prefix+'rating_6','images/icons/stars_off.png');
			SwapImage(prefix+'rating_7','images/icons/stars_off.png');
			SwapImage(prefix+'rating_8','images/icons/stars_off.png');
			SwapImage(prefix+'rating_9','images/icons/stars_off.png');
			SwapImage(prefix+'rating_10','images/icons/stars_off.png');
		} else if (RatingGiven == '6') { 
			SwapImage(prefix+'rating_7','images/icons/stars_off.png');
			SwapImage(prefix+'rating_8','images/icons/stars_off.png');
			SwapImage(prefix+'rating_9','images/icons/stars_off.png');
			SwapImage(prefix+'rating_10','images/icons/stars_off.png');
		} else if (RatingGiven == '7') { 
			SwapImage(prefix+'rating_8','images/icons/stars_off.png');
			SwapImage(prefix+'rating_9','images/icons/stars_off.png');
			SwapImage(prefix+'rating_10','images/icons/stars_off.png');
		} else if (RatingGiven == '8') { 
			SwapImage(prefix+'rating_9','images/icons/stars_off.png');
			SwapImage(prefix+'rating_10','images/icons/stars_off.png');
		} else if (RatingGiven == '9') { 
			SwapImage(prefix+'rating_10','images/icons/stars_off.png');
		} else if (RatingGiven == '10') { 
		}
	}
}




