
﻿var repsdf=false;var activityRunning=false;function searchKeyPressHandler(e){if(window.event&&window.event.keyCode==13){window.event.cancelBubble=true;window.event.returnValue=false;if(window.opera)
$get("tbTextToSearch").blur();return perfSearch();}
else if(e.which==13){return perfSearch()}}
function perfSearch(){var t=$get("tbTextToSearch").value.trim();if(t=="")
alert("Inserire termini di ricerca.");else{location.href="/search.aspx?qry="+escape(t);}
return false;}
function moveElm(elmId,newParentId){var ad=document.getElementById(elmId);var con=document.getElementById(newParentId);if(con!=null&&ad!=null){con.appendChild(ad);ad.style.display='inline';}}
function repDateParsing(){if(repsdf)return;Date.__std_parse=Date.parse;Date.parse=function(s){try{return Date.__std_parse(s);}
catch(e){return(s);var d=Date._jsParse(s);if(d){return d;}
else{throw e;}}}
repsdf=true;}
var backColors=new Array('ffe7e7','ddfcd6','fffecc');var ads=new Array('250x250_as');var selAd=ads[Math.floor(Math.random()*ads.length)];var selBackColor=backColors[Math.floor(Math.random()*backColors.length)];function setBackColor(){if(google_ad_format==selAd){google_color_bg=selBackColor;}}
google_ad_client='';google_ad_slot='';google_ad_width=0;google_ad_height=0;google_ad_format='';google_ad_type='';google_ad_channel='';google_color_border='';google_color_bg='';google_color_link='';google_color_text='';google_color_url='';google_ui_features='';google_cpa_choice='';function adselector(){var n=Math.floor(Math.random()*2)+1;if(n==1)
General_top_LBi_728x90();else
General_top_LBt_728x90();}
function Google_Referral_Sky_160x600(){repDateParsing();google_ad_client="pub-4545597397921775";google_ad_width=160;google_ad_height=600;google_ad_format="160x600_as";google_cpa_choice="CAEQzvnU1AMQ9aaNswMQ35ei2gIQncD8_gMQjP7UrAMQoqfSiQMQ1sWaqAMQxoTOkAcQ7sWZ7wMQjPWZoQMQ7dvR7wMQ8a2j5AMaCMj_rh8HdhSPKOqJ7_gBKPWCm84BKNvPz6kBKIXVmOkBKJyPib0BKILxieUBKNLZl9kBKKKbva4CKPrjz8kBKJTB1rgBKNXQi8QBKI2HwMEB";google_color_border="ffffff";google_color_bg="ffffff";google_color_link="e75700";google_color_text="000000";google_color_url="008000";}
function PostItem_mid_IL4_468x15(){repDateParsing();google_ad_client="pub-4545597397921775";google_ad_slot="5340306960";google_ad_width=468;google_ad_height=15;}
function PostItem_left_Qti_250x250(){repDateParsing();google_ad_client="pub-4545597397921775";google_ad_slot="0239794695";google_ad_width=250;google_ad_height=250;}
function TagCloud_top_IL4_468x15(){repDateParsing();google_ad_client="pub-4545597397921775";google_ad_slot="5115786287";google_ad_width=468;google_ad_height=15;}
function General_SSt_160x600(){repDateParsing();google_ad_client="pub-4545597397921775";google_ad_slot="4448427347";google_ad_width=160;google_ad_height=600;}
function TagCloud_left_Qti_250x250(){repDateParsing();google_ad_client="pub-4545597397921775";google_ad_slot="1175915021";google_ad_width=250;google_ad_height=250;}
function Search_top_IL4_468x15(){repDateParsing();google_ad_client="pub-4545597397921775";google_ad_slot="3240488557";google_ad_width=468;google_ad_height=15;}
function General_top_LBt_728x90(){repDateParsing();google_ad_client="pub-4545597397921775";google_ad_slot="3568319523";google_ad_width=728;google_ad_height=90;}
function General_Ri_250x250(){repDateParsing();google_ad_client="pub-4545597397921775";google_ad_slot="9370834745";google_ad_width=250;google_ad_height=250;google_cpa_choice="";}
function Detailcom_midl_Ri_200x200(){repDateParsing();google_ad_client="pub-4545597397921775";google_ad_slot="5773012476";google_ad_width=200;google_ad_height=200;google_cpa_choice="";}
function General_top_LBi_728x90(){repDateParsing();google_ad_client="pub-4545597397921775";google_ad_slot="5096890413";google_ad_width=728;google_ad_height=90;}
function List_topl_Qti_250x250(){repDateParsing();google_ad_client="pub-4545597397921775";google_ad_slot="5198077199";google_ad_width=250;google_ad_height=250;}
function List_midl_Qti_250x250(){repDateParsing();google_ad_client="pub-4545597397921775";google_ad_slot="4345331622";google_ad_width=250;google_ad_height=250;}
function List_top_IL4_468x15(){repDateParsing();google_ad_client="pub-4545597397921775";google_ad_slot="6909289540";google_ad_width=468;google_ad_height=15;}
function Detail_topr_Rti_336x280(){repDateParsing();google_ad_client="pub-4545597397921775";google_ad_slot="1030125567";google_ad_width=336;google_ad_height=280;}
function Detailcom_midr_Qti_200x200(){repDateParsing();google_ad_client="pub-4545597397921775";google_ad_slot="9626157390";google_ad_width=200;google_ad_height=200;}
function Detailcom_mid_IL4_468x15(){repDateParsing();google_ad_client="pub-4545597397921775";google_ad_slot="3521808546";google_ad_width=468;google_ad_height=15;}
function Viewtop_IL4_468x15(){repDateParsing();google_ad_client="pub-4545597397921775";google_ad_slot="2599389808";google_ad_width=468;google_ad_height=15;}
function Detailcom_mid_Bt_468x60(){repDateParsing();google_ad_client="pub-4545597397921775";google_ad_slot="7047065562";google_ad_width=468;google_ad_height=60;}
function PostItem_top_Bt_468x60(){repDateParsing();google_ad_client="pub-4545597397921775";google_ad_slot="9454925621";google_ad_width=468;google_ad_height=60;}
function PostItem_bot_Bt_336x280(){repDateParsing();google_ad_client="pub-4545597397921775";google_ad_slot="3242379193";google_ad_width=336;google_ad_height=280;}
var prm=null;function Init(sender){if(!Sys.WebForms)return;prm=Sys.WebForms.PageRequestManager.getInstance();if(prm){if(!prm.get_isInAsyncPostBack()){prm.add_initializeRequest(InitRequest);}}}
function InitRequest(sender,args){if(prm.get_isInAsyncPostBack()){args.set_cancel(true);alert("Una richiesta è già in corso.  Attendere... ");}}
probHover=function(){var probEls=new Array()
for(j=0;j<100;j++){probEls[j]=new Array();var item=document.getElementById('probpop'+j);if(item){probEls[j]=item.getElementsByTagName("LI");for(var i=0;i<probEls[j].length;i++){probEls[j][i].onmouseover=function(){this.className+=" probhover";}
probEls[j][i].onmouseout=function(){this.className=this.className.replace(new RegExp(" probhover\\b"),"");}}}}}
function containsDOM(container,containee){var isParent=false;do{if((isParent=container==containee))
break;containee=containee.parentNode;}
while(containee!=null);return isParent;}
function checkMouseLeave(element,evt){evt=(evt)?evt:((window.event)?window.event:"");window.status=evt;if(evt.relatedTarget){return!containsDOM(element,evt.relatedTarget);}else{if(element.contains(evt.toElement)){return(false);}else{return(true);}}}
function ShowHide(i){nav=document.getElementById('div'+i).style;con=document.getElementById('ul'+i);if(nav.display=="none"){nav.display='block';con.onmouseout=function(evt){if(checkMouseLeave(this,evt)){i=parseInt(this.id.substr(2));nav=document.getElementById('div'+i).style;nav.display='none';}}}else{nav.display='none';con.onmouseout=function(evt){if(checkMouseLeave(this,evt)){i=parseInt(this.id.substr(2));nav=document.getElementById('div'+i).style;nav.display='none';}}}}
if(window.attachEvent){window.attachEvent("onload",probHover);}
function updateTotalVotes(a,t,tot){var b=$get("VoteTotal_"+a,t);b.innerHTML="<b>"+tot+"</b>";var c=$get("voteWord_"+a,t);if(tot>0)
c.innerText="voti";else
c.innerText="voto";}
function dispwait(a,t){activityRunning=true;var i=document.createElement("img");i.setAttribute("src","/img/desmm_load_w.gif");i.setAttribute("width","36px");i.setAttribute("height","36px");var d=$get("waitImage_"+a,t);d.appendChild(i);}
function hidewait(a,t){var d=$get("waitImage_"+a,t);d.innerHTML="";activityRunning=false;}
function onVotingSuccess(result){var t=$get(result.TableId);hidewait(result.ArticleId,t.parentNode);if(result.Succeeded){t.className="voted";updateTotalVotes(result.ArticleId,t,result.Votes);var x=$get(result.TableId.replace("_VoteTable","_voteBtnTable"));x.style.display="none";}
else
alert(result.ErrMessage);}
function onVotingFailure(result){alert(result);}
function onUnvotingSuccess(result){var t=$get(result.TableId);hidewait(result.ArticleId,t.parentNode);if(result.Succeeded){updateTotalVotes(result.ArticleId,t,result.Votes);var x=$get(result.TableId.replace("_VoteTable","_voteBtnTable"));x=$get("lnkUnvote",x);x.attributes["onclick"].value=x.attributes["onclick"].value.replace("unvote","castVote");x.lastChild.nodeValue="VOTA!";}
else
alert(result.ErrMessage);}
function castVote(articleId,tableId){if(activityRunning){alert("Una richiesta è già in corso.  Attendere... ");return;}
var t=$get(tableId);dispwait(articleId,t.parentNode);FainfoAj.Vote(articleId,tableId,onVotingSuccess,onVotingFailure);}
function unvote(articleId,tableId){if(activityRunning){alert("Una richiesta è già in corso.  Attendere... ");return;}
var t=$get(tableId);dispwait(articleId,t.parentNode);FainfoAj.Unvote(articleId,tableId,onUnvotingSuccess,onVotingFailure);}
function onSetProblemSuccess(result){var lnk=$get(result.LinkId);var p=lnk;var t=null;while(t==null){if(p.parentNode.id.indexOf("ArticleEntryTable")>-1)
t=p.parentNode;else
p=p.parentNode;}
hidewait(result.ArticleId,t);if(result.Succeeded){lnk.parentNode.parentNode.parentNode.parentNode.parentNode.style.display='none';t.className="blur";updateTotalVotes(result.ArticleId,t,result.Votes);$get(t.id.replace("_ArticleEntryTable","_VotingSection")).style.display="none";}
else
alert(result.ErrMessage);}
function onSetProblemFailure(result){alert(result);}
function setProblem(articleId,linkId,probType){if(activityRunning){alert("Una richiesta è già in corso.  Attendere... ");return;}
var lnk=$get(linkId);var p=lnk;var t=null;while(t==null){if(p.parentNode.id.indexOf("ArticleEntryTable")>-1)
t=p.parentNode;else
p=p.parentNode;}
dispwait(articleId,t);ShowHide(lnk.parentNode.parentNode.parentNode.id.substr(3));FainfoAj.SetArticleProblem(articleId,linkId,probType,onSetProblemSuccess,onSetProblemFailure);}
