﻿
function toggle(divId) {
    var div = document.getElementById(divId)
    if (div.style.display == "none")
        div.style.display = "block";
    else
        div.style.display = "none";
}

function isBlock(divId) {
    var div = document.getElementById(divId)
    if (div.style.display == "none") {
        div.style.display = "block";
        return false;
    }
    else {
        div.style.display = "none";
        return true;
    }
}

function popupMessage() {
    // SET MESSAGE VALUES
    var to = "";
    var cc = "";
    var bcc = "";
    var subject = "Xrysi Eukairia";
    var body = "This link might interest you:\r\n" + window.location.href;

    var doc = "mailto:" + to + "?subject=" + escape(subject) + "&body=" + escape(body);
    window.location = doc;
}

function ChangeToUpper(txt) {
    var txtValue = document.getElementById(txt).value;
    txtValue = txtValue.replace("ά", "α");
    txtValue = txtValue.replace("έ", "ε");
    txtValue = txtValue.replace("ή", "η");
    txtValue = txtValue.replace("ί", "ι");
    txtValue = txtValue.replace("ϊ", "ι");
    txtValue = txtValue.replace("ΐ", "ι");
    txtValue = txtValue.replace("ό", "ο");
    txtValue = txtValue.replace("ύ", "υ");
    txtValue = txtValue.replace("ϋ", "υ");
    txtValue = txtValue.replace("ΰ", "υ");
    txtValue = txtValue.replace("ώ", "ω");
    txtValue = txtValue.replace("ς", "σ");
    txtValue = txtValue.replace(";", "");
    txtValue = txtValue.toUpperCase();
    document.getElementById(txt).value = txtValue;
}

function isNumberKey(e) {
    var charCode = (e.which) ? e.which : event.keyCode
    if (charCode > 31 && (charCode < 48 || charCode > 57))
        return false;

    return true;
}

function QuickSearch(e) {
    if (window.event) {
        if (event.keyCode == 13) {
            window.focus();
            if (typeof (Page_ClientValidate) != 'function' || Page_ClientValidate()) __doPostBack('ctl00$lnkASSearch', '')
        }
    }
    else if (e.which) {
        if (e.which == 13) {
            window.focus();
            if (typeof (Page_ClientValidate) != 'function' || Page_ClientValidate()) __doPostBack('ctl00$lnkASSearch', '')
        }
    }
}

function SearchForm(e) {
    var charCode = (e.which) ? e.which : event.keyCode
    if (charCode == 13) {
        window.focus();
        if (document.getElementById("ctl00_ctl02_lnkLeftSearch")) {
            if (typeof (Page_ClientValidate) != 'function' || Page_ClientValidate()) __doPostBack('ctl00$ctl02$lnkLeftSearch', '')
        }
        else {
            if (typeof (Page_ClientValidate) != 'function' || Page_ClientValidate()) __doPostBack('ctl00$ctl01$lnkLeftSearch', '')
        }
    }
}

function doOnload(e) {
    var allLinks = document.links;
    for (var i = 0; i < allLinks.length; i++) {
        if (allLinks[i].href.indexOf(location.host) >= 0) {
            if (allLinks[i].href.indexOf("?") >= 0)
                allLinks[i].href = allLinks[i].href + "&code=" + code;
            else
                allLinks[i].href = allLinks[i].href + "?code=" + code;
        }
    }
}