function change_radio(){
	if (document.getElementById("date") && (document.getElementById("date") != null || document.getElementById("date") != "undefined")){
		if(document.getElementById("date").value!= null && document.getElementById("date").value!= ""){
			if (document.getElementById("radio1") && (document.getElementById("radio1") != null || document.getElementById("radio1") != "undefined")){
				radio1.checked=false;
				radio2.checked=true;
			}
		}
	}
}
function clearText(){
	var thefield = document.getElementById("date").value;
	if (thefield != null){
		document.getElementById("date").value = "";
		if 	(document.getElementById("date_validate_ok") && 
			(document.getElementById("date_validate_ok") != null || document.getElementById("date_validate_ok") != "undefined")){
			document.getElementById("date_validate").innerHTML="";
		}
	}
			check_m();
} 
/* ---------------------------- INSERT USER ----------------------------------- */
/* first name validator for insert users*/
function f_name_validator(){
var str = document.getElementById("field1").value;
var xmlhttp;
if (str.length==0) { document.getElementById("f_msg").innerHTML=""; return; }
if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); }
else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{

var r =  document.getElementById("field1").value;
var found = r.search("#");
var found_0 = r.search("&");
if(found != -1 || found_0 != -1)
{
document.getElementById("f_msg").innerHTML='<h3 class="triangle-border left more_top">Μη αποδεκτοί χαρακτήρες!</h3>';
}
else{
document.getElementById("f_msg").innerHTML=xmlhttp.responseText;
}
checkall();
} }
xmlhttp.open("GET","php/checks/f_name_validate.php?q="+str,true);
xmlhttp.send();
}

/* last name validator for insert users*/
function l_name_validator(){
var str = document.getElementById("field2").value;
var xmlhttp;
if (str.length==0) { document.getElementById("l_msg").innerHTML=""; return; }
if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); }
else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{ 
var r =  document.getElementById("field2").value;
var found = r.search("#");
var found_0 = r.search("&");
if(found != -1 || found_0 != -1)
{
document.getElementById("l_msg").innerHTML='<h3 class="triangle-border left more_top">Μη αποδεκτοί χαρακτήρες!</h3>';
}
else{
document.getElementById("l_msg").innerHTML=xmlhttp.responseText;
}
checkall();

} }
xmlhttp.open("GET","php/checks/l_name_validate.php?q="+str,true);
xmlhttp.send();
}
function check_date(){
var str = document.getElementById("date").value;
var xmlhttp;
if (str.length==0) { document.getElementById("date_validate").innerHTML=""; return; }
if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); }
else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{ 


var r =  document.getElementById("date").value;
var found = r.search("#");
var found_0 = r.search("&");
if(found != -1 || found_0 != -1)
{
document.getElementById("date_validate").innerHTML='<h3 class="triangle-border left more_top">Μη αποδεκτοί χαρακτήρες!</h3>';
}
else{
document.getElementById("date_validate").innerHTML=xmlhttp.responseText;
}
		if (!document.getElementById("f_name") || document.getElementById("f_name") == null || document.getElementById("f_name") == "undefined"){		
			message();
			check_m();
		}
		else{
			message2();
			check_m2();
		}
} }
xmlhttp.open("GET","php/checks/date_validate.php?q="+str,true);
xmlhttp.send();
change_radio();
}
/* Email validator for insert users*/
function email_validator(){
var str = document.getElementById("field3").value;
var xmlhttp;
if (str.length==0) { document.getElementById("e_msg").innerHTML=""; return; }
if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); }
else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{ 


var r =  document.getElementById("field3").value;
var found = r.search("#");
var found_0 = r.search("&");
if(found != -1 || found_0 != -1)
{
document.getElementById("e_msg").innerHTML='<h3 class="triangle-border left more_top">Μη αποδεκτοί χαρακτήρες!</h3>';
}
else{
document.getElementById("e_msg").innerHTML=xmlhttp.responseText;
}
checkall();

} }
xmlhttp.open("GET","php/checks/email_validate.php?q="+str,true);
xmlhttp.send();
}

/* password validator for insert users*/
function pass1_validator(){
var str = document.getElementById("field4").value;
var xmlhttp;
if (str.length==0) { document.getElementById("p1_msg").innerHTML=""; return; }
if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); }
else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{ 
var r =  document.getElementById("field4").value;
var found = r.search("#");
var found_0 = r.search("&");
if(found != -1 || found_0 != -1)
{
document.getElementById("p1_msg").innerHTML='<h3 class="triangle-border left more_top">Μη αποδεκτοί χαρακτήρες!</h3>';
}
else{
document.getElementById("p1_msg").innerHTML=xmlhttp.responseText;
}
checkall();

} }
xmlhttp.open("GET","php/checks/p1_validate.php?q="+str,true);
xmlhttp.send();
}

/* password validator confirm for insert users*/
function pass2_validator(){
var str = document.getElementById("field5").value;
var str1 = document.getElementById("field4").value;
var xmlhttp;
if (str.length==0) { document.getElementById("p2_msg").innerHTML=""; return; }
if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); }
else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{ 
var r =  document.getElementById("field5").value;
var found = r.search("#");
var found_0 = r.search("&");
if(found != -1 || found_0 != -1)
{
document.getElementById("p2_msg").innerHTML='<h3 class="triangle-border left more_top">Μη αποδεκτοί χαρακτήρες!</h3>';
}
else{
document.getElementById("p2_msg").innerHTML=xmlhttp.responseText;
}
checkall();

} }
xmlhttp.open("GET","php/checks/p2_validate.php?q="+str+"&p="+str1,true);
xmlhttp.send();
}

/* ----------------------------------------------------------------------------- */



/* ------------------------------- EDIT USER ----------------------------------- */

/* first name validator for edit users*/
function f_name_validator2(){
var str = document.getElementById("field1").value;
var xmlhttp;
if (str.length==0) { document.getElementById("f_msg").innerHTML=""; return; }
if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); }
else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{

var r =  document.getElementById("field1").value;
var found = r.search("#");
var found_0 = r.search("&");
if(found != -1 || found_0 != -1)
{
document.getElementById("f_msg").innerHTML='<h3 class="triangle-border left more_top">Μη αποδεκτοί χαρακτήρες!</h3>';
}
else{
document.getElementById("f_msg").innerHTML=xmlhttp.responseText;
}
checkall2();
} }
xmlhttp.open("GET","php/checks/f_name_validate.php?q="+str,true);
xmlhttp.send();
}

/* last name validator for edit users*/
function l_name_validator2(){
var str = document.getElementById("field2").value;
var xmlhttp;
if (str.length==0) { document.getElementById("l_msg").innerHTML=""; return; }
if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); }
else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{ 
var r =  document.getElementById("field2").value;
var found = r.search("#");
var found_0 = r.search("&");
if(found != -1 || found_0 != -1)
{
document.getElementById("l_msg").innerHTML='<h3 class="triangle-border left more_top">Μη αποδεκτοί χαρακτήρες!</h3>';
}
else{
document.getElementById("l_msg").innerHTML=xmlhttp.responseText;
}
checkall2();

} }
xmlhttp.open("GET","php/checks/l_name_validate.php?q="+str,true);
xmlhttp.send();
}
/* Email validator for edit users*/
function email_validator2(){
var str = document.getElementById("field3").value;
var id = document.getElementById("id").value;
var xmlhttp;
if (str.length==0) { document.getElementById("e_msg").innerHTML=""; return; }
if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); }
else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
var r =  document.getElementById("field3").value;
var found = r.search("#");
var found_0 = r.search("&");
if(found != -1 || found_0 != -1)
{
document.getElementById("e_msg").innerHTML='<h3 class="triangle-border left more_top">Μη αποδεκτοί χαρακτήρες!</h3>';
}
else{
document.getElementById("e_msg").innerHTML=xmlhttp.responseText;
}
checkall2();

} }
xmlhttp.open("GET","php/checks/email_validate2.php?q="+str+"&e="+id,true);
xmlhttp.send();
}
/* password validator for edit users*/
function pass1_validator2(){
var str = document.getElementById("field4").value;
var xmlhttp;
if (str.length==0) { document.getElementById("p1_msg").innerHTML=""; return; }
if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); }
else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{ 
var r =  document.getElementById("field4").value;
var found = r.search("#");
var found_0 = r.search("&");
if(found != -1 || found_0 != -1)
{
document.getElementById("p1_msg").innerHTML='<h3 class="triangle-border left more_top">Μη αποδεκτοί χαρακτήρες!</h3>';
}
else{
document.getElementById("p1_msg").innerHTML=xmlhttp.responseText;
}
checkall3();

} }
xmlhttp.open("GET","php/checks/p1_validate.php?q="+str,true);
xmlhttp.send();
}

/* password validator confirm for edit users*/
function pass2_validator2(){
var str = document.getElementById("field5").value;
var str1 = document.getElementById("field4").value;
var xmlhttp;
if (str.length==0) { document.getElementById("p2_msg").innerHTML=""; return; }
if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); }
else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{ 
var r =  document.getElementById("field5").value;
var found = r.search("#");
var found_0 = r.search("&");
if(found != -1 || found_0 != -1)
{
document.getElementById("p2_msg").innerHTML='<h3 class="triangle-border left more_top">Μη αποδεκτοί χαρακτήρες!</h3>';
}
else{
document.getElementById("p2_msg").innerHTML=xmlhttp.responseText;
}
checkall3();

} }
xmlhttp.open("GET","php/checks/p2_validate.php?q="+str+"&p="+str1,true);
xmlhttp.send();
}

/* ----------------------------------------------------------------------------- */

/* -------------------- CHECKS FOR INSERT AND EDIT USER ------------------------ */
function checkall(){
	if (document.getElementById("f_validate") && document.getElementById("f_validate") != null && document.getElementById("f_validate") != "undefined"){		
		var str1 = document.getElementById("f_validate").innerHTML;
	}
	if (document.getElementById("l_validate") && document.getElementById("l_validate") != null && document.getElementById("l_validate") != "undefined"){		
		var str2 = document.getElementById("l_validate").innerHTML;
	}
	if (document.getElementById("e1_validate") && document.getElementById("e1_validate") != null && document.getElementById("e1_validate") != "undefined"){		
		var str3 = document.getElementById("e1_validate").innerHTML;
	}
	if (document.getElementById("p1_validate") && document.getElementById("p1_validate") != null && document.getElementById("p1_validate") != "undefined"){		
		var str4 = document.getElementById("p1_validate").innerHTML;
	}
	if (document.getElementById("p2_validate") && document.getElementById("p2_validate") != null && document.getElementById("p2_validate") != "undefined"){		
		var str5 = document.getElementById("p2_validate").innerHTML;
	}
	if(str1=="OK!" && str2=="OK!" && str3=="OK!" && str4=="OK!" && str5=="OK!"){
		document.getElementById('submit').className= 'button';
		document.getElementById('submit').disabled=false;
	}
	else{
		document.getElementById('submit').className= 'disable';
		document.getElementById('submit').disabled=true;
	}
}
function checkall2(){
	if (document.getElementById("f_validate") && document.getElementById("f_validate") != null && document.getElementById("f_validate") != "undefined"){		
		var str1 = document.getElementById("f_validate").innerHTML;
	}
	if (document.getElementById("l_validate") && document.getElementById("l_validate") != null && document.getElementById("l_validate") != "undefined"){		
		var str2 = document.getElementById("l_validate").innerHTML;
	}
	/*
	if (document.getElementById("e2_validate") && document.getElementById("e2_validate") != null && document.getElementById("e2_validate") != "undefined"){		
		var str3 = document.getElementById("e2_validate").innerHTML;
	}
	*/
	if((str1=="OK!" && str2=="OK!" /*&& str3=="OK!"*/) || (str1=="" && str2=="" /*&& str3==""*/)){
		document.getElementById('submit').className= 'button';
		document.getElementById('submit').disabled=false;
	}
	else{
		document.getElementById('submit').className= 'disable';
		document.getElementById('submit').disabled=true;
	}
}
function checkall3(){
	if (document.getElementById("p1_validate") && document.getElementById("p1_validate") != null && document.getElementById("p1_validate") != "undefined"){		
		var str1 = document.getElementById("p1_validate").innerHTML;
	}
	if (document.getElementById("p2_validate") && document.getElementById("p2_validate") != null && document.getElementById("p2_validate") != "undefined"){
		var str2 = document.getElementById("p2_validate").innerHTML;
	}
	if(str1=="OK!" && str2=="OK!"){
		document.getElementById('submit').className= 'button';
		document.getElementById('submit').disabled=false;
	}
	else{
		document.getElementById('submit').className= 'disable';
		document.getElementById('submit').disabled=true;
	}
}

/* ----------------------------------------------------------------------------- */

/* ------------------------------- INSERT DEVICE ------------------------------- */

/* ------------------------------- DEVICE ID VALIDATOR ------------------------- */
function id_validator(){
var str = document.getElementById("field1").value;
var xmlhttp;
if (str.length==0) { document.getElementById("f_msg").innerHTML=""; return; }
if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); }
else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{

var r =  document.getElementById("field1").value;
var found = r.search("#");
var found_0 = r.search("&");
if(found != -1 || found_0 != -1)
{
document.getElementById("f_msg").innerHTML='<h3 class="triangle-border left more_top">Μη αποδεκτοί χαρακτήρες!</h3>';
}
else{
document.getElementById("f_msg").innerHTML=xmlhttp.responseText;
}
checkall_d();
} }
xmlhttp.open("GET","php/checks/id_validate.php?q="+str,true);
xmlhttp.send();
}
function id_validator2(){
var str = document.getElementById("field1").value;
var xmlhttp;
if (str.length==0) { document.getElementById("f_msg").innerHTML=""; return; }
if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); }
else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{

var r =  document.getElementById("field1").value;
var found = r.search("#");
var found_0 = r.search("&");
if(found != -1 || found_0 != -1)
{
document.getElementById("f_msg").innerHTML='<h3 class="triangle-border left more_top">Μη αποδεκτοί χαρακτήρες!</h3>';
}
else{
document.getElementById("f_msg").innerHTML=xmlhttp.responseText;
}
checkall_d2();
} }
xmlhttp.open("GET","php/checks/id_validate2.php?q="+str,true);
xmlhttp.send();
}
/* password validator for insert device*/
function pass1_validator_d(){
var str = document.getElementById("field4").value;
var xmlhttp;
if (str.length==0) { document.getElementById("p1_msg").innerHTML=""; return; }
if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); }
else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{ 
var r =  document.getElementById("field4").value;
var found = r.search("#");
var found_0 = r.search("&");
if(found != -1 || found_0 != -1)
{
document.getElementById("p1_msg").innerHTML='<h3 class="triangle-border left more_top">Μη αποδεκτοί χαρακτήρες!</h3>';
}
else{
document.getElementById("p1_msg").innerHTML=xmlhttp.responseText;
}
checkall_d();

} }
xmlhttp.open("GET","php/checks/p1_validate.php?q="+str,true);
xmlhttp.send();
}

/* password validator confirm for insert device*/
function pass2_validator_d(){
var str = document.getElementById("field5").value;
var str1 = document.getElementById("field4").value;
var xmlhttp;
if (str.length==0) { document.getElementById("p2_msg").innerHTML=""; return; }
if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); }
else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{ 
var r =  document.getElementById("field5").value;
var found = r.search("#");
var found_0 = r.search("&");
if(found != -1 || found_0 != -1)
{
document.getElementById("p2_msg").innerHTML='<h3 class="triangle-border left more_top">Μη αποδεκτοί χαρακτήρες!</h3>';
}
else{
document.getElementById("p2_msg").innerHTML=xmlhttp.responseText;
}
checkall_d();

} }
xmlhttp.open("GET","php/checks/p2_validate.php?q="+str+"&p="+str1,true);
xmlhttp.send();
}
function checkall_d(){
	var str1 = document.getElementById("f_msg").innerHTML;
	var str2 = document.getElementById("p1_msg").innerHTML;
	var str3 = document.getElementById("p2_msg").innerHTML;	

var f1 = str1.search("OK!");
var f2 = str2.search("OK!");
var f3 = str3.search("OK!");
	
	if(f1!= -1 && f2!= -1 && f3!= -1){
		document.getElementById('submit').className= 'button';
		document.getElementById('submit').disabled=false;
	}
	else{
		document.getElementById('submit').className= 'disable';
		document.getElementById('submit').disabled=true;
	}

}
function checkall_d2(){
	if (document.getElementById("f_msg") && document.getElementById("f_msg") != null && document.getElementById("f_msg") != "undefined"){		
		var str1 = document.getElementById("f_msg").innerHTML;
		var f1 = str1.search("OK!");
		if(f1!= -1 || str1==""){
			document.getElementById('submit').className= 'button';
			document.getElementById('submit').disabled=false;
		}
		else{
			document.getElementById('submit').className= 'disable';
			document.getElementById('submit').disabled=true;
		}
	}
	else{
		document.getElementById('submit').className= 'disable';
		document.getElementById('submit').disabled=true;
	}

}
function checkall_d3(){	
	var str4 = document.getElementById("g1_msg").innerHTML;
	var str5 = document.getElementById("g2_msg").innerHTML;
	var str6 = document.getElementById("g3_msg").innerHTML;
	var str7 = document.getElementById("g4_msg").innerHTML;
	var str8 = document.getElementById("g5_msg").innerHTML;
	var str9 = document.getElementById("g6_msg").innerHTML;
	var str10 = document.getElementById("g7_msg").innerHTML;
	var str11 = document.getElementById("g8_msg").innerHTML;
	


var f4 = str4.search("OK!");
var f5 = str5.search("OK!");
var f6 = str6.search("OK!");
var f7 = str7.search("OK!");
var f8 = str8.search("OK!");
var f9 = str9.search("OK!");
var f10 = str10.search("OK!");
var f11 = str11.search("OK!");
	
	if(f4!= -1 && 
	(f5!= -1 || str5=="") && (f6!= -1 || str6=="") &&
	(f7!= -1 || str7=="") && (f8!= -1 || str8=="") &&
	(f9!= -1 || str9=="") && (f10!= -1 || str10=="") &&
	(f11!= -1 || str11=="")){
		document.getElementById('submit').className= 'button';
		document.getElementById('submit').disabled=false;
	}
	else{
		document.getElementById('submit').className= 'disable';
		document.getElementById('submit').disabled=true;
	}

}
function checkall_g(){	
	var str4 = document.getElementById("f_msg").innerHTML;

	var f4 = str4.search("OK!");
	if(f4!= -1|| str4==""){
		document.getElementById('submit').className= 'button';
		document.getElementById('submit').disabled=false;
	}
	else{
		document.getElementById('submit').className= 'disable';
		document.getElementById('submit').disabled=true;
	}

}
/* ----------------------------------------------------------------------------- */

function g_name_validator(){
		var str = document.getElementById("field1").value;
		var xmlhttp;
		if (str.length==0) { document.getElementById("f_msg").innerHTML=""; return; }
		if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); }
		else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
		xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{ 
		var r =  document.getElementById("field1").value;
		var found = r.search("#");
		var found_0 = r.search("&");
		if(found != -1 || found_0 != -1)
		{
		document.getElementById("f_msg").innerHTML='<h3 class="triangle-border left more_top">Μη αποδεκτοί χαρακτήρες!</h3>';
		}
		else{
		document.getElementById("f_msg").innerHTML=xmlhttp.responseText;
		
		checkall_g();
		}

		} }
		xmlhttp.open("GET","php/checks/g_validate.php?q="+str,true);
		xmlhttp.send();
}
function g_name_validator2(){
		var str = document.getElementById("field1").value;
		var id = document.getElementById("id").value;
		var xmlhttp;
		if (str.length==0) { document.getElementById("f_msg").innerHTML=""; return; }
		if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); }
		else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
		xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{ 
		var r =  document.getElementById("field1").value;
		var found = r.search("#");
		var found_0 = r.search("&");
		if(found != -1 || found_0 != -1)
		{
		document.getElementById("f_msg").innerHTML='<h3 class="triangle-border left more_top">Μη αποδεκτοί χαρακτήρες!</h3>';
		}
		else{
		document.getElementById("f_msg").innerHTML=xmlhttp.responseText;
		
		checkall_g();
		}

		} }
		xmlhttp.open("GET","php/checks/g_validate2.php?q="+str+"&i="+id,true);
		xmlhttp.send();
}
function check_m(){
		var str = document.getElementById("message").value;
		var xmlhttp;
		if (str.length==0) { 
			document.getElementById("m_validate").innerHTML=""; 
			return; 
		}
		if (window.XMLHttpRequest) { 
			xmlhttp=new XMLHttpRequest(); 
		}
		else { 
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
		}
		xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{ 
		var found = str.search("#");
		var found_0 = str.search("&");
		if(found != -1 || found_0 != -1)
		{
		document.getElementById("m_validate").innerHTML='<h3 class="triangle-border left more_top">Μη αποδεκτοί χαρακτήρες!</h3>';
		}
		else{
		document.getElementById("m_validate").innerHTML=xmlhttp.responseText;	
		}
		message();

		} }
		xmlhttp.open("GET","php/checks/message_validate.php?q="+str,true);
		xmlhttp.send();

}

function deletechecked3(){
	var answer = confirm("Θέλετε να συνεχίσετε;");
	if (answer) document.messages.submit(); 
	return false;
}

function message(){
	var str4 = document.getElementById("m_validate").innerHTML;
	var f4 = str4.search("OK!");
	if (!document.getElementById("date_validate_ok") || document.getElementById("date_validate_ok") == null || document.getElementById("date_validate_ok") == "undefined"){
		if(f4!= -1){
			document.getElementById('submit').className= 'button';
			document.getElementById('submit').disabled=false;
			document.getElementById("submit").onclick = function deletechecked2(){
				var answer = confirm("Θέλετε να συνεχίσετε;");
				if (answer) document.messages.submit(); 
				return false;
			};
		}
		else{
			document.getElementById('submit').className= 'disable';
			document.getElementById('submit').disabled=true;
		}
	}
	else{
		var str5 = document.getElementById("date_validate").innerHTML;
		var f5 = str5.search("OK!");
		if(f4!= -1 && (f5!= -1 || f5=="")){
			document.getElementById('submit').className= 'button';
			document.getElementById('submit').disabled=false;
			document.getElementById("submit").onclick = function deletechecked2(){
				var answer = confirm("Θέλετε να συνεχίσετε;");
				if (answer) document.messages.submit(); 
				return false;
			};
		}
		else{
			document.getElementById('submit').className= 'disable';
			document.getElementById('submit').disabled=true;
		}
	}
}
function f_name_validator3(){
var str = document.getElementById('field1').value;
var xmlhttp;
if (str.length==0) { document.getElementById("f_name").innerHTML=""; return; }
if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); }
else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{

var found = str.search("#");
var found_0 = str.search("&");
if(found != -1 || found_0 != -1)
{
document.getElementById("f_name").innerHTML='<h3 class="triangle-border left more_top">Μη αποδεκτοί χαρακτήρες!</h3>';
}
else{
document.getElementById("f_name").innerHTML=xmlhttp.responseText;	
}
message2();
} }
xmlhttp.open("GET","php/checks/f_name_validate2.php?q="+str,true);
xmlhttp.send();
}
function check_m2(){
		var str = document.getElementById("message").value;
		if (str.length==0) { 
			document.getElementById("m_validate").innerHTML=""; 
			return; 
		}
		if (window.XMLHttpRequest) { 
			xmlhttp=new XMLHttpRequest(); 
		}
		else { 
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
		}
		xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{ 
		var found = str.search("#");
		var found_0 = str.search("&");
		if(found != -1 || found_0 != -1)
		{
		document.getElementById("m_validate").innerHTML='<h3 class="triangle-border left more_top">Μη αποδεκτοί χαρακτήρες!</h3>';
		}
		else{
		document.getElementById("m_validate").innerHTML=xmlhttp.responseText;		
		message2();
		}

		} }
		xmlhttp.open("GET","php/checks/message_validate.php?q="+str,true);
		xmlhttp.send();

}
function message2(){

	var str4 = document.getElementById("m_validate").innerHTML;
	var str5 = document.getElementById("f_name").innerHTML;
	var f4 = str4.search("OK!");
	var f5 = str5.search("OK!");
	if (!document.getElementById("date_validate_ok") || document.getElementById("date_validate_ok") == null || document.getElementById("date_validate_ok") == "undefined"){
		if(f4!= -1 && f5!= -1){
			document.getElementById('submit').className= 'button';
			document.getElementById('submit').disabled=false;
			document.getElementById("submit").onclick = function deletechecked2(){
				var answer = confirm("Θέλετε να συνεχίσετε;");
				if (answer) document.messages.submit(); 
				return false;
			};
		}
		else{
			document.getElementById('submit').className= 'disable';
			document.getElementById('submit').disabled=true;
		}
	}
	else{
		var str6 = document.getElementById("date_validate").innerHTML;
		var f6 = str6.search("OK!");
		if(f4!= -1 && f5!= -1 && (f6!= -1 || f6=="")){
			document.getElementById('submit').className= 'button';
			document.getElementById('submit').disabled=false;
			document.getElementById("submit").onclick = function deletechecked2(){
				var answer = confirm("Θέλετε να συνεχίσετε;");
				if (answer) document.messages.submit(); 
				return false;
			};
		}
		else{
			document.getElementById('submit').className= 'disable';
			document.getElementById('submit').disabled=true;
		}
	}
}