function changeTabs(a)
{
	document.getElementById("menu"+a).className="active";
	for(i=1;i<5;i++) { if (i!=a) document.getElementById("menu"+i).className=""; }
}

function changeImage()
{
	where=document.getElementById("thephoto");
	which=Math.ceil(Math.random()*5);
	
	if (where.src!="")
	{
		pos=where.src.indexOf("photo")+5;
		thenum=where.src.substr(pos,1);
	
		which=Math.ceil(Math.random()*5);
		while(which==thenum) which=Math.ceil(Math.random()*5);	
	}
	else;	
	
	where.src="images/photo"+which+".jpg";
}

function checkIfMail(a,b)
{	
	theinput=document.getElementById(a);
	if ((theinput.value.indexOf("@")!=-1)&&((theinput.value.indexOf(".")!=-1))) submittheform(b);
	else alert("Η διεύθυνση που δώσατε δεν είναι σωστή. Παρακαλώ ξαναγράψτε την.");
}

function submittheform(a)
{
	which=document.getElementById(a);
	which.submit();
}
