function autoclick(){ link_url = new Array(); j = 0; link_url_opere = new Array(); jo = 0; link_url_tag = new Array(); jt = 0; link_url_cloud = new Array(); jc = 0; for (var i = 0; i < document.links.length; i++) { if ((document.links[i].search.indexOf("id_page=navtag")!=-1) && (''+document.links[i]!=''+document.location) && (document.links[i].search.indexOf("setoperasequence=operesequencelasthome")==-1)) { link_url[j] = document.links[i]; j++; if (document.links[i].search.indexOf("id=")!=-1) { // opere link_url_opere[jo] = document.links[i]; jo++; } else if (document.links[i].search.indexOf("idtag=")!=-1) { // tag link_url_tag[jt] = document.links[i]; jt++; } else if (document.links[i].search.indexOf("idautore=")==-1) { // tag cloud link_url_cloud[jc] = document.links[i]; jc++; } } } if (link_url.length>0) { var locationstring = new String(document.location); if (locationstring.substr(locationstring.length-17,17)=='#operatitolostart' && Math.random()<0.4) { document.location = locationstring.substr(0,locationstring.length-17)+'&dummy=1#operecorrelate'; } else if (link_url_cloud.length>0 && Math.random()<0.06) { // tag cloud random_link_index = Math.floor((Math.random()*link_url_cloud.length)%link_url_cloud.length); // alert('tag: '+link_url_tag.length+' opera: '+link_url_opere.length+' tag cloud: '+link_url_cloud.length+':'+random_link_index+':'+link_url_cloud[random_link_index]); document.location = link_url_cloud[random_link_index]; } else if (link_url_opere.length>0 && Math.random()<0.6) { // opere random_link_index = Math.floor((Math.random()*link_url_opere.length)%link_url_opere.length); // alert('tag cloud: '+link_url_cloud.length+' tag: '+link_url_tag.length+' opera: '+link_url_opere.length+':'+random_link_index+':'+link_url_opere[random_link_index]); document.location = link_url_opere[random_link_index]; } else if (link_url_tag.length>0) { // tag random_link_index = Math.floor((Math.random()*link_url_tag.length)%link_url_tag.length); // alert('tag cloud: '+link_url_cloud.length+' opera: '+link_url_opere.length+':'+random_link_index+'tag: '+link_url_tag.length+':'+random_link_index+':'+link_url_tag[random_link_index]); document.location = link_url_tag[random_link_index]; } else if (link_url_cloud.length>0) { // tag random_link_index = Math.floor((Math.random()*link_url_cloud.length)%link_url_cloud.length); // alert('tag: '+link_url_tag.length+' opera: '+link_url_opere.length+' tag cloud: '+link_url_cloud.length+':'+random_link_index+':'+link_url_cloud[random_link_index]); document.location = link_url_cloud[random_link_index]; } /* random_link_index = Math.floor((Math.random()*link_url.length)%link_url.length); // alert(link_url.length+':'+random_link_index+':'+link_url[random_link_index]); document.location = link_url[random_link_index]; */ } } function confirmDeleteAndGo() { if (confirm("L'operazione di cancellazione irreversibile. Vuoi continuare?")) { return true; } else { return false; } } function confirmDelete(formName) { if (confirm("L'operazione di cancellazione irreversibile. Vuoi continuare?")) { window.document.forms[formName].submit(); } } function confirmDeleteMessage(formName, text) { if (confirm(text)) { window.document.forms[formName].submit(); } } function findAndSelect(formName,controlName,table) { var url; url = "/arsmeteo/main.php?page=search&target="+table+"&fn="+formName+"&cn="+controlName+"&search=" + window.document.forms[formName].elements[controlName+"_cerca"].value; myWindow = window.open(url, "Elenco","dependent=yes,width=400,height=500,scrollbars=yes"); } function findAndSelect2(formName,controlName,table) { var url; url = "/arsmeteo/main.php?page=link&onlypage=1&formname="+formName+"&textname="+controlName; myWindow = window.open(url, "Link","dependent=yes,width=400,height=500,scrollbars=yes"); } function findAndSelect3(formName,controlName,table) { var url; url = "/arsmeteo/main.php?page=search_banner&target="+table+"&fn="+formName+"&cn="+controlName+"&search=" + window.document.forms[formName].elements[controlName+"_cerca"].value; myWindow = window.open(url, "Elenco","dependent=yes,width=400,height=500,scrollbars=yes"); } function setValue(formName,controlName1,value1,controlName2,value2) { window.opener.document.forms[formName].elements[controlName1].value = value1; window.opener.document.forms[formName].elements[controlName2].value = value2; window.close(); } function setLink(formName,textName,linkValue) { window.opener.document.forms[formName].elements[textName].value = linkValue; window.close(); } function vai(destination) { //window.document.location.replace(destination); window.document.location = destination; } function openDetail(url) { var nuovaFinestra; nuovaFinestra = window.open(url,'nuovaFinestra'); } function openNew(url) { var nuovaFinestra; nuovaFinestra = window.open(url,'nuovaFinestra', "dependent=yes,width=800,height=640,scrollbars=yes,location=no,menubar=no,resizable=yes,status=no,titlebar=no"); } function openNewBig(url) { var nuovaFinestra; nuovaFinestra = window.open(url,'nuovaFinestra', "dependent=yes,scrollbars=yes,location=no,menubar=no,resizable=yes,status=no,titlebar=no"); } /* chiude la popup e redirige all'indirizzo indicato */ function closeAndGo(url) { window.opener.document.location = url; window.close(); } /* Testa se la lunghezza del testo contenuto sia uguale a quella passata e passa il fuoco all'elemento corrente + offset */ function changeFocusOffset (InputObj, InputLen, offset) { if (InputObj.value.length == InputLen) { var i; for (i = 0; i < InputObj.form.length; i++) if (InputObj.form.elements[i].name == InputObj.name) break; i += offset; if (i < InputObj.form.length) InputObj.form.elements[i].focus(); } } function internalLink(formname, textname) { var url; url = "/arsmeteo/main.php?page=link&formname="+formname+"&textname="+textname; myWindow = window.open(url, "Link","dependent=yes,width=300,height=640,scrollbars=yes,location=no"); } function visibilityname() { if(navigator.appName == 'Microsoft Internet Explorer'){ return 'inline'; } else { return 'table-row'; } } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(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) { idx = specName.indexOf(","); if (idx!=-1) { specEl = specName.substr(0,idx); specName = specName.substr(idx+1); } else { specEl = specName; specName = ''; }; eval(specEl+".style.display=(visibile?'inline':'none')"); } }