function gautiPradinesReiksmes() {
	var values = new Array();
	values['uzklausa2'] = 'Jūsų užklausos tekstas';
	values['vardas'] = 'Vardas, pavardė';
	values['pastas'] = 'Jūsų el. pašto adresas';
	values['telefonas'] = 'Jūsų kontaktinis telefonas';
	return values;
}
			
function gautiKlaidas() {
	var mess = new Array();
	mess['uzklausa2'] = 'Įveskite klausimą';
	mess['vardas'] = 'Nurodykite vardą';
	mess['pastas'] = 'Netinkamas el. paštą';
	mess['telefonas'] = 'Įveskite telefoną';
	return mess;
}

function uzpildytiForma(id) {
	values = gautiPradinesReiksmes();
	$(id).getElements().each(function(el) {
		
		// default reiksme
		if(el.value == '') 	el.value = values[el.id];
		
		// po ivedimo reiksme
		$(el).observe('blur', function() {
			if(el.value == '') 	el.value = values[el.id];
		});
		
		// pries ivedima reiksme
		$(el).observe('focus', function() {
			if(el.value == values[el.id]) el.value = '';
		});

	});
}

function valytiForma(id) {
	values = gautiPradinesReiksmes();
	$(id).getElements().each(function(el) {
		el.value = values[el.id];
	});
	return false;
}

// tikrinam el pasta
function check_email(str) {
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	(filter.test(str)) ? testresults=true : testresults=false;
	return (testresults)
}

// uzklausos forma
function siusti() {
	values = gautiPradinesReiksmes();
	mess = gautiKlaidas();
	forma = $('uzklausa');
	geri = true;

	forma.getElements().each(function(el) {
		if($F(el).blank() || $F(el) == values[el.id]) {
			alert(mess[el.id]);
			el.focus();
			geri = false;
			throw $break;
		}
	});
	
	if (geri) {	forma.submit();	}
	
	return false;
}

//<!--
function showImg(file, title, width, height){
    var narsykle = window.opera || ( document.layers && !navigator.mimeTypes['*'] ) || navigator.vendor == 'KDE' || ( document.childNodes && !document.all && !navigator.taintEnabled ) || ( window.ScriptEngine && ScriptEngine() == 'JScript' && navigator.platform == 'Win32' && window.ActiveXObject && !navigator.__ice_version );
    var left=window.screen.width/2-width/2;
    var top=window.screen.height/2-height/2;
    var langas = window.open( ( narsykle ? '' : 'about:blank' ), 'nuotraukos', "height="+(height+2)+",width="+width+",left="+left+",top="+top+',location=0,menubar=0,scrollbars=0,status=0,toolbar=0' );
    html='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
    html+='<html xmlns="http://www.w3.org/1999/xhtml" lang="lt" xml:lang="lt">';
    html+='<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />';
    html+='<title>'+title+'<\/title>';
    html+='<style type="text/css">body{margin:0;padding:0;border:0;}<\/style>';
    html+='<\/head>';
    html+='<body>';
    html+='<a href="#" onclick="window.close()"><img src="'+file+'" border="0"/><\/a>';
    html+='<\/body>';
    html+='<\/html>';

    langas.document.open();
    langas.document.write(html);
    langas.document.close();
    langas.focus();
    return false;
}
//-->