<!-- 

/***************************************************************************\
 * Project : Pikaverus LLR
 *  Author : Jurga A.
 *   Email : jurga@tandemas.lt
 *
 * Copyright (c) 2005
 * UAB TANDEMAS". All rights reserved
 *
 *     App : members
 *    Name : scriptfile.js
 * Version : 1.00
\***************************************************************************/


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 įvestas naujas slaptažodis! Prašome įvesti iš naujo!");
return false }
else {
	theform.submit();
	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 valAgentsAppl(theform) {

	if (theform.agents_firstname.value=="") {
	alert("Please enter your name.");
	theform.agents_firstname.focus();
	return false
	}

	if (theform.agents_lastname.value=="") {
	alert("Please enter your surname.");
	theform.agents_lastname.focus();
	return false
	}

	if (theform.agents_company.value=="") {
	alert("Your company name is missing.");
	theform.agents_company.focus();
	return false
	}

	if (theform.agents_position.value=="") {
	alert("Your position title is missing");
	theform.agents_position.focus();
	return false
	}

	if ((!theform.agents_status[0].checked) && (!theform.agents_status[1].checked)){
	alert("Please select the category your company belongs to.");
	theform.agents_status[0].focus();
	return false
	}

	if (theform.agents_cmp_address.value=="") {
	alert("Please enter the address.");
	theform.agents_cmp_address.focus();
	return false
	}

	if (theform.agents_cmp_town.value=="") {
	alert("City/Town input field is empty.");
	theform.agents_cmp_town.focus();
	return false
	}

	if (theform.agents_cmp_country.value=="0"){
	alert("Please, select the country");
	theform.agents_cmp_country.focus();
	return false
	}

	if (theform.agents_tel.value=="") {
	alert("Your phone number is missing.");
	theform.agents_tel.focus();
	return false
	}

//	if (!testEmailEN(theform.agents_email.value,1,theform,'agents_email')) return false

	if (theform.agents_email.value=="") {
	alert("Please, enter your e-mail.");
	theform.agents_email.focus();
	return false
	}

	if (theform.agents_p.value=="") {
	alert("Please, enter your password.");
	theform.agents_p.focus();
	return false
	}

	if (theform.agents_p1.value=="") {
	alert("Please, retype your password once again.");
	theform.agents_p1.focus();
	return false
	}

	if (theform.agents_p.value!=theform.agents_p1.value) {
		alert("Passwords do not match! Please, try again!");
		return false 
	}

	theform.submit();
	return true
}

function valAgentsPass(theform) {

	if (!testEmailEN(theform.agents_email.value,1,theform,'agents_email')) return false

	theform.submit();
	return true
}

function valAgentsApplShort(theform) {

	if (theform.agents_firstname.value=="") {
	alert("Please enter your name.");
	theform.agents_firstname.focus();
	return false
	}

	if (theform.agents_lastname.value=="") {
	alert("Please enter your surname.");
	theform.agents_lastname.focus();
	return false
	}

	if (theform.agents_company.value=="") {
	alert("Your company name is missing.");
	theform.agents_company.focus();
	return false
	}

	if (theform.agents_position.value=="") {
	alert("Your position title is missing");
	theform.agents_position.focus();
	return false
	}

	if ((!theform.agents_status[0].checked) && (!theform.agents_status[1].checked)){
	alert("Please select the category your company belongs to.");
	theform.agents_status[0].focus();
	return false
	}

	if (theform.agents_cmp_address.value=="") {
	alert("Please enter the address.");
	theform.agents_cmp_address.focus();
	return false
	}

	if (theform.agents_cmp_town.value=="") {
	alert("City/Town input field is empty.");
	theform.agents_cmp_town.focus();
	return false
	}

	if (theform.agents_cmp_country.value=="0"){
	alert("Please, select the country");
	theform.agents_cmp_country.focus();
	return false
	}

	if (theform.agents_tel.value=="") {
	alert("Your phone number is missing.");
	theform.agents_tel.focus();
	return false
	}

	if (!testEmailEN(theform.agents_email.value,1,theform,'agents_email')) return false

	theform.submit();
	return true
}


function valAgentsApplP(theform) {


	if (theform.agents_p.value=="") {
	alert("Please, enter your password.");
	theform.agents_p.focus();
	return false
	}

	if (theform.agents_p1.value=="") {
	alert("Please, retype your password once again.");
	theform.agents_p1.focus();
	return false
	}

	if (theform.agents_p.value!=theform.agents_p1.value) {
		alert("Passwords do not match! Please, try again!");
		return false 
	}

	theform.submit();
	return true
}

function valAgentsApplO(theform) {


	if (theform.reservations_notes.value=="") {
	alert("Please, enter job description. Thank you.");
	theform.reservations_notes.focus();
	return false
	}

	theform.submit();
	return true
}



// -->
