<!--

String.prototype.trim = function () { return this.replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1"); }

/***************************************/

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;
	   }
	}
}

/***************************************/

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 + ">");
}

/***************************************/

var thePreloadImageUrls = new Array();
var thePreloadImages = new Array();

function addPreloadImage (inImageUrl)
{
	thePreloadImageUrls.push (inImageUrl);
}

function preloadImages()
{
	for (i = 0; i < thePreloadImageUrls.length; i++)
	{
		thePreloadImages[i] = new Image;
		thePreloadImages[i].src = thePreloadImageUrls[i];
	}
}

function clearPreloadImages()
{
	thePreloadImageUrls = new Array();
	thePreloadImages = new Array();
}

/***************************************/

function toggleVisibility (inId)
{
	obj = document.getElementById (inId);
	if (obj)
		obj.style.display = (obj.style.display == "block") ? "none" : "block";
}

function hideElement (inId)
{
	obj = document.getElementById (inId);
	if (obj)
		obj.style.display = "none";
}

function showElement (inId)
{
	obj = document.getElementById (inId);
	if (obj)
		obj.style.display = "block";
}

/***************************************/

function getPopupValue (id, _default)
{
	obj = document.getElementById(id);
	if (!obj || obj.selectedIndex <= 0)
		value = _default;
	else
		value = obj.options[obj.selectedIndex].value;
	return value;
}

function selectOption (id, inValue)
{
	obj = document.getElementById (id);
	if (obj)
	{
		for (i = 0; i < obj.options.length; i++)
		{
			if (obj.options[i].value == inValue)
			{
				obj.options[i].selected = true;
				break;
			}
		}
	}
}

/***************************************/

// bibicocotorro.com specific

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

function alertContextMenu()
{
/*
	if (lang == "es")
		alert ("");
	else
		alert ();
*/
	return false;
}

/***************************************/
-->