function mostrarFiltros(){
	new Effect.SlideDown('filtrosSelec');$('filtrosSelected').style.display='none';
	return false;
}
/*contactform.js*************************************************************************/
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 sendContactFWanted(){
if(
   (GetId('frmContactF').Nombre.value=='')||
   (GetId('frmContactF').Email.value=='')||
   ((GetId('frmContactF').mod.value=='0')&&(GetId('frmContactF').upl.value=='0'))
   ){
alert('Por favor complete todos los campos.');
}else{
if (validarEmail(GetId('frmContactF').Email.value)){
var xP=akiSfrm('frmContactF');
goAJAX('ContactF','ajax/contact.form.wanted.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";
}
/*contact.form.js*************************************************************************/
/*tooltips.js****************************************************************************/
function tooltipsSync(div,id,data,titleTips,styleTips){
	if(!isDefined($(div+id).prototip)){
		new Tip(div+id, {
			showOn: 'click',
			title : titleTips,
			ajax: {
			url: 'ajax.php?gear=sincronizacion/reporte&id='+id+'&'+data+styleTips,
			options: {
				onComplete: function(transport) {
					}
				}
			},
			hideOn: { element: 'closeButton', event: 'click' },
			width: 'auto',
			hook: { target: 'bottomMiddle', tip: 'topMiddle' },
			stem: 'topMiddle',
			style: styleTips,
			offset: { x: 0, y: 0 }
		}); 
	}
}
function tooltipsSyncColabora(div,id,data,titleTips,styleTips){
	if(!isDefined($(div+id).prototip)){	
		new Tip(div+id, {
			showOn: 'click',
			title : titleTips,
			ajax: {
				url: 'ajax.php?gear=sincronizacion/colaborar&id='+id+'&'+data+styleTips,
				options: {
					onComplete: function(transport) {
				}
			}
		},
		hideOn: { element: 'closeButton', event: 'click' },
		width: 'auto',
		hook: { target: 'bottomMiddle', tip: 'topLeft' },
		stem: 'topLeft',
		style: styleTips,
		offset: { x: 0, y: 5 }
		}); 	
	}
}
/*tooltips.js****************************************************************************/
/*funcNico.js****************************************************************************/
function Help(section) {
q = window.open('index.php?mod=help&section='+section, 'Help', 'scrollbars=1,resizable=1,width=450,height=400');
}
function ShowOrHide(d1, d2) {
if (d1 != '') DoDiv(d1);
if (d2 != '') DoDiv(d2);
}
function DoDiv(id) {
var item = null;
if (document.getElementById) {
item = document.getElementById(id);
} else if (document.all){
item = document.all[id];
} else if (document.layers){
item = document.layers[id];
}
if (!item) {
}else if (item.style) {
if (item.style.display == "none"){ item.style.display = ""; }
else {item.style.display = "none"; }
}else{ item.visibility = "show"; }
}
function getObject(obj) {
var theObj;
if(document.all) {
if(typeof obj=="string") {
return document.all(obj);
} else {
return obj.style;
}
}
if(document.getElementById) {
if(typeof obj=="string") {
return document.getElementById(obj);
} else {
return obj.style;
}
}
return null;
}
function Contar(entrada,salida,texto,caracteres) {
var entradaObj=getObject(entrada);
var salidaObj=getObject(salida);
var longitud=caracteres - entradaObj.value.length;
if(longitud <= 0) {
longitud=0;
texto='<span class="disable"> '+texto+' </span>';
entradaObj.value=entradaObj.value.substr(0,caracteres);
}
salidaObj.innerHTML = texto.replace("{CHAR}",longitud);
}
/*funcNico.js****************************************************************************/
/*func.js********************************************************************************/
function createSortable(theId, theClass){
var clases=new Array(theClass);
Sortable.create(theId,{tag:"div",hoverclass:"hoverSortable",constraint: false,dropOnEmpty:true,
    onChange:function(){
var order=Sortable.serialize(theId);
$('debug').innerHTML='<strong>'+theId+' </strong>'+order;
}
});
}
function createDroppable(theId,theClass,logic){
Droppables.add(theId, {
accept: theClass,
hoverclass:"hoverSortable",
onDrop: function(element) {
    $('debug2').innerHTML=element.id;
   droppableReact(element.id,theId,logic);
  }
});
}
function droppableReact(id1,id2,logic){
 width = defecto(logic, 'foro', true);
 $('debug2').innerHTML=id1+'-'+id2;
 goAJAX('','foro.admin.ajax.php','acc=move&logic='+logic+'&id1='+id1+'&id2='+id2,'','','0','0');
 $(id1).remove();
}
var win;
function showSysWindow(winName,winTitle,winDivId,File,w,h){
if(!isDefined(get(winName))){
win = new Window({id: winName, className: "mac_os_x", title: winTitle, width:w, height:h, wiredDrag: true,showEffectOptions:{duration:'0.0'},hideEffectOptions:{duration:'0.0'},recenterAuto:true});
win.setDestroyOnClose(); 
win.showCenter();
win.toFront();
win.setHTMLContent('<div class="winContent"><div id="'+winDivId+'"></div></div>');
  goAJAX(winDivId,File,'');
}else{
get(winName).toFront;
}
}
function showWin(href,title,w,h,winDivId,winTitle){
if(!isDefined(w)||(w=='')){w=600;}
if(!isDefined(h)||(h=='')){h=400;}
if(!isDefined(winDivId)||(winDivId=='')){
var winDivId='div'+str_replace(' ','',title);
}
if(!isDefined(winTitle)||(winTitle=='')){
var winTitle='win'+str_replace(' ','',title);
}
href=href+'&hwnd='+Math.floor(Math.random( ) * 999 - 2) + 1;
showSysWindow(winTitle,title,winDivId,href,w,h);
return false;
}
function showEditF(id,width,height){
width = defecto(width, 500, true);
height = defecto(height, 340, true);
showWin('foro.edit.ajax.php?logic=foro&id='+id,'Editar Foro',width,height,'ajaxEditF'+id,'winEditF'+id);
return false;
}
function showEditT(id,width,height){
width = defecto(width, 500, true);
height = defecto(height, 340, true);
showWin('foro.edit.ajax.php?logic=tema&id='+id,'Editar Tema',width,height,'ajaxEditT'+id,'winEditT'+id);
return false;
}
function defecto(valor, defecto, quiero_null){
quiero_null = quiero_null || false;
    if (quiero_null){
        valor = (typeof valor == 'undefined') ? defecto : valor;
    }else{
        valor = valor || defecto;
    }
    return valor;
}
function showDeleteF(id,titulo){
if(confirm("¿Desea eliminar el foro: " + titulo + "?")){
if(! confirm("¿Desea mover los subforos y temas a otro foro existente")){
document.location.href = "foro.admin.ajax.php?acc=delete&logic=foro&forum_id=" + id;
}
}
return false;
}
function showDeleteT(id,titulo){
if(confirm("¿Desea eliminar el tema: " + titulo + "?")){
document.location.href = "foro.admin.ajax.php?acc=delete&logic=tema&tema_id=" + id;
}
return false;
}
function createTip(element,content){
new Tip(element, content,{
style: 'azulblanco',
stem: 'topLeft',
hook: { tip: 'topLeft', mouse: true },
offset: { x: 2, y: 2 }  , 
closeButton: false,
showOn: 'click',
hideOthers: true,
hideOn: false,
fixed:true,
width:90,
hideAfter:1
});
}
function createTipInfo(element,content,widthX){
new Tip(element, content,{
style: 'protoblue',
stem: 'topLeft',
hook: { tip: 'topLeft', mouse: true },
offset: { x: 2, y: 2 }  , 
closeButton: false,
showOn: 'click',
hideOthers: true,
hideOn: false,
fixed:true,
width:widthX,
hideAfter:1
});
}
function createTipBlack(element,content,widthX, ofX, ofY){
new Tip(element, content,{
style: 'azulblanco',
stem: 'topMiddle',
hook: { tip: 'topMiddle', mouse: false },
offset: { x: ofX, y: ofY }  , 
closeButton: false,
showOn: 'click',
hideOthers: true,
hideOn: false,
fixed:true,
width:widthX,
hideAfter:1
});
}

/*suscribcion.js********************************************************************************/
/*ficha2****************************************************************************************/
function mostrarOcultar(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;
	}
}
function mostrarOcultarEfecto(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;
}
function graciasUser(idG){
	goAJAX('graciasUser','ajax.php','control=graciasUser&idg='+idG);
}
/*ficha2****************************************************************************************/
/*tablon.js*************************************************************************************/
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) { 
            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="";
}
/*tablon.js*************************************************************************************/
/*fichaFull*************************************************************************************/
function fichafull_reportTrailer(trailer_id, type){
	goAJAX('comment','ajax.php','gearAbsolute=gears/common/dwd/reportTrailer.php&html_id=' + trailer_id + '&type=' + type,'document.getElementById(\'opcionesTrailer'+trailer_id+'\').innerHTML = \'\';document.getElementById(\'opcionesTrailer'+trailer_id+'\').style.display=\'none\';','','0','0');
	return false;
}

function fichafull_verMasOpciones(dir){
	if(dir){
	document.getElementById('moreOptions').style.display = 'block';
	document.getElementById('btn_more').className = 'btn_min';
	document.getElementById('btn_more').innerHTML = '<div class="txt"><a href="#" onclick="fichafull_verMasOpciones(false);return false;">Ocultar opciones</a></div>';
	}else{
	document.getElementById('moreOptions').style.display = 'none';
	document.getElementById('btn_more').className = 'btn_more';
	document.getElementById('btn_more').innerHTML = '<div class="txt"><a href="#" onclick="fichafull_verMasOpciones(true);return false;">M&aacute;s opciones</a></div>';
	}
}
function MostrarTrailer(id){
	$('trailer'+id).style.display='none';
	new Tip('Botontrailer', $('trailer'+id), {
	style: 'azulblanco',
	title: "Trailer",
	stem: 'topMiddle',
	hook: {tip: 'topMiddle', mouse: false},
		offset: { x: 140, y: 12},
	closeButton: true,
	showOn: 'click',
	hideOthers: true,
	radius:3,
	border:3,
	hideOn: false,
	width:'auto'
	});	
	
}
/*fichaFull*************************************************************************************/
/*fichamini*************************************************************************************/
function fichamini_initTooltips(id){
	$('miniFD'+id).style.display='none';
	new Tip('miniFD_lnk'+id, $('miniFD'+id),{
	style: 'azulblanco',
	stem: 'bottomLeft',
	hook: { target: 'topLeft', tip: 'bottomLeft' },
	closeButton: false,
	showOn: 'mousemove',
	hideOthers: true,
	hideOn: false,
	hideAfter: 2 ,
	radius:3,
	border:3,
		offset: { x: 40, y: 0},
	width: 300
	});
}
/*fichamini*************************************************************************************/
/*lista*****************************************************************************************/
function listaDW_initTooltips(){
	$('filtrosSelec').style.display='none';
	new Tip('lnk_prueba_modo_experto', $('lnk_prueba_modo_experto_txt'),{
	title: 'Prueba el modo experto',
	style: 'azulblanco',
	stem: 'topRight',
	hook: {tip: 'topRight'},
	offset: { x: 10, y: 4},
	showOn: 'click',
	closeButton: true, 
	hideAfter: 3,
	hideOn: false,
	hideOthers: true,
	width: 200
	});
}
function lista_initTooltips(){
	$('filtrosSelec').style.display='none';
	new Tip('lnk_prueba_modo_experto', $('lnk_prueba_modo_experto_txt'),{
	title: 'Prueba el modo experto',
	style: 'azulblanco',
	stem: 'topRight',
	hook: {tip: 'topRight'},
	offset: { x: 10, y: 4},
	showOn: 'click',
	closeButton: true, 
	hideAfter: 3,
	hideOn: false,
	hideOthers: true,
	width: 200
	});
	new Tip('lnk_mas_opciones', $('vermasFiltros'),{
	title: 'Mas opciones',
	stem: 'topRight',
	hook: {tip: 'topRight'},
	offset: { x: 10, y: 4},
	showOn: 'click',
	closeButton: true, 
	hideAfter: 3,
	hideOn: false,
	hideOthers: true,
	width: 330
	});
}
/*lista*****************************************************************************************/
/*aportefull************************************************************************************/
function aportefull_initTooltips(otrasOpcionesTip){
	createTipBlack(document.getElementById('info1'),'<div id="s3" style="padding:5px;text-align:justify;"></div>',300,35,10);
	new Tip('OtrasOciones', otrasOpcionesTip, {
	style: 'azulblanco',
	stem: 'bottomMiddle',
	hook: { target: 'topMiddle', tip: 'bottomMiddle' },
	offset: { x: 0, y: 0 }
	});
}
/*aportefull************************************************************************************/
/*lisAportes************************************************************************************/
function lisAportes_initTooltips(descargaTip,calidadTip,idiomaTip,graciasTip){
	createTipBlack(document.getElementById('info1'),'<div id="s3" style="padding:5px;text-align:justify;"></div>',300,35,10);
	createTipInfo(document.getElementById('info2'),descargaTip,165);
	createTipInfo(document.getElementById('info3'),calidadTip,165);
	createTipInfo(document.getElementById('info4'),idiomaTip,165);
	createTipInfo(document.getElementById('info5'),graciasTip,165);
}
/*lisAportes************************************************************************************/
/*gracias***************************************************************************************/
function global_ilk_id(ilk_id){
	var ilk_id_s = ilk_id;
	document.write('<iframe src="http://api.perfilunico.com/ilk/?oid='+ilk_id_s+'" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:270px; height:40px;" allowTransparency="true"></iframe>');
}
function global_ilk(ilk_verb, ilk_term, ilk_href){
	var ilk_url_s = escape(ilk_href);
    var ilk_verb_s = ilk_verb;
    var ilk_term_s = escape(ilk_term);
	document.write('<iframe src="http://api.perfilunico.com/ilk/?url='+ilk_url_s+'&verb='+ilk_verb_s+'&term='+ilk_term_s+'" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:270px; height:40px;" allowTransparency="true"></iframe>');
}
/*gracias***************************************************************************************/
/*moderacion************************************************************************************/
function moderacion_getComments(id, gear){
	document.getElementById('content'+id).className = "content";
	goAJAX('comment','ajax.php','gearAbsolute=gears/common/comment/getCommentMod.php&gear='+gear+'&id_gear='+id,'document.getElementById(\'content'+id+'\').innerHTML = respuesta;','','0','0');
	moderacion_cambiarViewComment(id,gear,true);
	return false;
	}
	function moderacion_getCommentsPag(id, gear, pagcomment){
	Tips.hideAll();
	goAJAX('comment','ajax.php','gearAbsolute=gears/common/comment/getCommentMod.php&gear='+gear+'&id_gear='+id+'&pagcomment=' + pagcomment,'document.getElementById(\'content'+id+'\').innerHTML = respuesta;','','0','0');
	return false;
}
function moderacion_cambiarViewMore(orientacion, id, count){
	Tips.hideAll();
	if(orientacion){
		document.getElementById('responses' + id).className = 'responseListHidden';
	if(count>1){
	if(count<10)
	plural = "s&nbsp;";
	else
	plural = "s";
	}else
	plural = "&nbsp;&nbsp;&nbsp;";
			document.getElementById('viewmore' + id).innerHTML = '<a href="#" onclick="moderacion_cambiarViewMore(false,\''+id+'\',\''+count+'\');return false;"><div class="btnViewAll">'+count+' Respuesta'+plural+' <span class="blue">Ver</span></div></a>';
	   }else{
		document.getElementById('responses' + id).className = 'responseList';
			document.getElementById('viewmore' + id).innerHTML = '<a href="#" onclick="moderacion_cambiarViewMore(true,\''+id+'\',\''+count+'\');return false;"><div class="btnHiddenAll">Ocultar</div></a>';
	   }
}
function moderacion_getAvatar(id,content){
	if(isDefined(document.getElementById('avatar'+id))){
	if(!isDefined($('avatar'+id).prototip)){
	new Tip($('avatar'+id), content,{
	style: 'azulblanco',
	stem: 'bottomMiddle',
	hook: { tip: 'bottomMiddle', mouse: false },
		offset: { x: 35, y: 0},
	closeButton: false,
	showOn: 'mousemove',
	hideOthers: true,
	radius:5,
	border:5,
	hideOn: false,
	width: 100,
	hideAfter:1
	});
	}
	}
}
function moderacion_getOptionsReport(id, id_gear, gear){
	}
	function moderacion_deleteComment(id, id_gear, gear){
	Tips.hideAll();
	if(confirm("Esta seguro de eliminar este registro?")){
	goAJAX('comment','ajax.php','gearAbsolute=gears/common/comment/deleteCommentMod.php&comment_id=' + id + '&gear='+gear+'&id_gear='+id_gear,'document.getElementById(\'content'+id_gear+'\').innerHTML = respuesta;moderacion_getCountMod(\''+id_gear+'\',\''+gear+'\');','','0','0');
	}
	return false;
}
function moderacion_cambiarViewComment(id,gear,orientacion){
	if(orientacion){
	document.getElementById('content'+id).className = "content";
	document.getElementById('btnviewcomments'+id).innerHTML = '<a href="#" onclick="moderacion_cambiarViewComment(\''+id+'\',\''+gear+'\',false);return false;">Ocultar todo</a>';
	}else{
	document.getElementById('content'+id).className = "oculto";
	document.getElementById('content'+id).innerHTML = '';
	document.getElementById('btnviewcomments'+id).innerHTML = '<a href="#" onclick="moderacion_getComments(\''+id+'\',\''+gear+'\');return false;">Ver comentarios</a>';
	}
}
function moderacion_editComment(id, id_gear, gear){
	moderacion_closeFormAll();
	document.getElementById('operacionM'+id).innerHTML = moderacion_getFormMini(id, id_gear, gear);
	content = '<div onmouseover="getPosFocus(\'comment'+id+'\');"><form id="puEditITagLink_Form'+ id +'"><p>URL:</p><p><input type="text" id="urlIncludeLink'+ id +'" name="url" value="http://" style="width:250px;" /></p><p>Texto del enlace:</p><p><input type="text" id="textoIncludeLink'+ id +'" name="texto" value="" style="width:250px;" /></p><p style="padding-top:10px;"><input type="button" name="enviar" value="Aceptar" onClick="okIncludeLink(\'comment'+ id +'\',\'puEditITagLink_'+ id +'\',\''+ id +'\');$(\'puEditITagLink_Form'+ id +'\').reset();">&nbsp;&nbsp;&nbsp;<input type="button" name="cancelar" value="Cancelar" onClick="cancelIncludeLink(\'puEditITagLink_'+ id +'\');$(\'puEditITagLink_Form'+ id +'\').reset();"></p></form></div>';
	puEditITagLinkTT('comment'+ id,$('puEditITagLink_'+ id),content);
	}
	function moderacion_updateComments(id, id_gear, gear){
	Tips.hideAll();
	goAJAX('comment','ajax.php','gearAbsolute=gears/common/comment/updateCommentMod.php&comment_id='+id+'&gear='+gear+'&id_gear='+id_gear+'&comment='+document.getElementById('comment'+id).value,'document.getElementById(\'content'+id_gear+'\').innerHTML = respuesta;','','0','0');
	return false;
}
function moderacion_cancelTo(id){
	Tips.hideAll();
	document.getElementById('operacionM'+id).innerHTML = "";
}
function moderacion_closeFormAll(){
	i = 0;
	elements = document.getElementsByTagName("div");
	while (element = elements[i++]){
	if (element.className == "operacionM" && element.innerHTML != "") {
	element.innerHTML = "";
	  }
	}
}
function moderacion_getFormMini(id, id_gear, gear){
	return '<div class="miniFormRespuesta"><form method="post" action="." class="editor" enctype="multipart/form-data"><div id="dejarMsgAviso" style="display:none;" class="msg_amarillo"></div><div class="botonera"><div class="colores"> <a href="" class="btn_c00" onclick="return puEditITagColor(\'comment'+id+'\',\'e46add\');"></a> <a href="" class="btn_c01" onclick="return puEditITagColor(\'comment'+id+'\',\'865bc2\');"></a> <a href="" class="btn_c02" onclick="return puEditITagColor(\'comment'+id+'\',\'5785c2\');"></a> <a href="" class="btn_c03" onclick="return puEditITagColor(\'comment'+id+'\',\'4094bf\');"></a> <a href="" class="btn_c04" onclick="return puEditITagColor(\'comment'+id+'\',\'70b250\');"></a> <a href="" class="btn_c05" onclick="return puEditITagColor(\'comment'+id+'\',\'efd41c\');"></a> <a href="" class="btn_c06" onclick="return puEditITagColor(\'comment'+id+'\',\'f7bd58\');"></a> <a href="" class="btn_c07" onclick="return puEditITagColor(\'comment'+id+'\',\'ed5757\');"></a> </div>    <div class="botones"> <a href="" class="btn_negrita" onclick="return puEditITag(\'comment'+id+'\',\'[b]\',\'[/b]\');"></a> <a href="" class="btn_cursiva" onclick="return puEditITag(\'comment'+id+'\',\'[em]\',\'[/em]\');"></a> <a href="" class="btn_link" onclick="return false;" id="puEditITagLink_'+id+'"></a> <a href="" class="btn_cita" onclick="return puEditITag(\'comment'+id+'\',\'[blockquote]\',\'[/blockquote]\');"></a></div></div> <input type="hidden" id="posIcomment'+id+'" value="-1" />    <input type="hidden" id="posFcomment'+id+'" value="-1" /><div class="txt"><textarea class="textarea" name="comment'+id+'" id="comment'+id+'" onmouseover="rebootPos(\'comment'+id+'\')">'+ document.getElementById('comment_txt'+id).innerHTML +'</textarea></div>    <div class="btnsComment">    <div class="btnAddComment"><a href="#" onclick="if($(\'comment'+id+'\').value!=\'\'){moderacion_updateComments(\''+id+'\',\''+id_gear+'\',\''+gear+'\');}return false;">Actualizar</a></div> <div class="btnCancelComment"><a href="#" onclick="moderacion_cancelTo(\''+id+'\');return false;">Cancelar</a></div>    </div></form></div>';
}
function moderacion_getCountMod(id, gear){
	goAJAX('comment','ajax.php','gearAbsolute=gears/common/comment/getCountMod.php&gear='+gear+'&id_gear='+id,'document.getElementById(\'count'+id+'\').innerHTML = respuesta;','','0','0');
	return false;
}
function moderacion_bannearUser(user_id, id_gear, gear){
	if(confirm("Esta seguro de bannear al usuario?")){
	goAJAX('comment','ajax.php','gearAbsolute=gears/common/comment/banUserMod.php&user_id='+user_id+'&gear='+gear+'&id_gear='+id_gear,'document.getElementById(\'content'+id_gear+'\').innerHTML = respuesta;','','0','0');
	}
	return false;
}
function moderacion_readyComments(id_gear,gear,time){
	if(confirm("Confirme proceder a dar como revisado todo este bloque de comentarios")){
	goAJAX('comment','ajax.php','gearAbsolute=gears/common/comment/readyComments.php&gear='+gear+'&id_gear='+id_gear+'&time='+time,'document.getElementById(\'item'+id_gear+'\').innerHTML = respuesta;','','0','0');
	}
	return false;
}
function moderacion_getOrder(order,gear,id_gear){
	Tips.hideAll();	
	goAJAX('comment','ajax.php','gearAbsolute=gears/common/comment/getCommentOrderMod.php&gear='+gear+'&ajax=true&id_gear='+id_gear+'&order=' + order,'document.getElementById(\'content'+id_gear+'\').innerHTML = respuesta;','','0','0');
	return false;
}

/*moderacion************************************************************************************/
/*general***************************************************************************************/
function general_masTooltip(){
	new Tip('menu_lnk_mas', $('txt_menu_lnk_mas'),{
	stem: 'righBottom',
	style: 'azulblanco',
	hook: {tip: 'righBottom'},
	offset: { x: 35, y: 25},
	hideAfter: 0.2,
	hideOn: false,
	hideOthers: true,
	width: 150
	});
}
function general_isologoTooltip(){
	$('txt_Apartados_Principales').style.display='none';
	new Tip('isologo_lnk', $('txt_Apartados_Principales'),{
	stem: 'bottomLeft',
	style: 'azulblanco',
	hook: {tip: 'bottomLeft'},
	offset: { x: 10, y: 4},
	hideAfter: 1,
	hideOn: false,
	hideOthers: true,
	width: 200
	});
}
function general_listaTooltips(){
	$('filtrosSelec').style.display='none';
	new Tip('lnk_mas_opciones', $('vermasFiltros'),{
	title: 'Mas opciones',
	stem: 'topRight',
	hook: {tip: 'topRight'},
	offset: { x: 10, y: 4},
	showOn: 'click',
	closeButton: true, 
	hideAfter: 3,
	hideOn: false,
	hideOthers: true,
	width: 330
	});
	$('filtrosSelec').style.display='none';
	new Tip('lnk_prueba_modo_experto', $('lnk_prueba_modo_experto_txt'),{
	title: 'Prueba el modo experto',
	style: 'azulblanco',
	stem: 'topRight',
	hook: {tip: 'topRight'},
	offset: { x: 10, y: 4},
	showOn: 'click',
	closeButton: true, 
	hideAfter: 3,
	hideOn: false,
	hideOthers: true,
	width: 200
	});
	}
	function search_Send(){
	if(document.getElementById('search_txt').value!=""){
	document.location.href = "series-gratis-0-0-0-0-fx-1-1-sch-titulo-" + escape(document.getElementById('search_txt').value) + "-sch.fx";
	}
}

/*NEW*/
function getPosFocus(txta){
	posITxta = document.getElementById('posI'+txta).value;
	posFTxta = document.getElementById('posF'+txta).value;
	if(posITxta == -1 && posFTxta == -1){
	if (document.selection) {
	get(txta).focus();
	var range = document.selection.createRange();
	var stored_range = range.duplicate();
	stored_range.moveToElementText( get(txta) );
	stored_range.setEndPoint( 'EndToEnd', range );
	get(txta).selectionStart = stored_range.text.length - range.text.length;
	get(txta).selectionEnd = get(txta).selectionStart + range.text.length;
	posITxta = get(txta).selectionStart;
	posFTxta = get(txta).selectionEnd;
	}else if (get(txta).selectionStart || get(txta).selectionStart == '0'){
	posITxta = get(txta).selectionStart;
	posFTxta = get(txta).selectionEnd;
	}
	}
	document.getElementById('posI'+txta).value = posITxta;
	document.getElementById('posF'+txta).value = posFTxta;
}
function puEditITag(id, tOpen, tClose) {
	if (document.all) {
	puEditWSelIE_v2(id, tOpen, tClose);
	}else if (get) {
	puEditGetSel(id, tOpen, tClose);
	}
	get(id).focus();
	if (get(id).selectionStart == get(id).selectionEnd) {
	get(id).selectionStart = get(id).selectionStart - tClose.length;
	get(id).selectionEnd = get(id).selectionStart;
	}
	return false;
}


function cargarTextoTemporizado(str,id){
	document.getElementById(id).innerHTML = '<img src="themes/default/img/loading.gif" />';
	setTimeout(function(){document.getElementById(id).innerHTML = str;}, 4000);
}

function Ira(url){
	document.location.href=url;
}
function verVideoOnline(id){
	mostrarOcultar('verelvideo'+id);
	goAJAX('verelvideo'+id,'ajax.php','gear=vervideoOnline&id='+id);
	}

function ampliarcajas(tabla){
	if((get('content'+tabla).style.height=='') || (get('content'+tabla).style.height=='70px')){
		get('content'+tabla).style.height='320px';
		get('span'+tabla).innerHTML='[+] Ampliar Caja un poco M&aacute;s';
	}else if(get('content'+tabla).style.height=='320px'){
			get('content'+tabla).style.height='725px';
			get('span'+tabla).innerHTML='[-] Cerrar la Caja';
		}else if(get('content'+tabla).style.height=='725px'){
			get('content'+tabla).style.height='70px';
			get('span'+tabla).innerHTML='[+] Ampliar caja';
		}
}

function ampliarcajas2(tabla){
	if((get('caja'+tabla).style.height=='') || (get('caja'+tabla).style.height=='320px')){
		get('caja'+tabla).style.height='640px';
		get('span'+tabla).innerHTML='[+] Ampliar Caja un poco M&aacute;s';
	}else if(get('caja'+tabla).style.height=='640px'){
			get('caja'+tabla).style.height='1280px';
			get('span'+tabla).innerHTML='[-] Cerrar la Caja';
		}else if(get('caja'+tabla).style.height=='1280px'){
			get('caja'+tabla).style.height='320px';
			get('span'+tabla).innerHTML='[+] M&aacute;s Recomendadas';
		}
}



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

function insertarvalor(val){
	var s;
	var d=document.bucarpersonas.datos.value;
	//alert(d);
	if($(val).checked){
		s=val+',';}else{s='';}
	a=s+str_replace(val+',','',d);
	document.bucarpersonas.datos.value=a;
	
}
