<!-- 

/***************************************************************************\
 * Project : Automatika Eltech
 *  Author : Jurga A.
 *   Email : jurga@tandemas.lt
 *
 * Copyright (c) 2005
 * UAB „TANDEMAS". All rights reserved
 *
 *     App : www.automatic.lt
 *    Name : eltech-scriptfile.js
 * Version : 1.01
\***************************************************************************/



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=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 valFieldsNEWPASSW(theform) {

if (theform.NewPsw.value!=theform.NewPsw1.value) {
alert("Blogai \u012Fvestas naujas slapta\u017Eodis! Pra\u0161ome \u012Fvesti i\u0161 naujo!");
return false }
else {
	theform.submit();
	return true;
}
}

function testEmailLT(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\u0161au \u012Fvesti savo el. pa\u0161to adres\u0105.");
		eval("theform."+varname+".focus()");
		return false
	} else if (StringToTest!="" && !eMail.exec(StringToTest)) {
		alert("Neteisingas el. pa\u0161to adresas. Bandykite dar kart\u0105.");
		eval("theform."+varname+".focus()");
		return false
	} else return true
}


function valVisitorsAppl(theform) {

	if (theform.visitor_firstname.value=="") {
	alert("Pra\u0161au \u012Fvesti savo vard\u0105.");
	theform.visitor_firstname.focus();
	return false
	}

	if (theform.visitor_lastname.value=="") {
	alert("Pra\u0161au \u012Fvesti savo pavard\u0119.");
	theform.visitor_lastname.focus();
	return false
	}

	if (theform.visitor_position.value=="") {
	alert("\u012Era\u0161ykite savo pareigas.");
	theform.visitor_position.focus();
	return false
	}

	if (theform.visitor_company.value=="") {
	alert("Nurodykite \u012Fmon\u0119, kurioje dirbate.");
	theform.visitor_company.focus();
	return false
	}

	if (theform.visitor_address.value=="") {
	alert("Pra\u0161au \u012Fvesti \u012Fmon\u0117s adres\u0105.");
	theform.visitor_address.focus();
	return false
	}

	if (theform.visitor_town.value=="") {
	alert("Nurodykite miest\u0105/rajon\u0105, kuriame yra J\u016Bs\u0173 \u012Fmon\u0117.");
	theform.visitor_town.focus();
	return false
	}

	if ((theform.visitor_phone.value=="") && (theform.visitor_mob.value=="")){
	alert("\u012Eveskite bent vien\u0105 telefono numer\u012F.");
	theform.visitor_phone.focus();
	return false
	}

	if (!testEmailLT(theform.visitor_email.value,1,theform,'visitor_email')) return false
	theform.submit();
	return true
}

function valAgentsPass(theform) {

	if (!testEmailLT(theform.agents_email.value,1,theform,'agents_email')) return false

	theform.submit();
	return true
}

// -->

