// JavaScript Document
function ShowPopup(site,w,h) 
{
	 
	var y=0;
	var x=0;
		var opt = "width=" + w + ",height=" + h + ",top=" + y + ",left=" + x + "toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0";
 window.open(site,'_blank',opt);	
}
 
 function disableSelection(target){
if (typeof target.onselectstart!="undefined") //IE route
	target.onselectstart=function(){return false}
else if (typeof target.style.MozUserSelect!="undefined") //Firefox route
	target.style.MozUserSelect="none"
else //All other route (ie: Opera)
	target.onmousedown=function(){return false}
target.style.cursor = "default"
}

 
 
function bold(id,rightanswer) {
  if (document.getElementById)
  {
    var pnl = document.getElementById(id);
  	if (rightanswer)
    {
		
	    pnl.innerHTML = "<strong>"+ pnl.innerHTML+"<strong> (Juist !)";
	 	pnl.style.color = 'green';
	}
  	else
	{

		pnl.innerHTML = "<S><strong>"+ pnl.innerHTML+"<strong></S> Fout";
  		pnl.style.color = 'red';
  	}
  }
 // else if (document.all) {
  //  document.all[id].style.fontWeight = 'bold';
  //}
}



function moveListboxItem(fbox, tbox) 
{
var arrFbox = new Array();
var arrTbox = new Array();
var arrLookup = new Array();
var i;
for (i = 0; i < tbox.options.length; i++) {
arrLookup[tbox.options[i].text] = tbox.options[i].value;
arrTbox[i] = tbox.options[i].text;
}
var fLength = 0;
var tLength = arrTbox.length;
for(i = 0; i < fbox.options.length; i++) {
arrLookup[fbox.options[i].text] = fbox.options[i].value;
if (fbox.options[i].selected && fbox.options[i].value != "") {
arrTbox[tLength] = fbox.options[i].text;
tLength++;
}
else {
arrFbox[fLength] = fbox.options[i].text;
fLength++;
    }
}
arrFbox.sort();
arrTbox.sort();
fbox.length = 0;
tbox.length = 0;
var c;
for(c = 0; c < arrFbox.length; c++) {
var no = new Option();
no.value = arrLookup[arrFbox[c]];
no.text = arrFbox[c];
fbox[c] = no;
}
for(c = 0; c < arrTbox.length; c++) {
var no = new Option();
no.value = arrLookup[arrTbox[c]];
no.text = arrTbox[c];
tbox[c] = no;
    }
}
function add_smiley(myField, myValue) {

 
//IE support
if (document.selection) {
myField.focus();
sel = document.selection.createRange();
sel.text = myValue;
}
//MOZILLA/NETSCAPE support
else if (myField.selectionStart || myField.selectionStart == '0') {
var startPos = myField.selectionStart;
var endPos = myField.selectionEnd;
myField.value = myField.value.substring(0, startPos)
+ myValue
+ myField.value.substring(endPos, myField.value.length);
} else {
myField.value += myValue;
}


}
 function add_smiley_frompopup(myField, myValue) {

//IE support
if (opener.document.selection) {
opener.document.myField.focus();
sel = opener.document.selection.createRange();
sel.text = myValue;
}
//MOZILLA/NETSCAPE support
else if (opener.document.myField.selectionStart || opener.document.myField.selectionStart == '0') {
var startPos = opener.document.myField.selectionStart;
var endPos = opener.document.myField.selectionEnd;
opener.document.myField.value = opener.document.myField.value.substring(0, startPos)
+ opener.document.myValue
+ opener.document.myField.value.substring(endPos, opener.document.myField.value.length);
} else {
opener.document.myField.value += opener.document.myValue;
}


}
 
function popupAllSmileys () {
	// check to make sure a valid username has been entered
	 
	// the size of the popup window
	var width = 800;
	var height = 600;

	// the x,y position of the popup window
	// NOTE: this formula will auto-center the popup on the screen
	var y = (screen.height - height) / 2;
	var x = (screen.width - width) / 2;

	var url = "http://www.antwerpenXL.be/community/popup_smileys.php";
 
	var options = "width=" + width + ",height=" + height + ",top=" + y + ",left=" + x + ",resizable";

	// open the chat window as a popup, instead of embedded in webpage
	window.open( url, "chat", options );
 
}
