function contact()
{
call_ajax_post('./includes/html/contact.php', 'top-menu-ajax', '', 'Error','');    
}

function clearMenu()
{
document.getElementById('top-menu-ajax').style.display='inline';
document.getElementById('top-menu-ajax').innerHTML = '';	
}

function send_mail(){
var message=document.getElementById('message').value;
message=message.replace(/&/g,"κ");
message=message.replace(/'/g,"`");
message=message.replace(/"/g,"`");
var title=document.getElementById('title').value;
title=title.replace(/&/g,"κ");
title=title.replace(/'/g,"`");
title=title.replace(/"/g,"`");
var name=document.getElementById('name').value;
name=name.replace(/&/g,"κ");
name=name.replace(/'/g,"`");
name=name.replace(/"/g,"`");
var phone=document.getElementById('phone').value;
phone=phone.replace(/&/g,"κ");
phone=phone.replace(/'/g,"`");
phone=phone.replace(/"/g,"`");
var email=document.getElementById('email').value;
email=email.replace(/&/g,"κ");
email=email.replace(/'/g,"`");
email=email.replace(/"/g,"`");
call_ajax_post('./includes/mailer.php', 'infoMail', '<br><br><br><center><img src="./graphics/loadingAnimation.gif"></center><br><br><br>', 'Error','name='+name+'&email='+email+'&title='+title+'&message='+message+'&phone='+phone);
}

function validate(){
if(document.getElementById('name').value=='' || document.getElementById('email').value=='' || document.getElementById('title').value=='' || document.getElementById('message').value==''){alert('Αφήσατε κάποια πεδία κενά');}
else {send_mail();}
}

function aboutUs()
{
call_ajax_post('./includes/html/about-us.php', 'top-menu-ajax', '', 'Error','');
}

function register_form()
{
call_ajax_post('./includes/html/ajax-forms.php', 'top-menu-ajax', '', 'Error','form=register'); 
}

function captcha_refresh()
{
call_ajax_post('./includes/registration.php' , 'ajax_content_reg', '', 'Error','action=captcha_refresh');
}

function register()
{
if(document.register.terms.checked==false){alert('Πρέπει να αποδεχτείτε τους όρους χρήσης');}
else {
if (check_travelling('username_reg','&')==true){
if (check_travelling('username_reg','\'')==true){
if (check_travelling('username_reg','\"')==true){
if (check_travelling('mail_reg_a','&')==true){
if (check_travelling('mail_reg_b','&')==true){
if (check_travelling('company','&')==true){
if (check_travelling('url','&')==true){
call_ajax_post('./includes/registration.php','ajax_content_reg', '...', 'Error','action=register&username='+document.register.username.value+'&password='+hex_md5(document.register.password.value)+'&passwordconfirm='+hex_md5(document.register.passwordconfirm.value)+'&email='+document.register.email.value+'&emailconfirm='+document.register.emailconfirm.value+'&imagestamp='+document.register.imagestamp.value+'&company='+document.register.company.value+'&url='+document.register.url.value);
}  //url
}  //company
}  //mail_reg_b
}  //mail_reg_a
}  //username_reg
}  //username_reg
}  //username_reg
} 
}


function login()
{
if (check_travelling('username_log','&')==true){
  call_ajax_post('./includes/login_actions.php', 'ajax_content_reg', '...', 'Error','action=login&username='+document.login.username.value+"&password="+hex_md5(document.login.password.value)+document.login.challenge.value); 
  }  
}

function login_form()
{
  call_ajax_post('./includes/html/ajax-forms.php', 'top-menu-ajax', '', 'Error','form=login'); 
}
