function apridiv(id_div){
	document.getElementById(id_div).style.display='block';
}
function chiudidiv(id_div){
	document.getElementById(id_div).style.display='none';
}
function newPopUp(newurl,newname,param) {
	apopup = window.open(newurl,newname,param);}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}

var bookmarkurl="http://www.artemotore.com/"
var bookmarktitle="Artemotore"

function addbookmark(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

function popup(str) {
        searchWin = window.open(str,'popup','scrollbars=no,resizable=no,width=270,height=270,status=no,location=no,toolbar=no');
}

var checkobj

function agreesubmit(el){
checkobj=el
if (document.all||document.getElementById){
for (i=0;i<checkobj.form.length;i++){  
var tempobj=checkobj.form.elements[i]
if(tempobj.type.toLowerCase()=="submit")
tempobj.disabled=!checkobj.checked
}
}
}

function defaultagree(el){
if (!document.all&&!document.getElementById){
if (window.checkobj&&checkobj.checked)
return true
else{
alert("Accetti le condizioni riportate sopra?")
return false
}
}
}


function valid(){
var username = document.theform.username.value
var userLength = document.theform.username.value.length
if(userLength<3 || username==""){
alert("In serisci un tuo Username da 3-15 caratteri");
document.theform.username.focus()
return false
	}
var nome=document.theform.nome.value;
if (nome==""){
alert("Inserisci il tuo Nome!!")
document.theform.nome.focus()
return false
		}
var cognome=document.theform.cognome.value;
if (cognome==""){
alert("Inserisci il tuo Cognome!!")
document.theform.cognome.focus()
return false
		}	
var email=document.theform.email.value;
if (email==""){
alert("Inserisci la tua Email")
document.theform.email.focus()
return false
	}
if (email.indexOf('@', 0) == -1 || email.indexOf('.', 0) == -1){ alert("Errore l'e-mail inserita non è valida!!");
		document.theform.email.focus()
		return false
		}
}


function valid(){

var nome=document.theform.nome.value;
if (nome==""){
alert("Inserisci il tuo Nome!!")
document.theform.nome.focus()
return false
		}
var cognome=document.theform.cognome.value;
if (cognome==""){
alert("Inserisci il tuo Cognome!!")
document.theform.cognome.focus()
return false
		}
var messaggio=document.theform.messaggio.value;
if (messaggio==""){
alert("Inserisci il tuo messaggio!!")
document.theform.messaggio.focus()
return false
		}	
var oggetto=document.theform.oggetto.value;
if (oggetto==""){
alert("Inserisci il titolo del messaggio!!")
document.theform.oggetto.focus()
return false
		}	
var emailmit=document.theform.emailmit.value;
if (emailmit==""){
alert("Inserisci la tua Email!!")
document.theform.emailmit.focus()
return false
	}
if (emailmit.indexOf('@', 0) == -1 || emailmit.indexOf('.', 0) == -1){ alert("Errore l'e-mail inserita non è valida!!");
		document.theform.emailmit.focus()
		return false
		}
}

function popimmagine(str) 
{
 searchWin = window.open(str,'Guardafoto','scrollbars=yes,resizable=yes,width=650,height=460,status=no,location=no,toolbar=no');
}

function controllo(){
var test;
test="true";

	if (test=="true") {
					if(document.registrazione.nome.value=="")
					{
					alert("Inserisci il nome!");
					document.registrazione.nome.focus();
					test="false";
					}
				}
	
	if (test=="true") {
					if(document.registrazione.cognome.value=="")
					{
					alert("Inserisci il cognome!");
					document.registrazione.cognome.focus();
					test="false";
					}
				}
	
	if (test=="true") {
				if (document.registrazione.tipologia.value =="")
					{					
					alert("Seleziona una tipologia");
					document.registrazione.tipologia.focus();
					test="false";
					}
				}
	
	if (test=="true")
				{
				document.registrazione.submit();
				}
	}


function controllo_artisti(){
var test;
test="true";

	if (test=="true") {
					if(document.registrazione.nome.value=="")
					{
					alert("Inserisci il nome!");
					document.registrazione.nome.focus();
					test="false";
					}
				}
	
	if (test=="true") {
					if(document.registrazione.cognome.value=="")
					{
					alert("Inserisci il cognome!");
					document.registrazione.cognome.focus();
					test="false";
					}
				}
	
	if (test=="true") {
				if (document.registrazione.tipologia.value =="")
					{					
					alert("Seleziona una tipologia");
					document.registrazione.tipologia.focus();
					test="false";
					}
				}
	
	if (test=="true")
				{
				document.registrazione.submit();
				}
	}
	
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}

function checkDatasearch()
{ 
var correct = true 
if (document.cerca.key.value == "") {correct = false; alert("Prego inserire un termine per la ricerca!")}
return correct 
} 


var bookmarkurl= document.URL
var bookmarktitle="Artemotore"

function addbookmark(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

