function showPriceSection(sPsId,sImgPath){
for(i=0;i<15;i++){
sTmp="jps"+String.fromCharCode(65+i)
objImg=document.getElementsByName(sTmp)
if(objImg.length>0)
objImg[0].src=sImgPath+"/blank.gif"}
objImg=document.getElementsByName(sPsId)
objImg[0].src=sImgPath+"/arrow.gif"}
function OpenWin(theURL,winName,features){
window.open(theURL,winName,features)}
function OpenForm(url,width,height){
x=(window.screen.width-width)>>1
y=((window.screen.height-height)>>1)-20
window.open(url,
'_blank',
'scrollbars=yes,directories=no,menubar=no,status=yes,toolbar=no,resizable=yes,location=no,left='+x+', top='+y+',width='+width+",height="+height,
true)}
function CheckRegister(){
bIsValid=true
sErr=""
firstName=document.mainForm.firstName.value
if(firstName.length==0){
if(sErr.length>0)sErr+=", "
sErr+="il Nome"
bIsValid=false}
lastName=document.mainForm.lastName.value
if(lastName.length==0){
if(sErr.length>0)sErr+=", "
sErr+="il Cognome"
bIsValid=false}
postCode=document.mainForm.postCode.value
if(postCode.length==0){
if(sErr.length>0)sErr+=", "
sErr+="il CAP"
bIsValid=false}
address1=document.mainForm.address1.value
if(address1.length==0){
if(sErr.length>0)sErr+=", "
sErr+="l'Indirizzo"
bIsValid=false}
address3=document.mainForm.address3.value
if(address3.length==0){
if(sErr.length>0)sErr+=", "
sErr+="la Provincia"
bIsValid=false}
city=document.mainForm.city.value
if(city.length==0){
if(sErr.length>0)
sErr+=", "
sErr+="la Citta'"
bIsValid=false}
countryCode=document.mainForm.countryCode.value
regionCode=document.mainForm.regionCode.value
if(countryCode=="US"&&regionCode==""){
if(sErr.length>0)sErr+=", "
sErr+="lo Stato"
bIsValid=false}
phoneNumber=document.mainForm.phoneNumber.value
if(phoneNumber.length==0){
if(sErr.length>0)sErr+=", "
sErr+="il Numero di Telefono"
bIsValid=false}
emailAddress=document.mainForm.emailAddress.value
if(emailAddress.length==0){
if(sErr.length>0)sErr+=", "
sErr+="l'indirizzo E-mail"
bIsValid=false}
var goodEmail=true
var sValue=new String(emailAddress)
var iLen=emailAddress.length
var iAt=emailAddress.indexOf("@")
var iDot=emailAddress.lastIndexOf(".")
if(iLen==0 || iAt==-1 || iDot==-1 || iAt>iDot ||
(iDot-iAt)==1 || iDot==(iLen-1))
goodEmail=false
if(!goodEmail){
if(sErr.length>0)sErr+=", "
sErr+="un indirizzo E-mail corretto"
bIsValid=false}
if(!document.mainForm.authLocal[0].checked){
if(sErr.length>0)sErr+=", "
sErr+="autorizzare il trattamento dei dati personali"
bIsValid=false}
if(!document.mainForm.termsAndCondition.checked){
if(sErr.length>0)sErr+=", "
sErr+="accettare i Termini di Acquisto"
bIsValid=false}
if(sErr.length>0){
ShowError("Ti ricordiamo che è necessario compilare i seguenti campi: "+sErr)
sErr=""
bIsValid=false}
return bIsValid}
function CheckDeliveryRegister(){
bIsValid=true
sErr=""
deliveryPostCode=document.mainForm.deliveryPostCode.value
if(deliveryPostCode.length==0){
sErr+=("il CAP -\r\n")
bIsValid=false}
deliveryAddress1=document.mainForm.deliveryAddress1.value
if(deliveryAddress1.length==0){
sErr+=(" l'Indirizzo -\r\n")
bIsValid=false}
deliveryAddress3=document.mainForm.deliveryAddress3.value
if(deliveryAddress3.length==0){
sErr+=(" la Provincia -\r\n")
bIsValid=false}
deliveryCity=document.mainForm.deliveryCity.value
if(deliveryCity.length==0){
sErr+=(" la CittÃ \r\n")
bIsValid=false}
deliveryCountryCode=document.mainForm.deliveryCountryCode.value
deliveryRegionCode=document.mainForm.deliveryRegionCode.value
if(deliveryCountryCode=="US"&&deliveryRegionCode==""){
sErr+=(" lo Stato -\r\n")
bIsValid=false}
if(sErr.length>0){
ShowError("E' necessario inserire: "+sErr)
sErr=""
bIsValid=false}
return bIsValid}
function goToURL(sUrl,sJSession){
sFinalURL=sUrl+";jsessionid="+sJSession
document.location=sFinalURL}
function goToPage(iPage){
document.mainForm.page.value=iPage
document.mainForm.submit()}
function validateSearch(){
if(document.mainForm.newsTitolo.value==''&&
document.mainForm.fromDate.value==''&&
document.mainForm.toDate.value==''&&
document.mainForm.treeId.selectedIndex==0){
ShowError("Selezionare almeno un criterio di ricerca.")
return false}
return true}
function ShowError(sError){
window.open("showError.jsp?description="+sError,
"Errore",
"width=552,height=250")}
function checkCreditCard(){
var sErr=""
var sErr1=""
var sErr2=""
if(document.mainForm.cardNumber.value.length==0)
sErr1+="Inserire il numero della carta di credito"
if(document.mainForm.expirationMonth.selectedIndex==0)
sErr2+="mese"
if(document.mainForm.expirationYear.selectedIndex==0){
if(sErr2.length>0)
sErr2+=" e "
sErr2+="anno"}
if(sErr1.length>0 || sErr2.length>0){
if(sErr1.length>0){
sErr+=sErr1
if(sErr2.length>0)
sErr+=" e "}
if(sErr2.length>0)
sErr+="Selezionare "+sErr2+" della carta di credito."
ShowError(sErr)
return false}
return true}
function ShowHelp(){
window.open("vodafoneFaq.jsp",
"FAQ",
"width=572,height=500,scrollbars=yes")}
function exportXsl(){
document.mainForm.exportMode.value=1
document.mainForm.submit()}
function doAction(action){
if(action=='DEL'&&!confirm("Eliminare la scheda?")){
return}
else if(action=='CLS'){
document.location="historyBack.jsp"
return}
if(!validateForm()){
return}
document.mainForm.Action.value=action
document.mainForm.submit()}
function refreshForm(){
document.forms[0].submit()}
function handleKeyDown(obj){
var tabKeyCode=9
if(event.keyCode==tabKeyCode&&event.srcElement==obj){
obj.selection=document.selection.createRange()
obj.selection.text=String.fromCharCode(tabKeyCode)
event.returnValue=false}}
function format_number(p,d,ds){
var r
if(p<0){
p=-p
r=format_number2(p,d,ds)
r="-"+r}
else{
r=format_number2(p,d,ds)}
return r}
function format_number2(pnumber,decimals,decimalsSeparator){
var strNumber=new String(pnumber)
var arrParts=strNumber.split('.')
var intWholePart=parseInt(arrParts[0],10)
var strResult=''
if(isNaN(intWholePart))
intWholePart='0'
if(arrParts.length>1){
var decDecimalPart=new String(arrParts[1])
var i=0
var intZeroCount=0
while(i<String(arrParts[1]).length){
if(parseInt(String(arrParts[1]).charAt(i),10)==0){
intZeroCount+=1
i+=1}
else
break}
decDecimalPart=parseInt(decDecimalPart,10)/Math.pow(10,parseInt(decDecimalPart.length-decimals-1))
Math.round(decDecimalPart)
decDecimalPart=parseInt(decDecimalPart)/10
decDecimalPart=Math.round(decDecimalPart)
if(decDecimalPart==Math.pow(10,parseInt(decimals))){
intWholePart+=1
decDecimalPart="0"}
var stringOfZeros=new String('')
i=0
if(decDecimalPart>0){
while(i<intZeroCount){
stringOfZeros+='0'
i+=1}}
decDecimalPart=String(intWholePart)+decimalsSeparator+stringOfZeros+String(decDecimalPart)
var dot=decDecimalPart.indexOf(decimalsSeparator)
if(dot==-1){
decDecimalPart+=decimalsSeparator
dot=decDecimalPart.indexOf(decimalsSeparator)}
var l=parseInt(dot)+parseInt(decimals)
while(decDecimalPart.length<=l){
decDecimalPart+='0'}
strResult=decDecimalPart}
else{
var dot
var decDecimalPart=new String(intWholePart)
decDecimalPart+=decimalsSeparator
dot=decDecimalPart.indexOf(decimalsSeparator)
var l=parseInt(dot)+parseInt(decimals)
while(decDecimalPart.length<=l){
decDecimalPart+='0'}
strResult=decDecimalPart}
return strResult}
function disableButton(objButton){
objButton.disabled=true}
window.name="ticketone"
function Label(key,value){
this.key=key
this.value=value}
function Labels(){
this.labelList=new Array(64)
this.numLabels=0}
Labels.prototype.add=function(key,value){
this.labelList[this.numLabels++]=new Label(key,value)}
Labels.prototype.get=function(key){
for(i=0;i<this.numLabels;i++)
if(this.labelList[i].key==key)
return this.labelList[i].value
return "Label "+key+" not found."}
