setClassName = function(self, targetClassName){
	self.className=targetClassName;
}

jumpTo = function(self){
	// if(self.options[self.selectedIndex].value != ""){
		document.location="#" + self.options[self.selectedIndex].value;
	// }
}

/* example : <a href="http://www.myopenbox.org" onclick="popUp(this.href, '', 725, 450, location, scrollbars, resizable, status, toolbar, menubar); return false;"> test </a> */
popUp = function(href, winName, w, h, location, scrollbars, resizable, status, toolbar, menubar){
	var winLeft=(screen.width - w) / 2;
	var winTop=(screen.height - h) / 2;
	winProps="width=" + w + ",height=" + h + ",top=" + winTop + ",left=" + winLeft + ",location=" + location + ",scrollbars=" + scrollbars + ",resizable=" + resizable + ",status=" + status + ",toolbar=" + toolbar + ",menubar=" + menubar;
	winOpen=window.open(href, winName, winProps);
	winOpen.window.focus();
}

textCounter = function(targetField, maxLength){	
	// alert($(targetField).value.length + ' vs ' + ???; the value.length is not returning correct value (i think it's missing br and nl)
	if($(targetField).value.length > maxLength){
		$(targetField).value = $(targetField).value.substring(0, maxLength);
	} else {
		if($(targetField).value.length > 0){
			$(targetField + "_counter").innerHTML = "Characters left: " + (maxLength - $(targetField).value.length);
		} else {
			$(targetField + "_counter").innerHTML = "Maximum length: " + maxLength;
		}
	}
}

selectAll = function(targetSelectId){
	var targetSelect = $(targetSelectId);
	for(var i=0; i < targetSelect.options.length; i++){
		targetSelect.options[i].selected = true;
	}
	targetSelect.options[0].selected = false;
}
selectNone = function(targetSelectId){
	var targetSelect = $(targetSelectId);
	for(var i=0; i < targetSelect.options.length; i++){
		targetSelect.options[i].selected=false;
	}
}