function login_popup(){
	var open = window.open("login_popup.html", "Login", "width=400, height=310, scrollbar=0, toolbar=0");
}

function login_popup2(){
	var open2 = window.open("login_popup2.asp", "Login", "width=400, height=310, scrollbar=0, toolbar=0");
}

function validation(){
	client1=document.private_area.client1.value;
	Password=document.private_area.Password.value;
	
	if((client1=="430")&&(Password=="ABC"))
	{
			//alert("Anmeldung erfolgreich");
			window.location.href="login/Index.asp";
			return false;
	}
	else
	{
		alert("Please enter valid values of client and Password")
		return false;
	}
}
function validation2(){
	client1=document.login2.username.value;
	Password=document.login2.Password2.value;
	if((client1=="mike")&&(Password=="mike"))
	{
			//alert("Anmeldung erfolgreich");
			close();
			window.opener.location.href="login2/search_engine.html";
			return false;
	}
	else
	{
		alert("Please enter valid values of username and Password")
		return false;
	}
}

/*----------customer form validation-----------------*/
function customer_validation()
{
   if (document.getElementById('ley').checked == false){
     	alert('Devi prima accettare le Condizioni Generali di vendita.');
     	return false;
      }	
		name1=document.getElementById('F02').value;
		telefon1=document.getElementById('F03').value;
	  email=document.getElementById('F06').value;
		firmenname1=document.getElementById('F07').value;
		ustidnr1=document.getElementById('F08').value;
		hrbnummer1=document.getElementById('F10').value;
		dde1=document.getElementById('F11').value;
		strasse1=document.getElementById('F12').value;
		plz1=document.getElementById('F13').value;
		stadt1=document.getElementById('F14').value;

		region1=document.getElementById('F15').value;
		land1=document.getElementById('F16').value;

		member_number=document.getElementById('F36').value;
		company_name=document.getElementById('F37').value;
		
		datiB_01=document.getElementById('F39').value;
		datiB_02=document.getElementById('F40').value;
		datiB_03=document.getElementById('F41').value;
		datiB_04=document.getElementById('F42').value;						
		
		fact_email=document.getElementById('F43').value;		
		/*fact_person=document.getElementById('F44').value;		*/
		
		
		cancelleria=document.getElementById('F45').value;	
	  fornitori=document.getElementById('F46').value;	
	  ingrosso=document.getElementById('F47').value;	
	  retail=document.getElementById('F48').value;	
	  informatico=document.getElementById('F49').value;	
		
		
		
		var facturaonline=document.getElementById('F98').checked;
		var buyingretail=document.getElementById('F99').checked;
		
      
    if(buyingretail && facturaonline)
    {
    		   		
    		if((name1!="")&&(telefon1!="")&&(email!="")&&(firmenname1!="")&&(ustidnr1!="")&&(hrbnummer1!="")&&(dde1!="")&&(strasse1!="")&&(plz1!="")&&(stadt1!="")&&(datiB_01!="")&&(datiB_02!="")&&(datiB_03!="")&&(datiB_04!="")&&(member_number!="")&&(company_name!="")&&(fact_email!="")&&(cancelleria!="")&&(fornitori!="")&&(ingrosso!="")&&(retail!="")&&(informatico!=""))
				{	
					return true;
				}
				else
				{
					alert("I campi con l'asterisco devono essere compilati.");
					return false;
				}
    }
    else if(buyingretail)
		{
			
				if((name1!="")&&(telefon1!="")&&(email!="")&&(firmenname1!="")&&(ustidnr1!="")&&(hrbnummer1!="")&&(dde1!="")&&(strasse1!="")&&(plz1!="")&&(stadt1!="")&&(datiB_01!="")&&(datiB_02!="")&&(datiB_03!="")&&(datiB_04!="")&&(member_number!="")&&(company_name!="")&&(cancelleria!="")&&(fornitori!="")&&(ingrosso!="")&&(retail!="")&&(informatico!=""))
				{	
					
					return true;
				}
				else
				{
					alert("I campi con l'asterisco devono essere compilati.");
					return false;
				}
		}
		else if	(facturaonline)
		{
				if((name1!="")&&(telefon1!="")&&(email!="")&&(firmenname1!="")&&(ustidnr1!="")&&(hrbnummer1!="")&&(dde1!="")&&(strasse1!="")&&(plz1!="")&&(stadt1!="")&&(datiB_01!="")&&(datiB_02!="")&&(datiB_03!="")&&(datiB_04!="")&&(fact_email!="")&&(cancelleria!="")&&(fornitori!="")&&(ingrosso!="")&&(retail!="")&&(informatico!=""))
				{	
					return true;
				}
				else
				{
					alert("I campi con l'asterisco devono essere compilati.");
					return false;
				}
		}
		else
		{
			if((name1!="")&&(telefon1!="")&&(email!="")&&(firmenname1!="")&&(ustidnr1!="")&&(hrbnummer1!="")&&(dde1!="")&&(strasse1!="")&&(plz1!="")&&(stadt1!="")&&(datiB_01!="")&&(datiB_02!="")&&(datiB_03!="")&&(datiB_04!="")&&(cancelleria!="")&&(fornitori!="")&&(ingrosso!="")&&(retail!="")&&(informatico!=""))
			{	
				return true;
			}
			else
			{
				alert("I campi con l'asterisco devono essere compilati.");
				return false;
			}

		}
		
		

}

/*---------Access to the webshop------------*/
function acc_webshop_validation()
{
		customer_code=document.getElementById('customer_code').value;
		password1=document.getElementById('password1').value;
		your_name=document.getElementById('your_name').value;
		email=document.getElementById('email').value;
		if((customer_code!="")&&(password1!="")&&(your_name!="")&&(email!=""))
		{
			alert("I campi obbligatori devono essere compilati.");
			return true;
		}
		else
		{
			alert("Felder mit einem * müssen ausgefüllt werden.");
			return false;
		}

}

/*function customer_validation()
{
		name1=document.getElementById('name1').value;
		telefon1=document.getElementById('telefon1').value;
		firmenname1=document.getElementById('firmenname1').value;
		ustidnr1=document.getElementById('ustidnr1').value;
		hrbnummer1=document.getElementById('hrbnummer1').value;
		dde1=document.getElementById('dde1').value;
		strasse1=document.getElementById('strasse1').value;
		plz1=document.getElementById('plz1').value;
		stadt1=document.getElementById('stadt1').value;
		region1=document.getElementById('region1').value;
		land1=document.getElementById('land1').value;
		if((name1!="")&&(telefon1!="")&&(firmenname1!="")&&(ustidnr1!="")&&(hrbnummer1!="")&&(dde1!="")&&(strasse1!="")&&(plz1!="")&&(stadt1!="")&&(region1!="")&&(land1!=""))
		{
			alert("I campi obbligatori devono essere compilati.");
			return true;
		}
		else
		{
			alert("Felder mit einem * müssen ausgefüllt werden.");
			return false;
		}

}*/
