﻿// JScript File

function Kraj()
{
	countryK = UserAskForInfoForm.country.value;
//	alert(countryK);
	if ((countryK == "AD") || (countryK == "A") ||(countryK == "B") ||(countryK == "BA") ||(countryK == "BG") ||(countryK == "HR") ||(countryK == "CZ") ||(countryK == "DK") ||(countryK == "FI") ||(countryK == "F") ||(countryK == "FX") ||(countryK == "D") ||(countryK == "GR") ||(countryK == "HU") ||(countryK == "IS") ||(countryK == "IRL") ||(countryK == "I") ||(countryK == "LV") ||(countryK == "LI") ||(countryK == "LT") ||(countryK == "LU") ||(countryK == "MT") ||(countryK == "MD") ||(countryK == "MC") ||(countryK == "NL") ||(countryK == "NO") ||(countryK == "PT") ||(countryK == "RO") ||(countryK == "R") ||(countryK == "SM") ||(countryK == "SH") ||(countryK == "SK") ||(countryK == "SI") ||(countryK == "E") ||(countryK == "SE") ||(countryK == "CH") ||(countryK == "TR") ||(countryK == "UA") ||(countryK == "GB") ||(countryK == "VA") ||(countryK == "YU")  ||(countryK == "CY")  ||(countryK == "EE")  ||(countryK == "BY")  ||(countryK == "MK"))
	{
		zwrot = "UE";
	}
	else
	{
		zwrot = "USA";
	}
	if (countryK == "PL" || countryK == "P")
	{
		zwrot = "PL";
	}
	UserAskForInfoForm.countryK.value=zwrot;
	return zwrot;

}

function ValidateInput(obj)
{
    UserAskForInfoForm=document.all(formName);
	if (UserAskForInfoForm.firm.value == "" & UserAskForInfoForm.sname.value == "")
	{
		
		alert(DEMCON16 );
		UserAskForInfoForm.firm.focus;
		return false;
	}
	if ((UserAskForInfoForm.firm.value != "" ) && (UserAskForInfoForm.nip.value == "") && (UserAskForInfoForm.country.value == "PL"))
	{
	       alert(DEMCON37);
		UserAskForInfoForm.nip.focus;
		return false;
	}
	if (UserAskForInfoForm.street.value == "" )
	{
	       alert(DEMCON20);
		UserAskForInfoForm.street.focus;
		return false;
	}
	if (UserAskForInfoForm.city.value == "" )
	{
	       alert(DEMCON19);
		UserAskForInfoForm.city.focus;
		return false;
	}
	if (UserAskForInfoForm.zip.value == "" )
	{
	       alert(ORDERZIPVALID);
		UserAskForInfoForm.zip.focus;
		return false;
	}
	if (UserAskForInfoForm.email.value == "")
	{
		alert(DEMCON17 );
		UserAskForInfoForm.email.focus;
		return false;
	}
	if (UserAskForInfoForm.email2.value != UserAskForInfoForm.email.value)
	{
		alert(DEMCON17 );
		UserAskForInfoForm.email.focus;
		return false;
	}	
}

