var myTWin = window.myTWin;
    
function OpenMyWin(link,winName)
  {
var retValue=true;
if (myTWin!=null && !myTWin.closed)
  {
   myTWin.focus();
   myTWin.location.href=link.href;
   }
else
   {
myTWin=window.open(link.href,winName , '');
if (myTWin==null || typeof(myTWin)=="undefined")
retValue=false;
else
   {
   link.target=winName;
   myTWin.focus();
   }
   }
return retValue;
    }
	
function addEvent(obj, event, funct) {  
if (obj.attachEvent) { //IE  
    obj['e' + event + funct] = funct;  
	obj['x' + event + funct] = function() { obj['e' + event + funct](window.event); }  
    obj.attachEvent('on' + event, obj['x' + event + funct]);  
  } else // other browser  
     obj.addEventListener(event, funct, false);  
}

function removeEvent(obj, event, funct) {  
if (obj.detachEvent) { // IE  
	obj.detachEvent('on' + event, obj[event + funct]);  
    obj['x' + event + funct] = null;  
  } else // other browser  
     obj.removeEventListener(event, funct, false );  
}

/* volani
addEvent(objekt,"mouseover",fce);
removeEvent(objekt,"mouseout",fce);
*/

function zkontroluj_email(adresa)
{
re=/^[^.]+(\.[^.]+)*@([^.]+[.])+[a-z]{2,3}$/;
return adresa.search(re)==0;
}

function kontrola_formularu(formular,error)
{
z=0;
reg='';
inp=formular.getElementsByTagName('input');
for (k=0;k<inp.length;k++)
{
  if (inp[k].nextSibling && inp[k].nextSibling.nextSibling && (inp[k].type=='text' || inp[k].type=='password'))
       { 
         if (inp[k].nextSibling.nextSibling.firstChild.data=='*')
              {
                if (inp[k].name=='email')
                      { 
                        if (!zkontroluj_email(inp[k].value)) { reg+='false && '; }
                        else { reg+='true && '; }
                      }
                 else { 
                        if (inp[k].value=='' || inp[k].value==0 || inp[k].value==null) { reg+='false && '; }
                        else { reg+='true && '; }
                      }
         z++;
              }
         else {
                continue;
              }
       }
  else { 
         continue;
       }
}
reg+='true';
if (eval(reg))
     { 
       return true;
     }
else { 
       window.alert(error); return false;
     }
}