﻿<!-- JScript --> 


function checkEmptyText(a_form, a_message)
{
	if(a_form.value == "")
	{
		window.alert(a_message);
		a_form.focus();
		return false;
	}
	return true;
}

function checkEmail(a_form, a_message)
{
	if(a_form.value == "")
	{
		window.alert(a_message);
		a_form.focus();
		return false;
	}
	
	if(a_form.value.search(/@/)  == -1)
	{
		window.alert(a_message);
		a_form.focus();
		return false;
	}	
	
	return true;
}

function checkEmailIfSet(a_form, a_message)
{
	if(a_form.value == "")
	{
		return true;
	}
	
	if(a_form.value.search(/@/)  == -1)
	{
		window.alert(a_message);
		a_form.focus();
		return false;
	}	
	
	return true;
}

function checkZerovalSelection(a_form, a_message)
{
	if(a_form.value == 0)
	{
		window.alert(a_message);
		a_form.focus();
		return false;
	}
	return true;
}

function checkFormContact(form)
{
	if(!checkEmptyText(form.namesurname, 'Vnesite ime in priimek!'))
		return false;
		
	if(!checkEmptyText(form.email, 'Vnesite e-mail naslov!'))
		return false;	
		
	if(!checkEmailIfSet(form.email, 'Vnesite pravi e-mail naslov!'))
		return false;

	if(!checkEmptyText(form.comment, 'Vnesite vsebino sporočila!'))
		return false;


	form.submit();
	return true;
}




function openFormContact(a_pre)
{
	var remote = window.open( a_pre + 'email_contact.html', '','scrollbars=yes,status=yes,menubar=no,titlebar=no,toolbar=no,resizable=yes,WIDTH=680,HEIGHT=680');
	remote.focus();
	return true;
}


//END JScript --> 
