function hover(img_name,img_src) {
	document[img_name].src=img_src;
}

function base(img_name,img_src) {
	document[img_name].src=img_src;
}

function popupImage(title, image, width, height) {
	var popupWindow = window.open('/popups/image.php?title=' + title + '&image=' + image, 'popup', 'width=' + width + ',height=' + height + ',scrollbars=no,resizable=no');
	if (!popupWindow) {
			alert("A popup window has been blocked. Please set preferences to allow popup windows from www.toohiplimoservice.com.");
		}
	popupWindow.focus();
}

function ChartPopup(filename, width, height) {
    var popUp = window.open('/popups/' + filename, 'chartpopup', 'width=' + width + ',height=' + height + ',scrollbars=no,resizable=no,menubar=no,toolbar=no');
    popUp.focus();
}




function getRef(obj){
  if(typeof obj == "string") {obj= document.getElementById(obj);}
  else if (typeof obj == "object") {obj = obj;}

  return obj;
}



function toggleMenu(elementId) {
    if(getStyle(elementId, 'display') != 'block') {
        show(elementId);
    } else {
        hide(elementId);
    }
    return false;
}


function setStyle(obj, style, value){
  getRef(obj).style[style]= value;
}

function getStyle(obj, style){
  return getRef(obj).style[style];
}

function move(elem,x,y) {
  getRef(elem).style.left = x + "px";
  getRef(elem).style.top = y + "px";
}

function hide(elem)
{
  setStyle(elem,'display','none');
  setStyle(elem,'visibility','hidden');

}

function show(elem)
{
    setStyle(elem,'display','block');
    setStyle(elem,'visibility','visible');
}

function getCheckBoxValue(obj) {
	var message = '';
	for (i = 0; i < obj.length; i++) {
	    if (obj[i].checked) {
		message += obj[i].value + ', ';
	    }
	}
	
	return message;
}

 function getRadioButtonValue(obj) {
	      for (i = 0; i < obj.length; i++) {
		if (obj[i].checked) {
		    return obj[i].value;
		}
	     }
	  }

