﻿// JScript File

document.onkeydown = checkKey;
function checkKey(oEvent){
	var oEvent = (oEvent)? oEvent : event;
	var oTarget =(oEvent.target)? oEvent.target : oEvent.srcElement;
	if((oTarget.type=="text" || oTarget.type=="select-one") && oEvent.keyCode==13) 
		oEvent.keyCode = 9;
}

function hidestatus(){
	    window.status=''
	    return true
	}

	if (document.layers)
	document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)

	document.onmouseover=hidestatus
	document.onmouseout=hidestatus
		
		
 function datumska(kontrola) {
    var currDate = kontrola.value;
    var Month = (currDate.getMonth() + 1) + "/";
    var Day = currDate.getDate() + "/";
    var Year = currDate.getFullYear();
    var JustDate = Day + Month + Year;
    kontrola.value = JustDate;
}


var clientid;
function fnSetFocus(txtClientId)
{
	clientid=txtClientId;
	setTimeout("fnFocus()",800);
    
}

function fnFocus()
{
    eval("document.getElementById('"+clientid+"').focus()");
}

function OnClientResizeImage(sender, eventArgs) 
    {
        $get("lastResize").innerHTML = "Last image resize at " + (new Date()).toString();
    }

var fontSize = 12;
function OnClientResizeText(sender, eventArgs) 
{
    // This sample code isn't very efficient, but demonstrates the idea well enough
    var e = sender.get_element();
    // Make the font bigger until it's too big
    while((e.scrollWidth <= e.clientWidth) || (e.scrollHeight <= e.clientHeight)) {
        e.style.fontSize = (fontSize++)+'pt';
    }
    var lastScrollWidth = -1;
    var lastScrollHeight = -1;
    // Make the font smaller until it's not too big - or the last change had no effect
    // (for Opera where e.clientWidth and e.scrollWidth don't behave correctly)
    while (((e.clientWidth < e.scrollWidth) || (e.clientHeight < e.scrollHeight)) &&
        ((Sys.Browser.agent !== Sys.Browser.Opera) || (e.scrollWidth != lastScrollWidth) || (e.scrollHeight != lastScrollHeight))) 
        {
        lastScrollWidth = e.scrollWidth;
        lastScrollHeight = e.scrollHeight;
        e.style.fontSize = (fontSize--)+'pt';
        }
}