function add2list(sourceID,targetID) {
	source = document.getElementById(sourceID);
	target = document.getElementById(targetID);
	maxItems = source.options.length;
	maxItems2 = target.options.length;
	var ex;	
	for (i=0;i<maxItems;i++){
		if (source.options[i].selected === true){
			ex=0;
			for (j=0;j<maxItems2;j++) {if (source.options[i].text == target.options[j].text) ex=1; }
			if (ex==0){
				itemName = source.options[i].text;
				itemValue = source.options[i].value;
				target.options[target.options.length] = new Option(itemName,itemValue);
			}
		}	
	}
}


function remove4(sourceID) 
{
	source = document.getElementById(sourceID);
	maxItems = source.options.length;
	for (i=maxItems-1;i>=0;i--) 
		if (source.options[i].selected === true ){
			for (j=i;j<source.options.length-1;j++){
				source.options[j].text= source.options[j+1].text;
			 	source.options[j].value= source.options[j+1].value;
			}
			source.options.length--;
			maxItems--;
		}
}


function selectall(sourceID) 
{
	source = document.getElementById(sourceID);
	maxItems = source.options.length;
	for (i=0;i<maxItems;i++) 
		source.options[i].selected =true;
	
}

function toggleVisibility(id, NNtype, IEtype, WC3type,x,y) {
    if (document.getElementById) {
        eval("document.getElementById(id).style.visibility = \"" + WC3type + "\"");
		if (x!=0) eval("document.getElementById(id).style.left = \"" + x + "px\"");
		if (y!=0) eval("document.getElementById(id).style.top = \"" + y + "px\"");

    } else {
        if (document.layers) {
            document.layers[id].visibility = NNtype;
        } else {
            if (document.all) {
                eval("document.all." + id + ".style.visibility = \"" + IEtype + "\"");
				if (x!=0) eval("document.all." + id + ".style.left = \"" + x + "px\"");
				if (y!=0) eval("document.all." + id + ".style.top = \"" + y + "px\"");
            }
        }
    }
}

function toggleVisibilityXY(id,a,b,c,d,e) {
  var tempX = 0;
  var tempY = 0;
  var IE = document.all?true:false;
  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.body.scrollLeft;
    tempY = event.clientY + document.body.scrollTop;
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX;
    tempY = e.pageY;
  }  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0;}
  if (tempY < 0){tempY = 0;}  
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY

  toggleVisibility(id, 'show','visible','visible',tempX-d,tempY-e);
 
}

function show_div(divid){ 
	 document.getElementById(divid).style.display=''; 
}
	
function hidden_div(divid){ 
	document.getElementById(divid).style.display='none'; 
}
	