$.fn.emptySelect = function(){
	return this.each(function(){
		if(this.tagName == 'SELECT') this.options.length = 0;		
	});	
}

$.fn.loadSelectWithArray = function(optionDataArray){
	return $(this).emptySelect().each(function(){
		if(this.tagName == 'SELECT'){
			var selectElement = this;
			$.each(optionDataArray, function(indexAA, optionData){
				if(optionData != undefined){
					var option = new Option(optionData, indexAA);
					if($.browser.msie){
						selectElement.add(option);
					}
					else{
						selectElement.add(option, null);
					}					
				}				
			});			
		}		
	});	
}