
function getEML(id_posta){
       var link = document.getElementById(id_posta);
       if (link!==null){
         var obsah=link.innerHTML.replace(/\[zavinac\]/g,'@').replace(/\[tecka\]/g,'.')
         link.setAttribute('href','mailto:'+obsah);
         link.firstChild.nodeValue=obsah;
       }  
}  

function Vyraz(o){
  var maininput=document.getElementById('maininput');
  maininput.value=o.nodeValue;
}

function CheckEmail(email){
if (window.RegExp){
  re = new RegExp("^[^@]+@[^.]+[\.].+$");
  if (!re.test(email.value))
  {
   alert("Máte chybně vyplněnou e-mailovou adresu: "+email.value);
         email.focus();
   return false;
  }
 else return true;
 }
}

function SubmitForm(detail){
  var maininput=document.getElementById('maininput').value;
  if(maininput=='') {
    return false;
  }
  else{
   SendByAjax('ajax.php','counting','maininput='+maininput+'&Detail='+detail);
   return true;
  }
}

	function SendByAjax(strURL,id,str) {
		var xmlHttpReq = false;
	    var self = this;
	    
      // Mozilla
	    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
	    }
	    // IE
	    else if (window.ActiveXObject) {
	        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
 	   }


		 self.xmlHttpReq.open('POST', strURL, true);
	    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		self.xmlHttpReq.send(str);
		return false;
	}


function show(p){
  var o=document.getElementById('brand'+p);  
  for(a=0;a<=28;a++){
    o=document.getElementById('brand'+a);
    o.style.display=(a!=p)?'none':'block';
  }
}

function setTarget(n){
  var target;
  if (n){
     target=document.getElementById('linkexternal').getAttribute('target');     
  }
  else{
      target='drivers';
      var o=document.getElementById('drivers');
      o.style.height='600px';
      //o.style.border='2px solid';
      document.getElementById('iframecover').style.display='block';
      o.style.display='block';     
  }
  document.driverform.target=target;
  return target;
}

function openExternal(f){
  var l=eval('document.driverform.linkexternal'+f+'.value');
  window.open(l,'targetX','width=1,height=1,toolbar=yes,scrollbars=yes,resizable=yes');;
}

var banim=1;

function animace(){
    banim++;
    var count=document.getElementById("zarizenis").getAttribute("dir");
    var i = Math.round(1+count*Math.random());
    var v = Math.round(5+9*Math.random());
    animtimer=setTimeout("animace()",1500);
    o=document.getElementById('z'+i);
    o.style.fontSize=v+'pt';
    if(banim>=100) clearTimeout(animtimer);
}

/***********************************************
* Bookmark site script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

/* Modified to support Opera */
function bookmarksite(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}
