
function showHide(divId) {
  if (obj(divId))
    if (obj(divId).style.visibility == 'hidden') {
      obj(divId).style.visibility = 'visible';
      return true;
    } else {
      obj(divId).style.visibility = 'hidden';
      return false;
    }
}

function centerPopup(url, nome, w, h, scroll, resiz) {
  var winl = (screen.width - w) / 2;
  var wint = (screen.height - h) / 2;
  if(!resiz)
    resiz=true;
  winprops = 'height=' + h + ',width=' + w + ',top=' + wint + ',left=' + winl + ',scrollbars=' + scroll + ',resizable='+resiz+', toolbars=false, status=false, menubar=false';
  //alert (winprops);
  win = window.open(url, nome, winprops)
  if (parseInt(navigator.appVersion) >= 4) {
    win.window.focus();
  }
}

function addEvent(obj,event_name,func_name){
	if (obj.attachEvent){
		obj.attachEvent("on"+event_name, func_name);
	}else if(obj.addEventListener){
		obj.addEventListener(event_name,func_name,true);
	}else{
		obj["on"+event_name] = func_name;
	}
}

function obj(objId) {
  return document.getElementById(objId);
}

function showHideSpan(spanId) {
  if (obj(spanId))
    if (obj(spanId).style.display == 'none') {
      obj(spanId).style.display = '';
    } else {
      obj(spanId).style.display = 'none';
    }
}

// menu script
/*
var changeEachNode=true;
var subMenuParentCounter;
var actualSection="";
function getSection(){
	var selected="menuSelected";
	var unselected="menuUnselected";
	var over="menuOver";
	setOver= function(){
		this.className=over;
	}
	setOut= function(){
		this.className=this.getAttribute('oldClass');
	}
	var menuElements= obj('horiz_menu').getElementsByTagName('*');
	var counter=0;
	for (i=0; i<menuElements.length;i++){
		if (menuElements[i].getAttribute("type")=="menuvoice"){
			if (menuElements[i].id==actualSection){
				menuElements[i].className=selected+(changeEachNode ?"_"+counter:"");
				menuElements[i].onclick=function(){return false};
		}else{
				menuElements[i].className=unselected+(changeEachNode ?"_"+counter:"");
				menuElements[i].setAttribute("oldClass",menuElements[i].className)
				menuElements[i].onmouseover=setOver;
				menuElements[i].onmouseout=setOut;
			}
		counter++;
		}
	}
}

var actualSubSection="";
function getSubsection(){
  var selected="submenuSelected";
	var unselected="submenuUnselected";
	var over="submenuOver";
	setOver= function(){
		this.className=over;
	}
	setOut= function(){
		this.className=this.getAttribute('oldClass');
	}
	var menuElements= obj('horiz_submenu').getElementsByTagName('*');
	for (i=0; i<menuElements.length;i++){
		if (menuElements[i].getAttribute("type")=="submenuvoice"){
			if (menuElements[i].id==actualSubSection){
				menuElements[i].className=selected;
					menuElements[i].onclick=function(){return false};
			}
			else{
				menuElements[i].className=unselected;
				menuElements[i].onmouseover=setOver;
				menuElements[i].setAttribute("oldClass",menuElements[i].className)
				menuElements[i].onmouseout=setOut;
			}
		}
	}
}

hm_startFunction=function(){
if (actualSection && actualSection!="") getSection();
if (actualSubSection && actualSubSection!="") getSubsection();
}
addEvent(window,"load",hm_startFunction);
*/
function imgPopup (url) {
    var winl = (screen.width - 400) / 2;
    var wint = (screen.height - 400) / 2;
    var winprops = 'height=400,width=700, resizable=false,top='+wint+',left='+winl+', toolbars=false';
    win = window.open(url, 'swfPopup', winprops);
    if (parseInt(navigator.appVersion) >= 4)
      win.window.focus();
}