$(function(){
$("#actualizar_comentario").click(function(){
$("#menscom").html("
");
$.ajax({
type: "GET",
url: "/extensiones/comentario_menu/comentario_ajax.php",
cache: false,
success: function(h)
{
$("#comentario").html(h);
$("#menscom").html("");
}
});
return false;
});
$("a[href*='mediafire.com']").addClass("linkext").addClass("link_mediafire").attr({title: 'Descargar desde Mediafire'});
$("a[href*='megaupload.com']").addClass("linkext").addClass("link_megaupload").attr({title: 'Descargar desde Megaupload'});
$("a[href*='rapidshare.com']").addClass("linkext").addClass("link_rapidshare").attr({title: 'Descargar desde Rapidshare'});
$("a[href*='hotfile.com']").addClass("linkext").addClass("link_hotfile").attr({title: 'Descargar desde Hotfile'});
$("a[href*='depositfiles.com']").addClass("linkext").addClass("link_depositfiles").attr({title: 'Descargar desde Depositfiles'});
$("a[href*='fileserve.com']").addClass("linkext").addClass("link_fileserve").attr({title: 'Descargar desde Fileserve'});
var menuContent = $.get('/js/menu/menu.php', function(data){menuContent = data;});
$('#categories2').click(function(){
var menu3 = new Menu(this, {
content: menuContent,
width: 216,
maxHeight: 500,
positionOpts: {offsetY: -1},
callerOnState: 'btnMenuOn',
itemHover: 'hover',
selectCategories: false,
topLinkText: 'Todas las categorias'
}).create();
return false;
alert(0);
});
$('.barra_inferior').click(function()
{
$('#modules').slideToggle('slow',function(){
$.ajax({
type: 'POST',
url: '/extensiones/ajax/opciones.php',
data: 'id=IDUSUARIO&tipo=actividades&val=1'
});
});
return false;
});
$('.arriba').click(function()
{
$('html, body').animate({scrollTop:0}, 800);
return false;
});
$('#q').click(function()
{
$(this).val('');
});
setTimeout(function()
{
$('#uonster img').fadeIn('slow');
},1500);
function formatResult(row) {
return row[0].replace(/(<.+?>)/gi, '');
}
$('#q').autocomplete('/js/autocompletar/busqueda_recibir.php', {
width: 200,
max: 10,
selectFirst: false,
highlight: false,
scroll: true,
scrollHeight: 300,
formatResult: function(data, value) {
return value.split('> ')[1];
}
});
});
var position = 0;
function contar(id)
{
setInterval("cont_amigosonline("+id+")",10000);
setInterval("cont_radio("+id+")",80000);
setInterval("actualizar_barranoticias();",100000);
}
//Actualizar msn y expandir la lista de contactos
function actualizar_msn()
{
setInterval("actualizar_lista_contactos(\"lista_contactos\")",20000);
}
function actualizar_lista_contactos(id)
{
if(document.getElementById('lista_contactos').style.display!='none')
{
ajaxCall('http://sanigalia.com.ar:80/mensajero.php?id='+id+'&tipo=conectados&rand=' + parseInt(Math.random()*123123), 'GET', 0, rellenar_lista_contactos_con);
ajaxCall('http://sanigalia.com.ar:80/mensajero.php?id='+id+'&tipo=desconectados&rand=' + parseInt(Math.random()*123123), 'GET', 0, rellenar_lista_contactos_des);
}
}
function rellenar_lista_contactos_con(h,div)
{
document.getElementById('conectados').innerHTML = h;
}
function rellenar_lista_contactos_des(h,div)
{
document.getElementById('desconectados').innerHTML = h;
}
//Contador de amigos online
function cont_amigosonline(id)
{
$.ajax({
type: 'GET',
url: '/mensajero.php',
cache: false,
data: 'id='+id+'&tipo=contador',
success: function(h)
{
if(h!='error')
$('#cont_amigos').html(h);
else
location.reload();
}
});
}
//Contador de radio online
function cont_radio(id)
{
div = null;
ajaxCall('/mensajero.php?id='+id+'&tipo=contador_radio&rand=' + parseInt(Math.random()*123123), 'GET', 0, contador_radio);
}
function contador_radio(h,div)
{
document.getElementById('cont_radio').innerHTML = h;
}
function crear_conv(id,nombre)
{
var arriba = Math.floor(Math.random()*150 + 100) + 'px';
var izq = Math.floor(Math.random()*250 + 200) + 'px';
ajaxwin=dhtmlwindow.open('conv'+id, 'ajax', 'http://sanigalia.com.ar:80/mensajero.php?id='+id+'&tipo=conversacion&div=conversacion'+id, 'Conversación con '+nombre, 'width=350px,height=315px,left='+izq+',top='+arriba+',resize=0,scrolling=1');
bajardiv('conv'+id);
setInterval("actualizar(\""+id+"\")",10000);
}
function actualizar(id)
{
if(document.getElementById('mensajero_mensaje'+id))
{
div = id;
ajaxCall('http://sanigalia.com.ar:80/mensajero.php?id='+id+'&tipo=conversacion&mostrar=mensajes&div=conversacion'+id+'&rand=' + parseInt(Math.random()*123123), 'GET', 0, actualizar_conv);
}
}
function actualizar_conv(h,asa)
{
document.getElementById('mensajero_mensaje'+div).innerHTML = h;
}
function actualizar_temas(id)
{
$.ajax({
type: "POST",
url: "/temas/sanigalia2/cambiar_topbar.php",
cache: false,
data: "establecer=" + id
});
}
var dhtmlwindow={
imagefiles:['http://sanigalia.com.ar:80/js/windowfiles/min.gif', 'http://sanigalia.com.ar:80/js/windowfiles/close.gif', 'http://sanigalia.com.ar:80/js/windowfiles/restore.gif', 'http://sanigalia.com.ar:80/js/windowfiles/resize.gif'],
ajaxbustcache: true,
ajaxloadinghtml: 'Cargando...',
minimizeorder: 0,
zIndexvalue:100,
tobjects: [],
lastactivet: {},
init:function(t){
var domwindow=document.createElement("div");
domwindow.id=t;
domwindow.className="dhtmlwindow";
var domwindowdata='';
domwindowdata='
';
domwindowdata+='DHTML Window
';
domwindowdata+='
';
domwindowdata+='';
domwindowdata+='';
domwindowdata+='';
domwindow.innerHTML=domwindowdata;
document.getElementById("dhtmlwindowholder").appendChild(domwindow);
var t=document.getElementById(t);
var divs=t.getElementsByTagName("div");
for (var i=0; i'
window.frames["_iframe-"+t.id].location.replace(contentsource)
}
else if (contenttype=="ajax")
{
this.ajax_connect(contentsource, t);
}
t.contentarea.datatype=contenttype;
},
setupdrag:function(e)
{
var d=dhtmlwindow;
var t=this._parent;
d.etarget=this;
var e=window.event || e;
d.initmousex=e.clientX;
d.initmousey=e.clientY;
d.initx=parseInt(t.offsetLeft);
d.inity=parseInt(t.offsetTop);
d.width=parseInt(t.offsetWidth);
d.contentheight=parseInt(t.contentarea.offsetHeight);
if (t.contentarea.datatype=="iframe"){
t.style.backgroundColor="#F8F8F8";
t.contentarea.style.visibility="hidden"
}
document.onmousemove=d.getdistance;
document.onmouseup=function(){
if (t.contentarea.datatype=="iframe"){
t.contentarea.style.backgroundColor="white"
t.contentarea.style.visibility="visible"
}
d.stop()
}
return false
},
getdistance:function(e){
var d=dhtmlwindow
var etarget=d.etarget
var e=window.event || e
d.distancex=e.clientX-d.initmousex;
d.distancey=e.clientY-d.initmousey
if (etarget.className=="drag-handle")
d.move(etarget._parent, e)
else if (etarget.className=="drag-resizearea")
d.resize(etarget._parent, e)
return false //cancel default dragging behavior
},
getviewpoint:function(){
var ie=document.all && !window.opera
var domclientWidth=document.documentElement && parseInt(document.documentElement.clientWidth) || 100000
this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes
this.scroll_top=(ie)? this.standardbody.scrollTop : window.pageYOffset
this.scroll_left=(ie)? this.standardbody.scrollLeft : window.pageXOffset
this.docwidth=(ie)? this.standardbody.clientWidth : (/Safari/i.test(navigator.userAgent))? window.innerWidth : Math.min(domclientWidth, window.innerWidth-16)
this.docheight=(ie)? this.standardbody.clientHeight: window.innerHeight
},
rememberattrs:function(t){
this.getviewpoint() //Get current window viewpoint numbers
t.lastx=parseInt((t.style.left || t.offsetLeft))-dhtmlwindow.scroll_left //store last known x coord of window just before minimizing
t.lasty=parseInt((t.style.top || t.offsetTop));
t.lastwidth=parseInt(t.style.width);
},
move:function(t, e){
t.style.left=dhtmlwindow.distancex+dhtmlwindow.initx+"px"
t.style.top=dhtmlwindow.distancey+dhtmlwindow.inity+"px"
},
resize:function(t, e){
t.style.width=Math.max(dhtmlwindow.width+dhtmlwindow.distancex, 150)+"px"
t.contentarea.style.height=Math.max(dhtmlwindow.contentheight+dhtmlwindow.distancey, 100)+"px"
},
enablecontrols:function(e){
var d=dhtmlwindow
var sourceobj=window.event? window.event.srcElement : e.target //Get element within "handle" div mouse is currently on (the controls)
if (/Minimizar/i.test(sourceobj.getAttribute("title"))) //if this is the "minimize" control
d.minimize(sourceobj, this._parent)
else if (/Restaurar/i.test(sourceobj.getAttribute("title"))) //if this is the "restore" control
d.restore(sourceobj, this._parent)
else if (/Cerrar/i.test(sourceobj.getAttribute("title"))) //if this is the "close" control
d.close(this._parent)
return false
},
minimize:function(button, t){
dhtmlwindow.rememberattrs(t)
button.setAttribute("src", dhtmlwindow.imagefiles[2])
button.setAttribute("title", "Restaurar")
t.state="minimized" //indicate the state of the window as being "minimized"
t.contentarea.style.display="none"
t.statusarea.style.display="none"
if (typeof t.minimizeorder=="undefined"){ //stack order of minmized window on screen relative to any other minimized windows
dhtmlwindow.minimizeorder++ //increment order
t.minimizeorder=dhtmlwindow.minimizeorder
}
t.style.left="10px" //left coord of minmized window
t.style.width="250px"
var windowspacing=t.minimizeorder*10 //spacing (gap) between each minmized window(s)
t.style.top=dhtmlwindow.docheight-(t.handle.offsetHeight*t.minimizeorder)-windowspacing+"px";
},
restore:function(button, t){
dhtmlwindow.getviewpoint()
button.setAttribute("src", dhtmlwindow.imagefiles[0])
button.setAttribute("title", "Minimizar")
t.state="fullview" //indicate the state of the window as being "fullview"
t.style.display="block"
t.contentarea.style.display="block"
if (t.resizeBool) //if this window is resizable, enable the resize icon
t.statusarea.style.display="block"
t.style.left=parseInt(t.lastx)+dhtmlwindow.scroll_left+"px" //position window to last known x coord just before minimizing
t.style.top=parseInt(t.lasty)+"px"
t.style.width=parseInt(t.lastwidth)+"px"
},
close:function(t){
try{
var closewinbol=t.onclose()
}
catch(err){ //In non IE browsers, all errors are caught, so just run the below
var closewinbol=true
}
finally{ //In IE, not all errors are caught, so check if variable isn't defined in IE in those cases
if (typeof closewinbol=="undefined"){
alert("An error has occured somwhere inside your \"onclose\" event handler")
var closewinbol=true
}
}
if (closewinbol){ //if custom event handler function returns true
if (t.state!="minimized") //if this window isn't currently minimized
dhtmlwindow.rememberattrs(t) //remember window's dimensions/position on the page before closing
if (window.frames["_iframe-"+t.id]) //if this is an IFRAME DHTML window
window.frames["_iframe-"+t.id].location.replace("about:blank")
else
t.contentarea.innerHTML=""
t.style.display="none"
t.isClosed=true //tell script this window is closed (for detection in t.show())
}
return closewinbol
},
setopacity:function(targetobject, value){ //Sets the opacity of targetobject based on the passed in value setting (0 to 1 and in between)
if (!targetobject)
return
if (targetobject.filters && targetobject.filters[0]){ //IE syntax
if (typeof targetobject.filters[0].opacity=="number") //IE6
targetobject.filters[0].opacity=value*100
else //IE 5.5
targetobject.style.filter="alpha(opacity="+value*100+")"
}
else if (typeof targetobject.style.MozOpacity!="undefined") //Old Mozilla syntax
targetobject.style.MozOpacity=value
else if (typeof targetobject.style.opacity!="undefined") //Standard opacity syntax
targetobject.style.opacity=value
},
setfocus:function(t){ //Sets focus to the currently active window
this.zIndexvalue++
t.style.zIndex=this.zIndexvalue
t.isClosed=false //tell script this window isn't closed (for detection in t.show())
this.setopacity(this.lastactivet.handle, 0.5) //unfocus last active window
this.setopacity(t.handle, 1) //focus currently active window
this.lastactivet=t //remember last active window
},
show:function(t){
if (t.isClosed){
alert("DHTML Window has been closed, so nothing to show. Open/Create the window again.")
return
}
if (t.lastx) //If there exists previously stored information such as last x position on window attributes (meaning it's been minimized or closed)
dhtmlwindow.restore(t.controls.firstChild, t) //restore the window using that info
else
t.style.display="block"
this.setfocus(t)
t.state="fullview" //indicate the state of the window as being "fullview"
},
hide:function(t){
t.style.display="none"
},
ajax_connect:function(url, t){
var page_request = false
var bustcacheparameter=""
if (window.XMLHttpRequest) // if Mozilla, IE7, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE6 or below
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
}
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
t.contentarea.innerHTML=this.ajaxloadinghtml
page_request.onreadystatechange=function(){dhtmlwindow.ajax_loadpage(page_request, t)}
if (this.ajaxbustcache) //if bust caching of external page
bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
page_request.open('GET', url+bustcacheparameter, true)
page_request.send(null)
},
ajax_loadpage:function(page_request, t){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
t.contentarea.innerHTML=page_request.responseText
}
},
stop:function(){
dhtmlwindow.etarget=null //clean up
document.onmousemove=null
document.onmouseup=null
},
addEvent:function(target, functionref, tasktype){ //assign a function to execute to an event handler (ie: onunload)
var tasktype=(window.addEventListener)? tasktype : "on"+tasktype
if (target.addEventListener)
target.addEventListener(tasktype, functionref, false)
else if (target.attachEvent)
target.attachEvent(tasktype, functionref)
},
cleanup:function(){
for (var i=0; i.') //container that holds all dhtml window divs on page
window.onunload=dhtmlwindow.cleanup
function mostrar_temas()
{
if($('#temas').css('display')=='none')
{
div = 'temas_cargando';
document.getElementById('temas_cargando').innerHTML = '';
$.ajax({
type: 'GET',
url: '/extensiones/ajax/topbars.php',
cache: false,
success: function(h)
{
$('#temas_cargando').html(h);
$('#temas').fadeIn().hover(function(){}, function(){
$('#header').css({'background': '/temas/sanigalia2/imagenes/topbar.png'});
});
$(document).click(function(e)
{
e = e || window.event;
var targ = e.target || e.srcElement;
if($(targ).parent().attr('id') != 'temas_cargando')
$('#temas').fadeOut();
});
}
});
}
else
{
$('#temas').fadeOut();
}
}
function actualizar_barranoticias()
{
div = 'barranoticias';
ajaxCall('/extensiones/ajax/barranoticias.php?mostrar=1&rand=' + parseInt(Math.random()*123123), 'GET', 0, actualizar_contenido_barranoticias);
}
function actualizar_contenido_barranoticias(h,div)
{
document.getElementById('barranoticias').innerHTML = h;
}
function enviar_cb()
{
$.ajax({
type: 'POST',
url: '../../extensiones/chatbox_menu/chatbox_mensajes.php',
cache: false,
data: 'chat_submit=1&chatbox_ajax='+encodeURIComponent($('#chatbox_ajax').val())+'&cmessage='+encodeURIComponent($('#cmessage').val()),
success: function(h)
{
$('#chat').html(h);
$('#cmessage').val('');
cargar_lightbox('#chat .imgbb');
}
});
}
function actualizar_item_enlinea()
{
$('#mensenlinea').html('
');
$.ajax({
type: 'GET',
url: '../../extensiones/oenlinea_menu/oenlinea_menu.php',
cache: false,
success: function(h)
{
$('#enlinea').html(h);
$('#mensenlinea').html('');
}
});
}
function actualizar_item()
{
$('#ultimos_mensajes').html('
');
$.ajax({
type: 'GET',
url: '../../extensiones/chatbox_menu/chatbox_mensajes.php',
cache: false,
success: function(h)
{
$('#chat').html(h);
$('#ultimos_mensajes').html('');
cargar_lightbox('#chat .imgbb');
}
});
}
function ocultar(obj)
{
document.getElementById(obj).style.display='none';
}
function bajardiv(divnombre)
{
midiv = document.getElementById(divnombre);
for (i = 50; i < midiv.scrollHeight; i += 50)
{
var tmp = midiv.scrollTop;
midiv.scrollTop += i;
if (tmp == midiv.scrollTop)
{
break;
}
}
}
function actualizar_item_comentario()
{
document.getElementById('menscom').innerHTML = '
';
ajaxCall('/extensiones/comentario_menu/comentario_ajax.php?' + parseInt(Math.random()*123123), 'GET', 0, actualizar_comentario)
}
function actualizar_comentario(h)
{
document.getElementById('comentario').innerHTML = h;
document.getElementById('menscom').innerHTML = '';
}
function aire(id)
{
div='botonradio';
ajaxCall('/radio.php?id='+id+'&rand=' + parseInt(Math.random()*123123), 'GET', 0, actualizar_aire);
}
function actualizar_aire(h,div)
{
document.getElementById('botonradio').innerHTML = h;
}
function rellenar(origen,destino)
{
txt_des = document.getElementById(origen).innerHTML;
document.getElementById(destino).innerHTML=txt_des;
}
function showHide(e)
{
for( var i=0,limit=e.options.length; i < limit;++i)
{
var id = 'opcion' + e.options[i].value
if( e.options.selectedIndex==i )
{
document.getElementById(id).style.display='block';
}
else
{
document.getElementById(id).style.display='none';
}
}
}
function actualizar_sonido(id,rand)
{
if(document.getElementById(id+rand))
{
div = rand;
document.getElementById(id+rand).innerHTML = '';
ajaxCall('/conductores/lista_sonidos.php?id=sonido_selector_'+rand+'&' + parseInt(Math.random()*123123), 'GET', 0, actualizar_sonido_item);
}
}
function actualizar_sonido_item(h,rand)
{
document.getElementById('sonidos'+div).innerHTML = h;
}
function actualizar_emoticonos(id,rand)
{
if(document.getElementById(id+rand))
{
div = rand;
document.getElementById(id+rand).innerHTML = '';
ajaxCall('/conductores/lista_emoticonos.php?' + parseInt(Math.random()*123123), 'GET', 0, actualizar_emoticonos_item);
}
}
function actualizar_emoticonos_item(h,rand)
{
document.getElementById('emoticonos'+div).innerHTML = h;
}
jQuery.fn.fadeToggle = function(speed, easing, callback) {
return this.animate({opacity: 'toggle'}, speed, easing, callback);
};
// jQuery Scroll to Top Control script
var scrolltotop={
//startline: Integer. Number of pixels from top of doc scrollbar is scrolled before showing control
//scrollto: Keyword (Integer, or "Scroll_to_Element_ID"). How far to scroll document up when control is clicked on (0=top).
setting: {startline:121, scrollto: 0, scrollduration:800, fadeduration:[500, 100]},
controlHTML: '
', //HTML for control, which is auto wrapped in DIV w/ ID="topcontrol"
controlattrs: {offsetx:5, offsety:5}, //offset of control relative to right/ bottom of window corner
anchorkeyword: '.arriba', //Enter href value of HTML anchors on the page that should also act as "Scroll Up" links
state: {isvisible:false, shouldvisible:false},
scrollup:function(){
if (!this.cssfixedsupport) //if control is positioned using JavaScript
this.$control.hide() //hide control immediately after clicking it
var dest=isNaN(this.setting.scrollto)? this.setting.scrollto : parseInt(this.setting.scrollto)
if (typeof dest=='string' && jQuery('#'+dest).length==1) //check element set by string exists
dest=jQuery('#'+dest).offset().top
else
dest=0
this.$body.animate({scrollTop: dest}, this.setting.scrollduration);
},
keepfixed:function(){
var $window=jQuery(window)
var controlx=$window.scrollLeft() + $window.width() - this.$control.width() - this.controlattrs.offsetx
var controly=$window.scrollTop() + $window.height() - this.$control.height() - this.controlattrs.offsety
this.$control.css({left:controlx+'px', top:controly+'px'})
},
togglecontrol:function(){
var scrolltop=jQuery(window).scrollTop()
if (!this.cssfixedsupport)
this.keepfixed()
this.state.shouldvisible=(scrolltop>=this.setting.startline)? true : false
if (this.state.shouldvisible && !this.state.isvisible){
this.$control.show()
this.state.isvisible=true
if($('#barra').css('display')=='none')
{
$('#barra').css({'display':'block'});
$('#barra_cont').html($('#barra_orig').html());
}
}
else if (this.state.shouldvisible==false && this.state.isvisible){
this.$control.hide()
this.state.isvisible=false
if($('#barra').css('display')=='block')
{
$('#barra_orig').html($('#barra_cont').html());
$('#barra_cont').html('');
$('#barra').css({'display':'none'});
}
}
},
init:function(){
jQuery(document).ready(function($){
var mainobj=scrolltotop
var iebrws=document.all
mainobj.cssfixedsupport=!iebrws || iebrws && document.compatMode=="CSS1Compat" && window.XMLHttpRequest //not IE or IE7+ browsers in standards mode
mainobj.$body=(window.opera)? (document.compatMode=="CSS1Compat"? $('html') : $('body')) : $('html,body')
mainobj.$control=$(''+mainobj.controlHTML+'
')
.css({position:mainobj.cssfixedsupport? 'fixed' : 'absolute', display:'none', bottom:mainobj.controlattrs.offsety, right:mainobj.controlattrs.offsetx, cursor:'pointer'})
.attr({title:'Arriba!'})
.click(function(){mainobj.scrollup(); return false})
.appendTo('body')
if (document.all && !window.XMLHttpRequest && mainobj.$control.text()!='') //loose check for IE6 and below, plus whether control contains any text
mainobj.$control.css({width:mainobj.$control.width()}) //IE6- seems to require an explicit width on a DIV containing text
mainobj.togglecontrol()
$('a[href="' + mainobj.anchorkeyword +'"]').click(function(){
mainobj.scrollup()
return false
})
$(window).bind('scroll resize', function(e){
mainobj.togglecontrol()
})
})
}
}
scrolltotop.init()