
function checkaccess(){
if (autenticazione.username.value.length <= 0) {
	alert("Non hai inserito il nome utente");
	autenticazione.username.focus();
	return false}
if (autenticazione.password.value.length <= 0) {
	alert("Non hai inserito la password");
	autenticazione.password.focus();
	return false}
	}
function controllacerca(){
if (cerca.cosa.value.length <= 0) {
	alert("Non hai inserito nulla da cercare");
	cerca.cosa.focus();
	return false}
	}

function confermacancella() 
{
var agree=confirm("Sicuro di volerti Cancellare?\nTutti i Suoi dati andranno persi\ne sara' necessario iscriversi nuovamente\nper acquistare nel Nostro negozio");
if (agree)
	return true ;
else
	return false ;
}

function confermacancella_eng() 
{
var agree=confirm("Are u sure you want to be deleted from our database?\nAll of your information will be erased\nand you will need to register again\nto make a new order in our Shop");
if (agree)
	return true ;
else
	return false ;
}

function controllainserisci (){

if (registra.nome.type == 'text' && !/\S/.test (registra.nome.value))
{
alert("Non hai inserito il tuo nome");
registra.nome.focus()
return false
}

if (registra.cognome.type == 'text' && !/\S/.test (registra.cognome.value))
{
alert("Non hai inserito il tuo cognome");
registra.cognome.focus()
return false
}

if (registra.indirizzo.type == 'text' && !/\S/.test (registra.indirizzo.value))
{
alert("Non hai inserito il tuo indirizzo");
registra.indirizzo.focus()
return false
}

if (registra.civico.type == 'text' && !/\S/.test (registra.civico.value))
{
alert("Non hai inserito il numero civico");
registra.civico.focus()
return false
}

if (registra.cap.type == 'text' && !/\S/.test (registra.cap.value))
{
alert("Non hai inserito il Codice di Avviamento Postale");
registra.cap.focus()
return false
}

if (registra.citta.type == 'text' && !/\S/.test (registra.citta.value))
{
alert("Non hai inserito la tua citta");
registra.citta.focus()
return false
}

if (registra.provincia.value.value == 0) {
alert("Devi inserire la tua provincia")
registra.provincia.focus()
return false
}

if (registra.email.type == 'text' && !/\S/.test (registra.email.value))
{
alert("Non hai inserito la tua E-MAIL");
registra.email.focus()
return false
}

if (registra.emailripeti.type == 'text' && !/\S/.test (registra.emailripeti.value))
{
alert("Non hai confermato la tua E-MAIL");
registra.emailripeti.focus()
return false
}

if (registra.email.value != registra.emailripeti.value) {
alert("Gli email sono differenti...non coincidono")
registra.email.focus()
registra.email.select()
return false
}

if (registra.username.type == 'text' && !/\S/.test (registra.username.value))
{
alert("Non hai scelto un username");
registra.username.focus()
return false;
}

if (registra.password.value == "") {
alert("Devi inserire una password")
registra.password.focus()
return false
}

if (registra.password1.value == "") {
alert("Devi ripetere la password")
registra.password1.focus()
return false
}

if (registra.password.value != registra.password1.value) {
alert("La passord inserita non coincide con la prima")
registra.password.focus()
registra.password.select()
return false
}

}

var testresults
function checkemail()
{
var str=document.registra.email.value
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(str))
testresults=true
else
{
alert("Per favore inserire un e-mail valido!")
testresults=false
}
return (testresults)
}

function checkbae()
{
if (document.layers||document.getElementById||document.all)
return checkemail()
else
return true
}

function accetta() 
{
var agree=confirm("COMPLETANDO LA REGISTRAZIONE, PRESTA IL CONSENSO PER IL TRATTAMENTO DEI SUOI DATI\nCOME SCRITTO NELL'INFORMATIVA AI SENSI DELL'ART.10 DELLA LEGGE N.675/96");
if (agree)
	return true ;
else
	return false ;
}

function MM_goToURL()
{
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function PopupPic(id,sPicURL) { 
window.open("http://www.crericambi.it/immagine.asp?id="+id+"&picurl="+sPicURL,"POPUP","resizable=1,left=0,top=0,HEIGHT=100,WIDTH=100");
}

function checkInput2() {

if (form.nome.type == 'text' && !/\S/.test (form.nome.value))
{
alert("Non hai inserito il tuo nome");
form.nome.focus()
return false
}

if (form.cognome.type == 'text' && !/\S/.test (form.cognome.value))
{
alert("Non hai inserito il tuo cognome");
form.cognome.focus()
return false
}

if (form.email.type == 'text' && !/\S/.test (form.email.value))
{
alert("Non hai inserito la tua E-MAIL");
form.email.focus()
return false
}

}