// codice per pilotater l'inizio di una gallery
// tramite4 javascript
// cosi' uno puo' mandare il link alla gallery
// direttamente
//
try {
HTMLAnchorElement.prototype.click = function() {
var evt = this.ownerDocument.createEvent('MouseEvents');
evt.initMouseEvent('click', true, true, this.ownerDocument.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
this.dispatchEvent(evt);
}
} catch (e) { }
//
// id criptato dell'utente, usato da ajax
//
var MyRockitIdCrypted = "";
function checkTop() { /* verifica il top per le pagine mostrate sopra, manda alla home */
if (top.location==self.location) { window.location="/"; }
}
function checkTopBand() { /* verifica il top per le pagine mostrate sopra, manda alla scheda band */
if (top.location==self.location) { window.location="/band/band.php?x="+gup('x'); }
}
function gup( name ) { /* prende i parametri da una querystring get */
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null ) return "";
else return results[1];
}
function fixOpen2(idEspanso) { /* fix dimensioni colonne */
$('colonnasx2').style.height = ($('colonnasx2').getHeight() + $(idEspanso).getHeight()) + "px";
$('colonnadx2').style.height = ($('colonnadx2').getHeight() + $(idEspanso).getHeight()) + "px";
setTimeout(function () {$(idEspanso).style.display="";}, 500);
}
function fixClose2(idEspanso) { /* fix dimensioni colonne */
$('colonnasx2').style.height = ($('colonnasx2').getHeight() - $(idEspanso).getHeight()) + "px";
$('colonnadx2').style.height = ($('colonnadx2').getHeight() - $(idEspanso).getHeight()) + "px";
$(idEspanso).style.display='none';
}
function fixOpen(idEspanso) { /* fix dimensioni colonne */
$('colonnasx').style.height = ($('colonnasx').getHeight() + $(idEspanso).getHeight()) + "px";
$('colonnadx').style.height = ($('colonnadx').getHeight() + $(idEspanso).getHeight()) + "px";
$('contenuto').style.height = ($('contenuto').getHeight() - 20 + $(idEspanso).getHeight()) + "px";
setTimeout(function () {$(idEspanso).style.display='';},500);
}
function fixClose(idEspanso) { /* fix dimensioni colonne */
$('colonnasx').style.height = ($('colonnasx').getHeight() - $(idEspanso).getHeight()) + "px";
$('colonnadx').style.height = ($('colonnadx').getHeight() - $(idEspanso).getHeight()) + "px";
$('contenuto').style.height = ($('contenuto').getHeight() - 20 - $(idEspanso).getHeight()) + "px";
$(idEspanso).style.display='none';
}
function fixColumns(f) { /* al load corregge lunghezza colonne */
var S = $('colonnasx'+f).getHeight();
var D = $('colonnadx'+f).getHeight();
if (S>D) D=S;
D = D + 30;
$('colonnasx'+f).style.height = D + "px";
$('colonnadx'+f).style.height = D + "px";
if (f=='') $('contenuto').style.height = (D-20) + "px";
}
/* ---------------------------- pannello --------------------*/
function showGPanel(panelid,paneltrigger,closetext,opentext,tipotemp) {
if ($(panelid)) {
if (tipotemp==undefined) tipotemp='';
//alert($(panelid).className);
if($(panelid).style.display=='none' || $(panelid).className=='nascosto') {
$(panelid).style.display='';
if ($(panelid).className=='nascosto') $(panelid).className='visibile';
try {
$('colonnasx'+tipotemp).style.height = ($(panelid).getHeight() + $('colonnasx'+tipotemp).getHeight()) + "px";
$('colonnadx'+tipotemp).style.height = ($(panelid).getHeight() + $('colonnadx'+tipotemp).getHeight()) + "px";
//$('contenuto').style.height = ($(panelid).getHeight() + $('colonnadx'+tipotemp).getHeight()) + "px";
} catch(e) {}
//fixColumns('');
$(paneltrigger).innerHTML=opentext;
$(paneltrigger).blur();
} else {
//alert($('colonnasx'+tipotemp).style.height);
try {
$('colonnasx'+tipotemp).style.height = (-$(panelid).getHeight() + $('colonnasx'+tipotemp).getHeight()) + "px";
$('colonnadx'+tipotemp).style.height = (-$(panelid).getHeight() + $('colonnadx'+tipotemp).getHeight()) + "px";
//$('contenuto').style.height = (-$(panelid).getHeight() + $('colonnadx'+tipotemp).getHeight()) + "px";
} catch(e) {}
//alert($('colonnasx'+tipotemp).style.height);
$(panelid).style.display='none';
if ($(panelid).className=='visibile') $(panelid).className='nascosto';
//fixColumns('');
$(paneltrigger).innerHTML=closetext;
$(paneltrigger).blur();
}
}
}
function showCommentiForum(quanti) {
if (quanti>0) {
showGPanel('commentaform','linkcommenti','{+} leggili/scrivene uno','{-} nascondi');
} else {
showGPanel('commentaform','linkcommenti','{+} scrivene uno','{-} nascondi');
if ($('commentaform').style.display!='none') {if ($('body')) $('body').focus();}
}
}
/* -------------- cambio password -------------*/
function validacambiopassword(result) {
if (result) {
urlo = '/res/ajaxphp/ajax.modificapassword.php?p='+escape($('pwd').value)+'&op='+escape($('oldpwd').value)+'&target='+escape(MyRockitIdCrypted);
var temp = $('logpanel').innerHTML;
$('logpanel').innerHTML='faccio...';
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
var response = transport.responseText;
$('logpanel').innerHTML=response;
},
onFailure: function(){ }
});
setTimeout(function () {
$('logpanel').innerHTML = temp;
showGPanel('logpanel','logpanellink','{+}','{-}');
}, 5000);
}
}
/* ------------------------------- ricerca ------------------------------------ */
function selezCosa(ob) {
var obs = $('formcerca').getElementsByClassName('cosa');
for (i = 0; i < obs.length; i++) {
obs[i].style.textDecoration = "none";
}
ob.style.textDecoration='underline';
$('cosa').value=ob.innerHTML;
ob.blur();
}
/* ---------------------------- pannello altre correlate --------------------*/
//function showCorrelate(obj,iniziale) {
// if($('morenewscor').style.display=='none') {
// $('morenewscor').style.display='';
// obj.innerHTML='{-} nascondi';
// } else {
// $('morenewscor').style.display='none';
// obj.innerHTML=iniziale;
// }
//}
/* ---------------------------- aggiungi al player utente --------------------------*/
function aggiungiAllaMiaPlaylist(idb) {
try { $('usereferer').value='si'; } catch (e) {}
var temp = $('track'+idb).innerHTML;
$('track'+idb).innerHTML='faccio...';
urlo = '/res/ajaxphp/ajax.addaplaylist.php?r='+escape(idb)+'&u='+escape(MyRockitIdCrypted);
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
var response = transport.responseText;
$('track'+idb).innerHTML=response;
},
onFailure: function(){ }
});
setTimeout(function () {
$('track'+idb).innerHTML = temp;
}, 3000);
}
function eliminaDaPlaylist(idtarget,idb) {
qs = 'u='+escape(idtarget)+'&r=' + escape(idb)
urlo = '/res/ajaxphp/ajax.cancelladaplaylist.php?'+qs;
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
response = transport.responseText;
if (response=='ok') {
$('pl'+idb).remove();
} else {
alert(response);
}
},
onFailure: function(){ }
});
}
function salvaAscoltoLog(idtraccia) {
urlo = '/res/ajaxphp/ajax.loggaascolto.php?t='+escape(idtraccia)+'&u='+escape(MyRockitIdCrypted);
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
var response = transport.responseText;
},
onFailure: function(){ }
});
}
/* ---------------------------- chiamata addme come ascoltatore --------------------*/
function addascoltatore(band) {
try { $('usereferer').value='si'; } catch (e) {} //per utilizzare il redirect nel
//login se non sono loggato
//
var temp = $('addascoltatore').innerHTML;
$('addascoltatore').innerHTML='faccio...';
urlo = '/res/ajaxphp/ajax.addmeascoltatore.php?b='+escape(band)+'&io='+escape(MyRockitIdCrypted);
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
var response = transport.responseText;
$('addascoltatore').innerHTML=response;// + "refresh";
},
onFailure: function(){ }
});
setTimeout(function () {
$('addascoltatore').innerHTML = temp;
}, 5000);
}
/* ---------------------------- chiamata mostra info utente (amici comuni)--------------------*/
function showinfo(id) {
if ($('infouser'+id).style.display=='none') {
// $('infouser'+id).style.display='';
$('infouser'+id).innerHTML='cerco...';
urlo = '/res/ajaxphp/ajax.infouser.php?b='+escape(id)+'&io='+escape(MyRockitIdCrypted);
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
var response = transport.responseText;
$('infouser'+id).innerHTML=response;
if ($('colonnasx2')) fixOpen2('infouser'+id);
if ($('colonnasx')) fixOpen('infouser'+id);
if ($('linkinfouser'+id)) $('linkinfouser'+id).innerHTML = "{-} nascondi";
},
onFailure: function(){ }
});
} else {
$('infouser'+id).innerHTML='chiuso';
if ($('linkinfouser'+id)) $('linkinfouser'+id).innerHTML = "{+} mostra amici in comune";
// $('infouser'+id).style.display='none';
if ($('colonnasx2')) fixClose2('infouser'+id);
if ($('colonnasx')) fixClose('infouser'+id);
}
if ($('linkinfouser'+id)) $('linkinfouser'+id).blur();
}
/* ---------------------------- chiamata addme come ascoltatore --------------------*/
function piaccionoelimina(id,idtarget) {
qs = 'u='+escape(idtarget)+'&x=' + id
urlo = '/res/ajaxphp/ajax.cancellapiacciono.php?'+qs;
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
response = transport.responseText;
if (response=='ok') {
$('trPiacciono'+id).remove();
} else {
alert(response);
}
},
onFailure: function(){ }
});
}
/* ---------------------------- chiamata invia mail --------------------*/
function contattashowform() {
try { $('usereferer').value='si'; } catch (e) {} //per utilizzare il redirect nel
//login se non sono loggato
//
if ($('contattaform').style.display=="") {
contattaclose()
return;
}
if (MyRockitIdCrypted == '') {
var temp = $('contatta').innerHTML;
$('contatta').innerHTML='Non sei loggato.';
setTimeout(function () {
$('contatta').innerHTML = temp;
}, 5000);
return;
}
fixOpen2('contattaform');
setTimeout(function(){
$('contattamsgbox').value ='';
$('contattamsgbox').focus();
},500);
}
function contatta() {
urlo = '/res/ajaxphp/ajax.contatta.php?f='+escape(MyRockitIdCrypted)+'&t='+escape($('contattato').value)+'&m='+escape($('contattamsgbox').value);
fixClose2('contattaform');
var temp = $('contatta').innerHTML;
$('contatta').innerHTML='faccio...';
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
$('contatta').innerHTML=transport.responseText;
},
onFailure: function(){ }
});
setTimeout(function () {
$('contatta').innerHTML = temp;
}, 5000);
}
function contattaclose() {
fixClose2('contattaform');
}
/* ---------------------------- network --------------------*/
function networkshowform() {
try { $('usereferer').value='si'; } catch (e) {} //per utilizzare il redirect nel
//login se non sono loggato
//
if ($('networkform').style.display=="") {
networkclose()
return;
}
if (MyRockitIdCrypted == '') {
var temp = $('network').innerHTML;
$('network').innerHTML='Non sei loggato.';
setTimeout(function () {
$('network').innerHTML = temp;
}, 5000);
return;
}
fixOpen2('networkform');
setTimeout(function(){
$('networkmsgbox').value ='';
$('networkmsgbox').focus();
},500);
}
function network() { //azione
try { $('usereferer').value='si'; } catch (e) {}
urlo = '/res/ajaxphp/ajax.network.php?f='+escape(MyRockitIdCrypted)+'&t='+escape($('networkto').value)+'&m='+escape($('networkmsgbox').value);
fixClose2('networkform');
var temp = $('network').innerHTML;
$('network').innerHTML='faccio...';
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
$('network').innerHTML=transport.responseText;
},
onFailure: function(){ }
});
setTimeout(function () {
$('network').innerHTML = temp;
}, 5000);
}
function networkclose() { //annulla
fixClose2('networkform');
}
function networkelimina(id,idtarget) {
qs = 'u='+escape(idtarget)+'&x=' + id
urlo = '/res/ajaxphp/ajax.cancellanetwork.php?'+qs;
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
response = transport.responseText;
if (response=='ok') {
$('trNetwork'+id).remove();
} else {
alert(response);
}
},
onFailure: function(){ }
});
}
/* ---------------------------- commenta --------------------*/
function commentashowform() {
try { $('usereferer').value='si'; } catch (e) {}
if ($('commentaform').style.display=="") {
commentaclose()
return;
}
if (MyRockitIdCrypted == '') {
var temp = $('commenta').innerHTML;
$('commenta').innerHTML='Non sei loggato.';
setTimeout(function () {
$('commenta').innerHTML = temp;
}, 5000);
return;
}
fixOpen2('commentaform');
setTimeout(function(){ //ritardato per baco IE
$('commentamsgbox').value ='';
$('commentamsgbox').focus();
},500);
}
function commenta() {
try { $('usereferer').value='si'; } catch (e) {} //per utilizzare il redirect nel
//login se non sono loggato
//
urlo = '/res/ajaxphp/ajax.commenta.php?f='+escape(MyRockitIdCrypted)+'&t='+escape($('commentato').value)+'&m='+escape($('commentamsgbox').value);
fixClose2('commentaform');
var temp = $('commenta').innerHTML;
$('commenta').innerHTML='faccio...';
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
var response = transport.responseText;
if (response=='ok') {
response = 'commento registrato.';
window.location.reload();
}
$('commenta').innerHTML=response;
},
onFailure: function(){ }
});
setTimeout(function () {
$('commenta').innerHTML = temp;
}, 5000);
}
function commentaclose() {
fixClose2('commentaform');
}
/* ---------------------------- gestione --------------------*/
function gestiscishowform() {
try { $('usereferer').value='si'; } catch (e) {}
if ($('gestisciform').style.display=="") {
gestisciclose()
return;
}
if (MyRockitIdCrypted == '') {
var temp = $('gestisci').innerHTML;
$('gestisci').innerHTML='Non sei loggato.';
setTimeout(function () {
$('gestisci').innerHTML = temp;
}, 5000);
return;
}
fixOpen2('gestisciform');
setTimeout(function(){ //ritardato per baco IE
if ($('gestiscimsgbox')) {
$('gestiscimsgbox').value ='';
$('gestiscimsgbox').focus();
}
},500);
}
function gestisci() { //azione
var qs = "";
if ($('gestisciemail')) {
qs = 'f='+escape(MyRockitIdCrypted)+'&t='+escape($('gestiscito').value)+'&e='+escape($('gestisciemail').value);
} else {
qs = 'f='+escape(MyRockitIdCrypted)+'&t='+escape($('gestiscito').value)+'&m='+escape($('gestiscimsgbox').value);
}
urlo = '/res/ajaxphp/ajax.gestisci.php?'+qs;
fixClose2('gestisciform');
var temp = $('gestisci').innerHTML;
$('gestisci').innerHTML='faccio...';
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
$('gestisci').innerHTML=transport.responseText;
},
onFailure: function(){ }
});
setTimeout(function () {
$('gestisci').innerHTML = temp;
}, 5000);
}
function gestisciclose() { //annulla
fixClose2('gestisciform');
}
function accessielimina(c,tipo,entita,idtarget,idutente) {
qs = 'u='+escape(idtarget)+'&t=' + tipo + '&e=' + escape(entita)+'&u2='+escape(idutente)
urlo = '/res/ajaxphp/ajax.cancellaaccesso.php?'+qs;
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
response = transport.responseText;
if (response=='ok') {
$('trGestori'+c).remove();
} else {
alert(response);
}
},
onFailure: function(){ }
});
}
/* ---------------------------- dateconcerti per le band --------------------*/
function segnalaconcertoform() {
try { $('usereferer').value='si'; } catch (e) {}
if ($('segnalaconcertoform').style.display=="") {
segnalaconcertoclose()
return;
}
if (MyRockitIdCrypted == '') {
var temp = $('segnalaconcerto').innerHTML;
$('segnalaconcerto').innerHTML='Non sei loggato.';
setTimeout(function () {
$('segnalaconcerto').innerHTML = temp;
}, 5000);
return;
}
var dpck = new DatePicker({
disablePastDate : true,
relative : 'segnalaconcertodata'
});
fixOpen2('segnalaconcertoform');
setTimeout(function(){
$('segnalaconcertoluogo').focus();
},500);
}
function segnalaconcertofindplace(obj,provinciaid) {
if (obj.value.length>2) {
qs = "k=" + escape(obj.value);
urlo = '/res/ajaxphp/ajax.cercavenue.php?'+qs;
$('segnalaconcertofound').innerHTML='cerco...';
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
$('segnalaconcertofound').style.display='';
$('segnalaconcertofound').innerHTML=transport.responseText;
},
onFailure: function(){}
});
} else {
$('segnalaconcertofound').innerHTML="";
$('segnalaconcertofound').style.display='none';
$('segnalaconcertocitta').enable();
$('segnalaconcertoprovincia').enable();
$('segnalaconcertotipovenue').value = "";
$('segnalaconcertovenue').value = "";
$('segnalaconcertocitta').value = "";
$('segnalaconcertoprovincia').value = "";
}
}
function segnalaconcertoset(tipo,nome,citta,prov,id) {
$('segnalaconcertotipovenue').value=tipo;
$('segnalaconcertoluogo').value=unescape(nome);
$('segnalaconcertocitta').value=unescape(citta);
$('segnalaconcertovenue').value=id;
$('segnalaconcertoprovincia').value=prov;
$('segnalaconcertocitta').disable();
$('segnalaconcertoprovincia').disable();
}
function segnalaconcerto() { //azione
var qs = "";
qs = 'u='+escape(MyRockitIdCrypted) +
'&b=' + escape($('segnalaconcertoband').value) +
'&d=' + escape($('segnalaconcertodata').value) +
'&l=' + escape($('segnalaconcertoluogo').value) +
'&c=' + escape($('segnalaconcertocitta').value) +
'&v=' + escape($('segnalaconcertovenue').value) +
'&t=' + escape($('segnalaconcertotipovenue').value) +
'&p=' + escape($('segnalaconcertoprovincia').value) +
'&i=' + escape($('segnalaconcertocivadosi').checked ? "1" : "0") +
'&a='+escape($('segnalaconcertoaltreinfo').value);
urlo = '/res/ajaxphp/ajax.segnalaconcerto.php?'+qs;
//
//rimette a posto la pagina
//
if ($('datepicker-segnalaconcertodata')) $('datepicker-segnalaconcertodata').style.display='none';
$('segnalaconcertocitta').value ='';
$('segnalaconcertocitta').enable();
$('segnalaconcertoluogo').value ='';
$('segnalaconcertotipovenue').value ='';
$('segnalaconcertovenue').value ='';
$('segnalaconcertoprovincia').value ='';
$('segnalaconcertoprovincia').enable();
$('segnalaconcertoaltreinfo').value ='';
$('segnalaconcertofound').innerHTML ='';
fixClose2('segnalaconcertoform');
var temp = $('segnalaconcerto').innerHTML;
$('segnalaconcerto').innerHTML='faccio...';
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
response = transport.responseText;
if (response=='ok') {
response = 'concerto inserito.';
window.location.reload();
}
$('segnalaconcerto').innerHTML=response;
},
onFailure: function(){ }
});
setTimeout(function () {
$('segnalaconcerto').innerHTML = temp;
}, 5000);
}
function segnalaconcertoclose() { //annulla
if ($('datepicker-segnalaconcertodata')) $('datepicker-segnalaconcertodata').style.display='none';
fixClose2('segnalaconcertoform');
}
/* ---------------------------- dateconcerti per locali e festival--------------------*/
function segnalaconcertovenueform() {
try { $('usereferer').value='si'; } catch (e) {}
if ($('segnalaconcertovenueform').style.display=="") {
segnalaconcertovenueclose()
return;
}
if (MyRockitIdCrypted == '') {
var temp = $('segnalaconcertovenue').innerHTML;
$('segnalaconcertovenue').innerHTML='Non sei loggato.';
setTimeout(function () {
$('segnalaconcertovenue').innerHTML = temp;
}, 5000);
return;
}
var dpck = new DatePicker({
disablePastDate : true,
relative : 'segnalaconcertovenuedata'
});
fixOpen2('segnalaconcertovenueform');
setTimeout(function(){ $('segnalaconcertovenuenomeband').focus(); },500);
}
function segnalaconcertovenuefindband(obj) {
if (obj.value.length>2) {
qs = "k=" + escape(obj.value);
urlo = '/res/ajaxphp/ajax.cercaband.php?'+qs;
$('segnalaconcertovenuefound').innerHTML='cerco...';
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
$('segnalaconcertovenuefound').style.display='';
$('segnalaconcertovenuefound').innerHTML=transport.responseText;
},
onFailure: function(){}
});
} else {
$('segnalaconcertovenuefound').innerHTML="";
$('segnalaconcertovenuefound').style.display='none';
$('segnalaconcertovenueband').value = "";
}
}
function segnalaconcertovenueset(nome,ida) {
$('segnalaconcertovenueband').value=ida;
$('segnalaconcertovenuenomeband').value=unescape(nome);
}
function segnalaconcertovenue() { //azione
var qs = "";
qs = 'u='+escape(MyRockitIdCrypted) +
'&b=' + escape($('segnalaconcertovenueband').value) +
'&v=' + escape($('segnalaconcertovenuevenue').value) +
'&t=' + escape($('segnalaconcertovenuetipo').value) +
'&d=' + escape($('segnalaconcertovenuedata').value) +
'&i=' + escape($('segnalaconcertovenuecivadosi').checked ? "1" : "0") +
'&a='+escape($('segnalaconcertovenuealtreinfo').value);
urlo = '/res/ajaxphp/ajax.segnalaconcertovenue.php?'+qs;
//
//rimette a posto la pagina
//
if ($('datepicker-segnalaconcertovenuedata')) $('datepicker-segnalaconcertovenuedata').style.display='none';
$('segnalaconcertovenueband').value ='';
$('segnalaconcertovenuefound').innerHTML ='';
fixClose2('segnalaconcertovenueform');
var temp = $('segnalaconcertovenue').innerHTML;
$('segnalaconcertovenue').innerHTML='faccio...';
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
response = transport.responseText;
if (response=='ok') {
response = 'concerto inserito.';
window.location.reload();
}
$('segnalaconcertovenue').innerHTML=response;
},
onFailure: function(){ }
});
setTimeout(function () {
$('segnalaconcertovenue').innerHTML = temp;
}, 5000);
}
function segnalaconcertovenueclose() { //annulla
if ($('datepicker-segnalaconcertovenuedata')) $('datepicker-segnalaconcertovenuedata').style.display='none';
fixClose2('segnalaconcertovenueform');
}
/* ----------- date concerti partecipanti --------------- */
function aggiungimiconcerto(code) {
var qs = "";
qs ='u='+escape(MyRockitIdCrypted) +
'&c=' + escape(code);
urlo = '/res/ajaxphp/ajax.aggiungimiconcerto.php?'+qs;
var temp = $('partecipa'+code).innerHTML;
$('partecipa'+code).innerHTML='faccio...';
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
response = transport.responseText;
if (response=='ok') {
response = 'fatto.';
}
$('partecipa'+code).innerHTML=response;
},
onFailure: function(){ }
});
setTimeout(function () {
$('partecipa'+code).innerHTML = temp;
}, 5000);
}
function ciandroelimina(id,idtarget) {
qs = 'u='+escape(idtarget)+'&x=' + id
urlo = '/res/ajaxphp/ajax.cancellaciandro.php?'+qs;
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
response = transport.responseText;
if (response=='ok') {
$('trCiandro'+id).remove();
} else {
alert(response);
}
},
onFailure: function(){ }
});
}
function concertosegnalatoelimina(id,idtarget,IDA) {
qs = 'u='+escape(idtarget)+'&x=' + id + '&IDA=' + IDA
urlo = '/res/ajaxphp/ajax.cancellaconcertosegnalato.php?'+qs;
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
response = transport.responseText;
// alert("("+response+")");
if (response=='oktot') {
$('trSegnalato'+id).remove();
} else if (response=='ok') {
$('span'+id+'_'+IDA).remove();
} else if (response=='oktutto') {
document.location.href = document.location.href;
} else {
alert(response);
}
},
onFailure: function(){ }
});
}
/*-----------------------------funzioni myrockit mp3--------------------------------------*/
function modificaMp3(id,idtarget) {
if ($('formMp3'+id).style.display=='none') {
$('formMp3'+id).style.display="";
$('datiMp3'+id).style.display="none";
$('formMp3'+id).innerHTML = "loading...";
var qs = 'u='+ escape(idtarget)+ '&x=' + id
urlo = '/res/ajaxphp/ajax.getformmp3.php?'+qs;
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
// form aperto e visibile.
response = transport.responseText;
$('formMp3'+id).innerHTML=response;
fixOpen('formMp3'+id);
},
onFailure: function(){ }
});
}
}
function salvaMp3(id) {
if ( isNaN($('formMp3'+id).num.value) || ($('formMp3'+id).num.value<=0) )
{
alert('Il numero traccia inserito non è corretto!');
$('formMp3'+id).num.focus();
return false;
}
if ($('formMp3'+id).titolo.value=='')
{
alert('Non hai inserito il titolo del brano!');
$('formMp3'+id).titolo.focus();
return false;
}
urlo = '/res/ajaxphp/ajax.saveformmp3.php';
var params = $('formMp3'+id).serialize();
new Ajax.Request(urlo, {
method:'get',
parameters: params,
onSuccess: function(transport){
window.location.reload();
},
onFailure: function(){ }
});
}
function eliminaMp3(id,idtarget) {
if (confirm('Vuoi davvero cancellare questo MP3?'))
{
var qs = 'u='+escape(idtarget)+'&x=' + id
urlo = '/res/ajaxphp/ajax.cancellamp3.php?'+qs;
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
response = transport.responseText;
if (response=='ok') {
window.location.reload();
} else {
alert(response);
}
},
onFailure: function(){ }
});
}
}
function annullaMp3(id) {
fixClose('formMp3' + id);
$('datiMp3'+id).style.display="";
}
/*-----------------------------funzioni myrockit video--------------------------------------*/
function modificaVideo(id,idtarget) {
if ($('formVideo'+id).style.display=='none') {
$('formVideo'+id).style.display="";
$('datiVideo'+id).style.display="none";
$('formVideo'+id).innerHTML = "loading...";
var qs = 'u='+ escape(idtarget)+ '&x=' + id
urlo = '/res/ajaxphp/ajax.getformvideo.php?'+qs;
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
// form aperto e visibile.
response = transport.responseText;
$('formVideo'+id).innerHTML=response;
fixOpen('formVideo'+id);
},
onFailure: function(){ }
});
}
}
function salvaVideo(id) {
if ($('formVideo'+id).titolo.value=='')
{
alert('Non hai inserito il titolo del brano!');
$('formVideo'+id).titolo.focus();
return false;
}
if (
($('formVideo'+id).url.value.search(/http:\/\//)==-1)
|| (
($('formVideo'+id).url.value.search(/google/)==-1) &&
($('formVideo'+id).url.value.search(/vimeo/)==-1) && ($('formVideo'+id).url.value.search(/youtube/)==-1) &&
($('formVideo'+id).url.value.search(/myspace/)==-1) && ($('formVideo'+id).url.value.search(/qoob/)==-1) &&
($('formVideo'+id).url.value.search(/flv/)==-1)
)
)
{
alert('L\'URL inserito non è corretto!');
$('formVideo'+id).url.focus();
return false;
}
urlo = '/res/ajaxphp/ajax.saveformvideo.php';
var params = $('formVideo'+id).serialize();
new Ajax.Request(urlo, {
method:'get',
parameters: params,
onSuccess: function(transport){
window.location.reload();
},
onFailure: function(){ }
});
}
function eliminaVideo(id,idtarget) {
if (confirm('Vuoi davvero cancellare il riferimento a questo video?'))
{
var qs = 'u='+escape(idtarget)+'&x=' + id
urlo = '/res/ajaxphp/ajax.cancellavideo.php?'+qs;
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
response = transport.responseText;
if (response=='ok') {
window.location.reload();
} else {
alert(response);
}
},
onFailure: function(){ }
});
}
}
function annullaVideo(id) {
fixClose('formVideo' + id);
$('datiVideo'+id).style.display="";
}
/*-----------------------------funzioni myrockit foto--------------------------------------*/
function modificaFoto(id,idtarget,fotoalbum) {
if ($('formFoto'+id).style.display=='none') {
$('formFoto'+id).style.display="";
$('datiFoto'+id).style.display="none";
$('formFoto'+id).innerHTML = "loading...";
var qs = 'u='+ escape(idtarget)+ '&x=' + id + '&y=' + fotoalbum
urlo = '/res/ajaxphp/ajax.getformfoto.php?'+qs;
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
// form aperto e visibile.
response = transport.responseText;
$('formFoto'+id).innerHTML=response;
fixOpen('formFoto'+id);
var dpck = new DatePicker({
disablePastDate : false,
disableFutureDate : true,
relative : 'data'+id
});
},
onFailure: function(){ }
});
}
}
function salvaFoto(id) {
if ($('file'+id).value=="") {
if (id>0) {
urlo = '/res/ajaxphp/ajax.saveformfoto.php';
var params = $('formFoto'+id).serialize();
new Ajax.Request(urlo, {
method:'get',
parameters: params,
onSuccess: function(transport){
// form aperto e visibile.
response = transport.responseText;
$('datiFoto'+id).style.display='';
$('datiFoto'+id).innerHTML=response;
$('formFoto'+id).style.display='none';
},
onFailure: function(){ }
});
}
} else {
$('formFoto'+id).submit();
}
}
function eliminaFoto(id,idtarget,fotoalbum) {
var qs = 'u='+escape(idtarget)+'&x=' + id+'&y=' + fotoalbum
urlo = '/res/ajaxphp/ajax.cancellafoto.php?'+qs;
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
response = transport.responseText;
if (response=='ok') {
$('liFoto'+id).remove();
} else {
alert(response);
}
},
onFailure: function(){ }
});
}
function annullaFoto(id) {
fixClose('formFoto' + id);
$('datiFoto'+id).style.display="";
}
/*-----------------------------funzioni myrockit foto album--------------------------------------*/
function modificaFotoAlbum(id,idtarget) {
if ($('formFotoAlbum'+id).style.display=='none') {
$('formFotoAlbum'+id).style.display="";
$('datiFotoAlbum'+id).style.display="none";
$('formFotoAlbum'+id).innerHTML = "loading...";
var qs = 'u='+ escape(idtarget)+ '&x=' + id
urlo = '/res/ajaxphp/ajax.getformfotoalbum.php?'+qs;
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
// form aperto e visibile.
response = transport.responseText;
$('formFotoAlbum'+id).innerHTML=response;
fixOpen('formFotoAlbum'+id);
var dpck = new DatePicker({
disablePastDate : false,
disableFutureDate : true,
relative : 'data'+id
});
},
onFailure: function(){ }
});
}
}
function salvaFotoAlbum(id) {
if (id>0) {
urlo = '/res/ajaxphp/ajax.saveformfotoalbum.php';
var params = $('formFotoAlbum'+id).serialize();
new Ajax.Request(urlo, {
method:'get',
parameters: params,
onSuccess: function(transport){
// form aperto e visibile.
response = transport.responseText;
$('datiFotoAlbum'+id).style.display='';
$('datiFotoAlbum'+id).innerHTML=response;
$('formFotoAlbum'+id).style.display='none';
},
onFailure: function(){ }
});
} else {
$('formFotoAlbum'+id).submit();
}
}
function eliminaFotoAlbum(id,idtarget) {
var qs = 'u='+escape(idtarget)+'&x=' + id
urlo = '/res/ajaxphp/ajax.cancellafotoalbum.php?'+qs;
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
response = transport.responseText;
if (response=='ok') {
$('liFotoAlbum'+id).remove();
} else {
alert(response);
}
},
onFailure: function(){ }
});
}
function annullaFotoAlbum(id) {
fixClose('formFotoAlbum' + id);
$('datiFotoAlbum'+id).style.display="";
}
/*-----------------------------funzioni myrockit modifica info concerto --------------------------------------*/
function modificaInfoConcerto(code,idtarget) {
if ($('formInfoConcerto'+code).style.display=='none') {
$('formInfoConcerto'+code).style.display="";
$('datiInfoConcerto'+code).style.display="none"; //contiene le info
$('formInfoConcerto'+code).innerHTML = "loading...";
var qs = 'u='+ escape(idtarget)+ '&x=' + code
urlo = '/res/ajaxphp/ajax.getforminfoconcerto.php?'+qs;
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
// form aperto e visibile.
response = transport.responseText;
$('formInfoConcerto'+code).innerHTML=response;
fixOpen('formInfoConcerto'+code);
},
onFailure: function(){ }
});
}
}
function salvaInfoConcerto(code) {
if (code>0) {
urlo = '/res/ajaxphp/ajax.saveforminfoconcerto.php';
var params = $('formInfoConcerto'+code).serialize();
new Ajax.Request(urlo, {
method:'get',
parameters: params,
onSuccess: function(transport){
// form aperto e visibile.
response = transport.responseText;
$('datiInfoConcerto'+code).style.display='';
$('datiInfoConcerto'+code).innerHTML=response;
$('formInfoConcerto'+code).style.display='none';
},
onFailure: function(){ }
});
} else {
$('formInfoConcerto'+id).submit();
}
}
function annullaInfoConcerto(code) {
fixClose('formInfoConcerto' + code);
$('datiInfoConcerto'+code).style.display="";
}
/*-----------------------------funzioni myrockit links band--------------------------------------*/
function modificaLink(id,idtarget) {
if ($("formLink"+id).style.display=='none') {
$('formLink'+id).style.display="";
$('datiLink'+id).style.display="none";
$('formLink'+id).innerHTML = "loading...";
qs = 'u='+escape(idtarget)+'&x=' + id
urlo = '/res/ajaxphp/ajax.getformlink.php?'+qs;
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
// form aperto e visibile.
response = transport.responseText;
$('formLink'+id).innerHTML=response;
fixOpen('formLink'+id);
},
onFailure: function(){ }
});
}
}
function salvaLink(id) {
$('formLink'+id).submit();
}
function eliminaLink(id,idtarget) {
qs = 'u='+escape(idtarget)+'&x=' + id
urlo = '/res/ajaxphp/ajax.cancellalink.php?'+qs;
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
response = transport.responseText;
if (response=='ok') {
$('liLink'+id).remove();
} else {
alert(response);
}
},
onFailure: function(){ }
});
}
function annullaLink(id) {
fixClose('formLink' + id);
$('datiLink'+id).style.display="";
}
/* ------------------- generi ------------------------------ */
function implode( glue, pieces ) {
return ( ( pieces instanceof Array ) ? pieces.join ( glue ) : pieces );
}
function conta(nome,j,max,formaname) {
var c = 0;
var obj = $(formaname).elements[nome];
for(var i=0; imax) {
obj[j-1].checked=false;
} else {
if (obj[j-1].checked) {
$(nome+'div'+j).style.textDecoration='underline';
var ar = $(nome+'hid').value.split(","); //split
ar[ar.length] = obj[j-1].value; //aggiungo
$(nome+'hid').value = implode(",",ar); //implode
} else {
$(nome+'div'+j).style.textDecoration='none';
var ar = $(nome+'hid').value.split(","); //split
for(i=0;i=2) {
qs = "k=" + escape(obj.value);
urlo = '/res/ajaxphp/ajax.cercauser.php?'+qs;
$('cercautentefound').innerHTML='cerco...';
$('cercautentefound').style.display='';
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
$('cercautentefound').style.display='';
$('cercautentefound').innerHTML=transport.responseText;
},
onFailure: function(){}
});
} else {
$('cercautentefound').innerHTML="";
$('cercautentefound').style.display='none';
$('cercautentefound').value = "";
}
}
function scegliutente(id,nome) {
$('nome_destinatario').value=unescape(nome);
$('cd_destinatario').value=id;
$('cercautentefound').innerHTML="";
$('cercautentefound').style.display='none';
$('cercautentefound').value = "";
}
function setNetwork(obj) {
if (obj.checked) {
$('nome_destinatario').value = "NETWORK";
$('nome_destinatario').disable();
$('cd_destinatario').value = "0";
$('cd_destinatario').disable();
$('cercautentefound').innerHTML="";
$('cercautentefound').style.display='none';
$('cercautentefound').value = "";
} else {
$('cd_destinatario').enable();
$('nome_destinatario').enable();
$('nome_destinatario').value = "";
}
}
function popplayer(id) {
var x = 500;
var y = 300;
var w=open("/user/popplayer.php?x="+id,"popupplayer","toolbar=no,status=no,menubar=no,scrollbars=yes"
+",resizable=no,location=no,directories=no,width="+x+",height="+y+"");
}
/*-----------------------------funzioni forum--------------------------------------*/
function forumGetQuotedBody(idboard,idmsg) {
$('quotebutton'+idmsg).innerHTML = " >> loading...";
qs = 'idboard='+idboard+'&idmsg='+idmsg;
urlo = '/res/ajaxphp/ajax.forumgetquotedbody.php?'+qs;
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
// form aperto e visibile.
response = transport.responseText;
$('body').value += response;
$('body').focus();
$('quotebutton'+idmsg).innerHTML = " ";
},
onFailure: function(){ }
});
}
/* ---------------------------- chiamata addme come ascoltatore --------------------*/
function inviainvito(i,email) {
var temp = $('invita'+i).innerHTML;
$('invita'+i).innerHTML='faccio...';
urlo = '/res/ajaxphp/ajax.sendinvito.php?b='+escape(email)+'&io='+escape(MyRockitIdCrypted);
// alert(urlo);
new Ajax.Request(urlo, {
method:'get',
onSuccess: function(transport){
var response = transport.responseText;
$('invita'+i).innerHTML=response;
},
onFailure: function(){ }
});
}
/*------------------------ switch pannelli home -----------*/
function switchPanelHome() {
var max = 0;
if ($('dallahome').getHeight()>$('dalfeed').getHeight()) max = $('dallahome').getHeight(); else max = $('dalfeed').getHeight();
$('contenutodx').style.height=max + "px";
if($('dallahome').style.display=='none') {
$('dallahome').style.display='';
$('dalfeed').style.display='none';
} else {
$('dalfeed').style.display='';
$('dallahome').style.display='none';
}
}