function sayit(say)
{
 alert('Nápověda\n\n' + say);
}

// over and return
function ov(vt)
{
  document.getElementById(vt).style.backgroundColor='#99d9f7';
}
                                                           
function re(vt)
{
  document.getElementById(vt).style.backgroundColor='#389ac6';
}

function mwzoom(zp,zt,imw,imh)
      {
      
      MWImage = window.open('','_blank','width='+(imw)+',height='+(imh)+',menu=0,navigate=0,statusbar=0,top='+(screen.height/2-imh/2)+',left='+(screen.width/2-imw/2)+'');

      with (MWImage.document)
      {
      open();
       writeln('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
       writeln('<html>');
       writeln('<head>');
       writeln('<meta http-equiv="Content-Type" content="text/html; charset=windows-1250" />');
       writeln('<meta http-equiv="Content-Language" content="cs" /> ');
       writeln('<title>'+zt+'</title>');  
       writeln('<style type="text/css"> ');
       writeln('body {margin-top: 0px;font-family: Verdana, \'Geneva CE\', lucida, sans-serif; margin: 0;padding: 0;color: #333333;background-color : #ffffff;text-align: center;}');
       writeln('h1 {padding:0px;margin:5px;font-weight:bold;font-size:10pt;color:#ff3300;}');
       writeln('.bt {font-size : 8pt;font-weight: bold;color:#ffffff;border-top: solid 1px #aaaaaa;border-bottom: solid 1px #666666;border-left: solid 1px #aaaaaa;border-right: solid 1px #666666;background: #888888;text-align: center;}');
       writeln('</style>');
       writeln('</head>');
       writeln('<body>');
       writeln('<h1><input type="button" onclick="window.close()" value="zavřít" style="float:right;" class="bt" />'+zt+'</h1>');
       writeln('<img src="'+zp+'" style="cursor:pointer;" onclick="window.close();" />');
       writeln('<p style="text-align:center;">&nbsp;</p>');  
       writeln('</body>\n</html>');
      close();
      }
      MWImage.focus();     
}
    
     
// mwshop

function getkey(e)
{
 var code;

  if (!e)
    var e = window.event; //  IE
 
  if (e.keyCode)
    code = e.keyCode; // IE and Gecko
  else
 
  if (e.which)
      code = e.which; // NN4
  return code;
}

function numeric(eX)
{
  test=getkey(eX);
  if (test > 31 && (test < 48 || test > 57))
  return false;
}

function cbb(idecko)
{
 el=document.getElementById(idecko); 
 el.checked=(el.checked == true)?false:true;
}

function navimgset(vt,im) // previous / next page
{
 /*  alert('Cesta: ' + pi); */
 document.getElementById(vt).src = im ;
}                               

/* livesearch v 1.0 */         
function xmlhttp(addr, pid, targ)
{
    var xhttpRequest;
    try {  
         xhttpRequest = new XMLHttpRequest(); /* Firefox, Opera, Konq... */
        } 
        catch(e){ 
        try 
           { 
            xhttpRequest = new ActiveXObject("Msxml2.XMLHTTP"); /* IE MS XML 2 */
           } 
            catch (e) {
            try { 
                  xhttpRequest = new ActiveXObject("Microsoft.XMLHTTP"); /* IE MS XML */
                } 
                  catch (E) { xhttpRequest = false; 
                }
           } 
        }
                // customize search
                tk = document.getElementById(targ).value;
                cachebeat=parseInt(Math.random()*999999);
                htr = addr + '?qa=' + tk + '&param=' + cachebeat;
    xhttpRequest.open("POST", htr, true);
    xhttpRequest.onreadystatechange= function () 
    {
        processRequest(xhttpRequest, pid) 
    };
    xhttpRequest.send(null);
}

function processRequest(xhttpRequest, pid) 
{
    //vl =  document.getElementById('mss').value.length;
    if (xhttpRequest.readyState == 4)
    {
        if (( xhttpRequest.status >= 200 && xhttpRequest.status < 300 ) || xhttpRequest.status == 304)
        {
            if (typeof pid == 'string') 
            {
                //document.getElementById(pid).style.display = 'block';
                document.getElementById(pid).innerHTML = "";
                document.getElementById(pid).innerHTML = xhttpRequest.responseText;
            }
        }
        else
        {
            alert("Chyba adresy " + xhttpRequest.status +" : "+ xhttpRequest.statusText);
        }
    }
    else
    {
        if (typeof addr == 'string' && pid != '') 
        {
            document.getElementById(pid).innerHTML = 'čekejte...';
        }
    }
   // if(vl<1){ document.getElementById(pid).style.display = 'none'; }
       
}          
           
  
           
                 
           

