﻿function ConvertToUpper(theid)
{ var thecontrol = document.getElementById(theid); thecontrol.value = thecontrol.value.toUpperCase(); }
var ns6 = document.getElementById && !document.all
function countlimit(maxlength, e, placeholder) {
    var theform = eval(placeholder)
    var lengthleft = maxlength - theform.value.length
    var placeholderobj = document.all ? document.all[placeholder] : document.getElementById(placeholder)
    if (window.event || e.target && e.target == eval(placeholder)) { placeholderobj.innerHTML = lengthleft }
    if (lengthleft < 0)
    { alert('Έχετε υπερβεί το μέγιστο επιτρεπτό όριο χαρακτήρων στις Παρατηρήσεις κατά ' + ((-1) * lengthleft) + ' χαρακτήρες.'); return false; } 
}
function displaylimit(thename, theid, thelimit) {
    var theform = theid != "" ? document.getElementById(theid) : thename; var limit_text = 'Απομένουν<b> <span id="' + theform.toString() + '">' + (thelimit - theform.value.length) + '</span></b> χαρακτήρες.'
    if (document.all || ns6)
        document.write(limit_text)
    if (document.all)
        eval(theform).onkeyup = function() { countlimit(thelimit, event, theform) }
    else if (ns6)
        document.body.addEventListener('keyup', function(event) { countlimit(thelimit, event, theform) }, true);
}
function ShowHelp(strUrl)
{ window.open(strUrl, "Help", "location=no,toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=yes,top=40,left=40,width=720,height=480"); }


function BrowserCheck() {
    var b = navigator.appName;
    if (b == "Netscape") this.b = "NS";
    else if (b == "Microsoft Internet Explorer") this.b = "IE";
    else this.b = b;
    this.v = parseInt(navigator.appVersion);
    this.NS = (this.b == "NS" && this.v >= 4);
    this.NS4 = (this.b == "NS" && this.v == 4);
    this.NS5 = (this.b == "NS" && this.v == 5);
    this.IE = (this.b == "IE" && this.v >= 4);
    this.IE4 = (navigator.userAgent.indexOf('MSIE 4') > 0);
    this.IE5 = (navigator.userAgent.indexOf('MSIE 5') > 0);
    if (this.IE5 || this.NS5) this.VER5 = true;
    if (this.IE4 || this.NS4) this.VER4 = true;
    this.OLD = (!this.VER5 && !this.VER4) ? true : false;
    this.min = (this.NS || this.IE);
}

function Cover(bottom, top, ignoreSize) {
    var location = Sys.UI.DomElement.getLocation(bottom);
    top.style.position = 'absolute';
    top.style.top = location.y + 'px';
    top.style.left = location.x + 'px';
    if (!ignoreSize) {
        top.style.height = bottom.offsetHeight + 'px';
        top.style.width = bottom.offsetWidth + 'px';
    }
}


function clickButton(e, buttonid) {
    var evt = e ? e : window.event;
    var bt = document.getElementById(buttonid);
    if (bt) {
        if (evt.keyCode == 13) {
            bt.click();
            return false;
        }
    }
}

var statusmsg = "Copyright B-logica 2009";
function hidestatus() {
    window.status = statusmsg;
    return true;
}
if (document.layers)
    document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)

document.onmouseover = hidestatus;
document.onmouseout = hidestatus;



//Generating Pop-up Print Preview page
function getPrint(print_area, title) {
    //Creating new page
    var pp = window.open();
    //Adding HTML opening tag with <HEAD> … </HEAD> portion 
    pp.document.writeln('<html><head><title>Print Preview</title>')
    //pp.document.writeln('<LINK href=../App_Themes/DefaultTemplate/default.css type="text/css" rel="stylesheet">')
    //pp.document.writeln('<link href="PrintStyle.css" ' +
      //                  'type="text/css" rel="stylesheet" >')
    //pp.document.writeln('<base target="_self"></HEAD>')
    pp.document.writeln('<style type="text/css">')
    pp.document.writeln('body {margin-left: 10px }')
    pp.document.writeln('.textNormal10 {font-family: Verdana, Helvetica, Geneva, Arial, sans-serif; font-size: 10px; font-weight: normal; font-style: normal; color: #666666; text-transform: none;}')
    pp.document.writeln('.textNormalBold11 {font-family: Verdana, Helvetica, Geneva, Arial, sans-serif; font-size: 11px; font-weight: bold; font-style: normal; color: #666666; text-transform: none;}')
    pp.document.writeln('.listNormal {list-style-image:url(images/green_list_dot_round.gif); margin: 8px 0px 4px 20px;}')
    pp.document.writeln('.listNormal li {padding: 0px 4px 2px 0px;}')
    pp.document.writeln('.hrGrayDashed {border: Dashed 1px #e5e6e8;}')
    pp.document.writeln('</style>')

    pp.document.writeln('</head>')
        
    //Adding Body Tag
    pp.document.writeln('<body MS_POSITIONING="GridLayout" bottomMargin="0"');
    pp.document.writeln(' leftMargin="0" topMargin="0" rightMargin="0">');
    //Adding form Tag
    pp.document.writeln('<form method="post">');

    //Creating two buttons Print and Close within a HTML table
    pp.document.writeln('<TABLE width=100%><TR><TD></TD></TR><TR><TD align=right>');
    pp.document.writeln('<INPUT ID="PRINT" type="button" value="Print" ');
    pp.document.writeln('onclick="javascript:location.reload(true);window.print();">');
    pp.document.writeln('<INPUT ID="CLOSE" type="button" ' +
                        'value="Close" onclick="window.close();">');
    pp.document.writeln('</TD></TR><TR><TD></TD></TR></TABLE>');

    pp.document.writeln('<span style="font-size: 22px; font-weight: bold; color: black; margin-left: 10px;"><u>' + title + '</u></span><br /><br />');
    //Writing print area of the calling page
    pp.document.writeln(document.getElementById(print_area).innerHTML);
    //Ending Tag of </form>, </body> and </HTML>
    pp.document.writeln('</form></body></html>');
}

