<!-- 

function openPIC( pageToLoad, winName, width, height, left, center) {
xposition=200; yposition=20;
    if ((parseInt(navigator.appVersion) >= 4 ) && (center)){
        xposition = (screen.width - width) / 2;
        yposition = (screen.height - height) / 2;
    }
    args = "width=" + width + "," 
    + "height=" + height + "," 
    + "location=0," 
    + "menubar=0,"
    + "resizable=0,"
    + "scrollbars=0,"
    + "status=0," 
    + "titlebar=0,"
    + "toolbar=0,"
    + "hotkeys=0,"
    + "screenx=" + xposition + ","  //NN Only
    + "screeny=" + yposition + ","  //NN Only
    + "left=" + xposition + ","     //IE Only
    + "top=" + yposition;           //IE Only

    window.open( pageToLoad,winName,args );
}

function openPIC_big( pageToLoad, winName, width, height, left, center) {
xposition=200; yposition=20;
    if ((parseInt(navigator.appVersion) >= 4 ) && (center)){
        xposition = (screen.width - width) / 2;
        yposition = (screen.height - height) / 2;
    }
    args = "width=" + width + "," 
    + "height=" + height + "," 
    + "location=0," 
    + "menubar=0,"
    + "resizable=1,"
    + "scrollbars=1,"
    + "status=0," 
    + "titlebar=0,"
    + "toolbar=0,"
    + "hotkeys=0,"
    + "screenx=" + xposition + ","  //NN Only
    + "screeny=" + yposition + ","  //NN Only
    + "left=" + xposition + ","     //IE Only
    + "top=" + yposition;           //IE Only

    window.open( pageToLoad,winName,args );
}

function check_addr(yyy) {
var retVal=false
if ((yyy.value.indexOf('@') != -1) && (yyy.value.indexOf('.') != -1))
	retVal=true	
return retVal
}

function valFieldsNEWS(theform) {

if (!check_addr(theform.f2)){alert ("Klaidingas el. pašto adresas!"); return false; }
theform.submit();
return true;
}

function Open_WinNormal(fname,widthofwin,heightofwin,topofwin,leftconerofwin)
{
options = "toolbar=0,status=0,menubar=0,scrollbars=0," + "resizable=0,top=" + topofwin + ", left=" + leftconerofwin + ", width=" + widthofwin + ",height="+ heightofwin + ",screenx=200,screeny=50";
    pasiulymas = window.open( fname , "normal", options);

}

function testEmail(StringToTest, RequiredInTheForm, theform, varname){

	eMail=/^(\w{2,}|\w{1,}.\w{1,})(@\w{2,}.|@\w{2,}.\w{2,}.)(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$/i;

	if (RequiredInTheForm==1 && StringToTest=="") {
		alert("Prašau įvesti el. pašto adresą.");
		eval("theform."+varname+".focus()");
		return false
	} else if (StringToTest!="" && !eMail.exec(StringToTest)) {
		alert("KLAIDA: neteisingas el. pašto adresas.");
		eval("theform."+varname+".focus()");
		return false
	} else return true
}

function testEmailEN(StringToTest, RequiredInTheForm, theform, varname){

	eMail=/^(\w{2,}|\w{1,}.\w{1,})(@\w{2,}.|@\w{2,}.\w{2,}.)(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$/i;

	if (RequiredInTheForm==1 && StringToTest=="") {
		alert("Please enter your e-mail address.");
		eval("theform."+varname+".focus()");
		return false
	} else if (StringToTest!="" && !eMail.exec(StringToTest)) {
		alert("The e-mail you entered is not correct. Try again.");
		eval("theform."+varname+".focus()");
		return false
	} else return true
}

function validateFieldsOfOrder2(theform) {

	if (theform.f_1.value=="") {
	alert("Prašau įvesti originalo kalbą.");
	theform.f_1.focus();
	return false
	}

	if (theform.f_2.value=="") {
	alert("Prašau įvesti kalbą, į kurią reikia išversti.");
	theform.f_2.focus();
	return false
	}

	if (theform.f_3.value=="") {
	alert("Prašau įvesti sritį (pavyzdžiui, medicina, ekonomika ir pan.).");
	theform.f_3.focus();
	return false
	}

	if (theform.f_5.value=="") {
	alert("Įveskite terminą, iki kada turi būti atliktas vertimas.");
	theform.f_5.focus();
	return false
	}

	if (theform.f_7.value=="") {
	alert("Įveskite įmonės pavadinimą.");
	theform.f_7.focus();
	return false
	}

	if (theform.f_8.value=="") {
	alert("Prašau įvesti atsakingą asmenį.");
	theform.f_8.focus();
	return false
	}

	if (theform.f_9.value=="") {
	alert("Įveskite telefono numerį.");
	theform.f_9.focus();
	return false
	}

	if (!testEmail(theform.f_11.value,1,theform,'f_11')) return false
	
	theform.submit();
	return true
}

function validateFieldsOfAppl(theform) {

	if ((!theform.a_1[0].checked) && (!theform.a_1[1].checked) && (!theform.a_1[2].checked) && (!theform.a_1[3].checked) && (!theform.a_1[4].checked) && (!theform.a_1[5].checked)){
	alert("Prašau nurodyti savo anglų kalbos žinias.");
	theform.a_1[0].focus();
	return false
	}

	if ((!theform.p_1[0].checked) && (!theform.p_1[1].checked)){
	alert("Prašau pažymėti, ar turite vairuotojo pažymėjimą.");
	theform.p_1[0].focus();
	return false
	}

	if (theform.f_1.value=="") {
	alert("Prašau įvesti savo vardą.");
	theform.f_1.focus();
	return false
	}

	if (theform.f_2.value=="") {
	alert("Prašau įvesti savo pavardę.");
	theform.f_2.focus();
	return false
	}

//	if ((!theform.f_4[0].checked) && (!theform.f_4[1].checked)){
//	alert("Prašau nurodyti savo lytį.");
//	theform.f_4[0].focus();
//	return false
//	}

	if (theform.f_9.value=="") {
	alert("Prašome įvesti gatvės pavadinimą. Jei gatvės nėra, įrašykite žodį nėra.");
	theform.f_9.focus();
	return false
	}

	if ((theform.f_9.value!="nėra") && (theform.f_9.value!="nera") && (theform.f_10.value=="")){
	alert("Prašome įvesti namo numerį.");
	theform.f_10.focus();
	return false
	}


	if (theform.f_12.value=="") {
	alert("Prašome nurodyti miestą/kaimą.");
	theform.f_12.focus();
	return false
	}

	if ((theform.f_16.value=="") && (theform.f_18.value=="")) {
		alert("Prašome įvesti bent vieną savo telefono numerį.");
		theform.f_16.focus();
		return false
	}

	if (!testEmail(theform.f_21.value,1,theform,'f_21')) return false

	if (!theform.conditions.checked){
		alert("Prašau patvirtinti, kad duomenis pateikiate laisva valia ir jie yra teisingi.");
		theform.conditions.focus();
		return false
	}

	theform.submit();
	return true
}


function validateFieldsOfQuiz(theform) {

	if (theform.f_1.value=="") {
	alert("Please enter your name.");
	theform.f_1.focus();
	return false
	}

	if (theform.f_2.value=="") {
	alert("You should specify your age.");
	theform.f_2.focus();
	return false
	}

	if (theform.f_5.value=="") {
	alert("Please enter your location.");
	theform.f_5.focus();
	return false
	}

	if (theform.f_3.value=="") {
	alert("Please enter your phone number.");
	theform.f_3.focus();
	return false
	}

	if (!testEmailEN(theform.f_4.value,1,theform,'f_4')) return false

	theform.submit();
	return true
}

// -->
