function speclogin()
{
 var loginfalse = document.getElementById('login_pwX');
 var logintrue = document.getElementById('login_pw');
 var agent = document.getElementById('login_agent');
 
 d = loginfalse.value.split(',');
 if(d.length>1)
 {
  logintrue.value = d[0];
  agent.value = d[1];
 }else{
  logintrue.value = d[0];
  agent.value = 0;
 }
 //alert('Heslo: ' + logintrue.value + '\nAgent: ' + agent.value);
 
}


function isint(ide1,ide2) {
   var a = document.getElementById(ide1).value;
   var b = document.getElementById(ide2).value;
   
if(b>1){ 
    
   var c = a / b; 
   
   var d = parseInt(c);
   
  /*
     return c==d && c.toString()==d.toString();
  */  
   e = 2 * b;
   f = 3 * b;
   g = 10 * b;   
   
   if (c==d && c.toString()==d.toString()){
    return true;
   }else{ 
    alert('U tohoto zboží lze zakoupit pouze násobky minimálního množství! \nMinimální množství u této položky je '+ b +' !\nLze tedy zakoupit např.: '+ b +', ' + e + ', ' + f + ' nebo ' + g +'ks!\n');    
    return false;
   }
 }else{
   return true; 
 }  
   
} 


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 pnpage(mt,ct,ot,it,vt) // previous / next page
{
 document.vFilterP.action='?map='+map+'&mcat='+ct+'&ord='+ot+'&c='+it;
 document.vFilterP.submit();
}                               

function showdetail(pth,vt) // show product detail
{ 
 document.getElementById(vt).action=pth; 
 document.getElementById(vt).submit();  
} 
   
function showcatalog(mt,ct,ot,vt) // show catalog
{ 
 document.getElementById(vt).action='?map='+mt+'&mcat='+ct+'&ord='+ot; 
 document.getElementById(vt).submit();  
}    
     
function mwzoom(zp,zt,imw,imh)
      {
      MWImage = window.open(zp,"Top","left=100,top=100,width="+imw+",height="+imh+",menu=0,navigate=0,statusbar=0");

      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>'+zt+'</h1>');
       writeln('<img src="'+zp+'" style="cursor:pointer;" onclick="window.close();" />');
       writeln('<p style="text-align:center;"><input type="button" onclick="window.close()" value="zavřít okno" class="bt" /></p>');  
       writeln('</body>\n</html>');
      close();
      }
      MWImage.focus();     
}
           

