
	function OnSubmit(strRegCode)
	{
		var arrURL = document.URL.split("/");
		var strLang = arrURL[arrURL.length-2];
		
		document.form1.pib.value = document.form1.pib.value.replace(/\"|\'/g, "");
		document.form1.maticni.value = document.form1.maticni.value.replace(/\"|\'/g, "");
		document.form1.sifra.value = document.form1.sifra.value.replace(/\"|\'/g, "");
		document.form1.pun.value = document.form1.pun.value.replace(/\"|\'/g, "");
		document.form1.skraceni.value = document.form1.skraceni.value.replace(/\"|\'/g, "");
		document.form1.ime.value = document.form1.ime.value.replace(/\"|\'/g, "");
		document.form1.adresa.value = document.form1.adresa.value.replace(/\"|\'/g, "");
		document.form1.opstina.value = document.form1.opstina.value.replace(/\"|\'/g, "");
		document.form1.mesto.value = document.form1.mesto.value.replace(/\"|\'/g, "");
		document.form1.country.value = document.form1.country.value.replace(/\"|\'/g, "");
		document.form1.telefon.value = document.form1.telefon.value.replace(/\"|\'/g, "");
		document.form1.faks.value = document.form1.faks.value.replace(/\"|\'/g, "");
		document.form1.mail.value = document.form1.mail.value.replace(/\"|\'/g, "");
		document.form1.pdv.value = document.form1.pdv.value.replace(/\"|\'/g, "");
		document.form1.banka.value = document.form1.banka.value.replace(/\"|\'/g, "");
		document.form1.racun.value = document.form1.racun.value.replace(/\"|\'/g, "");
		
		if(document.form1.sifra.value.length == 0)
			document.form1.sifra.value = "0";
			
		if(document.form1.faks.value.length == 0)
			document.form1.faks.value = "0";

		if(document.form1.pib.value.length && document.form1.maticni.value.length && document.form1.sifra.value.length && 
		document.form1.pun.value.length && document.form1.skraceni.value.length && document.form1.ime.value.length && 
		document.form1.adresa.value.length && document.form1.opstina.value.length && document.form1.country.value.length && document.form1.mesto.value.length && 
		document.form1.telefon.value.length && document.form1.faks.value.length && document.form1.mail.value.length && 
		document.form1.banka.value.length && document.form1.racun.value.length)
		{
			var str = document.form1.mail.value;
			
			if(str.search(/@/) != -1)
			{
				if(document.form1.regcode.value == strRegCode)
				{
					document.form1.submit();
					return;
				}
				else
				{
					if(strLang == "ser")
						alert("Niste upisali tačan registracioni kôd.");
					else if(strLang == "hun")
						alert("Nem másolta be helyesen a kódot.");
					else if(strLang == "eng")
						alert("The registration code does not match.");
				
					return;
				}
			}
			else
			{
				if(strLang == "ser")
					alert("Niste zadali E-mail adresu.");
				else if(strLang == "hun")
					alert("Nem adott meg érvényes E-mail címet.");
				else if(strLang == "eng")
					alert("You have not provided a valid E-mail address.");
				
				return;
			}
		}
		else
		{	
			if(strLang == "ser")
				alert("Niste popunili sva polja.");
			else if(strLang == "hun")
				alert("Nem töltötte ki az összes mezőt.");
			else if(strLang == "eng")
				alert("You have not filled in all the required fields.");
				
			return;
		}
	}
	
	function ShowExamples()
	{
		var arrURL = document.URL.split("/");
		var strLang = arrURL[arrURL.length-2];
		
		document.form1.pib.value = "102217483";
		document.form1.maticni.value = "08771324";
		document.form1.sifra.value = "51700";
		document.form1.skraceni.value = "Ex-Tel Trade";
		document.form1.ime.value = "Popadić Zoran";
		document.form1.telefon.value = "24/524-525";
		document.form1.faks.value = "24/670-205";
		document.form1.mail.value = "trade@ex-tel.com";
		document.form1.postcode.value = "24000";
		document.form1.pdv.value = "133738713";
		document.form1.banka.value = "ProCredit Banka";
		document.form1.racun.value = "220-52667-07";
		
		if(strLang == "ser")
		{
			document.form1.pun.value = "'Ex-Tel Trade' Društvo sa ograničenom odgovornošću za trgovinu, proizvodnju i usluge, export-import";
			document.form1.adresa.value = "Somborski put 23";
			document.form1.opstina.value = "Subotica";
			document.form1.mesto.value = "Subotica";
			document.form1.country.value = "Srbija";
		}
		else if(strLang == "hun")
		{
			document.form1.pun.value = "'Ex-Tel Trade' Gyártó és Szolgáltató, Export-import Korlátolt Felelőségű Társaság";
			document.form1.adresa.value = "Zombori út 23";
			document.form1.opstina.value = "Szabadka";
			document.form1.mesto.value = "Szabadka";
			document.form1.country.value = "Szerbia";
		}
		else if(strLang == "eng")
		{
			document.form1.pun.value = "Ex-Tel Trade Ltd., Trading, Manufacturing, Services, Export-Import";
			document.form1.adresa.value = "Somborski put 23";
			document.form1.opstina.value = "Subotica";
			document.form1.mesto.value = "Subotica";
			document.form1.country.value = "Serbia";
		}
	}
