function popup1($id, $pg){
	window.open('popup.php?id='+$id+'&pg='+$pg, 'showDia1', 'toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=no,copyhistory=no,scrollbars=yes,width=470,height=470,top=0,left=0');
}

function popup2($image){
	window.open('popup1.php?image='+$image, 'showDia1', 'toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=no,copyhistory=no,scrollbars=yes,width=650,height=450,top=0,left=0');
}

function validate()
{
var regex = new RegExp("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@([0-9a-z][0-9a-z-]*[0-9a-z]\.)+[a-z]{2}[mtgvu]?$");

 if(document.forms.guest.author.value=="")
 {
   alert("Empty/Invalid Name");
   document.forms.guest.author.value="";
   document.forms.guest.author.focus();
   return(false);
}

if (document.forms.guest.email.value.search(regex) == -1) 
{
	alert("Empty/Invalid Email");
	document.forms.guest.email.value="";
	document.forms.guest.email.focus();
	return(false);
}

if (document.forms.guest.text.value == "") 
{
	alert("Empty Message");
	document.forms.guest.text.value="";
	document.forms.guest.text.focus();
	return(false);
}
if (document.forms.guest.secret_num.value == "") 
{
	alert("Fill the correct secret number");
	document.forms.guest.secret_num.value="";
	document.forms.guest.secret_num.focus();
	return(false);
}
}