function popup(direccion, pantallacompleta, herramientas, direcciones, estado, barramenu, barrascroll, cambiatamano, ancho, alto, izquierda, arriba, sustituir){
     var opciones = "fullscreen=" + pantallacompleta +
                 ",toolbar=" + herramientas +
                 ",location=" + direcciones +
                 ",status=" + estado +
                 ",menubar=" + barramenu +
                 ",scrollbars=" + barrascroll +
                 ",resizable=" + cambiatamano +
                 ",width=" + ancho +
                 ",height=" + alto +
                 ",left=" + izquierda +
                 ",top=" + arriba;
     var ventana = window.open(direccion,"venta",opciones,sustituir);
}

/*
function popup(pagina, ancho, alto) {
	var opciones='toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, width='+ancho+', height='+alto+'';
	window.open(pagina,"",opciones);
}
*/

function login(showhide){
	if(showhide == "show"){
        document.getElementById('popupbox').style.visibility="visible"; /* If the function is called with the variable 'show', show the login box */
    }else if(showhide == "hide"){
        document.getElementById('popupbox').style.visibility="hidden"; /* If the function is called with the variable 'hide', hide the login box */
    }
}

function cerrarLogin(){	
	document.write("<a href=\"javascript:login('hide');\"><img src=\"themes/tudeparty/images/cerrar.png\" alt=\"\" width=\"16\" height=\"16\" border=\"0\"></a>");
}

//Funciones para el temporizador de la inactividad
/*
var secs
var timerID = null
var timerRunning = false
var delay = 1000

function InitializeTimer(){
    // Set the length of the timer, in seconds
    secs = 300
    StopTheClock()
    StartTheTimer()
}

function StopTheClock(){
    if(timerRunning)
        clearTimeout(timerID)
    timerRunning = false
}

function StartTheTimer(){
    if (secs==0){
        StopTheClock()
        // Here's where you put something useful that's
        // supposed to happen after the allotted time.
        // For example, you could display a message:
        //alert("analizando inactividad")
		//alert('inactividad');
		xajax_tiempoDeInactividadX();
		InitializeTimer();
    } else {
        //self.status = secs
        secs = secs - 1
        timerRunning = true
        timerID = self.setTimeout("StartTheTimer()", delay)
    }
}
//Terminan funciones para el temporizador de la inactividad

//Funciones para el temporizador del chequeo de la lista de amigos conectados
var secsAmigos
var timerIDAmigos = null
var timerRunningAmigos = false
var delayAmigos = 1000

function temporizadorAmigos(){
    // Set the length of the timer, in seconds
    secsAmigos = 60
    StopTheClockAmigos()
    StartTheTimerAmigos()
}

function StopTheClockAmigos(){
    if(timerRunningAmigos)
        clearTimeout(timerIDAmigos)
    timerRunningAmigos = false
}

function StartTheTimerAmigos(){
    if (secsAmigos==0){
        StopTheClockAmigos()

		xajax_checaConectados(false);
		temporizadorAmigos();
    } else {
        self.status = secsAmigos
        secsAmigos = secsAmigos - 1
		//alert(secsAmigos);
        timerRunningAmigos = true
        timerIDAmigos = self.setTimeout("StartTheTimerAmigos()", delayAmigos)
    }
}
*/

//Funciones agregadas el 23-12-09
//Funcion para cortar cadenas igual que wordwrap en php
String.prototype.wordWrap = function(m, b, c){
	var i, j, l, s, r;
	if(m < 1)
		return this;
	for(i = -1, l = (r = this.split("\n")).length; ++i < l; r[i] += s)
		for(s = r[i], r[i] = ""; s.length > m; r[i] += s.slice(0, j) + ((s = s.slice(j)).length ? b : ""))
			j = c == 2 || (j = s.slice(0, m + 1).match(/\S*(\s)?$/))[1] ? m : j.input.length - j[0].length
			|| c == 1 && m || j.input.length + (j = s.slice(m).match(/^\S*/)).input.length;
	return r.join("\n");
};
//Termina Funciones agregadas el 23-12-09

//Funciones agregadas el 24-12-09
//Funciones para mostrar un mensaje al posicionar el mouse sobre un vinculo
/***********************************************
* Show Hint script- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

var horizontal_offset="9px" //horizontal offset of hint box from anchor link

/////No further editting needed

var vertical_offset="0" //horizontal offset of hint box from anchor link. No need to change.
var ie=document.all
var ns6=document.getElementById&&!document.all

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1
if (whichedge=="rightedge"){
var windowedge=ie && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-30 : window.pageXOffset+window.innerWidth-40
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth+parseInt(horizontal_offset)
}
else{
var windowedge=ie && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
}
return edgeoffset
}

function showhint(menucontents, obj, e, tipwidth){
if ((ie||ns6) && document.getElementById("hintbox")){
dropmenuobj=document.getElementById("hintbox")
dropmenuobj.innerHTML=menucontents
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (tipwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=tipwidth
}
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px"
dropmenuobj.style.visibility="visible"
obj.onmouseout=hidetip
}
}

function hidetip(e){
dropmenuobj.style.visibility="hidden"
dropmenuobj.style.left="-500px"
}

function createhintbox(){
var divblock=document.createElement("div")
divblock.setAttribute("id", "hintbox")
document.body.appendChild(divblock)
}

if (window.addEventListener)
window.addEventListener("load", createhintbox, false)
else if (window.attachEvent)
window.attachEvent("onload", createhintbox)
else if (document.getElementById)
window.onload=createhintbox
//Termina Funciones agregadas el 24-12-09

//Funciones agregadas el 26-12-09
function detectarTecla(e){
	var num = e?e.keyCode:event.keyCode;
	alert('valor ascii: ' + num);
}
//Termina Funciones agradas el 26-12-09

//Funciones agregadas el 21-01-10
   function muestra_cargando(){
      xajax.dom.create("capa_actualiza","div", "cargando");
      $("#cargando").css('width', '100%');
      $("#cargando").css('height', '100%');
      $("#cargando").css('position', 'absolute');
      $("#cargando").css('top', '50%');
      $("#cargando").css('left', '50%');
      $("#cargando").css('margin-top', '-10px');
      $("#cargando").css('margin-left', '-110px');
      xajax.$('cargando').innerHTML='<img src="images/cargando.gif" alt="cargando..." width="220" height="19" border="0">';
   }

   xajax.callback.global.onResponseDelay = muestra_cargando;
   //xajax.callback.global.onComplete = oculta_cargando;
//Termina Funciones agregadas el 21-01-10