
function OpenBrWindow(theURL,winName,features, myWidth, myHeight) {
	if(window.screen){
		var myLeft = (screen.width-myWidth)/2;
		var myTop = (screen.height-myHeight)/2;
		features+=(features!='')?',':'';
		features+=',left='+myLeft+',top='+myTop;
	}
	var t = window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
	t.focus();
}
function addEvent(elm, evType, fn, useCapture) {
	if (elm.addEventListener) {
		elm.addEventListener(evType, fn, useCapture);
		return true;
	}
	else if (elm.attachEvent) {
		var r = elm.attachEvent('on' + evType, fn);
		return r;
	}
	else {
		elm['on' + evType] = fn;
	}
}


	function getAllSelectedText(obj){
		var result = "";
		for(var i=0; i<obj.options.length; i++){
			result += ","+obj.options[i].text;
		}
		if(result!=""){
			result = result.substring(1);
		}
		return result;
	}
	function getAllSelectedValues(obj){
		var result = "";
		for(var i=0; i<obj.options.length; i++){
			result += ","+obj.options[i].value;
		}
		if(result!=""){
			result = result.substring(1);	
		}
		return result;
	}	
	function copySelectedOptions(from,to){
		var options = new Object();
		for(var i=0; i<to.options.length; i++){
			options[to.options[i].value] = true;
		}
	
		for(var i=0; i<from.options.length; i++){
			var o = from.options[i];
			if(o.selected){
				if (options[o.value] == null || options[o.value] == "undefined"){
					to.options[to.options.length] = new Option( o.text, o.value, false, false);
				}
			}
		}
		
		for(var i=from.options.length-1; i>=0; i--){
			if(from.options[i].selected){
				from.options[i] = null;
			}
		}
	}	
	function removeSelectedOptions(obj){

		for (var i=(obj.options.length-1); i>=0; i--){
			var o = obj.options[i];
			if (o.selected){
				obj.options[i] = null;
			}
		}
	}	
