Array.prototype.contains = function (elem) {
  var i;
  for (i = 0; i < this.length; i++) {
    if (this[i] == elem) {
      return true;
    }
  }

  return false;
};

function selectOptions(selectID, optionValues) {
	console.log(optionValues);
	if (document.getElementById(selectID) &&(( typeof(optionValues) == 'object' && optionValues.length > 0) || typeof(optionValues) == 'number')) {
		
		var selectel = document.getElementById(selectID);
		
		if (typeof(optionValues) == 'number') {
			for (var i=0; i < selectel.length; i++) {
				if (selectel[i].value == optionValues) {
					selectel[i].selected = true;
					break;
				}
			}
		} else {
			for (var i=0; i < selectel.length; i++) {
				if (optionValues.contains(selectel[i].value ))
					selectel[i].selected = true;
			}
		}
		
	}
}
