							
								votato = 0;
								function prendiElementoDaId(id_elemento) {
									var elemento;
									if(document.getElementById){
										elemento = document.getElementById(id_elemento);
									}else{
										elemento = document.all[id_elemento];
									}
									return elemento;
								};							
								function votaStelle(v,cid)
								{
									if(votato==1) return;
									for(k=1;k<=v;k++)
									{
										prendiElementoDaId("star"+k).src = '/images/star.on.png';
									}
									c = eseguiInRemoto('/votaACT.php?m='+cid+'&v='+v+'&nocache='+new Date().getTime());
									if(c=='-9')
									{
										Sexy.alert('<h1>SBK2011</h1><em>SBK The Game</em><br/><br><p>Immagine gi&agrave; votata!');
										for(k=1;k<=v;k++)
										{
											prendiElementoDaId("star"+k).src = '/images/star.off.png';
										}
										document.getElementById('rateLabel').innerHTML = '';
									}
									votato = 1;
									switch(v)
									{
										case 1:document.getElementById('rateLabel').innerHTML = 'Terrible';break;
										case 2:document.getElementById('rateLabel').innerHTML = 'booo';break;
										case 3:document.getElementById('rateLabel').innerHTML = 'Not so bad';break;
										case 4:document.getElementById('rateLabel').innerHTML = 'Good';break;
										case 5:document.getElementById('rateLabel').innerHTML = 'WOW!';break;
									}
									if(c=='-9') document.getElementById('rateLabel').innerHTML = '';
																		
								}
								function offStelle()
								{
									if(votato==1) return;
									for(k=1;k<=5;k++)
									{
										var f = prendiElementoDaId("star"+k).src;
										if(f.indexOf('/images/star.on.png') == -1)
										{
											prendiElementoDaId("star"+k).src = '/images/star.off.png';
										}
									}
									document.getElementById('rateLabel').innerHTML = '';
								}
								function onStelle(v)
								{
									if(votato==1) return;
									for(k=1;k<=v;k++)
									{
										var f = prendiElementoDaId("star"+k).src;
										if(f.indexOf('/images/star.on.png') == -1)
										{	
											prendiElementoDaId("star"+k).src = '/images/star.rollon.png';
										}
									}
									
									switch(v)
									{
										case 1:document.getElementById('rateLabel').innerHTML = 'Terrible';break;
										case 2:document.getElementById('rateLabel').innerHTML = 'booo';break;
										case 3:document.getElementById('rateLabel').innerHTML = 'Not so bad';break;
										case 4:document.getElementById('rateLabel').innerHTML = 'Good';break;
										case 5:document.getElementById('rateLabel').innerHTML = 'WOW!';break;
									}
								}
								
	function manageAbuse(v,abid)
	{
		strP = "v="+v+"&abid="+abid+"&nocache="+new Date().getTime();

		s = fmk$PostCall('/EXECManageabuse',strP,true,'catalogoDati');
		switch(s)
		{
			case '1':
				Sexy.info('<p>Process completed</p>');
				break;
			default:
				Sexy.error('<p>Service unavailable; please retry later</p>');
				break;
		}
	}
								
	function jscopri(idd)
	{
		if ($("#"+idd+":first").is(":hidden")) {
			$("#"+idd).slideToggle("slow");
		} 	
	}
	function jnascondi(idd)
	{
		 $("#"+idd).slideUp("slow"); 
	}
	
	function jmostraannunci(idd)
	{
			
				if ($("#"+idd+":first").is(":hidden")) {
					$('#console').css("margin-top", "10px");  
					$("#"+idd).slideDown("slow");
				} else {
					$('#console').css("margin-top", "125px"); 
					 $("#"+idd).slideUp("slow"); 
					 
				}
	}
	function jscambia(idd)
	{
			
				if ($("#"+idd+":first").is(":hidden")) {
					$("#"+idd).slideDown("slow");
				} else {
					 $("#"+idd).slideUp("slow"); 
					 
				}
	}	
	
	function createCookie(name,value,days) {if (days) {var date = new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires = "; expires="+date.toGMTString();}else var expires = "";document.cookie = name+"="+value+expires+"; path=/";}
	function readCookie(name) {var nameEQ = name + "=";var ca = document.cookie.split(';');for(var i=0;i < ca.length;i++) {var c = ca[i];while (c.charAt(0)==' ') c = c.substring(1,c.length);if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);}return null;}
	function eraseCookie(name) {createCookie(name,"",-1);}

	
	        function fmk$PostCall(url,parString,callBack,content){
                  var ajax = assegnaXMLHttpRequest();
                  if(ajax) {
                    ajax.open("POST", url, false);
		            ajax.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		            ajax.setRequestHeader("Content-length", parString.length);
                    ajax.setRequestHeader("connection", "close");
                    ajax.send(parString);
                    return ajax.responseText;
                  } 
                  else {
                    return false;
                  }		        
	        }


            function salvaDEM(q) 
            {
                if(q>1)
                    q = 0;            
                var alertSTD = "<h1>Newsletter</h1><em>SBK The Game</em><br/><p>";
                var MailMissed = new Array("E-Mail missed","E-Mail mancante","E-Mail missed");
                var MailInvalid = new Array("Invalid E-Mail","E-Mail non valida","Invalid E-Mail");            
                var Privacy = new Array("Check the privacy policy conditions","Accetta le condizioni sulla privacy","Check the privacy policy conditions");   
                var StoringKO = new Array("Service unavailable; please retry later","Registrazione non terminata a causa di errori;<br />riprovare in seguito","Service unavailable; please retry later");   
                var StoringOK = new Array("Thank you!<br>Your E-Mail was successfully recorded","Grazie!<br>Registrazione terminata con successo!","Thank you!<br>Your E-Mail was successfully recorded");   
                var StoringYET = new Array("E-mail is already existing!","E-Mail gi&agrave; registrata!","E-mail is already existing!");
            
                 if (document.frmNewsletter.email.value == '') 
                 {
                    Sexy.error(alertSTD+MailMissed[q]+'</p>');
                    return false;
                 }
                if (document.frmNewsletter.email.value.indexOf('@') == -1) { Sexy.error(alertSTD+MailInvalid[q]+'</p>'); return false; }
                if (document.frmNewsletter.email.value.indexOf('.') == -1) { Sexy.error(alertSTD+MailInvalid[q]+'</p>'); return false; }
                if (document.frmNewsletter.email.value.indexOf(',') >= 0) { Sexy.error(alertSTD+MailInvalid[q]+'</p>'); return false; }
                
                
                if(!document.frmNewsletter.privacy.checked)
                {
                    Sexy.error(alertSTD+Privacy[q]+'</p>');
                    return;
                }      
                          
                strP = "email="+document.frmNewsletter.email.value;
                s = fmk$PostCall('/EXECnewsletter',strP,true,'catalogoDati');
                switch(s)
                {
                    case '-1':
                        Sexy.error(alertSTD+StoringKO[q]+'</p>');
                        break;                
                    case '0':
                        Sexy.error(alertSTD+StoringYET[q]+'</p>');
                        break;
                    case '1':
                        Sexy.info(alertSTD+StoringOK[q]+'</p>');
                        document.frmNewsletter.email.value = '';
                        document.frmNewsletter.privacy.checked = false;
                        break;
                    default:
                        Sexy.error(alertSTD+StoringKO[q]+'</p>');
                        break;
                }
                return false;
            }
            
            
            function manageSUPPORT(q) 
            {
                
                
                                          
                strP = "action="+q+"&id="+document.manageTicket.id.value+"&status="+document.manageTicket.status.value+"&faq="+document.manageTicket.faq.checked+"&cc="+document.manageTicket.cc.checked+"&answer="+encodeURI(document.manageTicket.answer.value);
                v = 1;
                switch(q)
                {
                    case 'a':
                        if(!confirm('Question will be closed and an E-Mail will be send to customer\nContinue?'))
                        {
                            v = 0
                        }
                        break;
                }

                if(v==0)
                    return;
                                
                s = fmk$PostCall('/EXECmanagesupport',strP,true,'catalogoDati');

               
                switch(s)
                {
                    case '1':
                        if(q=='a')
                        {
                            Sexy.error('<p>Ticket closed, E-Mail sent</p>');
                        }else{
                            Sexy.error('<p>Ticked saved</p>');
                        }
                        break;
                    default:
                        Sexy.error('<p>Service unavailable; please retry later</p>');
                        break;
                }
                document.location.href='./';
            }              

            function salvaSUPPORT(q) 
            {
                if(q>1)
                    q = 0;            
                var alertSTD = "<h1>Customer support</h1><em>SBK The Game</em><br/><p>";
                var MailMissed = new Array("E-Mail missed","E-Mail mancante");            
                var controlInvalid = new Array("Invalid secure number","Numero di sicurezza non valido");            
                var controlText = new Array("Question missed","Domanda mancante");            
                
                var MailInvalid = new Array("Invalid E-Mail","E-Mail non valida");            
                
                var StoringKO = new Array("Service unavailable; please retry later","Registrazione non terminata a causa di errori;<br />riprovare in seguito");   
                var StoringOK = new Array("Thank you!<br>Your question was successfully recorded","Grazie!<br>Richiesta inviata al customer support di SBKX!");   
                
            
                 if (document.frmPostQuest.email.value == '') 
                 {
                    Sexy.error(alertSTD+MailMissed[q]+'</p>');
                    return false;
                 }
                if (document.frmPostQuest.email.value.indexOf('@') == -1) { Sexy.error(alertSTD+MailInvalid[q]+'</p>'); return false; }
                if (document.frmPostQuest.email.value.indexOf('.') == -1) { Sexy.error(alertSTD+MailInvalid[q]+'</p>'); return false; }
                if (document.frmPostQuest.email.value.indexOf(',') >= 0) { Sexy.error(alertSTD+MailInvalid[q]+'</p>'); return false; }
                
                
                 if (document.frmPostQuest.control.value == '') 
                 {
                    Sexy.error(alertSTD+controlInvalid[q]+'</p>');
                    return false;
                 }
                 
                 if (document.frmPostQuest.question.value == '') 
                 {
                    Sexy.error(alertSTD+controlText[q]+'</p>');
                    return false;
                 }                 
                          
                strP = "email="+document.frmPostQuest.email.value+"&country="+document.frmPostQuest.country.value+"&type="+document.frmPostQuest.type.value+"&platform="+document.frmPostQuest.platform.value+"&question="+encodeURI(document.frmPostQuest.question.value);
                s = fmk$PostCall('/EXECsupport',strP,true,'catalogoDati');
                switch(s)
                {
                    case '-1':
                        Sexy.error(alertSTD+StoringKO[q]+'</p>');
                        break;                
                    case '1':
                        Sexy.info(alertSTD+StoringOK[q]+'</p>');
                        document.frmPostQuest.email.value = '';
                        break;
                    default:
                        Sexy.error(alertSTD+StoringKO[q]+'</p>');
                        break;
                }
                
                document.frmPostQuest.email.value = '';
                document.frmPostQuest.question.value = '';                
                return false;
            }            

            
            function salvaPOLL(q) 
            {
                if(q>1)
                    q = 0;
                var alertSTD = "<h1>Poll</h1><em>SBK The Game</em><br/><p>";
                var InvalidData = new Array("Please select an answer","Selezionare una risposta");            
                var StoringKO = new Array("Service unavailable; please retry later","Non posso registrare il voto<br />riprovare in seguito");   
            
                
                if(!document.frmPoll.risposta[0])
				{
					return;
				}
                v = 0;
                if(document.frmPoll.risposta[0].checked)
                   v = document.frmPoll.risposta[0].value; 
                   
                if(document.frmPoll.risposta[1].checked)
                   v = document.frmPoll.risposta[1].value; 
                   
                if(document.frmPoll.risposta[2].checked)
                   v = document.frmPoll.risposta[2].value;                                       
                   
                if(document.frmPoll.risposta[3])
                {
                    if(document.frmPoll.risposta[3].checked)
                       v = document.frmPoll.risposta[3].value;           
                }
       
                strP = "idc="+document.frmPoll.idc.value+"&v="+v;
                
                s = fmk$PostCall('/EXECpoll',strP,true,'catalogoDati');
                switch(s)
                {
                    case '-1':
                        Sexy.error(alertSTD+InvalidData[q]+'</p>');
                        break; 
                    case '0':
                        Sexy.error(alertSTD+StoringKO[q]+'</p>');
                        break;                
                    case '1':
                        caricaTestoLight('pollArea','/pollViewResult.php?idc='+document.frmPoll.idc.value+'&l='+q);
                        break;
                    default:
                        Sexy.error(alertSTD+StoringKO[q]+'</p>');
                        break;
                }
                return false;
            }            
            
            
            function sendMessage(q) 
            {
                if(q>1)
                    q = 0;            
                var alertSTD = "<h1>Contacts</h1><em>SBK The Game</em><br/><p>";
                var MailMissed = new Array("E-Mail missed","E-Mail mancante");            
                var MailInvalid = new Array("Invalid E-Mail","E-Mail non valida");            
                var Privacy = new Array("Privacy not accepted","Privacy non accettata!");
                var NameMissed = new Array("Name missed","Name mancante");            
                var MessageMissed = new Array("Message missed","Messaggio mancante");            
                
                var SendingKO = new Array("Service unavailable; please retry later","Impossibile inviare;<br />riprovare in seguito");   
                var SendingOK = new Array("Thank you!<br>Your message was successfully sent","Grazie!<br>Messaggio inviato con successo!");   
            
                 if (document.frmContacts.name.value == '') 
                 {
                    Sexy.error(alertSTD+NameMissed[q]+'</p>');
                    return false;
                 }             
            
                 if (document.frmContacts.email.value == '') 
                 {
                    Sexy.error(alertSTD+MailMissed[q]+'</p>');
                    return false;
                 }
                if (document.frmContacts.email.value.indexOf('@') == -1) { Sexy.error(alertSTD+MailInvalid[q]+'</p>'); return false; }
                if (document.frmContacts.email.value.indexOf('.') == -1) { Sexy.error(alertSTD+MailInvalid[q]+'</p>'); return false; }
                if (document.frmContacts.email.value.indexOf(',') >= 0) { Sexy.error(alertSTD+MailInvalid[q]+'</p>'); return false; }
                
                
  
                 
                 if (document.frmContacts.mex.value == '') 
                 {
                    Sexy.error(alertSTD+MessageMissed[q]+'</p>');
                    return false;
                 } 
                
                if(!document.frmContacts.privacy.checked)
                {
                    Sexy.error(alertSTD+Privacy[q]+'</p>');
                    return;
                }      
                          
                strP = "email="+document.frmContacts.email.value+"&name="+document.frmContacts.name.value+"&mex="+encodeURI(document.frmContacts.mex.value);
                s = fmk$PostCall('/EXECContacts',strP,true,'catalogoDati');
                switch(s)
                {
                    case '0':
                        Sexy.error(alertSTD+SendingKO[q]+'</p>');
                        break;
                    case '1':
                        Sexy.info(alertSTD+SendingOK[q]+'</p>');
                        document.frmContacts.name.value = '';
                        document.frmContacts.mex.value = '';
                        document.frmContacts.email.value = '';
                        document.frmContacts.privacy.checked = false;
                        break;
                    default:
                        Sexy.error(alertSTD+SendingKO[q]+'</p>');
                        break;
                }
                return false;
            }
            
            
            
            function salvaUSER(q) 
            {
                if(q>1)
                    q = 0;            
                var alertSTD = "<h1>Sign up for free membership</h1><em>SBK The Game</em><br/><p>";
                var MailMissed = new Array("E-Mail missed","E-Mail mancante");            
                var MailInvalid = new Array("Invalid E-Mail","E-Mail non valida");
                var NickMissed = new Array("Member name missed","Nickname mancante");                
                var PasswordMissed = new Array("Password missed","Password mancante");
                var PasswordInvalid = new Array("Password invalid; at least six chars recommended","Password non valida; indicare almeno sei caratteri");
                var PasswordUncheck = new Array("Confirm password wrong","Conferma password errata");


                var Agreement = new Array("Membership Agreement not accepted","Membership Agreemen non accettato");   
                
                var StoringKO = new Array("Service unavailable; please retry later","Registrazione non terminata a causa di errori;<br />riprovare in seguito");   
                var StoringOK = new Array("Thank you!<br>Your registration was successfully recorded; check your E-Mail Inbox","Grazie!<br>Registrazione terminata con successo!");   
                var StoringYET = new Array("Account already existing!Check your E-Mail inbox","Account già registrato!\nTi abbiamo rimandato le tue credenziali di accesso");
                var UpdNot = new Array("Update unsuccessfully!Invalid E-Mail","Aggiornamento non completato; E-Mail non valida");
                var UpdYes = new Array("Update successfully completed!","Aggiornamento completato con successo!");
            
                if (document.frmReg.email.value == ''){Sexy.error(alertSTD+MailMissed[q]+'</p>');return false;}
                if (document.frmReg.email.value.indexOf('@') == -1) { Sexy.error(alertSTD+MailInvalid[q]+'</p>'); return false; }
                if (document.frmReg.email.value.indexOf('.') == -1) { Sexy.error(alertSTD+MailInvalid[q]+'</p>'); return false; }
                if (document.frmReg.email.value.indexOf(',') >= 0) { Sexy.error(alertSTD+MailInvalid[q]+'</p>'); return false; }

                if (document.frmReg.nick.value == ''){Sexy.error(alertSTD+NickMissed[q]+'</p>');return false;}                
                if (document.frmReg.password.value.length < 6){Sexy.error(alertSTD+PasswordInvalid[q]+'</p>');return false;}                
                if (document.frmReg.password.value == ''){Sexy.error(alertSTD+PasswordMissed[q]+'</p>');return false;}                
                if(document.frmReg.cpassword)
                    if (document.frmReg.password.value != document.frmReg.cpassword.value){Sexy.error(alertSTD+PasswordUncheck[q]+'</p>');return false;}                
                /*
                if(document.frmReg.agreement)
                    if(!document.frmReg.agreement.checked){Sexy.error(alertSTD+Agreement[q]+'</p>');return;}      
                */
                
                
                          
                strP = "email="+document.frmReg.email.value+"&nick="+document.frmReg.nick.value+"&newsletter="+document.frmReg.newsletter.value+"&password="+document.frmReg.password.value+"&country="+document.frmReg.country.value;
                s = fmk$PostCall('/EXECregistration',strP,true,'dataTable');
                switch(s)
                {
                    case '-3':
                        Sexy.info(alertSTD+UpdYes[q]+'</p>');
                        break;
                    case '-2':
                        Sexy.error(alertSTD+UpdNot[q]+'</p>');
                        break;
                    case '-1':
                        Sexy.error(alertSTD+StoringYET[q]+'</p>');
                        break;
                    case '1':
                        Sexy.info(alertSTD+StoringOK[q]+'</p>');
                        
                        break;
                    default:
                        Sexy.error(alertSTD+StoringKO[q]+'</p>');
                        break;
                }
                if(document.frmReg.cpassword)
                {
                    document.frmReg.email.value = '';
                    document.frmReg.nick.value = '';
                    document.frmReg.password.value = '';
                    document.frmReg.cpassword.value = '';                
                    document.frmReg.newsletter.checked = false;
                    document.frmReg.country.value = '';                
                }
                return false;
            }
            
            
            
            
            function loginUSER(q) 
            {
                if(q>1)
                    q = 0;            
                var alertSTD = "<h1>Sign up for free membership</h1><em>SBK The Game</em><br/><p>";
                var MailMissed = new Array("E-Mail missed","E-Mail mancante");            
                var MailInvalid = new Array("Invalid E-Mail","E-Mail non valida");
                var PasswordMissed = new Array("Password missed","Password mancante");
                var PasswordInvalid = new Array("Password invalid; at least six chars recommended","Password non valida; indicare almeno sei caratteri");
                var PasswordUncheck = new Array("Confirm password wrong","Conferma password errata");


                var StoringKO = new Array("Service unavailable; please retry later","Login non terminata a causa di errori;<br />riprovare in seguito");   
                var StoringNOK = new Array("Invalid Login","Login non valida");   
                var StoringOK = new Array("Welcome into SBX-X","Benvenuto in SBX-X");   
            
                if (document.frmLogin.email.value == ''){Sexy.error(alertSTD+MailMissed[q]+'</p>');return false;}
                if (document.frmLogin.password.value == ''){Sexy.error(alertSTD+PasswordMissed[q]+'</p>');return false;}                
                
                
                langCode = 'EN-us';
                switch(q)
                {
                   case 0:
                    langCode = 'EN-us';
                    break;
                   case 1:
                    langCode = 'IT-it';
                    break;
                }                
                          
                strP = "email="+document.frmLogin.email.value+"&password="+document.frmLogin.password.value;
                s = fmk$PostCall('/EXEClogin',strP,true,'dataTable');


                switch(s)
                {
                    case '-1':
                        document.getElementById('loginResponse').innerHTML = StoringKO[q];
                        break;                
                    case '1':
                        document.getElementById('loginResponse').innerHTML = StoringOK[q];
                        setTimeout("document.location.href='/"+langCode+"/my.html'",1500);
                        break;
                    default:
                        document.getElementById('loginResponse').innerHTML = StoringNOK[q];
                        break;
                }
                document.frmLogin.email.value = '';
                document.frmLogin.password.value = '';
                setTimeout("document.getElementById('loginResponse').innerHTML=''",1500);
                return false;
            }
            
            
            
            function lossPSW(q) 
            {
                if(q>1)
                    q = 0;
                var alertSTD = "<h1>Sign up for free membership</h1><em>SBK The Game</em><br/><p>";
                var MailMissed = new Array("E-Mail missed","E-Mail mancante");            
                var MailInvalid = new Array("Invalid E-Mail","E-Mail non valida");


                var StoringKO = new Array("Service unavailable; please retry later","Login non terminata a causa di errori;<br />riprovare in seguito");   
                var StoringOK = new Array("Login sent successfully","Login reinviata correttamente!");   
            
                if (document.frmLossPSW.email.value == ''){Sexy.error(alertSTD+MailMissed[q]+'</p>');return false;}
                
                
                          
                strP = "email="+document.frmLossPSW.email.value;
                s = fmk$PostCall('/EXEClosslogin',strP,true,'dataTable');
                switch(s)
                {
                    case '1':
                        Sexy.info(alertSTD+StoringOK[q]+'</p>');
                        break;
                    default:
                        Sexy.error(alertSTD+StoringKO[q]+'</p>');
                        break;
                }
                document.frmLossPSW.email.value = '';
                return false;
            }
         
	        
	        function reloadMY()
	        {
	            document.location.href='my.html';
	        }  
	        

            
        function manageUSER(q) 
        {
            salvaUSER(q);
        }
