
/* image swap functions */
function switchMainMenu(main, src) {
   id = 'img_main_' + main;
   if (document.images && document.images[id]) {
      document.images[id].src = src;
   }
}

function switchSubMenu(sub, src) {
   id = 'img_sub_' + sub;
   if (document.images && document.images[id]) {
      document.images[id].src = src;
   }
}

/* popup functions */
var pop = null;

function popdown() {
  if (pop && !pop.closed) pop.close();
}

function popup(obj, w, h, append) {
   var url = (obj.getAttribute) ? obj.getAttribute('href') : obj.href;
   if (!url) return true;
   var args = 'width=' + w + ',height=' + h;
   if (append && append.length > 0) args += ',' + append;
   popdown();
   pop = window.open(url,'',args);
   return (pop) ? false : true;
}



function showObj(divObj) {
	if(divObj != null) {
		divObj.style.display = "block";
	}
}
function hideObj(divObj) {
	if(divObj != null) {
		divObj.style.display = "none";
	}
}

function toggle(divName) {
	var divObj = document.getElementById(divName);
	if(divObj != null) {
		if((divObj.style.display != "") && (divObj.style.display != "none")) {
			hideObj(divObj);
		} else {
			showObj(divObj);
		}
	}
}