<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
  MM_swapImgRestore();
  MM_swapImage('CubeMinu','','http://static.hot.ee/images/3d_cube_minu2.gif','menu','','http://static.hot.ee/images/3d_cube_22.gif',1);
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

// submitb vormi millel on element "post" ja annab
// sellele v22rtuse val
function doPOST (vorm, val) {
    v = document.forms[vorm];
    v.post.value = val;
    v.submit ();
}


function check_all_boxes (vorm, checked) {
    var i;
    v = document.forms [vorm];
    for (i = 0; i < v.elements.length; i++) {
        v.elements [i].checked = checked;
    }
}

function doFormAction(vorm,action) {
    v = document.forms [vorm];
    v.action = action;
    v.submit();
    return true;
}

function askConfirmation(msg,vorm,action) {
  if (confirm(msg)) {
    return doFormAction(vorm,action);
  }
  else {
    return false;
  }
}

function setBase(baseObj,rteObj){
  baseObj.value=rteObj.docHtml;
  alert(baseObj.value);
}

function setRTE(rteObj,value){
  rteObj.docHtml=value;
}

function doSubmit (vorm) {
    v = document.forms [vorm];
    v.submit ();
    return true;
}

// sessionid-aware redirect script for url's
function redirect (url) {
    if (document.location.pathname.substring(0, 2) == "/@") {
        document.location = document.location.pathname.substring(0, 22) + url;
    } else {
        document.location = url;
    }
}

function redirect_w (url) {
  redirect(url);
  return false;
}

// value for the "blank" Option used to end the list:
var blankText = "                    ";
// move selected items from one list to the other
function selMove( sFrom, sTo, doAll ) {
    // go through forwards, moving items to the "to" list:
    var ix;
    // where we start putting new values...
    toLoc = sTo.options.length - 1;

    for ( ix = 0; ix < sFrom.options.length; ++ix ) {
        sopt = sFrom.options[ix];
        if ( ( sopt.value != 0 ) && ( doAll || sopt.selected ) ) {
            // replace or append our new option...
            sTo.options[toLoc] = 
                new Option( sopt.text, sopt.value );
            ++toLoc; 
        }
        // tack a new "blank" option onto end, to act
        // as a minimum width for the Select list:
        sTo.options[toLoc] = new Option( blankText, 0 ); // 0 value item?
    }
    // then go backwards, removing selected options
    for ( ix = sFrom.options.length - 1; ix >= 0; --ix ) {
        sopt = sFrom.options[ix];
        if ( ( sopt.value != 0 ) && ( doAll || sopt.selected ) ) {
            sFrom.options[ix] = null;
        }
    }
}

function forceSelect( which ) {
    var ix;
    for ( ix = 0; ix < which.options.length; ++ix ) {
        sopt = which.options[ix];
        if ( sopt.value != 0 ) {
            sopt.selected = true;
        } else {
            sopt.selected = false;
        }
    }
}

function openPopup (name, url, w, h) {
    var wind;
    wind = window.open(url, name, 'width='+w+',height='+h+',toolbar=0,status=0,menubar=0,directories=0,location=0,scrollbars=yes,copyhistory=0,resizable=no');
    wind.focus();
}

function togglebtn(id) {
    class1="menu-btn-up";
    class2="menu-btn-down";

    elem=document.getElementById("a"+id);

    if(elem.className==class1) {
        elem.className=class2;
    }
    else if(elem.className==class2) {
        elem.className=class1;
    }
}

function togglelabel(id) {
    class1="menuback";
    class2="menuback-hidden";

    elem=document.getElementById("a"+id);

    if(elem.className==class1) {
        elem.className=class2;
    }
    else if(elem.className==class2) {
        elem.className=class1;
    }
}

function detect_IE(){
    var detect = navigator.userAgent.toLowerCase();
    // if it is Opera then it can not be IE
    if (detect.indexOf('opera') > -1)
        return false;

    if (detect.indexOf('compatible') > -1 && detect.indexOf('msie') > -1)
        return true;
    else
        return false;
}
var browser_IE = detect_IE();

if(!browser_IE)
{
    var last_mouse_X = 0;
    var last_mouse_Y = 0;

    window.captureEvents(Event.MouseMove);
    window.onmousemove = function (e)
    {
        last_mouse_X = e.clientX;
        last_mouse_Y = e.clientY;
    }
}

function open_shim(layer_name)
{
    var layer = document.getElementById(layer_name);
    if (!browser_IE || layer==null)
        return;

    var shim = document.getElementById('shim_'+layer_name);
    if (shim==null)
        shim = create_shim('shim_'+layer_name);

    if (layer.style.zIndex=="undefined" || layer.style.zIndex < 100)
        layer.style.zIndex = 100;

    shim.style.width = layer.offsetWidth+'px';
    shim.style.height = layer.offsetHeight+'px';
    shim.style.top = layer.style.top;
    shim.style.left = layer.style.left;
    shim.style.zIndex = layer.style.zIndex - 1;
    shim.style.position = "absolute";
    shim.style.display = "block";
}

function close_shim(layer_name)
{
    var shim = document.getElementById('shim_'+layer_name);
    if (shim!=null)
        shim.style.display = "none";
}

function create_shim(shim_name){
    try {
        var elem=document.createElement('iframe');
        elem.setAttribute('id',shim_name);
        elem.style.border='0px';
        elem.style.width='0px';
        elem.style.height='0px';
        elem.src='javascript:false';
        document.body.appendChild(elem);

        return elem;
    } catch(exception) {
        var iframeHTML='\<iframe id="'+shim_name+'" style="';
        iframeHTML+='border:0px;';
        iframeHTML+='width:0px;';
        iframeHTML+='height:0px;"';
        iframeHTML+=' src="javascript:false;"><\/iframe>';
        document.body.innerHTML+=iframeHTML;
        return document.getElementById(shim_name);
    }
}

function show_hint(text, offset_x, offset_y) {
    if(browser_IE) {
    //if (window.event) {
        // IE
        var cX = window.event.clientX;
        var cY = window.event.clientY;
    } else {
        var cX = last_mouse_X;//last_mouse_X;
        var cY = last_mouse_Y;//last_mouse_Y;
    }
    show_hint_int(text, cX, cY, offset_x, offset_y);
}

function show_hint2(event, text, offset_x, offset_y) {
    show_hint_int(text, event.clientX, event.clientY, offset_x, offset_y);
}

function show_hint_int(text, mposx, mposy, offset_x, offset_y) {
    var hint = document.getElementById('hint');
    if (hint == null) {
        hint = document.createElement('div');
        hint.setAttribute('id','hint');
        document.body.appendChild(hint);
    }

    hint.className='hint';
    var dbase = false;
    if (document.documentElement) {
        dbase = document.documentElement;
    } else {
        // non std. compliant
        dbase = document.body;
    }
    var lpos = dbase.scrollLeft + mposx + 15 - offset_x;
    hint.style.left = lpos+'px';
    var tpos = dbase.scrollTop + mposy - offset_y;
    hint.style.top = tpos+'px';
    hint.style.zIndex = '100';
    hint.style.position = 'absolute';
    hint.style.visibility = 'visible';
    hint.innerHTML = text;

    open_shim('hint');
}

function hide_hint() {
    var hint = document.getElementById('hint');
    if (hint!=null)
        hint.style.visibility='hidden';
    close_shim('hint');
}

//-->
