
function ControlVersion()
{var version;var axo;var e;try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");version=axo.GetVariable("$version");}catch(e){}
if(!version)
{try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");version="WIN 6,0,21,0";axo.AllowScriptAccess="always";version=axo.GetVariable("$version");}catch(e){}}
if(!version)
{try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");version=axo.GetVariable("$version");}catch(e){}}
if(!version)
{try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");version="WIN 3,0,18,0";}catch(e){}}
if(!version)
{try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");version="WIN 2,0,0,11";}catch(e){version=-1;}}
return version;}
function GetSwfVer(){var flashVer=-1;if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var swVer2=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";var flashDescription=navigator.plugins["Shockwave Flash"+swVer2].description;var descArray=flashDescription.split(" ");var tempArrayMajor=descArray[2].split(".");var versionMajor=tempArrayMajor[0];var versionMinor=tempArrayMajor[1];var versionRevision=descArray[3];if(versionRevision==""){versionRevision=descArray[4];}
if(versionRevision[0]=="d"){versionRevision=versionRevision.substring(1);}else if(versionRevision[0]=="r"){versionRevision=versionRevision.substring(1);if(versionRevision.indexOf("d")>0){versionRevision=versionRevision.substring(0,versionRevision.indexOf("d"));}}
var flashVer=versionMajor+"."+versionMinor+"."+versionRevision;}}
else if(navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1)flashVer=4;else if(navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1)flashVer=3;else if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1)flashVer=2;else if(isIE&&isWin&&!isOpera){flashVer=ControlVersion();}
return flashVer;}
function DetectFlashVer(reqMajorVer,reqMinorVer,reqRevision)
{versionStr=GetSwfVer();currentFlashVersion=versionStr;if(versionStr==-1){return false;}else if(versionStr!=0){if(isIE&&isWin&&!isOpera){tempArray=versionStr.split(" ");tempString=tempArray[1];versionArray=tempString.split(",");}else{versionArray=versionStr.split(".");}
var versionMajor=versionArray[0];var versionMinor=versionArray[1];var versionRevision=versionArray[2];if(versionMajor>parseFloat(reqMajorVer)){return true;}else if(versionMajor==parseFloat(reqMajorVer)){if(versionMinor>parseFloat(reqMinorVer))
return true;else if(versionMinor==parseFloat(reqMinorVer)){if(versionRevision>=parseFloat(reqRevision))
return true;}}
return false;}}
function inserisciSWF(){if(flashSupported){if(typeof(insertFlash)!="undefined"){for(swf in insertFlash){var flash=document.getElementById(swf);if(flash){flash.innerHTML=insertFlash[swf];}}}}else{for(swf in insertFlash){var flash=document.getElementById(swf);if(flash){flash.innerHTML="<p class=\"noflaash\">La tua versione ("+currentFlashVersion+") di flash player non è aggiornata, questo sito richiede almeno la versione ("+reqMajorVer+"."+reqMinorVer+"."+reqRevision+")</p>";}}}}
function nascondiMostraFlash(visualizza){if(insertFlash){for(swf in insertFlash){var flash=document.getElementById(swf);flash.style.visibility=visualizza;}}}
function shot(str,w,h){var option;var href;option="scrollbars=yes, resizable=yes, status=no, location=no, toolbar=no";href=location.href.substr(0,location.href.lastIndexOf("index.php"));str=href+str;if(w&&w>0)option+=",width="+w;if(h&&h>0)option+=",height="+h;window.open(str,'',option);}
function getMouseCoordsWithinEventTarget(event){var coords={x:0,y:0};if(!event)
{event=window.event;coords.x=event.offsetX;coords.y=event.offsetY;}
else
{var Element=event.target;var CalculatedTotalOffsetLeft=0;var CalculatedTotalOffsetTop=0;while(Element.offsetParent)
{CalculatedTotalOffsetLeft+=Element.offsetLeft;CalculatedTotalOffsetTop+=Element.offsetTop;Element=Element.offsetParent;}
coords.x=event.pageX-CalculatedTotalOffsetLeft;coords.y=event.pageY-CalculatedTotalOffsetTop;}
return coords;}
function getPageCoords(emt)
{var coords={x:0,y:0};while(emt)
{coords.x+=emt.offsetLeft;coords.y+=emt.offsetTop;emt=emt.offsetParent;}
return coords;}
function isElement(node){return(node.nodeType==1);}
function closeSub(menu){for(var i=0;i<menu.childNodes.length;i++)
if(menu.childNodes[i].nodeName.toLowerCase()=="li"){li=menu.childNodes[i];li.onmouseover=li.onactivate=li.onfocus=function(){if(this.subMenu){this.subMenu.className=this.subMenu.className.replace(/subMenu-off/g,"subMenu-on");}};li.onmouseout=li.ondeactivate=li.onblur=function(){if(this.subMenu)closeSub(this.subMenu)};for(j=0;j<li.childNodes.length;j++)
if(li.childNodes[j].nodeName.toLowerCase()=="ul"||li.childNodes[j].nodeName.toLowerCase()=="ol")closeSub(li.subMenu=li.childNodes[j]);}
menu.className=menu.className.replace(/\s?subMenu-on/g,"")+" subMenu-off";}
function menu_init(){if(tags_=document.getElementsByTagName('ul'))
for(i=0;i<tags_.length;i++)
if(tags_[i].className==menuClassName)closeSub(tags_[i]);if(tags_=document.getElementsByTagName('ol'))
for(i=0;i<tags_.length;i++)
if(tags_[i].className==menuClassName)closeSub(tags_[i]);document.getElementById("menu").style.visibility="visible";}
function sottomenuSezioni(){$$('li.onOff').each(function(li){li.onmouseover=function(){document.getElementById("stmSx"+this.id.substring(3)).className="stmSxHover";document.getElementById("stmA"+this.id.substring(3)).className="bgHover";document.getElementById("stmDx"+this.id.substring(3)).className="stmDxHover";};li.onmouseout=function(){document.getElementById("stmSx"+this.id.substring(3)).className="stmSx";document.getElementById("stmA"+this.id.substring(3)).className="bgDefault";document.getElementById("stmDx"+this.id.substring(3)).className="stmDx";};});}
var errors="";function controllaForm(form){form.nome.controlla=true;form.azienda.controlla=true;form.telefono.controlla=true;form.email.controlla=true;form.email.mail=true;form.richiesta.controlla=true;return verify(form);}
function verify(f)
{errors="";var empty_fields="";var checkOk=true;for(var i=0;i<f.length;i++){var e=f.elements[i];if(e.type=="checkbox"){if((e.controlla)&&(e.checked==0)){empty_fields+="\n          "+e.name;checkOk=false;continue;}}else if(((e.type=="text")||(e.type=="textarea"))){if((e.controlla)&&((e.value==null)||(e.value=="")||isblank(e.value))){empty_fields+="\n          "+e.name;checkOk=false;continue;}
if((e.value==null)||(e.value=="")||isblank(e.value)){continue;}
if(e.numeric||(e.min!=null)||(e.max!=null)){var v=parseFloat(e.value);if(isNaN(v)||((e.min!=null)&&(v<e.min))||((e.max!=null)&&(v.value>e.max))){if(e.controlla)checkOk=false;errors+="-Il campo "+e.name+" deve essere un numero";if(e.min!=null)errors+=" maggiore di "+e.min;if(e.max!=null&&e.min!=null)
errors+=" e minore di "+e.max;else if(e.max!=null)
errors+=" minore di "+e.max;errors+=".\n";}}else if(e.value.length>0){if(e.mail){Filtro=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;if(!Filtro.test(e.value)){errors+="Il campo mail "+e.name+" contiene un indirizzo non valido!!\n";checkOk=false;}}else if(e.telefonico){checkOk=isTelefonico(e.value);if(!checkOk)errors+="Il campo "+e.name+" contiene dati non validi!!\n";}else if(e.checkPIVA){checkOk=ControllaPIVA(e.value);}else if(e.codiceFiscale){checkOk=ControllaCF(e.value);}else if(e.user){checkOk=isTelefonico(e.value);if(!checkOk)errors+="Il campo "+e.name+" contiene dati non validi!!\n";}}}}
if(errors||empty_fields){msg="____________________________________________________\n";if(empty_fields){msg+="- I seguenti campi richiesti risultano vuoti:"+empty_fields+"\n";if(errors)msg+="\n";}
msg+=errors;msg+="____________________________________________________";alert(msg);}
if(checkOk){return true;}else{return false;}}
function ControllaCF(cf)
{var validi,i,s,set1,set2,setpari,setdisp;if(cf=='')return false;cf=cf.toUpperCase();if(cf.length!=16)
errors+="La lunghezza del codice fiscale non è corretta: il codice fiscale dovrebbe essere lungo esattamente 16 caratteri.\n";validi="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for(i=0;i<16;i++){if(validi.indexOf(cf.charAt(i))==-1){errors+="<strong>Il codice fiscale</strong> contiene un carattere non valido `"+cf.charAt(i)+"'.I caratteri validi sono le lettere e le cifre.\n";return false;}}
set1="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";set2="ABCDEFGHIJABCDEFGHIJKLMNOPQRSTUVWXYZ";setpari="ABCDEFGHIJKLMNOPQRSTUVWXYZ";setdisp="BAKPLCQDREVOSFTGUHMINJWZYX";s=0;for(i=1;i<=13;i+=2)
s+=setpari.indexOf(set2.charAt(set1.indexOf(cf.charAt(i))));for(i=0;i<=14;i+=2)
s+=setdisp.indexOf(set2.charAt(set1.indexOf(cf.charAt(i))));if(s%26!=cf.charCodeAt(15)-'A'.charCodeAt(0)){errors+="Il codice fiscale non è corretto: il codice di controllo non corrisponde.\n";return false;}
return true;}
function ControllaPIVA(pi)
{if(pi=='')return false;if(pi.length!=11){errors+="La lunghezza della partita IVA non è corretta: la partita IVA dovrebbe essere lunga esattamente 11 caratteri.\n";return false;}
validi="0123456789";for(i=0;i<11;i++){if(validi.indexOf(pi.charAt(i))==-1){errors+="La partita IVA contiene un carattere non valido `"+pi.charAt(i)+"'.I caratteri validi sono le cifre.\n";return false;}}
s=0;for(i=0;i<=9;i+=2)
s+=pi.charCodeAt(i)-'0'.charCodeAt(0);for(i=1;i<=9;i+=2){c=2*(pi.charCodeAt(i)-'0'.charCodeAt(0));if(c>9)c=c-9;s+=c;}
if((10-s%10)%10!=pi.charCodeAt(10)-'0'.charCodeAt(0)){errors+="La partita IVA non ?alida: il codice di controllo non corrisponde.\n";return false;}
return true;}
function isblank(s){for(var i=0;i<s.length;i++){var c=s.charAt(i);if((c!=' ')&&(c!='\n')&&(c!='\t'))return false;}
return true;}
function isNumeric(stringa){if(isNaN(stringa)){return true;}else{return false;}}
function isTelefonico(stringa){if(!isNaN(stringa)){return true;}else{return false;}}
function controllaDaMaschera(stringa,maschera){}
var posizioneCont=0;var spostamentoX=730;var request=null;function provaMappa(){var _str=encodeURIComponent("strada saliceto panaro");var _cit=encodeURIComponent("modena");var url="http://www.parkerriver.com/s/dd?"+_str+"&tlt=44.628710&tln=10.969854&csz="+_cit+"%2Citaly&country=it&tname=dipnet";httprequest("GET",url,true,handleResponse);}
function handleResponse(){if(request.readyState==200){alert(request.responseText);}else{}}
function httprequest(reqType,url,async,respHandle){if(window.XMLHttpRequest){request=new XMLHttpRequest();if(request.overrideMimeType){request.overrideMimeType('text/xml');}}else if(window.ActiveXObject){try{request=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{request=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}}
if(request){if(reqType.toLowerCase()!="post"){initReq(reqType,url,async,respHandle);}else{var args=arguments[4];if(args!=null&&args.length>0){initReq(reqType,url,async,respHandle,args);}}}else{alert("non va un quel!!");}}
function initReq(reqType,url,bool,respHandle){try{document.write(url);request.open(reqType,"www.dipnet.net",bool);request.onreadystatechange=respHandle;if(reqType.toLowerCase()=="post"){request.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=UTF-8");request.send(arguments[4]);}else{request.send(null);}}catch(errv){alert(errv.message);}}
function do_init(){document.getElementById("linkForm").style.background="#96bf0d";document.getElementById("linkForm").style.color="#2f2f2f";document.getElementById("frecciaForm").className="frecciaGrigiaVerde";settaBottoneMappa();$("btResetta").href="javascript: void 0;";$("btResetta").onclick=function(){$("formContatti").reset();}
$("btInvia").href="javascript: void 0;";$("btInvia").onclick=function(){if(verify($("formContatti")))$("formContatti").submit();}
var objForm=$("formContatti");objForm.nome.controlla=true;objForm.email.controlla=true;objForm.email.mail=true;objForm.commento.controlla=true;objForm.autorizzazione.controlla=true;}
function settaBottoneRichiesta(){var form=document.getElementById("linkForm");form.href="javascript:void 0";form.onclick=function(){if(parseInt(posizioneCont)=="730"){x="-730";posizioneCont=0;}else if(parseInt(posizioneCont)==0){x="730";posizioneCont="730";}
new Effect.MoveBy('contMappa',0,x,{duration:2,fps:25,from:0.0,to:1.0,afterFinish:entraForm});}};function entraForm(){if(parseInt(posizioneCont)==0){x="730";posizioneCont="730";}else if(parseInt(posizioneCont)=="730"){x="-730";posizioneCont=0;}
new Effect.MoveBy('form',0,x,{duration:2,fps:25,from:0.0,to:1.0});document.getElementById("linkForm").style.background="#96bf0d";document.getElementById("linkForm").style.color="#2f2f2f";document.getElementById("frecciaForm").className="frecciaGrigiaVerde";document.getElementById("linkDove").style.background="#2f2f2f";document.getElementById("linkDove").style.color="#96bf0d";document.getElementById("frecciaDove").className="frecciaVerdeNera";document.getElementById("linkForm").onclick=function(){}
settaBottoneMappa();};function settaBottoneMappa(){var dove=document.getElementById("linkDove");dove.href="javascript:void 0";dove.onclick=function(){if(parseInt(posizioneCont)==0){x="730";posizioneCont="730";}else if(parseInt(posizioneCont)=="730"){x="-730";posizioneCont=0;}
var effetto=new Effect.MoveBy('form',0,x,{duration:2,fps:25,from:0.0,to:1.0,afterFinish:entraMappa});}};function entraMappa(){if(parseInt(posizioneCont)=="730"){x="-730";posizioneCont=0;}else if(parseInt(posizioneCont)==0){x="730";posizioneCont="730";}
new Effect.MoveBy('contMappa',0,x,{duration:2,fps:25,from:0.0,to:1.0,afterFinish:caricaMappa});document.getElementById("linkDove").style.background="#96bf0d";document.getElementById("linkDove").style.color="#2f2f2f";document.getElementById("frecciaDove").className="frecciaGrigiaVerde";document.getElementById("linkForm").style.background="#2f2f2f";document.getElementById("linkForm").style.color="#96bf0d";document.getElementById("frecciaForm").className="frecciaVerdeNera";document.getElementById("linkDove").onclick=function(){}
settaBottoneRichiesta()};function caricaMappa(){if(document.getElementById("mappa")){if(GBrowserIsCompatible()){var map=new GMap2(document.getElementById("mappa"));map.setCenter(new GLatLng(44.629741,10.969854),16);map.addControl(new GLargeMapControl());map.addControl(new GMapTypeControl());map.setMapType(G_HYBRID_MAP);var point=new GLatLng(44.628641,10.969754);var marker=new GMarker(point);GEvent.addListener(marker,"click",function(){marker.openInfoWindowHtml("<p><b>Dipnet s.n.c. - Web Agency Modena</b><br />Viale Caduti sul Lavoro 9<br />41100 Modena</p>");});map.addOverlay(marker);}
window.onunload=function(){GUnload();}}};function resettaLink(){var form=document.getElementById("linkForm");form.onclick=function(){};var dove=document.getElementById("linkDove");dove.onclick=function(){};}
var menuClassName="menuNavigazione";var isIE=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false;var isWin=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false;var isOpera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;var flashSupported=false;var currentFlashVersion=0;var checkFlashVersion=true;var reqMajorVer=9;var reqMinorVer=0;var reqRevision=28;window.onload=function(){if(checkFlashVersion){var hasReqestedVersion=DetectFlashVer(reqMajorVer,reqMinorVer,reqRevision);if(hasReqestedVersion){flashSupported=true;}else{flashSupported=false;}}
if(typeof(menu_init)=="function"){menu_init();}
for(var i=0;i<document.links.length;i++)
if(document.links[i].rel=="external"){document.links[i].target="_blank";}
inserisciSWF();if(typeof("do_init")!="undefined"){do_init();}
if(gaTracker){var pageTracker=_gat._getTracker(gaTracker);pageTracker._initData();pageTracker._trackPageview();}}