﻿var elegxos2 = document.passwdform.elegxosd.value;
//var user_name = document.passwdform.text1.value;
var confdel;
var nf = document.passwdform.nfound.value;
var nfp = document.passwdform.nfoundp.value;
var myInterface = document.passwdform.myInterface.value;
//if (document.passwdform.myfirstaccess.value==1)
//{
//	if (document.passwdform.loggedincheck.value==0)
//	{
//		window.open("whatbrowsers.asp","","toolbar=no,scrollbars=yes,width=500,height=360");
//	}
//}

if ( elegxos2==2 )
{
	document.passwdform.elegxosd.value="";
	confdel=window.confirm(nf);
	if ( confdel==false )
	{
		eval("location = ('index.asp?interface=" + myInterface + "');");
	}
	else if ( confdel==true )
	{
		eval("location = ('preregister.asp?interface=" + myInterface + "');");
	}
}
else if ( elegxos2==1 )
{
	document.passwdform.elegxosd.value="";
	window.alert(nfp);
	eval("location = ('index.asp?interface=" + myInterface + "&elegxod=" + elegxos2 + "');");
}
else if ( elegxos2==3 )
{
	document.passwdform.elegxosd.value="";
	window.alert(document.passwdform.strnotactivated.value);
}
	
function myaction()
{
	var user = document.passwdform.text1.value;
	var passwd = document.passwdform.passwd.value;
	var ab = document.passwdform.all_blank.value;
	var pb = document.passwdform.pass_blank.value;
	var ub = document.passwdform.user_blank.value;
	var not_pass_ch = document.passwdform.not_pass_ch.value;
	var not_user_ch = document.passwdform.not_user_ch.value;
	if ( (passwd == "") && (user=="") )
	{
		window.alert(ab);
		document.passwdform.text1.focus();
		return false;	
	}
	else if ( (passwd == " ") && (user==" ") )
	{
		window.alert(ab);
		document.passwdform.text1.focus();
		return false;	
	}
	else if ( (passwd == "") || (passwd == " ") )
	{
		window.alert(pb);
		document.passwdform.passwd.focus();
		return false;	
	}
	else if ( (user=="") || (user==" ") )
	{
		window.alert(ub);
		document.passwdform.text1.focus();
		return false;	
	}
	else if ( elegxos_pass() )
	{
		window.alert(not_pass_ch);
		document.passwdform.passwd.focus();
		return false;
	}
	else if ( elegxos_user() )
	{
		window.alert(not_user_ch);
		document.passwdform.text1.focus();
		return false;
	}
}

function elegxos_user()
{
	var re,r,re1,r1;
	var s = document.passwdform.text1.value;
	re = new RegExp("[0-9a-zA-Zα-ωΑ-Ωάέώίόήύ_-]");
	re1 = new RegExp("[^0-9a-zA-Zα-ωΑ-Ωάέώίόήύ_-]");
	r1 =  s.search(re1);
	r = s.search(re);
	if ( r==(-1) )
	{
		document.passwdform.text1.value = "";
		return true;
	}
	else if( r1!=(-1) )
	{
		document.passwdform.text1.value = "";
		return true;
	}
	else
	{
		return false;
	}
}

function elegxos_pass()
{
	var na = document.passwdform.passwd.value;
	var rga,sca,rga1,sca1;
	rga = new RegExp(" ");
	rga1 = new RegExp("'");
	sca = na.search(rga);
	sca1 = na.search(rga1);
	if ( sca!=(-1) )
	{
		document.passwdform.passwd.value = "";
		return true;
	}
	else if ( sca1!=(-1) )
	{
		document.passwdform.passwd.value = "";
		return true;
	}
	else
	{
		return false;
	}
}


function change(myChoice)
{
	
	var check_if_more = document.article_variables.check_if_more.value;
//	var timh_rst = document.article_variables.timh_rst.value;
	var metablhth_kinhshs = document.article_variables.metablhth_kinhshs.value;
	var n = document.article_variables.n.value;
	var articlei = document.article_variables.articlei.value;
	var myLoc;

	switch(myChoice)
	{		
				case	1033:
					myLoc="en";
					break;
				case	1032:
					myLoc="el";
					break;
				case	1030:
					myLoc="da";
					break;
				case	1043:
					myLoc="nl";
					break;
				case	1044:
					myLoc="no";
					break;
				case	1036:
					myLoc="fr";
					break;
				case	1031:
					myLoc="de";
					break;
				case	1039:
					myLoc="is";
					break;
				case	1040:
					myLoc="it";
					break;
				case	2070:
					myLoc="pt";
					break;
				case	1035:
					myLoc="fi";
					break;
				case	1034:
					myLoc="es";
					break;
				case	1053:
					myLoc="sv";
					break;
				default:
					myLoc=1033;
	}
		//	document.location.href="index.asp?interface=" + myLoc + "&check_if_more=" + check_if_more + "&timh_rst=" + timh_rst + "&metablhth_kinhshs=" + metablhth_kinhshs + "&n=" + n + "&articlei=" + articlei;
			document.location.href="index.asp?interface=" + myLoc + "&check_if_more=" + check_if_more + "&metablhth_kinhshs=" + metablhth_kinhshs + "&n=" + n + "&articlei=" + articlei;
}

//function full_image(fullimage,w,h)
//{	//w = w+50;	//h = h+50;
	//window.open("full_image.asp?fullimage=" + fullimage,"", "toolbar=no,width=" + w + ",height=" + h );//}
function full_image(fullimage,w,h)
{	w = w+50;	h = h+70;	if (w<=800)	{
		window.open("full_image.asp?fullimage=" + fullimage,"", "toolbar=no,width=" + w + ",height=" + h );		//window.open("full_image.asp?fullimage=" + fullimage,"", "toolbar=no,width=800,height=600");
	}
	else
	{
		window.open("full_image.asp?fullimage=" + fullimage,"", "toolbar=no,scrollbars=yes,width=800,height=600");
	}}
function minimize(mynum) 
{
	if (mynum=="0")
	{
		document.location.href="index.asp?mmchk=min";
	}
	else if (mynum=="1")
	{
		document.location.href="index.asp?mmchk1=min";
	}
	else if (mynum=="2")
	{
		document.location.href="index.asp?mmchk2=min";
	}
	else if (mynum=="3")
	{
		document.location.href="index.asp?mmchk3=min";
	}
	else if (mynum=="4")
	{
		document.location.href="index.asp?mmchk4=min";
	}
	else if (mynum=="5")
	{
		document.location.href="index.asp?mmchk5=min";
	}
	else if (mynum=="6")
	{
		document.location.href="index.asp?mmchk6=min";
	}
	else if (mynum=="7")
	{
		document.location.href="index.asp?mmchk7=min";
	}
	else if (mynum=="99")
	{
		document.location.href="index.asp?mmchkreg=min";
	}
}

function maximize(mynum) 
{
	if (mynum=="0")
	{
		document.location.href="index.asp?mmchk=max";
	}
	else if (mynum=="1")
	{
		document.location.href="index.asp?mmchk1=max";
	}
	else if (mynum=="2")
	{
		document.location.href="index.asp?mmchk2=max";
	}
	else if (mynum=="3")
	{
		document.location.href="index.asp?mmchk3=max";
	}
	else if (mynum=="4")
	{
		document.location.href="index.asp?mmchk4=max";
	}
	else if (mynum=="5")
	{
		document.location.href="index.asp?mmchk5=max";
	}
	else if (mynum=="6")
	{
		document.location.href="index.asp?mmchk6=max";
	}
	else if (mynum=="7")
	{
		document.location.href="index.asp?mmchk7=max";
	}
	else if (mynum=="99")
	{
		document.location.href="index.asp?mmchkreg=max";
	}
}