/**
* aki ajax with overlay

*/
var strCargando='cargando...';
var navegador=navigator.appName;
var ie=document.all;
var dom=GetId;
var ns4=document.layers;
function getId(Id){
	return document.getElementById(Id);
	}
function GetId(Id){
	return document.getElementById(Id);
}
function get(Id){
	return document.getElementById(Id);
}
function putIn(id,html){
	get(id).innerHTML=html;
}
function putInVal(id, val){
	get(id).value=val;
}
function CrearObjetoAjax(){
	try {
		req = new XMLHttpRequest();
	} catch(err1) {
		try {
			req = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (err2) {
			try {
				req = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (err3) {
				req = false;
			}
		}
	}
	return req;
}


var ogoAJAX = new Array();
ogoAJAX[0]=CrearObjetoAjax();
ogoAJAX[1]=CrearObjetoAjax();
ogoAJAX[2]=CrearObjetoAjax();
ogoAJAX[3]=CrearObjetoAjax();
ogoAJAX[4]=CrearObjetoAjax();
ogoAJAX[5]=CrearObjetoAjax();
ogoAJAX[6]=CrearObjetoAjax();
ogoAJAX[7]=CrearObjetoAjax();
ogoAJAX[8]=CrearObjetoAjax();


function goAJAX(xW,xF, xP,Exec,Load,replOnStart,replOnEnd){
	if ((ogoAJAX[0].readyState==4)||(ogoAJAX[0].readyState==0)){
		goAJAXx(ogoAJAX[0],xW,xF, xP,Exec,Load,replOnStart,replOnEnd);
	}else{
		if ((ogoAJAX[1].readyState==4)||(ogoAJAX[1].readyState==0)){
			goAJAXx(ogoAJAX[1],xW,xF, xP,Exec,Load,replOnStart,replOnEnd);
		}else{
			if ((ogoAJAX[2].readyState==4)||(ogoAJAX[2].readyState==0)){
			goAJAXx(ogoAJAX[2],xW,xF, xP,Exec,Load,replOnStart,replOnEnd);
			}else{
				if ((ogoAJAX[3].readyState==4)||(ogoAJAX[3].readyState==0)){
					goAJAXx(ogoAJAX[3],xW,xF, xP,Exec,Load,replOnStart,replOnEnd);
				}else{
					if ((ogoAJAX[4].readyState==4)||(ogoAJAX[4].readyState==0)){
							goAJAXx(ogoAJAX[4],xW,xF, xP,Exec,Load,replOnStart,replOnEnd);
					}else{
						if ((ogoAJAX[5].readyState==4)||(ogoAJAX[5].readyState==0)){
							goAJAXx(ogoAJAX[5],xW,xF, xP,Exec,Load,replOnStart,replOnEnd);
						}else{
							if ((ogoAJAX[6].readyState==4)||(ogoAJAX[6].readyState==0)){
								goAJAXx(ogoAJAX[6],xW,xF, xP,Exec,Load,replOnStart,replOnEnd);	
							}else{
								if ((ogoAJAX[7].readyState==4)||(ogoAJAX[7].readyState==0)){
									goAJAXx(ogoAJAX[7],xW,xF, xP,Exec,Load,replOnStart,replOnEnd);
								}else{
								goAJAXx(ogoAJAX[8],xW,xF, xP,Exec,Load,replOnStart,replOnEnd);	
								}
							}
						}	
					}
				}
			}
		}
	}
}

function goAJAXx(ogoAJAXx,xW2,xF2, xP2,Exec,Load,replOnStart,replOnEnd){
	var L=Load;
	if ((L=='')||(!isDefined(L))){		
		L='<br />'+strCargando;
	} else {
		L='Cargando...';
	}
	if(navegador!='Netscape'){
		ogoAJAXx.open('post',xF2,true);
		}
	ogoAJAXx.onreadystatechange = 	function (){
			//alert(xW2);
//			alert(navegador);
			if (ogoAJAXx.readyState == '1'){
				if(((!isDefined(replOnStart))||(replOnStart==''))&& xW2!='' && xW2!=null){
					GetId(xW2).innerHTML=L;
				}
			}else if (ogoAJAXx.readyState == '4'){
				var respuesta=ogoAJAXx.responseText;
				if(((replOnEnd=='')||(!isDefined(replOnEnd)))&& xW2!=''&& xW2!=null && isDefined(xW2)){
					try{GetId(xW2).innerHTML=(respuesta);}catch(e){/*alert(e+navegador);*/}
				}
	
				eval(Exec);
	
			}
		}
	if(navegador=='Netscape'){
		ogoAJAXx.open('post',xF2,true);
		}
	//ogoAJAXx.open('post',xF2,true);
	ogoAJAXx.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	var http = xP2;
	ogoAJAXx.send(http);

}
function isDefined(variable)
{
	return (!(!( variable||false )))
}
function strlen(strVar)
{
	return(strVar.length)
}

function winajax(tit,w,h,f,p,Exec,Load){/*Function winajax and goAJAX under LGPL Licence*/
	GetId('btnCerrarVtna').style.display='';
	var oVtna = GetId("sVentana");
	GetId("TitVna").innerHTML=tit;
	oVtna.style.width=w+'px';
	oVtna.style.height=h+'px';
	//centet top window
	centerDivWindow('sVentana');
	showOverlay();

	goAJAX('ContentVentana',f,p,Exec,Load);
}
function truebody(){
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function ocultarVtna(){
	hideOverlay();
}
//fin goajax

function str_replace(search, replace, subject) {
	return subject.split(search).join(replace);
}
function akiSfrm(frm){
	o = document.forms[frm].elements[0];
	var xP=o.name+'='+escape(o.value);
	var sxP=o.name+'='+escape(o.value);
	for (i=1; i<document.forms[frm].elements.length; i++) {
		ob = document.forms[frm].elements[i];
		if (ob.checked){
		xP = xP + '&' + ob.name + '=' + 'ok'+escape(ob.value);
			sxP = sxP + '\n > ' + ob.name + '=' + 'ok'+escape(ob.value);
		}else{
			xP = xP + '&' + ob.name + '=' + escape(ob.value);
			sxP = sxP + '\n > ' + ob.name + '=' + escape(ob.value);
		}
	}
	//alert(sxP);
	return xP;
}

function centerDivWindow(WindowId){
	var iebody=(document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body
	var dsocleft=document.all? iebody.scrollLeft : pageXOffset
	var dsoctop=document.all? iebody.scrollTop : pageYOffset
	oVtna = GetId(WindowId);
	oVtna.style.position="absolute";
	var vh=str_replace('px','',oVtna.style.height);
	var vw=str_replace('px','',oVtna.style.width);
	var theTop =(((iebody.clientHeight/2)+dsoctop)-((vh/2)));
	if(theTop<1){theTop='100';}
	oVtna.style.top = (theTop /2) + 'px';
	oVtna.style.left=((((iebody.clientWidth/2)+dsocleft)-((vw/2)))/2 ) +'px';
	//alert(oVtna.style.top + ' - ' + oVtna.style.left);
}


function akShowHide(div){
	if (get(div).style.display==''){
		get(div).style.display='none';
	}else{
		get(div).style.display='';
	}
	return false;
}

function importJs(src){
  var scriptElem = document.createElement('script');
  scriptElem.setAttribute('src',src);
  scriptElem.setAttribute('type','text/javascript');
  document.getElementsByTagName('head')[0].appendChild(scriptElem);
}



function isLogged(){
	showMiniDash();
}
function initFicha(id){
	goAJAX('visitasviews','ajax.php','control=ficha.visita&id='+id);
	}
function bajarElink(i){
	goAJAX("descargascontar",'ajax.php', 'control=bajarElink&i='+i);	
	}
function verVideo(i){
	winajax('Video','100','360','ajax.php','control=video&i='+i,'','');
	}
function priorizarDescarga(i){
	goAJAX("Priorizar",'ajax.php', 'control=priorizarDescarga&i='+i);	
		}

function FichaAlta(){
	winajax('Agregar Ficha','600','1200','ajax/fichaAlta.php','');
	}
	
function buscarFichas(str){
	var destino='b-descargar-' + escape(str) + '-1-1.xml';
	document.location.href=destino;
	return false;
	}
function mostrarOcular(id){
	ob=get(id).style;
	if(ob.display=='none'){
			ob.display='';
			}else{	
				ob.display='none';
				}
	return false;
	}
function subcripcion(){
	goAJAX('subscipcion','ajax.php','control=subcripcion');
	}

	var waoOM_ocupado='1';
function waoOcultarMostrar(claseCSS,id_a_mostrar){
	if(waoOM_ocupado=='1'){
		waoOM_ocupado='0';
	var misO=$$(claseCSS);
		for (i=0;i<misO.length;i++){
			new Effect.BlindUp((misO[i]).id, {duration: 0.1});			
		}
		setTimeout("new Effect.BlindDown('" + id_a_mostrar + "', { duration: 0.5 });setTimeout(\"waoOM_ocupado='1';\",500);",200);
	}else{
		return false;
		}
}
var ResizingTextArea = Class.create();
 
ResizingTextArea.prototype = {
    defaultRows: 1,
    initialize: function(field)
    {
        this.defaultRows = Math.max(field.rows, 1);
        this.resizeNeeded = this.resizeNeeded.bindAsEventListener(this);
        Event.observe(field, "click", this.resizeNeeded);
        Event.observe(field, "keyup", this.resizeNeeded);
    },
 
    resizeNeeded: function(event)
    {
        var t = Event.element(event);
        var lines = t.value.split('\n');
        var newRows = lines.length + 1;
        var oldRows = t.rows;
        for (var i = 0; i < lines.length; i++)
        {
            var line = lines[i];
            if (line.length >= t.cols) newRows += Math.floor(line.length / t.cols);
        }
        if (newRows > t.rows) t.rows = newRows;
        if (newRows < t.rows) t.rows = Math.max(this.defaultRows, newRows);
    }
}
function graciasUser(idG){
	goAJAX('graciasUser','ajax.php','control=graciasUser&idg='+idG);
	}
function mOvr(src,clrIn) {//on mouse in
	src.style.cursor = 'hand';
	src.bgColor = clrIn;	
	}
function mOut(src,clrIn) {// on mouse out
	src.style.cursor = 'default';
	src.bgColor = clrIn;
	}
function mClk(src) {//on click
	//src.bgColor = "#ffcc99";
	}
	
	
/*fichamini*************************************************************************************/
function fichamini_initTooltips(id,title){
	$('fichita'+id).style.display='none';
	new Tip('fichita_lnk'+id, $('fichita'+id),{
	style: 'darkgrey',
	title: title,
	hideOthers: true,
	radius:3,
	border:3,
	width: 'auto'
	});
}

function fichamini_initTooltips2(id,title){
	$('fichita'+id).style.display='none';
	new Tip('fichita_lnk'+id, $('fichita'+id),{
	border: 2,
    style: 'protogrey',
	borderColor: '#444',
	backgroundColor:'#FFF',
	titleBackgroundColor:'#444',
	title: title,
	stem: 'leftMiddle',
	hook: { target: 'bottomMiddle', tip: 'leftMiddle',mouse: true },
	offset: { x: 50, y: 0 }, 
	radius:3,
	width: 320
	});
}

function fichamini_initTooltipsTop(id,title,img){
	$('fichitaImgTOP'+id).innerHTML='<img src="'+img+'" width="170" height="auto" class="MiniF_Imagen"/>';
	$('fichita'+id).style.display='none';
	new Tip('fichita_lnk'+id, $('fichita'+id),{
	border: 2,
    style: 'protogrey',
	borderColor: '#444',
	backgroundColor:'#FFF',
	titleBackgroundColor:'#444',
	title: title,
	stem: 'leftMiddle',
	hook: { target: 'bottomMiddle', tip: 'leftMiddle',mouse: true },
	offset: { x: 50, y: 0 }, 
	radius:3,
	width: 320
	});
}

/*fichamini*************************************************************************************/

var loading1='<p>&nbsp;</p>Cargando...<p>&nbsp;</p>';
var loading2='Cargando...';
function showMiniDash(){
	goAJAX('sLogin','webkit/ajax/controller.php', 'c=showMiniDash','',loading2);
}

function isLogged(){
//	new Effect.Fade('Ventana550',{duration:0.3});
//	new Effect.Fade('sOverlay',{duration:0.8});
	showMiniDash();

}

function irAW(n){
	var web= new Array();
	web[0]='bajandopeliculas' + '.com';
	web[1]='peliculasem' + '.com';
	web[2]='peliculasdd' + '.com';
	web[3]='peliculas2' + '.com';
	web[4]='dpeliculas' + '.com';
	web[5]='emuleya' + '.com';
	web[6]='bajandoseries' + '.com';
	web[7]='emulemundo' + '.com';
	web[8]='forosfx' + '.com';
	web[9]='series-anime' + '.com';
	web[10]='mp3afull' + '.com';
	web[11]='condd' + '.com';
	web[12]='masestrenos' + '.com';
	web[13]='emuseries' + '.com';
	web[14]='seriesdd' + '.com';
	web[15]='centralp2p' + '.com';
	web[16]='estrenosbittorrent' + '.com';
	web[17]='nacionjuegos' + '.com';
	web[18]='maslatinos' + '.com';
	web[19]='peliculastt' + '.com';
	web[20]='contorrent' + '.com';
	web[21]='seriestt' + '.com';
	web[22]='conemule' + '.com';
	web[23]='peliculasonline2' + '.com';
	web[24]='subtituladas' + '.com';
//	web[25]='peliculasonline2' + '.com';
	
		document.location.href='http' + '://' + 'www.' + web[n];
	return false;
}
function irareg(n,webid){
	var web= new Array();
		web[22]='perfilunico' + '.com' + '/registro.central.php?Web='+ webid;
		document.location.href='http' + '://' + 'www.' + web[n];
	return false;
}



// JavaScript Document
 function validarEmail(valor) {
  if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor)){
   return (true)
  } else {
   alert("La dirección de email es incorrecta.");
   return (false);
  }
 }
function sendContactF(){
		if(
		   (GetId('frmContactF').Nombre.value=='')||
		   (GetId('frmContactF').Email.value=='')||
		   (GetId('frmContactF').Mensaje.value=='')
		   ){
			alert('Por favor complete todos los campos.');
			}else{
				if (validarEmail(GetId('frmContactF').Email.value)){
					var xP=akiSfrm('frmContactF');
					goAJAX('ContactF','ajax/contact.form.php', xP);
				}
				}
		}
function showContactF(){
		winajax('Cont&aacute;ctenos:','400','400','ajax.php','control=contact.form');
		}
		
function OcultarVtna(){
	var objDiv = GetId("sOverlay");
	objDiv.style.display = "none";
	var objDiv = GetId("sVentana");
	objDiv.style.display = "none";
}

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.toUTCString());
}

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

function checkCookie(usuario){
	username=getCookie('arbolito');
	if (username!=null && username!=""){
	    setCookie('arbolito','click',1); //volvemos a setera la cookie si sigue navegando 
  		return true;
	}else{
		return false;	
	}
}


function iecompattest(){
return (document.compatMode && document.compatMode!='BackCompat')? document.documentElement : document.body
}	
function posicionar(){
	var startX = document.body.clientWidth - document.body.scrollLeft - 200; // Tamaño horizontal de la barra en pixeles
	var startY = 30; // Tamaño vertical de la barra en pixeles   
	var verticalpos='frombottom' // 'fromtop' o 'frombottom' para definir si va arriba o abajo.
	barheight=GetId('Arbolito').offsetHeight
	var ns = (navigator.appName.indexOf('Netscape') != -1) || window.opera;
	var d = document;
	function ml(id){
		var el=d.getElementById(id);
		el.style.visibility='visible'
		if(d.layers){el.style=el;}
		el.sP=function(x,y){this.style.left=x+'px';this.style.top=y+'px';};
		el.x = startX;
		if (verticalpos=='fromtop'){
			el.y = startY;
		}else{
			el.y = ns ? pageYOffset + innerHeight : iecompattest().scrollTop + iecompattest().clientHeight;
			el.y -= startY;
		}
		return el;
	}
	window.stayTopLeft=function(){
		if (verticalpos=='fromtop'){
			var pY = ns ? pageYOffset : iecompattest().scrollTop;
			ftlObj.y += (pY + startY - ftlObj.y)/20;
		}else{
			var pY = ns ? pageYOffset + innerHeight - barheight: iecompattest().scrollTop + iecompattest().clientHeight - barheight;
			ftlObj.y += (pY - startY - ftlObj.y)/20;
		}
		ftlObj.sP(ftlObj.x, ftlObj.y);
		setTimeout('stayTopLeft()', 1);
	}
	ftlObj = ml('Arbolito');
	stayTopLeft();
	if(checkCookie('click')){
	  GetId('Arbolito').style.visibility = 'hidden';
      GetId('contenarbolito').style.display = '';
	}else{
		 GetId('contenarbolito').style.display = 'none';
	}
}	

function cerrarPopup(pid){
      GetId(pid).style.visibility = 'hidden';    
	  setCookie('arbolito','click',1);  
      GetId('contenarbolito').style.display = '';
}



function abrirPopupComments(params){
	 window.open("http://bajandome.com/?logic=comments" + params, "", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, width=690, height=550, top=85, left=140");
}

// JavaScript Document

function strlen (string) {
    var str = string+'';
    var i = 0, chr = '', lgth = 0;
 
    var getWholeChar = function (str, i) {
        var code = str.charCodeAt(i);
        var next = '', prev = '';
        if (0xD800 <= code && code <= 0xDBFF) { // High surrogate (could change last hex to 0xDB7F to treat high private surrogates as single characters)
            if (str.length <= (i+1))  {
                throw 'High surrogate without following low surrogate';
            }
            next = str.charCodeAt(i+1);
            if (0xDC00 > next || next > 0xDFFF) {
                throw 'High surrogate without following low surrogate';
            }
            return str.charAt(i)+str.charAt(i+1);
        } else if (0xDC00 <= code && code <= 0xDFFF) { // Low surrogate
            if (i === 0) {
                throw 'Low surrogate without preceding high surrogate';
            }
            prev = str.charCodeAt(i-1);
            if (0xD800 > prev || prev > 0xDBFF) { //(could change last hex to 0xDB7F to treat high private surrogates as single characters)
                throw 'Low surrogate without preceding high surrogate';
            }
            return false; // We can pass over low surrogates now as the second component in a pair which we have already processed
        }
        return str.charAt(i);
    };
 
    for (i=0, lgth=0; i < str.length; i++) {
        if ((chr = getWholeChar(str, i)) === false) {
            continue;
        } // Adapt this line at the top of any loop, passing in the whole string and the current iteration and returning a variable to represent the individual character; purpose is to treat the first part of a surrogate pair as the whole character and then ignore the second part
        lgth++;
    }
    return lgth;
}


///////////////////////////////////////////// Agrandara el tamaño del texarea sin dejar mostrar el barra 

// http://jroller.com/rmcmahon/entry/resizingtextarea_with_prototype
// Usage: <% apply_behaviour "textarea", "new ResizingTextArea(this);" %>
 
var ResizingTextArea = Class.create();
 
ResizingTextArea.prototype = {
    defaultRows: 1,
    initialize: function(field)
    {
        this.defaultRows = Math.max(field.rows, 1);
        this.resizeNeeded = this.resizeNeeded.bindAsEventListener(this);
        Event.observe(field, "click", this.resizeNeeded);
        Event.observe(field, "keyup", this.resizeNeeded);
    },
 
    resizeNeeded: function(event)
    {
        var t = Event.element(event);
        var lines = t.value.split('\n');
        var newRows = lines.length + 1;
        var oldRows = t.rows;
        for (var i = 0; i < lines.length; i++)
        {
            var line = lines[i];
            if (line.length >= t.cols) newRows += Math.floor(line.length / t.cols);
        }
        if (newRows > t.rows) t.rows = newRows;
        if (newRows < t.rows) t.rows = Math.max(this.defaultRows, newRows);
    }
}


function activarCampo(id){
	get(id).disabled="";
	}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function tablonAjax(id_web,id_cosa,tipohilo,cache_general,tituloContent){
	var con='control=tablon/textmensajeAjax&id_web='+id_web+'&id_cosa='+id_cosa+'&tipohilo='+tipohilo+'&cache_general='+cache_general+'&tituloContent='+tituloContent;
	goAJAX('tablon','ajax.php',con,'','');
}


function showMensajes(id_web,id_cosa,tipohilo,cache_general,tituloContent){
	var con='control=tablon/textmensaje&id_web='+id_web+'&id_cosa='+id_cosa+'&tipohilo='+tipohilo+'&cache_general='+cache_general+'&tituloContent='+tituloContent;
	var adm='control=tablon/administrar&id_web='+id_web+'&id_cosa='+id_cosa+'&tipohilo='+tipohilo+'&cache_general='+cache_general+'&tituloContent='+tituloContent;
	goAJAX('mensaje','ajax.php',con,'','');
	goAJAX('adminis','ajax.php',adm,'','');
}
	
function showRespuesta(id,id_web,id_cosa,tipohilo){
	var con='control=tablon/textrespuesta&id_web='+id_web+'&id_cosa='+id_cosa+'&tipohilo='+tipohilo+'&idmensaje='+id;
	Effect.BlindUp('linkresponder'+id, { duration: 0.5 });
	Effect.Appear('respuesta'+id, { duration: 1.5 }); 
	goAJAX('respuesta'+id,'ajax.php',con,'','');
	new Effect.ScrollTo('respuesta'+id, {duration: 0.9,offset: -90});
}
function showListaRespuesta(id){
	Effect.BlindDown('ListaRespuesta'+id, { duration: 0.5 });
	get('mostrar_respuestas'+id).style.display='none';
	}
function postComment(frm){
	var url=document.URL;
	var xP = akiSfrm(frm)+'&control=tablon/guardarmensaje&url='+url;
	goAJAX('ultimoMensaje','ajax.php',xP,'Effect.BlindUp(\'areadeltexto\', { duration: 0.5 });Effect.BlindDown(\'ultimoMensaje\', { duration: 0.9 });');
	return false;
	}
function postRespuesta(frm,id){
	var url=document.URL;
	var xP = akiSfrm(frm)+'&control=tablon/guardarRespuesta&url='+url;
	goAJAX('respuesta'+id,'ajax.php',xP,'Effect.BlindUp(\'areadeltexto'+id+'\', { duration: 1.0 });Effect.BlindDown(\'ultimoMensaje\', { duration: 1.9 });');
	return false;
	}
function contarcaracteres(area){
	var str=document.getElementById(area).value;
	var cuantoshay=strlen(str);
	//alert(cuantos);
	var cuantos=800-cuantoshay;
	if(cuantoshay>10){
		get('button').disabled='';
		} else{get('button').disabled='disabled';}
	GetId('Rcarateres').innerHTML=cuantos;
	}
function contarcaracteresRespuesta(area,id){
	var str=document.getElementById(area).value;
	var cuantoshay=strlen(str);
	//alert(cuantos);
	var cuantos=800-cuantoshay;
	if(cuantoshay>10){
		get('button'+id).disabled='';
		} else{get('button'+id).disabled='disabled';}
	GetId('Rcarateres'+id).innerHTML=cuantos;
	}	
function administrar(id,tipo){
	var xP ='&control=tablon/AdministrarHilo&id='+id+'&tipo='+tipo;
		goAJAX('tablon','ajax.php',xP,'');
	}

function Editarmensaje(id){
	document.getElementById('textoEditar'+id).readOnly=false;
	get('okt'+id).style.display="none";
	document.getElementById('textoEditar'+id).style.backgroundColor="#FFF";
}
function saveValtitulocolecc(obj){
	/* desactivamos el campo */
	get(obj.id).disabled="disabled";
	get(obj.id).style.bgcolor="#FFFFFF";
	var id = str_replace('textoEditar','',obj.id);
	/* construimos los parametros de la solicitud ajax */
	/* No se recomienda pasar la tabla como parametro en una web publica */
	var xP = 'name=' + obj.name;
	xP += '&value=' + obj.value;
	xP += '&id=' + id;
	xP += '&control=tablon/GuardartextoEditado';
	/* hacemos la solicitud ajax pero sin reemplazar ni al inicio ni al final,
	tambien llamamos a una funcion para reactivar el campo */
	var exec = 'activarCampo(\'' + obj.id + '\')';
	goAJAX('okt'+id,'ajax.php',xP,exec,'','0','0');
	get('okt'+id).style.display="";
	showSaved('okt'+id);
	document.getElementById('textoEditar'+id).readOnly=true;
	document.getElementById('textoEditar'+id).style.backgroundColor="#BBB";
}
function showSaved(val){
	$(val).style.display='';
	new Effect.Pulsate($(val),{direction: 'top-left'});
	setTimeout("new Effect.Fade($(val),{direction: 'top-left'});",2000);
	}

function borrarMensaje(id,idh){
	var confirmMsg  = ' Esta por Borrar Un Mensaje...\n Esta seguro? ';
	var	ID ='id='+id+'&control=tablon/Borrarmensaje&id_hilo='+idh;
	if (confirmMsg == '' || typeof(window.opera) != 'undefined') {
        return true;
	    }
    var is_confirmed = confirm(confirmMsg + ' \n   ');
    if (is_confirmed){
		
		Effect.BlindUp('mensaje'+id, { duration: 0.7 });
		//get('mensaje'+id).style.display="none";	
		goAJAX('','ajax.php',ID);
	}
}
function BanearUser(user,id){
	var usr='control=tablon/banearUser&user='+user;
	goAJAX('','ajax.php',usr,'','');
	var xP ='&control=tablon/AdministrarHilo&id='+id;
	goAJAX('tablon','ajax.php',xP,'');
}

function suscribsion(id_cosa,tipo,idM){
	var usr='control=tablon/suscribsion&id_cosa='+id_cosa+'&tipo='+tipo;
	goAJAX('notificacion'+id_cosa+tipo+idM,'ajax.php',usr,'');
	}
function enviarmail(){
	var xP ='&control=tablon/enviarmail';
	goAJAX('tablon','ajax.php',xP,'');
	}
function mostrarOcularEfecto(id){
ob=get(id).style;
if(ob.display=='none'){
		Effect.Appear(id, { duration: 2.0 });
		}else{	
			new Effect.BlindUp(id, {duration: 1.0});		
			}
return false;
}
