// JavaScript Document Powered by Spyros® (Puma)



function date ()
{
	var d = new Date()
	var weekday=new Array("Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο")
	var monthname=new Array("Ιανουαρίου","Φεβρουαρίου","Μαρτίου","Απριλίου","Μαϊου","Ιουνίου","Ιουλίου","Αυγούστου","Σεπτεμβρίου","Οκτωβρίου","Νοεμβρίου","Δεκεμβρίου")
	document.write(weekday[d.getDay()] + " ")
	document.write(d.getDate() + " ")
	document.write(monthname[d.getMonth()] + " ")
	document.write(d.getFullYear())

}

function doLogin ()
{
	var username = window.document.fm.username.value;
	var password = window.document.fm.password.value;
	var fm = window.document.fm;
	
	if ( blank ( username )  || blank ( password ) )
	{
		alert ( "Παρακαλούμε συμπληρώστε Όνομα χρήστη και Κωδικό" );
	}
	else
	{
		fm.submit();
	}
}

function forgot ( token )
{
	var y = (screen.availHeight - 200)/2;
    var x = (screen.availWidth - 300)/2;
	
	window.open('forgot.php?token=' + token, 'ForgotPassword','width=300, height=220, screenX=' + x + ', screenY = ' + y + ',top=' + y + ',left = ' + x);
}

function newmember ( token )
{
	var xx = 500;
	var yy = 700;
	
	var y = (screen.availHeight - yy)/2;
    var x = (screen.availWidth - xx)/2;
	
	window.open('newmember.php?token=' + token, 'ForgotPassword','width=' + xx + ', height=' + yy + ', screenX=' + x + ', screenY = ' + y + ',top=' + y + ',left = ' + x);
}

function Load_divs ( x )
{
	if ( x == 1 )
		c = window.document.getElementById('content_inner_sponsor');
	else
		c = window.document.getElementById('content_inner');
	
	m = window.document.getElementById('menu');
	s = window.document.getElementById('sponsors');
	
	hc = c.offsetHeight;
	hm = m.offsetHeight;
	hs = m.offsetHeight;
	
	hmax = Math.max ( Math.max( hc, hm), hs );
	
	

	
	//window.document.getElementById('column').style.bottom = "0px";
	

	mh = window.document.getElementById('menu_height');
	
	//alert ("Hmax = " + hmax + ", Sub = " + mh.offsetHeight + ", Menu = " + m.offsetHeight + ", Content = " + c.offsetHeight);
	//aaa = hmax - mh.offsetHeight

	if ( hmax - mh.offsetHeight < 174 )
		hmax = mh.offsetHeight + 174;

		c.style.height = hmax - 2 + "px";
		m.style.height = hmax - 4 + "px";
		if ( x == 1 )
			s.style.height = hmax - 10 + "px";

	//alert ("Hmax = " + hmax + ", Diffence = " + aaa + ", Sub = " + mh.offsetHeight + ", Menu = " + m.offsetHeight + ", Content = " + c.offsetHeight);
}

function blank ( x )
{
	 var length = x.length;
	 var result = 1;

	for ( i = 1; i <= length; i++ )
	{
		if ( x.charAt(i-1) != " " ) {
			
			result = 0;
			break;
		}
	} 
	return result;
}

function EnterKey ( e )
{
	if(window.event) { // IE
		keynum = e.keyCode;
	}
	else if(e.which) { // Netscape/Firefox/Opera
		keynum = e.which;
	}
	if ( keynum == 13 ) {
		doLogin();
		return false;
	}
	else {
		return true;	
	}
}

function Subscribe ()
{
	email = window.document.getElementById('EMAIL');
	msg = "";

	
	if ( !email.value.match(/(\w+)@(.+)\.(\w+)$/)) {
		msg = "Το e-mail δεν είναι έγκυρο";
		alert ( msg );
	}
	else {
		window.open ( "http://www.ahma.gr/subscribe.php?EMAIL=" + email.value, "subscribe", "width=220, height=150, status = 1 " );
	}
}
