


function msgerror()
{
	return false
}

function disable_func(e)
{
	mac=navigator.userAgent.indexOf('Mac')!=-1;
	if(document.all)
	{
		if(event.button==2||(mac&&(event.ctrlKey||event.keyCode==91)))
		{
			return(false)
		}
	}
	else
	{
		if(e.which==3||(mac&&(e.modifiers==2||e.ctrlKey)))
			{
				return false
			}
		else 
			if(e.which==1)
				{
					window.captureEvents(Event.MOUSEMOVE);
					window.onmousemove=false
				}
	}
}

function set_time()
{
	setTimeout("set_time()",300)
}


/*************************************************************/
/* Funcões para o menu do Vale do Ave	*/
/*************************************************************/
function show(id)
{
	el = document.getElementById('panel' + id);
	if (el.style.display == 'none')
	{
		el.style.display = '';
	} 
	else 
	{
		el.style.display = 'none';
	}
}


function getValue()
{
  // First, we load the URL into a variable
  var varname = "itemId";
  var url = window.location.href;

  // Next, split the url by the ?
  var qparts = url.split("?");

  // Check that there is a querystring, return "" if not
  if (qparts.length == 0)
  {
    return "";
  }

  // Then find the querystring, everything after the ?
  var query = qparts[1];

  // Split the query string into variables (separates by &s)
  var vars = query.split("&");

  // Initialize the value with "" as default
  var value = "";

  // Iterate through vars, checking each one for varname
  for (i=0;i<vars.length;i++)
  {
    // Split the variable by =, which splits name and value
    var parts = vars[i].split("=");
    
    // Check if the correct variable
    if (parts[0] == varname)
    {
      // Load value into variable
      value = parts[1];

      // End the loop
      break;
    }
  }
  
  // Convert escape code
  value = unescape(value);

  // Convert "+"s to " "s
  value.replace(/\+/g," ");

  // Return the value
  return value;
}
/*************************************************************/



/*************************************************************
	Protecção, Bloqueio do botão do lado direito do rato
/*************************************************************/
if((navigator.appName.indexOf('Internet Explorer')==-1) ||((navigator.userAgent.indexOf('MSIE')!=-1) && (document.all.length!=0)))
{
	if(document.all)
		{
			
			mac = (navigator.userAgent.indexOf('Mac') != -1);
			version = parseFloat('0'+navigator.userAgent.substr(navigator.userAgent.indexOf('MSIE')+5),10);
			if(!mac && version>4)
				{
					document.oncontextmenu=msgerror
				}
			else
				{
					document.onmousedown=disable_func;
					document.onkeydown=disable_func;
				}
		}
		else
		{
		 if(document.layers)
			{
				window.captureEvents(Event.MOUSEDOWN|Event.modifiers|Event.KEYDOWN|Event.MOUSEUP);
				window.onmousedown=disable_func;
				window.onkeydown=disable_func;
				window.onmouseup=hp_mu
			}
			else
			{
				if(document.getElementById&&!document.all)
				{
					document.oncontextmenu=msgerror;
					document.onmousedown=false
				}
			}
		}
}

if((navigator.appName.indexOf('Internet Explorer')==-1)||((navigator.userAgent.indexOf('MSIE')!=-1)&&(document.all.length!=0)))
	{
		if(document.all && (navigator.userAgent.indexOf('Opera')==-1))
			{
				set_time()
			}
	}

if(window.location.href.substring(0,4)=="file")
	window.location="about:blank";
