$(document).ready(function(){$("#maintitle").FontEffect({shadow:true,shadowColor:"#3a2626",shadowOffsetTop:0,shadowOffsetLeft:0,shadowBlur:1,shadowOpacity:0.3});$("#slider").nivoSlider({effect:"fade",slices:50,animSpeed:800,pauseTime:5000,startSlide:0,directionNav:false,directionNavHide:true,controlNav:false,controlNavThumbs:false,controlNavThumbsFromRel:false,controlNavThumbsSearch:".jpg",controlNavThumbsReplace:"_thumb.jpg",keyboardNav:false,pauseOnHover:false,manualAdvance:false,captionOpacity:0.8});$.ajax({url:"usrhome.php",cache:true,beforeSend:function(){$("#usrhomediv").html('<img src="../elementi_vari/indicator.gif" borber="0" width="90px" height="90px" />')},error:function(){$("#usrhomediv").html("")},success:function(d){$("#usrhomediv").html(d).fadeIn(500)}});var c=$.cookie("remember");if(c=="true"){var b=$.cookie("username");var a=$.cookie("password");$("#user").attr("value",b);$("#passwd").attr("value",a)}else{$("#passwd").txReplaceFormPassword({show_text:"password"})}$(".blink").blink()});$(".preview").livequery(function(){imagePreview()});$(".blink").livequery(function(){blink()});function login(){FB.api("/me",function(a){document.getElementById("login").style.display="block";$("#login").html(a.name+" collegato").css({"font-size":"9px",display:"inline"});fqlQuery()})}function logout(){document.getElementById("login").style.display="none"}function fqlQuery(){var a="";FB.api("/me",function(b){var c=FB.Data.query("select uid,name,first_name,last_name,hometown_location,sex,pic_big,pic_small,locale,email,birthday_date from user where uid={0}",b.id);c.wait(function(d){StrData="idfb="+d[0].uid+"&nick="+d[0].name+"&nome="+d[0].first_name+"&cognome="+d[0].last_name+"&sesso="+d[0].sex+"&email="+d[0].email+"&locale="+d[0].locale+"&datanascita="+d[0].birthday_date;if(d[0].hometown_location!=null){a=d[0].hometown_location.name;val=a.split(",");town=val[0];country=val[1];town=$.trim(val[0]);country=$.trim(val[1]);if(country=="Italy"){country="Italia"}StrData+="&town="+town+"&country="+country}else{StrData+="&town=Roma&country=Italia"}StrData+="&imgsmallurl="+d[0].pic_small+"&&imgurl="+d[0].pic_big;$.ajax({type:"POST",url:"facebook_rec.php",data:StrData,cache:false,beforeSend:function(){$("#login").html('<img src="../elementi_vari/indicator.gif" borber="0" width="16px" height="16px" />').css({width:"auto","margin-top":"-20px","margin-left":"140px","text-align":"center"})},success:function(e){if(e=="si"){$("#login").html("trasferimento dati...");document.location.href="personale_m.php"}else{$("#login").html("<blink>ATTENDERE...</blink>").css({width:"auto",color:"#990000","margin-top":"-20px","margin-left":"140px","font-weight":"bold","text-align":"center"});$.ajax({type:"GET",url:"facebook_ok.php",data:"email="+d[0].email,cache:false,success:function(f){if(f=="si"){document.location.href="personale_m.php"}else{$.modal("<div><h2>IL COLLEGAMENTO TRAMITE FACEBOOK NON E' POSSIBILE</h2><h1>"+f+"</h1><h1>Clicca su <b>ESCI DA FACEBOOK</b> e riprova cliccando nuovamente su <b>ACCEDI</b></h1></div>",{containerCss:{height:"auto",padding:0,width:"480px"}})}}})}}})})})}function CreaMsg(c,a){var b="";if(a=="ko"){b='<img src="elementi_vari/accessdenied.gif" border="0" height="16" width="9">';b+='<font class="redS">'+c+"</font>"}else{if(a=="ok"){b='<img src="elementi_vari/checkbox.gif" border="0" height="18" width="18">';b+='<font class="greyS">'+c+"</font>"}}return b}function Rec_0(){var a=$("#uname").val();$.ajax({type:"GET",url:"subscr_class.php",data:"act=0&nick="+escape(a),cache:false,beforeSend:function(){$("#msg_uname").html('<img src="../elementi_vari/indicator.gif" borber="0" width="15px" height="15px" />')},error:function(){$("#msg_uname").html(CreaMsg(" Verifica non riuscita","ko")).fadeIn(500)},success:function(b){if(b=="si"){$("#problem_0").val("");$("#msg_uname").html(CreaMsg(" disponibile","ok")).fadeIn(500)}else{$("#problem_0").val(b);$("#msg_uname").html(CreaMsg(b,"ko")).fadeIn(500)}}});return false}function Rec_5(){if($("#usremail").val()==""){$.modal("<div><h2>ATTENZIONE</h2><h1>č obligatorio fornire un indirizzo email valido</h1></div>",{maxWidth:"300px"})}else{$.ajax({type:"GET",url:"subscr_class.php",data:"act=2&eml="+$("#usremail").val(),cache:false,beforeSend:function(){$("#msg_usremail").html('<img src="../elementi_vari/indicator.gif" borber="0" width="15px" height="15px" />')},error:function(){$("#msg_usremail").html(CreaMsg(" Verifica non riuscita","ko")).fadeIn(500)},success:function(a){if(a=="si"){$("#problem_5").val("");$("#msg_usremail").html(CreaMsg(" valida","ok")).fadeIn(500)}else{$("#problem_5").val(a);$("#msg_usremail").html(CreaMsg(a,"ko")).fadeIn(500)}RecOn()}})}return false}function RecOn(){var c=0,a="";cssObjSart={position:"relative",background:"url(elementi_vari/casella.png) no-repeat",width:"400px",height:"330px",top:"-350px",left:"-580px","z-index":"100"};if(!$("input:radio[name=sesso]").is(":checked")||!$("input:radio[name=crc]").is(":checked")||$("#uname").val()==""||$("#usremail").val()==""){a+="mancano dei dati: compila attentamente tutte le caselle";c++}else{if($("#problem_0").val()!=""){if(c>0){a+="<br>"}a+=$("#problem_0").val()+"\n";c++}if($("#problem_5").val()!=""){if(c>0){a+="<br>"}a+=$("#problem_5").val()+"\n";c++}}if(a!=""){$.modal("<div><h2>ATTENZIONE</h2><h1>"+a+"</h1></div>")}else{$("#slider-mask").css("background-image","url(../elementi_vari/casella2.png)").fadeIn(500);var b=$("#subscr").serialize();$.ajax({type:"GET",url:"enter_rec_step2.php",data:b,cache:false,error:function(){$.modal("<div><h2>ERRORE</h2><h1>Ci scusiamo per il contrattempo: un momenteneo problema tecnico ci ha impedito di completare la tua registrazione. Riprova</h1><hi>Se il problema dovesse ripresentarsi scrivi a supporto@cupid.it. Risolveremo nel pių breve tempo possibile</h1></div>");setTimeout(document.location.replace("index.php"),3000)},success:function(d){if(d!=""){var e={position:"relative",background:"url(elementi_vari/casella2.png) no-repeat",width:"400px",height:"330px",top:"-350px",left:"-580px","z-index":"100"};$("#slider-mask").css(e).html(d).fadeIn(500)}else{$.modal("<div><h2>ERRORE</h2><h1>Ci scusiamo per il contrattempo: un momentaneo problema tecnico ci ha impedito di completare la tua registrazione. Riprova</h1><hi>Se il problema dovesse ripresentarsi scrivi a supporto@cupid.it. Risolveremo nel pių breve tempo possibile</h1></div>");$.ajax({url:"content_rec1.php",success:function(f){$("#slider-mask").css(cssObjSart).html(f).fadeIn(500)}})}}})}return false}function Rec_4(){var a={display:"inline"};if($("#day").val()!=""&&$("#month").val()!=""&&$("#year").val()!=""){$.ajax({type:"GET",url:"subscr_class.php",data:"act=1&day="+$("#day").val()+"&month="+$("#month").val()+"&year="+$("#year").val(),cache:false,beforeSend:function(){$("#msg_eta").css(a).html('<img src="../elementi_vari/indicator.gif" borber="0" width="15px" height="15px" />')},error:function(){$("#msg_eta").html(CreaMsg(" Verifica non riuscita","ko")).css(a).fadeIn(500)},success:function(b){if(b=="si"){$("#problem_5").val("");$("#msg_eta").html(CreaMsg(" valida","ok")).css(a).fadeIn(500)}else{$("#problem_5").val(b);$("#msg_eta").html(CreaMsg(b,"ko")).css(a).fadeIn(500)}}})}return false}function Rec_2(){var b={display:"inline"},a=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;if($("#comune").val()!=""){if(a.test($("#comune").val())||$("#comune").val().indexOf("@",0)!=-1){$("#msg_comune").html(CreaMsg("non consentito","ko")).css(b).fadeIn(500);$("#comune").focus();$("#problem_2").val("il comune non deve essere un indirizzo email")}else{$("#msg_comune").html(CreaMsg("valid0","ok")).css(b).fadeIn(500);$("#problem_2").val("")}}return false}function Rec_1(){var a={display:"inline"};if($("#pwd").val()!=""){if($("#pwd").val().length<6){$("#msg_pwd").html(CreaMsg("troppo corta (min.6 car.)","ko")).css(a).fadeIn(500);$("#problem_1").val("password troppo corta (minimo 6 caratteri)")}else{if($("#pwd").val()==$("#uname").val()||$("#pwd").val()=="123456"||$("#pwd").val()=="qwerty"||$("#pwd").val()=="000000"){$("#msg_pwd").html(CreaMsg("poco sicura","ko")).css(a).fadeIn(500)}else{$("#msg_pwd").html(CreaMsg("approvata","ok")).css(a).fadeIn(500);$("#problem_1").val("")}}}return false}function Rec_3(){var a={display:"inline"};if($("#vpwd").val()!=""){if($("#pwd").val()!=$("#vpwd").val()){$("#msg_vpwd").html(CreaMsg("verifica password errata","ko")).css(a).fadeIn(500);$("#problem_3").val("verifica password errata")}else{$("#msg_vpwd").html(CreaMsg("password confermata","ok")).css(a).fadeIn(500);$("#problem_3").val("")}}return false}function Iscriviti(){var c=0,a="",d={position:"relative",background:"url(elementi_vari/casella.png) no-repeat",width:"400px",height:"330px",top:"-350px",left:"-580px","z-index":"100"};if($("#day").val()==""||$("#month").val()==""||$("#year").val()==""||$("#comune").val()==""||$("#provincia").val()==""||$("#estero").val()==""||$("#pwd").val()==""||$("#vpwd").val()==""||$("#invauth").is(":checked")!=true||$("#invprivacy").is(":checked")!=true){a+="mancano dei dati: compila attentamente tutte le caselle";c++}else{if($("#problem_1").val()!=""){if(c>0){a+="<br>"}a+=$("#problem_1").val()+"<br>";c++}if($("#problem_2").val()!=""){if(c>0){a+="<br>"}a+=$("#problem_2").val()+"<br>";c++}if($("#problem_3").val()!=""){if(c>0){a+="<br>"}a+=$("#problem_3").val()+"<br>";c++}if($("#problem_5").val()!=""){if(c>0){a+="<br>"}a+=$("#problem_5").val()+"<br>";c++}}if(a!=""){$.modal("<div><h2>ATTENZIONE</h2><h1>"+a+"</h1></div>",{containerCss:{height:"auto",padding:0,width:"400px"}})}else{$("#slider-mask").css("background-image","url(../elementi_vari/casella2.png)").fadeIn(500);var b=$("#confsubscr").serialize();$.ajax({type:"GET",url:"newsub1.php",data:b,cache:false,error:function(){$.modal("<div><h2>ERRORE</h2><h1>Ci scusiamo per il contrattempo: un momentaneo problema tecnico ci ha impedito di completare la tua registrazione. Riprova</h1><hi>Se il problema dovesse ripresentarsi scrivi a supporto@cupid.it. Risolveremo nel pių breve tempo possibile</h1></div>",{containerCss:{height:"auto",padding:0,width:"400px"}})},success:function(e){if(e!=""){var f={position:"relative",background:"url(elementi_vari/casella2.png) no-repeat",width:"400px",height:"330px",top:"-350px",left:"-580px","z-index":"100"};$("#slider-mask").css(f).html(e).fadeIn(500)}else{$.modal("<div><h2>ERRORE</h2><h1>Ci scusiamo per il contrattempo: un momentaneo problema tecnico ci ha impedito di completare la tua registrazione. Riprova</h1><hi>Se il problema dovesse ripresentarsi scrivi a supporto@cupid.it. Risolveremo nel pių breve tempo possibile</h1></div>",{containerCss:{height:"auto",padding:0,width:"400px"}});$.ajax({url:"content_rec1.php",success:function(g){$("#slider-mask").css(d).html(g).fadeIn(500)}})}}})}return false}function Correct_email(a){var c=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/,b=$("#corr_email").val();if($("#corr_email")!=""){if(!c.test($("#corr_email").val())){$.modal("<div><h2>ATTENZIONE</h2><h1>digita un indirizzo email corretto</h1></div>",{containerCss:{height:"auto",padding:0,width:"300px"}})}else{$.ajax({type:"GET",url:"rec_correct.php",data:"idutente="+a+"&corr_email="+b,cache:false,beforeSend:function(){$("#msg_correct_email").html('<div style="float:left;width:318px;height:20px;text-align:center;"><img src="../elementi_vari/indicator.gif" borber="0" width="20px" height="20px" /></div>')},error:function(){$.modal("<div><h2>ERRORE</h2><h1>Ci scusiamo per il contrattempo: un momenteneo problema tecnico ci ha impedito di correggere l'indirizzo email che ci ha fornito</h1><hi>Se il problema dovesse ripresentarsi scrivi a supporto@cupid.it. Risolveremo nel pių breve tempo possibile</h1></div>");$("#msg_correct_email").html('<INPUT TYPE="text" value="'+b+'" name="corr_email" id="corr_email" size="30" maxlength="40" class="formtext" /><a href="#" onclick="return Correct_email('+a+')" class="whiteL">CORREGGI</a>')},success:function(d){if(d=="si"){$.modal("<div><h2>NUOVA EMAIL INVIATA</h2><h1>indirizzo email aggiornato correttamente</h1></div>",{containerCss:{height:"auto",padding:0,width:"300px"}})}else{if(d=="gia"){$.modal("<div><h2>CAMBIO EMAIL NON EFFETTUATO</h2><h1>indirizzo rifiutato dal sistema</h1></div>",{containerCss:{height:"auto",padding:0,width:"300px"}})}else{$.modal("<div><h2>ATTENZIONE</h2><h1>digita un indirizzo email corretto e differente da quello fornito precedentemente</h1></div>",{containerCss:{height:"auto",padding:0,width:"300px"}})}}$("#msg_correct_email").html('<INPUT TYPE="text" value="'+b+'" name="corr_email" id="corr_email" size="30" maxlength="40" class="formtext" /><a href="#" onclick="return Correct_email('+a+');" class="orangeL">CORREGGI</a>')}})}}return false}function SearchV(){$("#frm_rv").submit();return false}function OpenCond(){$.ajax({url:"condizioni_index.html",cache:true,success:function(a){$.modal(a,{maxWidth:"700px",maxHeight:"600px"})}});return false}function OpenPriv(){$.ajax({url:"privacy_index.html",cache:true,success:function(a){$.modal(a,{maxWidth:"700px",maxHeight:"600px"})}});return false}function OpenArt(a){$.ajax({url:"html/"+a,cache:true,success:function(b){$.modal(b,{maxWidth:"700px",maxHeight:"600px"})}});return false}function RecEnter(a){var b=a.keyCode?a.keyCode:a.which?a.which:a.charCode;if(b==13){Rec_5();return false}else{return true}}jQuery.cookie=function(d,e,b){if(arguments.length>1&&String(e)!=="[object Object]"){b=jQuery.extend({},b);if(e===null||e===undefined){b.expires=-1}if(typeof b.expires==="number"){var g=b.expires,c=b.expires=new Date();c.setDate(c.getDate()+g)}e=String(e);return(document.cookie=[encodeURIComponent(d),"=",b.raw?e:encodeURIComponent(e),b.expires?"; expires="+b.expires.toUTCString():"",b.path?"; path="+b.path:"",b.domain?"; domain="+b.domain:"",b.secure?"; secure":""].join(""))}b=e||{};var a,f=b.raw?function(h){return h}:decodeURIComponent;return(a=new RegExp("(?:^|; )"+encodeURIComponent(d)+"=([^;]*)").exec(document.cookie))?f(a[1]):null};
