function select_radio(someelement, uncheckelement, elvalue, imageobject) {
	someelement.value=elvalue;
	if(document.getElementById(uncheckelement.value)!=null) {
		document.getElementById(uncheckelement.value).src='images/radio_off.gif';
	}
	imageobject.src='images/radio_on.gif';
	uncheckelement.value=imageobject.id;
}
function select_checkbox(someelement, imageobject) {
	if(someelement.value==1) {
		someelement.value=0;
		imageobject.src='images/checkbox_off.gif';
	} else {
		someelement.value=1;
		imageobject.src='images/checkbox_on.gif';
	}
}
function select_checkboxg(someelement, imageobject) {
	if(someelement.value==1) {
		someelement.value=0;
		imageobject.src='images/checkboxg_off.gif';
	} else {
		someelement.value=1;
		imageobject.src='images/checkboxg_on.gif';
	}
}
function select_checkbox_g(someelement, imageobject) {
	if(someelement.value==1) {
		someelement.value=0;
		imageobject.src='../../../../images/checkboxg_off.gif';
	} else {
		someelement.value=1;
		imageobject.src='../../../../images/checkboxg_on.gif';
	}
}

function onthou_locatie(prov_id, c_id, imageobject) {
	var atts='top=10, left=10, width=300, height=100, menubar=no, toolbar=no, scrollbars=no, locationbar=no, statusbar=no';
	var imgs=new String(imageobject.src);
	if(imgs.indexOf('images/checkbox_on.gif', 0)>-1) {
		var loc='vergeet_locatie.php';
		imageobject.src='images/checkbox_off.gif';
	} else {
		var loc='onthou_locatie.php?province_id='+prov_id+'&city_id='+c_id;
		imageobject.src='images/checkbox_on.gif';
	}
	window.open(loc, 'onthou_locatie', atts);
}

function open_kaart(id) {
	var atts='top=10, left=10, width=780, height=750, menubar=no, toolbar=no, scrollbars=yes, locationbar=no, statusbar=no';
	var loc='kaart.php?id='+id;
	window.open(loc, 'visitekaart', atts);
}
function open_kaart_g(id) {
	var atts='top=10, left=10, width=780, height=750, menubar=no, toolbar=no, scrollbars=yes, locationbar=no, statusbar=no';
	var loc='visitekaart.php';
	window.open(loc, 'visitekaart', atts);
}
function open_rating(id) {
	var atts='top=10, left=10, width=780, height=750, menubar=no, toolbar=no, scrollbars=yes, locationbar=no, statusbar=no';
	var loc='ratings_popup.php?id='+id;
	window.open(loc, 'ratings', atts);
}
function open_rating_g(id) {
	var atts='top=10, left=10, width=780, height=750, menubar=no, toolbar=no, scrollbars=yes, locationbar=no, statusbar=no';
	var loc='../../../../ratings_popup.php?id='+id;
	window.open(loc, 'ratings', atts);
}

function check_enter0() {
	if(self.event.keyCode==13) {
		document.login0.submit();
	}
}
function check_enter_general(form) {
	if(self.event.keyCode==13) {
		form.submit();
	}
}
function check_enter_balk() {
	if(self.event.keyCode==13) {
		go_zoek_balk();
	}
}

function go_zoek_balk() {
	if(document.uzoek_balk.allcategory.value==0) {
		document.getElementById('w_id').name='dumb';
		document.getElementById('r_id').name='dumb';
		document.getElementById('c_id').name='dumb';
		document.getElementById('a_id').name='dumb';
	} else {
		valstr=new String(document.uzoek_balk.allcategory.value);
		document.uzoek_balk.category_id.value=valstr.substr(0, valstr.indexOf('_', 0));
		document.uzoek_balk.rubriek_id.value=valstr.substring((valstr.indexOf('_', 0)+1), valstr.lastIndexOf('_'));
		document.uzoek_balk.world_id.value=valstr.substring((valstr.lastIndexOf('_')+1), valstr.length);
		document.getElementById('a_id').name='dumb';
	}
//	if((document.uzoek_balk.wie.value=='')&&(document.uzoek_balk.waar.value=='')) {
//		alert('U dient eerst op te geven wie u zoekt of waar u zoekt.');
//		document.uzoek_balk.wie.focus();
//		return;
//	}
	if(document.uzoek_balk.wie.value!='') {
		var strwie=new String(document.uzoek_balk.wie.value);
		if(strwie.length<3) {
			alert('U dient minimaal 3 letters op te geven in \"Wie zoekt u\" veld.');
			document.uzoek_balk.wie.focus();
			return;
		}
	}
	if(document.uzoek_balk.waar.value!='') {
		var strwaar=new String(document.uzoek_balk.waar.value);
		if(strwaar.length<3) {
			alert('U dient minimaal 3 letters op te geven in \"Waar zoekt u\" veld.');
			document.uzoek_balk.waar.focus();
			return;
		}
	}
	document.uzoek_balk.submit();
}

function valid_email(email) {
	test=new String(email);
	if(test.indexOf('@', 0)==-1) {
		return false;
	}
	if(test.indexOf('.', 0)==-1) {
		return false;
	} else {
		var ind=test.indexOf('.', 0);
	}
	while(ind!=-1) {
		var indl=ind+1;
		ind=test.indexOf('.', indl);
	}
	if((indl-2)<=test.indexOf('@', 0)) {
		return false;
	}
	return true;
}
function back() {
	history.go(-1);
}
