/*------------------------------------------------------------------------------------------
											Sistemas do Futuro 2006 
------------------------------------------------------------------------------------------*/

function hsrc_init() {
  if (!document.getElementById) return
  var imgOriginSrc;
  var imgTemp = new Array();
  var imgarr = document.getElementsByTagName('img');
  for (var i = 0; i < imgarr.length; i++) {
    if (imgarr[i].getAttribute('hsrc')) {
        imgTemp[i] = new Image();
        imgTemp[i].src = imgarr[i].getAttribute('hsrc');
        imgarr[i].onmouseover = function() {
            imgOriginSrc = this.getAttribute('src');
            this.setAttribute('src',this.getAttribute('hsrc'))
        }
        imgarr[i].onmouseout = function() {
            this.setAttribute('src',imgOriginSrc)
        }
    }
  }

  // Hover automático dos botoes.
	var splitAT = "/eitec/";
	var temp=self.location.href.split( splitAT );
	var pagina = temp[1].split(".");
	if ( pagina.length > 0 )
	{
		if ( $("b_" + pagina[0]) )
		{
			$("b_" + pagina[0]).src = "images/b_" + pagina[0] + ".gif";
		}
	}
	document.title = "Eitec 2006";
}

// GetObject
function $(o) {
	if (typeof(o) == "string")
		return document.getElementById(o)
	else
		return o;
}

// Jump
function jump( target ) {
	var link = null;
	var remote = false;

	if ( target == "ci" )
	{
		return;
	}

	switch ( target )
	{
	case "uc":
		link = "http://www.uc.pt";
		remote = true;
		break;
	case "ic":
		link = "http://www.uc.pt";
		remote = true;
		break;
	case "isq":
		link = "http://www.isq.pt";
		remote = true;
		break;
	case "sf":
		link = "http://www.sistemasfuturo.pt";
		remote = true;
		break;
	}
	
	if ( link == null )
	{
		link = target + ".html";
	}
	
	if ( remote == true )
	{
		window.open( link, "Link");
	} else {
		self.location = link;
	}
}

function abrePopup( link, width, height ) {
	newWindow(link, 'popup', width, height, 1, 1, 0, 0, 0, 1, 0); return false;
}

function newWindow(a_str_windowURL, a_str_windowName, a_int_windowWidth, a_int_windowHeight, a_bool_scrollbars, a_bool_resizable, a_bool_menubar, a_bool_toolbar, a_bool_addressbar, a_bool_statusbar, a_bool_fullscreen) {
  var int_windowLeft = (screen.width - a_int_windowWidth) / 2;
  var int_windowTop = (screen.height - a_int_windowHeight) / 2;
  var str_windowProperties = 'height=' + a_int_windowHeight + ',width=' + a_int_windowWidth + ',top=' + int_windowTop + ',left=' + int_windowLeft + ',scrollbars=' + a_bool_scrollbars + ',resizable=' + a_bool_resizable + ',menubar=' + a_bool_menubar + ',toolbar=' + a_bool_toolbar + ',location=' + a_bool_addressbar + ',statusbar=' + a_bool_statusbar + ',fullscreen=' + a_bool_fullscreen + '';
  var obj_window = window.open(a_str_windowURL, a_str_windowName, str_windowProperties)
    if (parseInt(navigator.appVersion) >= 4) {
      obj_window.window.focus();
    }
}


