if (document.layers) {
	document.captureEvents(Event.MOUSEMOVE);
	document.onmousemove = captureMousePosition;
} else if (document.all) {
	document.onmousemove = captureMousePosition;
} else if (document.getElementById) {
	document.onmousemove = captureMousePosition;
}

var xMousePos = 0;
var yMousePos = 0;

function captureMousePosition(e) {
    if (document.layers) {
        xMousePos = e.pageX;
        yMousePos = e.pageY;
    } else if (document.all) {
        xMousePos = window.event.x+document.body.scrollLeft;
        yMousePos = window.event.y+document.body.scrollTop;
    } else if (document.getElementById) {
       	xMousePos = e.pageX;
        yMousePos = e.pageY;
    }
}

function show(theme, which, nr) {
	var thumb = document.getElementById('thumb1');

	if( thumb.style.visibility == 'hidden' )
	{
		thumb.style.left = xMousePos+20;
		thumb.style.top = yMousePos+20;
		thumb.style.visibility = 'visible';

		map=Math.ceil(nr/1000);
		if(which == 0)
			thumb.innerHTML = '<img src="pasfoto/' + which + '' + theme + '.gif" alt="" style="border: 1px solid #FFFFFF">';
		else
			thumb.innerHTML = '<img src="pasfoto/'+map+'/' + nr + '.jpg" alt="" style="border: 1px solid #FFFFFF">';
	}
}

function close_t() {
	document.getElementById('thumb1').style.visibility = 'hidden';
}

function spotlight(x, theme) {
	var a = document.getElementById('spotlight');
	var b = document.getElementById('spotlight_hit');

	if(b.value == 1) {
		a.innerHTML = '<img src="thema/' + theme + '/ovrg/spotlight.png" alt="">';
		b.value = 2;
	} else {
		a.innerHTML = x;
		b.value = 1;
	}

	setTimeout("spotlight(document.getElementById('spotlight_txt').value, document.getElementById('spotlight_theme').value)", 5000);
}

function viderror() {
	var a = document.getElementById('viderror');

	a.innerHTML = '';
	a.style.visibility = 'hidden';
}

function notificatie(msg) { 
	if (confirm(msg))
		return true;
	else
		return false;
}

function ubb(x) {
	document.forms.form.bericht.value = document.forms.form.bericht.value + x;
}

function navi(jump) {
	eval("parent" + ".location = '" + jump.options[jump.selectedIndex].value + "'");
}

function rating(jump, idnr, fid, page) {
	eval("parent" + ".location = 'rate.php?id=" + idnr + "&pic=" + fid + "&pagina=" + page + "&cijfer=" + jump.options[jump.selectedIndex].value + "'");
}

function ratingvid(jump, idnr, fid, page) {
	eval("parent" + ".location = 'ratevid.php?id=" + idnr + "&pic=" + fid + "&pagina=" + page + "&cijfer=" + jump.options[jump.selectedIndex].value + "'");
}

function opties1(f, theme) {
	var n = document.getElementById('optiesx');

	n.innerHTML = '<img src="thema/' + theme + '/ovrg/b.gif" alt=""> ' + f;
}

function opties2(m) {
	var k = document.getElementById('optiesx');

	k.innerHTML = '&nbsp;';
}

function friend_next(pagina, paginas, lid, thema, andere) {
	if(pagina >= paginas)
		window.alert('Je kan niet naar de volgende pagina omdat er maar ' + paginas +' pagina\'s zijn.');
	else {
		var page = eval(pagina);
		var page2 = page+1;
		this.window.location = 'profiel.php?id=' + lid + '&thema=' + thema + '&buddies=' + page2 + '&wannabee=' + andere + '#friends';
	}
}

function friend_back(pagina, paginas, lid, thema, andere) {
	if(pagina == 1)
		window.alert('Je kan niet naar de vorige pagina omdat je al op pagina 1 zit.');
	else {
		var page = eval(pagina);
		var page2 = page-1;
		this.window.location = 'profiel.php?id=' + lid + '&thema=' + thema + '&buddies=' + page2 + '&wannabee=' + andere + '#friends';
	}
}

function wannabee_next(pagina, paginas, lid, thema, andere) {
	if(pagina >= paginas)
		window.alert('Je kan niet naar de volgende pagina omdat er maar ' + paginas +' pagina\'s zijn.');
	else {
		var page = eval(pagina);
		var page2 = page+1;
		this.window.location = 'profiel.php?id=' + lid + '&thema=' + thema + '&wannabee=' + page2 + '&buddies=' + andere + '#friends';
	}
}

function wannabee_back(pagina, paginas, lid, thema, andere) {
	if(pagina == 1)
		window.alert('Je kan niet naar de vorige pagina omdat je al op pagina 1 zit.');
	else {
		var page = eval(pagina);
		var page2 = page-1;
		this.window.location = 'profiel.php?id=' + lid + '&thema=' + thema + '&wannabee=' + page2 + '&buddies=' + andere + '#friends';
	}
}

function select(theme) {
	var g = document.getElementById('verwijder');

	if(g.innerHTML == '') {
		document.getElementById('sel').src = 'thema/' + theme + '/postvak/min.gif';
		g.innerHTML = '<div class=row2><div class=row2a><input type="image" src="thema/' + theme + '/ovrg/verwijder.gif" alt=""></div></div>';
	} else {
		document.getElementById('sel').src = 'thema/' + theme + '/postvak/plus.gif';
		g.innerHTML = '';
	}

	for(i = 0; i < document.form.elements.length; i++) {
		if(document.form.elements[i].type == 'checkbox') {
			if(document.form.elements[i].checked == true)
				document.form.elements[i].checked = false;
			else
				document.form.elements[i].checked = true;
		}
	}
}

function select_del(theme) {
	var h = document.getElementById('verwijder');

	h.innerHTML = '<div class=row2><div class=row2a><input type="image" src="thema/' + theme + '/ovrg/verwijder.gif" alt=""></div></div>';
}

function menu(theme, nr) {
	var links = new Array();
	links[1] = '<img src=thema/' + theme + '/ovrg/b1.gif alt=""> <a href="index.php">BEGINPAGINA</a> <img src=thema/' + theme + '/ovrg/b1.gif alt=""> <a href="chat_' + theme + '.php" target="_blank">CHAT</a> <img src=thema/' + theme + '/ovrg/b1.gif alt=""> <a href="help.php">HELP</a> <img src=thema/' + theme + '/ovrg/b1.gif alt=""> <a href="reglement.php">REGLEMENT</a> <img src=thema/' + theme + '/ovrg/b1.gif alt=""> <a href="ubb_codes.php">UBB CODES</a> <img src=thema/' + theme + '/ovrg/b1.gif alt=""> <a href="crew.php">CREW</a> <img src=thema/' + theme + '/ovrg/b1.gif alt=""> <a href="online.php">ONLINE</a> <img src=thema/' + theme + '/ovrg/b1.gif alt=""> <a href="mobile.php">GSM STUFF</a>';
	links[2] = '<img src=thema/' + theme + '/ovrg/b1.gif alt=""> <a href="forum.php">INDEX</a> <img src=thema/' + theme + '/ovrg/b1.gif alt=""> <a href="forum_zoeken.php">ZOEKEN</a> <img src=thema/' + theme + '/ovrg/b1.gif alt=""> <a href="forum_actief.php">ACTIEVE TOPICS</a> <img src=thema/' + theme + '/ovrg/b1.gif alt=""> <a href="forum_mijn.php">MIJN TOPICS</a> <img src=thema/' + theme + '/ovrg/b1.gif alt=""> <a href="forum_nieuw.php">NIEUW TOPIC</a> <img src=thema/' + theme + '/ovrg/b1.gif alt=""> <a href="reglement.php#forum">FORUM RICHTLIJNEN</a>';
	
	document.getElementById('menu1').src = 'thema/' + theme + '/index/1a.gif';
	document.getElementById('menu2').src = 'thema/' + theme + '/index/2a.gif';

	document.getElementById('menu' + nr).src = 'thema/' + theme + '/index/' + nr + '.gif';
	document.getElementById('menu_balk').innerHTML = links[nr];
}

function menu_uit(theme, msg) {
	document.getElementById('menu1').src = 'thema/' + theme + '/index/1a.gif';
	document.getElementById('menu2').src = 'thema/' + theme + '/index/2a.gif';

	document.getElementById('menu_balk').innerHTML = '<img src=thema/' + theme + '/ovrg/b1.gif alt=""> <b>' + msg + '</b>';
}

function vergroot(nummer) {
	var q = document.form.bericht.rows;

	if(q > 8) {
		if(nummer == 1)
			document.form.bericht.rows = q-5;
		else
			document.form.bericht.rows = q+5;
	} else
		document.form.bericht.rows = q+5;
}

function stem_poll() {
	if(document.zoeke.elements['p1a'].checked == true)
		var t = 1;
	if(document.zoeke.elements['p2a'].checked == true)
		var t = 2;
	if(document.zoeke.elements['p3a'].checked == true)
		var t = 3;

	window.location = 'stem_poll.php?id='+t;
}

function stem_poll1(theme, idnr) {
	if(document.form.elements['p1a'].checked == true)
		var t = 1;
	if(document.form.elements['p2a'].checked == true)
		var t = 2;
	if(document.form.elements['p3a'].checked == true)
		var t = 3;

	if(theme == 'pink')
		var f = 'http://www.angelbabes.nl/';
	else
		var f = 'http://www.devildudes.nl/';

	window.location = f+'stem_poll1.php?id='+t+'&profiel='+idnr;
}

function kleurcod(kcode) {
	document.getElementById('kleurpicker').value = kcode;
}