// JavaScript Document
String.prototype.get = function(p){
	var res = this.match(new RegExp("[?|&]?" + p + "=([^&]*)"));
	if(res)
		return res[1];
	return '';
}

String.prototype.replaceAll = function(pat, reemp){
	var idx = this.indexOf(pat);
	var str = this;
	while (idx != -1) {
		str = str.replace(pat, reemp);
		idx = str.indexOf(pat);
	}
	return str;
}
var mensaje = unescape(window.location.search.get('m').replaceAll('+', ' '));

if(mensaje != '') alert(mensaje);

Array.prototype.indexOf = function(valor){
	for(var n = 0; n < this.length; n++)
		if(this[n] == valor)
			return n;
	return -1;
}

function $(objid){
	if(typeof(objid) == 'string')
		return document.getElementById(objid);
	return objid;
}

function showMenu(obj){
	obj = $(obj);
	var opciones = obj.childNodes;
	for(var n = 0; n < opciones.length; n++)
		if(opciones[n].className == 'opcion')
			opciones[n].style.display = '';
}
function hideMenu(obj){
	obj = $(obj);
	var opciones = obj.childNodes;
	for(var n = 0; n < opciones.length; n++)
		if(opciones[n].className == 'opcion')
			opciones[n].style.display = 'none';
}

function show(obj){
	obj = $(obj);
	if(obj)
		obj.style.display = '';
}

function hide(obj){
	obj = $(obj);
	if(obj)
		obj.style.display = 'none';
}

function toggle(obj){
	obj = $(obj);
	if(obj)
		if(obj.style.display == '')
			obj.style.display = 'none';
		else
			obj.style.display = '';
}