function goThere(url){
   window.location.href = url;
}

function objExists(objToTest) {
	if (null == objToTest) {
		return false;
	}
	if ("undefined" == typeof(objToTest) ) {
		return false;
	}
	return true;
}

function getSelectValueByName(which, name){
	var length = name.length;
	for(i=0;i<which.length;i++) {
		var tempobj=which.elements[i];
		if(tempobj.name.substring(0,length)==name) {
			return getSelectedValue(which, tempobj);
		}
	}
}

function getSelectedValue(frm, obj){
	//does the object exist
	if(objExists(obj)){
		//does the object have any sub-entities		
		if(objExists(obj[0])){
			//if it does, is it a radio select?
			if(obj[0].type && obj[0].type == 'radio'){
				for(i=0; i<obj.length; i++){
					if(obj[i].checked){
						return obj[i].value;
					}
				}
			} else if(obj.type == 'select-one'){
				return obj[obj.selectedIndex].value;
			}			
		} else {
			//the object doesn't have any sub entites, so just return its value
			return obj.value;
		}
	}
}

function applyDisplay(element, value){
    if(document.getElementById(element)){
        document.getElementById(element).style.display = value;
    }
}

function confirmMsg(msg) {
  if (!confirm(msg)) {
    return false;
  }

  return true;
}
