
function isNull(a){
  return (typeof(a)=="object" && !a);
}


function isUndefined(a){
  return typeof(a)=="undefined";
} 


function isFunction(a){
  return typeof(a)=="function";
}


function isString(a){
  return typeof(a)=="string";
}


function isArray(a){ 
  return a && !(a.propertyIsEnumerable("length")) && typeof a==="object" && typeof a.length==="number";
}


Array.prototype.walk=function(fc){  
  var returnArray=[]; 
  for(i=0;i<this.length;i++)returnArray.push(fc(this[i])); 
  return returnArray;
};


Array.prototype.find=function(searchStr){  
  var returnArray=false;  
  for(var i=0;i<this.length;i++){  
    if(this[i]===searchStr){   
      if(!returnArray)returnArray=[];   
      returnArray.push(i);   
    }
  }
  return returnArray;
};


function listProperties(obj){
  var lst="";
  for(var prop in obj)if(typeof obj[prop]!="function")lst+=prop+": "+obj[prop]+"\n";
  return lst;
}
 

Object.prototype.listProperties=function(){
  return listProperties(this);
};


function listMethods(obj,full){
  var lst="";
  for(var prop in obj)if(typeof obj[prop]=="function")lst+=prop+": "+obj[prop]+"\n";
  if(full)return lst;
  var lst2="";
  var fceRE=browser.isIE?/(.*): function(\([^\{]+)\{/g:/(.*):\s+\ *function\s*(.*)\{/g;
  while(result=fceRE.exec(lst)){
    lst2+=result[1]+result[2]+"\n";
  }
  return lst2;
}



Object.prototype.listMethods=function(full){
  return listMethods(this,full);
};




var browser={
  isIE:!!(window.attachEvent && !window.opera),
  isOpera:!!window.opera,
  isMozilla:(navigator.product=="Gecko" && navigator.userAgent.indexOf("KHTML")==-1),
  
  getIEversion:function(){
    if(!browser.isIE)return 0; else {
      var ver=navigator.appVersion;
      ver=ver.substring(ver.indexOf("MSIE")+4);
      return ver.substring(0,ver.indexOf(";"));
    }
  },

  toString:function(){
    return listProperties(navigator);
  },

  isOldIE:(this.isIE && this.getIEversion()<7)
};


document.lang=document.getElementsByTagName("html")[0].lang?document.getElementsByTagName("html")[0].lang:"cs";



function trim(inpstr){
  return inpstr.replace(/^\s*(\S*(\s+\S+)*)\s*$/,"$1");
}


String.prototype.trim=function(){
  return trim(this);
} 


function isMail(inpstr){
  return /^[_a-zA-Z0-9\.\-]+@[_a-zA-Z0-9\.\-]+\.[a-zA-Z]{2,4}$/.test(inpstr);
}


String.prototype.isMail=function(){
  return isMail(this);
} 


function isISOdate(inpstr){
  return /^[0-9]{4}\-[0-9]{2}\-[0-9]{2}$/.test(inpstr); 
}


function isCzechDate(inpstr){
  return /^([0-9]{1,2}\.\s*){2}[0-9]{4}$/.test(inpstr);
}


function isPosInt(inpstr){
  return /^[0-9]+$/.test(inpstr);
}


function is9numbers(inpstr){
  return /^(\s*\d\s*){9}$/.test(inpstr);
}


function czech2ISOdate(inpstr){
  if(matches=inpstr.match(/^([0-9]{1,2})\.\s*([0-9]{1,2})\.\s*([0-9]{4})$/)){
    if(matches[1]<10)matches[1]="0"+matches[1];
      if(matches[2]<10)matches[2]="0"+matches[2];
      return matches[3]+"-"+matches[2]+"-"+matches[1];
  }
}


function ISO2czechDate(inpstr){
  if(matches=inpstr.match(/^([0-9]{2,4})\-([0-9]{1,2})\-([0-9]{1,2})$/)){
    if(matches[1].length==2){if(matches[1]<70)matches[1]="20"+matches[1]; else matches[1]="19"+matches[1];} 
    if(matches[2].length==2 && matches[2].charAt(0)=="0")matches[2]=matches[2].substring(1);
    if(matches[3].length==2 && matches[3].charAt(0)=="0")matches[3]=matches[3].substring(1);
    return matches[3]+". "+matches[2]+". "+matches[1];
  }
}

   
function encodeHTML(str){
  str=str.replace(/&/ig,"&amp;");
  str=str.replace(/</ig,"&lt;");
  str=str.replace(/\>/ig,"&gt;");
  str=str.replace(/\x22/ig,"&quot;");
  return str;
}  
  

      
function number_format(number,decimals,point,separator){ 
  if(!isNaN(number)){ 
    point=point?point:"."; 
    number=number.toString().split("."); 
    if(separator){ 
      var tmp_number=[]; 
      for(var i=number[0].length,j=0;i>0;i-=3){ 
        var pos=i>0?i-3:i; 
        tmp_number[j++]=number[0].substring(i,pos); 
      } 
      number[0]=tmp_number.reverse().join(separator); 
    } 
    if(decimals)if(number[1])number[1]=Math.round(parseFloat(number[1].substr(0,decimals)+"."+number[1].substr(decimals,number[1].length),10)); else number[1]="00";
    return(number.join(point));
  }else return null; 
} 


Number.prototype.number_format=function(decimals,point,separator){
  return number_format(this,decimals,point,separator) ;
};

  
  
  
  
  
   
  
  
  
  
  
  
function getEl(el){
  if(typeof(el)=="string")el=document.getElementById(el);
  if(!el)return null;
  
  if(browser.isIE){

    el.getElementsByClassName=function(clsName,tagName){return getElementsByClassName(this,clsName,tagName);};
    
    el.getElementsByTagNames=function(){
      var args=[this];
      var al=arguments.length;
      for(var i=0;i<al;i++)args.push(arguments[i]);
      return getElementsByTagNames.apply(null,args);
    }

    el.setDN=function(){setDN(this);};
    el.setDB=function(){setDB(this);};
    el.setDI=function(){setDI(this);};

    el.setTrDB=function(){setTrDB(this);};
    el.setVV=function(){setVV(this);};
    el.setVH=function(){setVH(this);};
    el.swapDisplay=function(){swapDisplay(this);};
    el.swapVisibility=function(){swapVisibility(this);};
    el.clipEl=function(l,t,r,b){clipEl(this,l,t,r,b);};
    el.nextEl=function(){return nextEl(this);};
    el.prevEl=function(){return prevEl(this);};
    el.lastEl=function(){return lastEl(this);};
    el.firstEl=function(){return firstEl(this);};

  }
  
  el.perform=function(fc){fc(this)};
  
  return el;
}

var gE=getEl;




 
  



function getElementsByClassName(parEl,clsName,tagName){

if(typeof(parEl)=="string")parEl=document.getElementById(parEl);
  if(isUndefined(tagName))tagName="*";
  var out=[];
  var els=parEl.getElementsByTagName(tagName);

  if(isArray(clsName))clsName=clsName.join("|");

  for(var i=0;i<els.length;i++){
    if(eval("/\\b"+clsName+"\\b/").test(els[i].className))out.push(gE(els[i]));
  }

  out.setDN=function(){setDN(this);};
  out.setDB=function(){setDB(this);};
  out.setDI=function(){setDI(this);};

  out.setTrDB=function(){setTrDB(this);};
  out.setVV=function(){setVV(this);};
  out.setVH=function(){setVH(this);};
  out.swapDisplay=function(){swapDisplay(this);};
  out.swapVisibility=function(){swapVisibility(this);};

  out.clipEl=function(l,t,r,b){clipEl(this,l,t,r,b);};
  out.perform=function(fc){fc(this)};

  return out;
}



function getElementsByClassNameua(parEl,clsName,tagName){

if(typeof(parEl)=="string")parEl=document.getElementById(parEl);
  if(isUndefined(tagName))tagName="*";
  var out=[];
  var els=parEl.getElementsByTagName(tagName);

  if(isArray(clsName))clsName=clsName.join("|");

  for(var i=0;i<els.length;i++){
    if(eval("/\\b"+clsName+"\\b/").test(els[i].className))out.push(gE(els[i]));
  }

  out.setDN=function(){setDN(this);};
  out.setDB=function(){setDB(this);};
  out.setDI=function(){setDI(this);};

  out.setTrDB=function(){setTrDB(this);};
  out.setVV=function(){setVV(this);};
  out.setVH=function(){setVH(this);};
  out.swapDisplay=function(){swapDisplay(this);};
  out.swapVisibility=function(){swapVisibility(this);};

  out.clipEl=function(l,t,r,b){clipEl(this,l,t,r,b);};
  out.perform=function(fc){fc(this)};

  return out;
}


function getElementsByTagNames(el){
  var out=[];
  if(isString(el))el=document.getElementById(el);
  var al=arguments.length;
  for(var i=1;i<al;i++){
    var tmpa=el.getElementsByTagName(arguments[i]);
    var tmpal=tmpa.length;
    for(var j=0;j<tmpal;j++)out.push(gE(tmpa[j]));
  }
  
  out.setDN=function(){setDN(this);};
  out.setDB=function(){setDB(this);};

  out.setDI=function(){setDI(this);};
  out.setTrDB=function(){setTrDB(this);};
  out.setVV=function(){setVV(this);};
  out.setVH=function(){setVH(this);};
  out.swapDisplay=function(){swapDisplay(this);};
  out.swapVisibility=function(){swapVisibility(this);};
  out.clipEl=function(l,t,r,b){clipEl(this,l,t,r,b);};
  out.perform=function(fc){fc(this)};
  
  return out;
}




function firstEl(el){
  if(el=el.firstChild){
    if(el.nodeType==1)return gE(el); else return nextEl(el); 
  }else return null; 
}


function lastEl(el){
  if(el=el.lastChild){
    if(el.nodeType==1)return gE(el); else return prevEl(el); 
  }else return null; 

}


function nextEl(el){
  while(el=el.nextSibling)if(el.nodeType==1)return gE(el);

  return null;
}


function prevEl(el){
  while(el=el.previousSibling)if(el.nodeType==1)return gE(el);

  return null;
}




function getViewportHeight(){
  if(window.innerHeight)return parseInt(window.innerHeight);
  else if(document.documentElement && document.documentElement.clientHeight)return parseInt(document.documentElement.clientHeight);
  else if(document.body && document.body.clientHeight)return parseInt(document.body.clientHeight);
}


function getViewportWidth(){
  if(window.innerWidth)return parseInt(window.innerWidth);
  else if(document.documentElement && document.documentElement.clientWidth)return parseInt(document.documentElement.clientWidth);
  else if(document.body && document.body.clientWidth)return parseInt(document.body.clientWidth);
}


function getElementHeight(el){
  if(typeof(el)=="string")el=document.getElementById(el);
  if(browser.isIE)return parseInt(el.offsetHeight);
  else return parseInt(document.defaultView.getComputedStyle(el,"").getPropertyValue("height"));
}


function getElementWidth(el){
  if(typeof(el)=="string")el=document.getElementById(el);
  if(browser.isIE)return parseInt(el.offsetWidth);
  else return parseInt(document.defaultView.getComputedStyle(el,"").getPropertyValue("width"));
}


function findPosX(el){
 if(typeof(el)=="string")el=document.getElementById(el);
  var curleft=0;
  if(el.offsetParent){
    while(el.offsetParent){
      curleft+=el.offsetLeft;
      el=el.offsetParent;
    }
  }else if(el.x)curleft+=el.x;
  return parseInt(curleft);
}


function findPosY(el){
 if(typeof(el)=="string")el=document.getElementById(el);
  var curtop=0;
  if(el.offsetParent){
    while(el.offsetParent){
      curtop+=el.offsetTop;
      el=el.offsetParent;
    }
  }else if(el.y)curtop+=el.y;
  return parseInt(curtop);
}


function setDN(){
  function _setDN(el){    
   if(el.style)el.style.display="none";
  }
  
  var al=arguments.length;
  for(var i=0;i<al;i++){var el=arguments[i];if(typeof(el)=="string")_setDN(gE(el));else if(ell=el.length){for(var j=0;j<ell;j++)_setDN(el[j]);}else _setDN(el);}
}


function setDB(el){
  function _setDB(el){  
    if(el.style)el.style.display="block";
  }
 
  var al=arguments.length;
  for(var i=0;i<al;i++){var el=arguments[i];if(typeof(el)=="string")_setDB(gE(el));else if(ell=el.length){for(var j=0;j<ell;j++)_setDB(el[j]);}else _setDB(el);}
}


function setDI(el){
  function _setDI(el){
    if(el.style)el.style.display="inline";
  }
  
  var al=arguments.length;
  for(var i=0;i<al;i++){var el=arguments[i];if(typeof(el)=="string")_setDI(gE(el));else if(ell=el.length){for(var j=0;j<ell;j++)_setDI(el[j]);}else _setDI(el);}
}


function setVH(el){
  function _setVH(el){
   if(el.style)el.style.visibility="hidden";
  }

  var al=arguments.length;
  for(var i=0;i<al;i++){var el=arguments[i];if(typeof(el)=="string")_setVH(gE(el));else if(ell=el.length){for(var j=0;j<ell;j++)_setVH(el[j]);}else _setVH(el);}
}


function setVV(el){
  function _setVV(el){
    if(el.style)el.style.visibility="visible";
  }

  var al=arguments.length;
  for(var i=0;i<al;i++){
    var el=arguments[i];
    if(typeof(el)=="string")_setVV(gE(el));
    else if(ell=el.length){
      for(var j=0;j<ell;j++)_setVV(el[j]);
    }else _setVV(el);
  }
}


function setTrDB(el){
  function _setTrDB(el){
    if(el.style)el.style.display=browser.isIE?"block":"table-row";
  }
  
  var al=arguments.length;
  for(var i=0;i<al;i++){
    var el=arguments[i];
    if(typeof(el)=="string")_setTrDB(gE(el));
    else if(ell=el.length){
      for(var j=0;j<ell;j++)_setTrDB(el[j]);
    }else _setTrDB(el);
  }
}


function swapDisplay(el){
  function _swapDisplay(el){
    if(el.style)el.style.display=el.style.display=="none"?"block":"none";
  }
  var al=arguments.length;
  for(var i=0;i<al;i++){
    var el=arguments[i];
    if(typeof(el)=="string")_swapDisplay(gE(el));
    else if(ell=el.length){
      for(var j=0;j<ell;j++)_swapDisplay(el[j]);
    }else _swapDisplay(el);
  }
}


function swapVisibility(el){
  function _swapVisibility(el){
    if(el.style)el.style.visibility=el.style.visibility=="hidden"?"visible":"hidden";
  }
  var al=arguments.length;
  for(var i=0;i<al;i++){
    var el=arguments[i];
    if(typeof(el)=="string")_swapVisibility(gE(el));
    else if(ell=el.length){
      for(var j=0;j<ell;j++)_swapVisibility(el[j]);
    }else _swapVisibility(el);
  }
}


function clipEl(el,l,t,r,b){
  function _clipEl(el,l,t,r,b){
    if(el.style) el.style.clip="rect("+t+"px,"+(getElementWidth(el)-r)+"px,"+(getElementHeight(el)-b)+"px,"+l+"px)";
  } 

  var al=arguments.length;
  for(var i=0;i<al;i++){
    var el=arguments[i];
    if(typeof(el)=="string")_clipEl(gE(el));
    else if(ell=el.length){
      for(var j=0;j<ell;j++)_clipEl(el[j],l,t,r,b);
    }else _clipEl(el,l,t,r,b);
  }
}





if(!browser.isIE){

  HTMLElement.prototype.getElementsByClassName=function(clsName,tagName){return getElementsByClassName(this,clsName,tagName);};

  HTMLElement.prototype.getElementsByTagNames=function(){
    var args=[this];
    var al=arguments.length;
    for(var i=0;i<al;i++)args.push(arguments[i]);
    return getElementsByTagNames.apply(null,args);
  };

  HTMLElement.prototype.setDN=function(){setDN(this);};
  HTMLElement.prototype.setDB=function(){setDB(this);};
  HTMLElement.prototype.setDI=function(){setDI(this);};
  HTMLElement.prototype.setVH=function(){setVH(this);};
  HTMLElement.prototype.setVV=function(){setVV(this);};
  HTMLElement.prototype.setTrDB=function(){setTrDB(this);};
  HTMLElement.prototype.swapDisplay=function(){swapDisplay(this);};
  HTMLElement.prototype.swapVisibility=function(){swapVisibility(this);};

  HTMLElement.prototype.clipEl=function(l,t,r,b){clipEl(this,l,t,r,b);};
  HTMLElement.prototype.nextEl=function(){return nextEl(this);};
  HTMLElement.prototype.prevEl=function(){return prevEl(this);};
  HTMLElement.prototype.firstEl=function(){return firstEl(this);};
  HTMLElement.prototype.lastEl=function(){return lastEl(this);};

}







function picWin(url,wi,he,title,winParams,closeTitle){
  var win=window.open("","","width="+wi+",height="+he+(isUndefined(winParams)?"":(","+winParams)));
  if(typeof(win)!="object")return true;

  var posLeft=Math.round((screen.width-wi)/2);
  var posTop=Math.round((screen.height-he)/2);
  var cls=""
  var titl="";
  if(!isUndefined(closeTitle)){
    cls=closeTitle;
  }else{
    if(document.lang=="en")cls="Click to close the window"; else cls="Kliknutím zavřete okno"; 
  }
  if(!isUndefined(title))titl=title;

  var html='<html><head><title>'+titl+'</title><meta http-equiv="content-type" content="text/html; charset=iso-8859-2"></head><body style="margin:0"><img src="'+url+'" style="cursor:pointer;cursor:hand;display:block;" width="'+wi+'" height="'+he+'" onclick="window.close()" alt="" title="'+cls+'"></body></html>';

  win.document.open();
  win.document.write(html);
  win.document.close(); 
  win.focus();
 
  return false;
}






function FormValidator(el,mode,errClass){
  
  
  var mailRE=/^[_a-zA-Z0-9\.\-]+@[_a-zA-Z0-9\.\-]+\.[a-zA-Z]{2,4}$/;
  var iso_dateRE=/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/;
  var czech_dateRE=/^([0-9]{1,2}\ *\.){2}\ *[0-9]{4}$/;
  var phoneRE=/^(\ *[0-9]\ *){9}$/;
  var intRE=/^[0-9]+$/;
  

  this.mode=isUndefined(mode)?1:mode;
  if(this.mode==1)this.errClass=isUndefined(errClass)?"error":errClass;

// var errClass=errClass || "error";

  if(typeof(el)=="string")el=gE(el);
  this.inps=[];
  
  if(isFunction(el.onsubmit))el.originalOnsubmit=el.onsubmit;

  this.labels=[];
  var labelEls=el.getElementsByTagName("label");
  for(var i=0;i<labelEls.length;i++){
    if(!isUndefined(labelEls[i].htmlFor) && labelEls[i].htmlFor!="")this.labels[labelEls[i].htmlFor]=labelEls[i].firstChild.data;
  }
  
 // el.checkform=this;  

  var self=this;

  el.onsubmit=function(){
    var emptys=[];
    var invalids=[];
    var usermessages=[];

    var imess="Následující položky mají chybný formát:";
    var emess="Následující položky nebyly vyplněny:";

    if(document.lang=="en"){
      var imess="The following items have invalid format:";
      var emess="The following items are required:";
    }
    
    var imess_0='Položka "%" má chybný formát';
    var emess_0='Položka "%" není vyplněna';
    if(document.lang=="en"){
      var imess_0='The item "%" has incorrect format';
      var emess_0='The item "%" is required';
    }
    
    var inps=self.inps;
    
    var modeEnabled=function(mode,modearray){
      for(var i=0;i<modearray.length;i++){
        if(modearray[i]==mode)return true; 
      }
      return false;
    }
   
    var alrt="";
    
    

    for(var i=0;i<inps.length;i++){

      if(isUndefined(inps[i][4]) || eval(inps[i][4])){
    
        if(typeof(inps[i][0])=="string")inps[i][0]=getEl(inps[i][0]);
        var el=inps[i][0];
        var mode=inps[i][1].toLowerCase().replace(/\ /gi,"");
        

        var modesdef=["require","validate","radios","checkboxes","user"];


        var modes=mode.split("&");

        for(var j=0;j<modesdef.length;j++)eval("var mode_"+modesdef[j]+"="+(modeEnabled(modesdef[j],modes)?"true":"false"));
      
        var type=inps[i][2];
        if(typeof type=="string" && type.trim()!="")var typeRE=eval(type+"RE");else var typeRE=type;

        var label="";
        if(!isUndefined(inps[i][3]) && !isNull(inps[i][3]))label=inps[i][3]; else if(!isUndefined(self.labels[el.id]))label=self.labels[el.id]; 
        
        label=label.replace(/\:$/,"");
        
        if(mode_require){
          if(el.value.trim()==""){
            emptys[emptys.length]=label;
            
            if(self.mode==0){
              alert(emess_0.replace(/%/,label));
              el.focus();
              return false;
            }
            el.className+=" "+self.errClass;
            el.onchange=new Function('if(isFunction(this.originalOnchange))this.originalOnchange(); if(this.value.trim()!="")this.className=this.className.replace(/\\b'+self.errClass+'\\b/,""); else if(!/\\b'+self.errClass+'\\b/.test(this.className))this.className+=" '+self.errClass+'";');
          }
        }
        
        
        if(mode_validate){
          if(el.value.trim()!="" && !typeRE.test(el.value)){
            invalids[invalids.length]=label;
             if(self.mode==0){
              alert(imess_0.replace(/%/,label));
              el.focus();
              return false;
            }
            el.className+=" "+self.errClass;
            el.onchange=new Function('if(isFunction(this.originalOnchange))this.originalOnchange(); if(this.value.trim()!="" && '+typeRE+'.test(this.value))this.className=this.className.replace(/\\b'+self.errClass+'\\b/,""); else if(this.value.trim()!="" && !'+typeRE+'.test(this.value) && !/\\b'+self.errClass+'\\b/.test(this.className))this.className+=" '+self.errClass+'";');
          }
        }
        
           
        if(mode_radios){
          var ins=el.parentNode.getElementsByTagName("input");
          var miss=true;
          for(var j=0;j<ins.length;j++)if(ins[j].checked)miss=false;
          if(miss){
            emptys[emptys.length]=label;
            el.parentNode.className+=" "+self.errClass;
            var fc=new Function('if(isFunction(this.originalOnclick))this.originalOnclick(); this.parentNode.className=this.parentNode.className.replace(/\\b'+self.errClass+'\\b/gi,"");');
            for(var j=0;j<ins.length;j++)ins[j].onclick=fc;              
          }
        }
        
        
        if(mode_checkboxes){
          var ins=el.parentNode.getElementsByTagName("input");     
          var miss=true;
          for(var j=0;j<ins.length;j++)if(ins[j].checked)miss=false;
          if(miss){
            emptys[emptys.length]=label;
            el.parentNode.className+=" "+self.errClass;
            var fc=new Function('if(isFunction(this.originalOnclick))this.originalOnclick(); var inps=this.parentNode.getElementsByTagName("input");  var miss=true;for(var i=0;i<inps.length;i++)if(inps[i].checked)miss=false;   if(!miss) this.parentNode.className=this.parentNode.className.replace(/\\b'+self.errClass+'\\b/,""); else this.parentNode.className+=" '+self.errClass+'"');
            for(var j=0;j<ins.length;j++)ins[j].onclick=fc;              
          }
        }

        
        
        
     		 if(mode_user){
       			if(eval(inps[i][5])){
         			usermessages.push(inps[i][6]);
        				if(el.type.toLowerCase()=="text" || el.type.toLowerCase()=="password" || el.tagName.toLowerCase()=="textarea")el.className+=" "+self.errClass;
          		el.onchange=new Function('if(isFunction(this.originalOnchange))this.originalOnchange(); if('+inps[i][5]+'){if(!/\\b'+this.className+'\\b/.test(this.className))this.className=this.className+" '+self.errClass+'";}else this.className=this.className.replace(/\\b'+self.errClass+'\\b/,"");');
        		}
        }
        
        
      }
    }
    
    
    
    if(emptys.length>0 || invalids.length>0 || usermessages.length>0){
      if(emptys.length>0){
        alrt+=emess+"\n\n";
        for(var i=0;i<emptys.length;i++)alrt+=emptys[i]+"\n";
      }  

      if(invalids.length>0){
        if(emptys.length>0)alrt+="\n\n";
         alrt+=imess+"\n\n";
        for(var i=0;i<invalids.length;i++)alrt+=invalids[i]+"\n";
      }  
    
      if(usermessages.length>0){
        if(emptys.length>0||invalids.length>0)alrt+="\n";
        for(var i=0;i<usermessages.length;i++)alrt+=usermessages[i]+"\n";
      }

      alert(alrt);
      return false;
    }
    
    if(!isUndefined(this.originalOnsubmit))return this.originalOnsubmit();

  }
  
}



FormValidator.prototype.registerInput=function(){
  if(el=gE(arguments[0])){
    if(isFunction(el.onchange))el.originalOnchange=el.onchange;
    if(isFunction(el.onclick))el.originalOnclick=el.onclick;
    this.inps[this.inps.length]=arguments;
  }else alert('"'+arguments[0]+'" not found');
}











function openWindowsByClassName(cn){
function targetBlank(e){
	if(browser.isIE)el=event.srcElement; else el=e.target;
	while(el.tagName.toLowerCase()!="a")el=el.parentNode;
	var hrf=el.href;
	var newwin=window.open(hrf);
	return typeof(newwin)=="object"?false:true;
}



  cn=cn || "targetblank";
	 var lnks=document.getElementsByTagName("a");
	 for(var i=0;i<lnks.length;i++){
	   if((" "+lnks[i].className+" ").indexOf(" "+cn+" ")>-1){
   			lnks[i].onclick=targetBlank;
  		}
 	}
}




