<!--

function openNewWindow(URLtoOpen, windowName, windowFeatures) { 
  newWindow=window.open(URLtoOpen, windowName, windowFeatures);
}


var docParams = new Array();
function GetParams()
{
	var query = window.location.search.substring(1);
	var parms = query.split('&');
	for (var i=0; i<parms.length; i++) {
	   var pos = parms[i].indexOf('=');
	   if (pos > 0) {
		  var key = parms[i].substring(0,pos);
		  var val = parms[i].substring(pos+1);
		  docParams[key] = val;
	   }
	}
}
GetParams();

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

MM_reloadPage(true);

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_controlSound(x, _sndObj, sndFile) { //v3.0
  var i, method = "", sndObj = eval(_sndObj);
  if (sndObj != null) {
    if (navigator.appName == 'Netscape') method = "play";
    else {
      if (window.MM_WMP == null) {
        window.MM_WMP = false;
        for(i in sndObj) if (i == "ActiveMovie") {
          window.MM_WMP = true; break;
      } }
      if (window.MM_WMP) method = "play";
      else if (sndObj.FileName) method = "run";
  } }
  if (method) eval(_sndObj+"."+method+"()");
  else window.location = sndFile;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_controlShockwave(objStr,x,cmdName,frameNum) { //v3.0
  var obj=MM_findObj(objStr);
  if (obj) eval('obj.'+cmdName+'('+((cmdName=='GotoFrame')?frameNum:'')+')');
}


function toggleVisibility(inId, inOffset)
{
	theElem = document.getElementById (inId);
	if (theElem.style.visibility == "visible")
	{
		theElem.style.visibility = "hidden";
		theElem.style.marginTop = "-1000px";
	}
	else
	{
		theElem.style.visibility = "visible";
		theElem.style.marginTop = inOffset + "px";
	}
}


function mailAntiSpam(usuario, dominio)
{
	document.write("<a href=\"mailto:" + usuario + "@" + dominio + "\">" + usuario + "@" + dominio + "</a>")
}


function scramble_a(domain,name)
{
	scramble("a", domain, name, "", "", "=");
}


function scramble(tag,domain,name,subject,params,content)
{
	if (subject==null) subject = "";
	if (params==null) params = "";
	if (content==null) content = "";
		
	var a = "@";
	var e = name;
	var g = domain;
	e += a + g;

	if (content == "=")
		content = e;

	if (subject != "")
		e += "?subject=" + subject;
		
	document.write ("<" + tag + " ");
	document.write ("href=\"mai");
	document.write ("lto:");
	document.write (e + "\" ");
	document.write (params + ">");
	
	document.write (content);

	if (tag == "a" || tag == "img")
		document.write ("</" + tag + ">");
}


function jc_select (smallfile, largefile)
{
	document.getElementById("jc_galeryfoto").src = "../galerias/jcloading.png";
	document.getElementById("jc_galeryfoto").src = largefile;
}


function setCookie(c_name,value,expiredays)
{
	var exdate = new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie = c_name+ "=" + escape(value) + ((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
} 


function getCookie(c_name)
{
	if (document.cookie.length > 0)
	{
		c_start = document.cookie.indexOf (c_name + "=")
		if (c_start!=-1)
		{
			c_start=c_start + c_name.length+1
			c_end = document.cookie.indexOf(";",c_start)
			if (c_end==-1) c_end = document.cookie.length
			return unescape(document.cookie.substring(c_start,c_end))
		} 
	}
	return null
}

// --- Slideshow stuff

var xfadeOpacity = 0;
var slideShowTimer = null;
var slideShowNextIndex = 1;
var slideShowImages = new Array();
var slideShowNextImage = new Image();
var slideShowStartTime = 0;
// configurable parameters:
var slideShowFadeBackImage = false;	// set to true if images are of different sizes; otherwise set to false
var slideShowFirstShowTime = 3000;
var slideShowNormalShowTime = 6000;
var slideShowFadeTime = 800;

function addSlideToSlideshow (inUrl)
{
	slideShowImages.push (inUrl);
}

function disorderArray()
{
	var newArray = new Array();
	for (i = 0; i < slideShowImages.length; i++)
		newArray[i] = Math.random() + "x" + i;
	newArray.sort();
	for (i = 0; i < slideShowImages.length; i++)
	{
		idx = newArray[i].substr(newArray[i].indexOf("x")+1);
		temp = slideShowImages[i];
		slideShowImages[i] = slideShowImages[idx];
		slideShowImages[idx] = temp;
	}
}

function xfadeImages()
{
	var dateObj = new Date();
	xfadeOpacity = Math.round (100 * (dateObj.getTime() - slideShowStartTime) / slideShowFadeTime);
	if (xfadeOpacity > 100)
		xfadeOpacity = 100;

	document.getElementById("slideShowImage2").style.filter = "alpha(Opacity=" + xfadeOpacity + ")";
	document.getElementById("slideShowImage2").style.opacity = xfadeOpacity/100;

	if (slideShowFadeBackImage)
	{
		document.getElementById("slideShowImage1").style.filter = "alpha(Opacity=" + (100-xfadeOpacity) + ")";
		document.getElementById("slideShowImage1").style.opacity = (100-xfadeOpacity)/100;
	}

	if (xfadeOpacity == 100)
	{
		document.getElementById("slideShowImage1").src = document.getElementById("slideShowImage2").src;
		if (slideShowFadeBackImage)
		{
			document.getElementById("slideShowImage1").style.filter = "alpha(Opacity=100)";
			document.getElementById("slideShowImage1").style.opacity = 1;
		}
		document.getElementById("slideShowImage2").style.filter = "alpha(Opacity=0)";
		document.getElementById("slideShowImage2").style.opacity = 0;
		slideShowNextImage.src = slideShowImages[slideShowNextIndex];
		slideShowTimer = setTimeout ("changeImage()", slideShowNormalShowTime);
	}
	else
		slideShowTimer = setTimeout ("xfadeImages()", 5);
}

function changeImage()
{
	document.getElementById("slideShowImage2").src = slideShowNextImage.src;
	if (!slideShowFadeBackImage)
	{
		document.getElementById("slideShowImage2").style.filter = "alpha(Opacity=0)";
		document.getElementById("slideShowImage2").style.opacity = 0;
	}

	slideShowNextIndex++;
	if (slideShowNextIndex >= slideShowImages.length)
		slideShowNextIndex = 0;
	
	var dateObj = new Date();
	slideShowStartTime = dateObj.getTime();
	xfadeOpacity = 0;
	slideShowTimer = setTimeout ("xfadeImages()", 5);
}

function initSlides(inShuffle)
{
	if (slideShowImages.length > 0)
	{
		if (inShuffle)
			disorderArray();
		slideShowNextImage.src = slideShowImages[slideShowNextIndex];
		slideShowTimer = setTimeout ('changeImage()', slideShowFirstShowTime);
	}
}

function exitSlides()
{
	if (slideShowTimer != null)
		clearTimeout (slideShowTimer);	
}

// --- End slideshow stuff

-->

