// GLOBAL FUNCTION //varibili per il rating var timerID; var myWidthOLD; var myHeightOLD; var mylightBoxObj; var session_up=false; var chat_users_request_obj=false; if (window.XMLHttpRequest) // try to create XMLHttpRequest chat_users_request_obj = new XMLHttpRequest(); if (window.ActiveXObject) // if ActiveXObject use the Microsoft.XMLHTTP chat_users_request_obj = new ActiveXObject("Microsoft.XMLHTTP"); window.onload = function(){ MM_preloadImages('/_images/headerMenu1_f2.jpg','/_images/headerMenu2_f2.jpg','/_images/headerMenu3_f2.jpg','/_images/headerMenu3_f2.jpg','/_images/headerMenu4_f2.jpg','/_images/headerMenu5_f2.jpg'); caricaFlashAvvio(); initRateAct(); // settaAvvio(); /* initVideoMenu(); initUserMenu(); initContestVideoMenu(); */ } function startloadChatUserList(){ setInterval("loadChatUserList();",10000); } function loadChatUserList(){ chat_users_request_obj.open("GET", "/_php/chatUsers.php" , true); chat_users_request_obj.onreadystatechange = loadChatUserListRes; chat_users_request_obj.send(null); } function loadChatUserListRes(){ if (chat_users_request_obj.readyState==4) { if (chat_users_request_obj.responseText.indexOf('invalid') == -1) { document.getElementById("lista_utenti_chat").innerHTML=chat_users_request_obj.responseText; } } } function apriLightBox(href,tit){ showLightbox(href,tit); } function setIframeSrc(src){ myFrame=document.getElementById("flashback"); if(myFrame){ myFrame.src=src; } } function showMap(){ document.getElementById("homemap").style.display = "block"; flashWriter("homemap",400,400,"/_fp/matera_sensibile.swf?","transparent") } function hideMap(){ document.getElementById("homemap").style.display = "none"; document.getElementById("homemap").innerHTML="MAPPA SENSIBILE"; } function setGeo(cnt){ if(document.getElementById("geo")) { document.getElementById("geo").value = cnt; } } function popupwindow(LarghezzaCont,AltezzaCont,Pagina,nome,scrol,stat) { var lsBrowser = navigator.appName; var navInfo = navigator.userAgent; if (scrol == "yes") { if (navInfo == "Mac" && lsBrowser.indexOf("Microsoft") >= 0) { aw = 0; } else { aw = 17; } } else { aw = 0; } var iMyWidth; var iMyHeight; var LarghezzaPagina; var AltezzaPagina; LarghezzaPagina = screen.availWidth; AltezzaPagina = screen.availHeight; LarghezzaCont=LarghezzaCont.toUpperCase() AltezzaCont=AltezzaCont.toUpperCase() if (LarghezzaCont == "FULL") { LarghezzaWindow = screen.availWidth; } else { LarghezzaWindow = parseInt(LarghezzaCont) + aw; } if (AltezzaCont == "FULL") { AltezzaWindow = screen.availHeight; } else { AltezzaWindow = AltezzaCont; } iMyWidth = (LarghezzaPagina/2) - (LarghezzaWindow/2); iMyHeight = (AltezzaPagina/2) - (AltezzaWindow/2); win = window.open(Pagina,nome,"height=" + AltezzaWindow + ",width=" + LarghezzaWindow + ",menubar=0,resizable=yes,scrollbars=" + scrol + ",status=" + stat + ",titlebar=0,toolbar=0,left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ""); win.focus(); } function MM_preloadImages() { //v3.0 var d=document; if(d.images) { if(!d.MM_p) { d.MM_p=new Array(); } var j=d.MM_p.length; var a=arguments; for(var i=0; i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i0){ loadAjaxContestVideoXML('/_php/postList.php?act=contest&id='+id_contest,-1,id_contest); } } function openFileUpFormVideo(){ for(var i=0;i<9;i++){ document.getElementById("file"+i).value=""; if(i>0) chiudiDIV("file"+i+"cnt"); } apriDIV("file0cnt"); } function openFileUpFormFoto(){ for(var i=0;i<9;i++){ document.getElementById("file"+i).value=""; apriDIV("file"+i+"cnt"); } } function openFileUpFormTesto(){ for(var i=0;i<9;i++){ document.getElementById("file"+i).value=""; chiudiDIV("file"+i+"cnt"); } } function aprichiudi(actdiv){ if(document.getElementById(actdiv).style.display=="block"){ document.getElementById(actdiv).style.display="none"; }else{ document.getElementById(actdiv).style.display="block"; } } function apriDIV(actdiv){ document.getElementById(actdiv).style.display="block"; } function chiudiDIV(actdiv){ document.getElementById(actdiv).style.display="none"; } function azionaMenuProgramma(actdiv,str){ document.getElementById("menuA0").innerHTML="Mattina"; document.getElementById("menuA1").innerHTML="Pomeriggio"; document.getElementById("menuA2").innerHTML="Sera"; document.getElementById("menuA3").innerHTML="Notte"; for(var i=0;i<4;i++){ if(i==actdiv){ document.getElementById("blocco_"+i).style.display="block"; document.getElementById("menuA"+i).innerHTML=""+str+""; }else{ document.getElementById("blocco_"+i).style.display="none"; } } } function apriDIVMenu(actdiv){ document.getElementById("blocco_"+actdiv).style.display="block"; document.getElementById("menuA"+actdiv).setAttribute("class", "menuProgrammiSel"); } function chiudiDIVMenu(actdiv){ document.getElementById("blocco_"+actdiv).style.display="none"; document.getElementById("menuA"+actdiv).setAttribute("class", ""); } function apriDIVMenuSearch(actdiv){ document.getElementById("blocco_"+actdiv).style.display="block"; if(actdiv==0){ document.getElementById("videoChannelMenuItem0").innerHTML="POST"; document.getElementById("videoChannelMenuItem1").innerHTML="UTENTI"; }else{ document.getElementById("videoChannelMenuItem0").innerHTML="POST"; document.getElementById("videoChannelMenuItem1").innerHTML="UTENTI"; } } function chiudiDIVMenuSearch(actdiv){ document.getElementById("blocco_"+actdiv).style.display="none"; } function checkData(){ mf=document.register; tmp = mf.nick.value; if(tmp.length < 1) { alert("Inserisci il Nickname."); mf.nick.focus(); return false; }; if(tmp.length > 12 || tmp.length < 4 ) { alert("Inserisci un Nickname compreso tra i 4 e i 12 caratteri."); mf.nick.focus(); return false; }; // email control if(window.RegExp) { var rexp=new RegExp("^[_a-zA-Z0-9-]+(\\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*(\\.([a-zA-Z]){2,4})$"); if(!rexp.test(mf.email.value)) { alert("L\'e-mail deve avere questo formato: username@dominio.it \r\n\""+mf.email.value+"\" non è un indirizzo valido. Verificalo e prova di nuovo."); mf.email.focus(); return false; }; }else { if(!(mf.email.value.indexOf("@") > 0)) { alert("L\'e-mail deve avere questo formato: username@do.ma.in \r\n'"+mf.email.value+"' non è un indirizzo valido. Verificalo e prova di nuovo."); mf.email.focus(); return false; } } tmp = mf.nome.value; if(tmp.length < 1) { alert("Inserisci il Nome"); mf.nome.focus(); return false; }; tmp = mf.cognome.value; if(tmp.length < 1) { alert("Inserisci il Cognome"); mf.cognome.focus(); return false; }; // return true if the input date is valid, false otherwise day = mf.gg.value; month = mf.mm.value-1; //The month needs to be a 0 (zero) for Jan, up to 11 to Dec. year = mf.aaaa.value; dteDate=new Date(year,month,day); if (!((day==dteDate.getDate()) && (month==dteDate.getMonth()) && (year==dteDate.getFullYear()))) { alert("Inserisci una data valida."); mf.gg.focus(); return false; }; tmp = mf.citta.value; if(tmp.length < 1) { alert("Inserisci la Citta'."); mf.citta.focus(); return false; }; tmp = mf.prov; if(tmp.selectedIndex==0) { alert("Seleziona la Provincia."); mf.prov.focus(); return false; }; tmp = mf.telefono.value; if(tmp.length < 1) { alert("Inserisci il telefono."); mf.telefono.focus(); return false; }; if(!mf.sesso[0].checked && !mf.sesso[1].checked){ alert("Specifica il Sesso."); mf.sesso[0].focus(); return false; }; if(!mf.consenso[0].checked){ alert("Per registrarti devi aderire alle condizioni di trattamento dei dati personali."); mf.consenso[0].focus(); return false; }; return true; } function checkDataEdit(){ mf=document.register; tmp = mf.passwd.value; tmp2 = mf.passwd2.value; if(tmp.length > 0){ if(tmp.length > 12 || tmp.length < 4 ){ alert("Inserisci una Password compresa tra i 4 e i 12 caratteri."); return false; }else{ if(tmp!=tmp2){ alert("Verifica che la password fornita coincida con la password di conferma."); return false; } } } // email control if(window.RegExp){ var rexp=new RegExp("^[_a-zA-Z0-9-]+(\\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*(\\.([a-zA-Z]){2,4})$"); if(!rexp.test(mf.email.value)){ alert("L\'e-mail deve avere questo formato: username@dominio.it \r\n\""+mf.email.value+"\" non è un indirizzo valido. Verificalo e prova di nuovo."); mf.email.focus(); return false; } }else{ if(!(mf.email.value.indexOf("@") > 0)){ alert("L\'e-mail deve avere questo formato: username@dominio.it \r\n'"+mf.email.value+"' non è un indirizzo valido. Verificalo e prova di nuovo."); mf.email.focus(); return false; } } tmp = mf.nome.value; if(tmp.length < 1){ alert("Inserisci il Nome"); mf.nome.focus(); return false; } tmp = mf.cognome.value; if(tmp.length < 1){ alert("Inserisci il Cognome"); mf.cognome.focus(); return false; } // return true if the input date is valid, false otherwise day = mf.gg.value; month = mf.mm.value-1; //The month needs to be a 0 (zero) for Jan, up to 11 to Dec. year = mf.aaaa.value; dteDate=new Date(year,month,day); if (!((day==dteDate.getDate()) && (month==dteDate.getMonth()) && (year==dteDate.getFullYear()))){ alert("Inserisci una data valida."); mf.gg.focus(); return false; } tmp = mf.citta.value; if(tmp.length < 1){ alert("Inserisci la Citta'."); mf.citta.focus(); return false; } /*tmp = mf.prov; if(tmp.selectedIndex==0){ alert("Seleziona la Provincia."); mf.prov.focus(); return false; }*/ if(!mf.sesso[0].checked && !mf.sesso[1].checked){ alert("Specifica il Sesso."); mf.sesso[0].focus(); return false; } tmp = mf.telefono.value; if(tmp.length < 1){ alert("Inserisci il telefono."); mf.telefono.focus(); return false; } if(!mf.abbonato[0].checked && !mf.abbonato[1].checked){ alert("Specifica se sei Abbonato."); mf.abbonato[0].focus(); return false; } return true; } function checkPostData(){ mf=document.post; tmp = mf.titolo.value; if(tmp.length < 1){ alert("Inserisci il Titolo."); mf.titolo.focus(); return false; } /* var tot_contest=0; if(document.getElementById("tot_contest")){ tot_contest=parseInt(document.getElementById("tot_contest").value); for(var i=0;i1){ var estVideoArray = new Array("mov", "avi", "wmv", "mpg"); if(!validateFileName(mf.file0.value,estVideoArray)){ mf.file0.value=""; mf.file0.focus(); return false; } } if(mf.tipo_file[1].checked){ var estPhotoArray = new Array("gif", "jpg", "png"); if(mf.file0.value.length>1){ if(!validateFileName(mf.file0.value,estPhotoArray)){ mf.file0.value=""; mf.file0.focus(); return false; } } if(mf.file1.value.length>1){ if(!validateFileName(mf.file1.value,estPhotoArray)){ mf.file1.value=""; mf.file1.focus(); return false; } } if(mf.file2.value.length>1){ if(!validateFileName(mf.file2.value,estPhotoArray)){ mf.file2.value=""; mf.file2.focus(); return false; } } if(mf.file3.value.length>1){ if(!validateFileName(mf.file3.value,estPhotoArray)){ mf.file3.value=""; mf.file3.focus(); return false; } } if(mf.file4.value.length>1){ if(!validateFileName(mf.file4.value,estPhotoArray)){ mf.file4.value=""; mf.file4.focus(); return false; } } } if(mf.tipo_file[0].checked){ mf.file1.value=""; mf.file2.value=""; mf.file3.value=""; mf.file4.value=""; } if(!mf.consenso_1.checked || !mf.consenso_2.checked || !mf.consenso_3.checked){ alert("Accetta tutte le condizioni legali."); mf.consenso_1.focus(); return false; } return true; } var STag= new Array(); function addStag(id,tname){ if(STag.length==0){ STag[0]=tname; document.getElementById(id).style.color="#EFC700"; }else{ allowAdd=true; remPos=0; STagStr=""; for(i=0;i<(STag.length);i++){ if(STag[i]==tname){ allowAdd=false; remPos=i; break; } } if(allowAdd){ STag[STag.length]=tname; document.getElementById(id).style.color="#EFC700"; }else{ STag.splice(remPos,1); document.getElementById(id).style.color="black"; } } } function checkMsg(){ if(document.posta.commento.value.length <= 1){ alert("Inserisci il testo del commento."); return false; }else{ return true; } } function checkOut(Obj){ if(Obj.options[Obj.selectedIndex].value!="17"){ document.getElementById("divtestata").style.display="none"; document.getElementById("testata").value=""; }else{ document.getElementById("divtestata").style.display="block"; } } function moveTopScroll(){ window.scrollTo(0,0); } var maxchar=7000 function checkLimit(obj){ if(obj.value.length>maxchar){ alert("Il testo non deve superare i 7.000 caratteri"); obj.value=obj.value.substring(0,maxchar); } } function checkTextLimit(obj){ if(obj.value.length>999){ alert("Il testo non deve superare i 1000 caratteri"); obj.value=obj.value.substring(0,999); } } function validateFileName(str,est) { var charValid = false; if(str.indexOf("/")!=-1 && (str.lastIndexOf("/")+1)0) { //valido i caratteri for (var i = 0; i=48 && codice<=57) || (codice>=65 && codice<=90) || (codice>=97 && codice<=122)) { charValid = true; } else { charValid = false; msg_str_err+=" - il carattere: "+str.charAt(i)+" non valido, e' possibile usare solo caratteri alfanumerici ed i simboli '.' '-' '_'\n"; break; } } //valido le estensioni var myest = str.substr((str.length-3)); var estValid = false; for (var j = 0; j