var xmlHttp = createXmlHttpRequestObject();
var	obr1=0;
var	obr2=0;



function createXmlHttpRequestObject() 
{
  // will store the reference to the XMLHttpRequest object
  var xmlHttp;
  // this should work for all browsers except IE6 and older
  try
  {
    // try to create XMLHttpRequest object
    xmlHttp = new XMLHttpRequest();
  }
  catch(e)
  {
    // assume IE6 or older
    var XmlHttpVersions = new Array("MSXML2.XMLHTTP.6.0",
                                    "MSXML2.XMLHTTP.5.0",
                                    "MSXML2.XMLHTTP.4.0",
                                    "MSXML2.XMLHTTP.3.0",
                                    "MSXML2.XMLHTTP",
                                    "Microsoft.XMLHTTP");
    // try every prog id until one works
    for (var i=0; i<XmlHttpVersions.length && !xmlHttp; i++) 
    {
      try 
      { 
        // try to create XMLHttpRequest object
        xmlHttp = new ActiveXObject(XmlHttpVersions[i]);
      } 
      catch (e) {} // ignore potential error
    }
  }
  // return the created object or display an error message
  if (!xmlHttp)
    alert("Error creating the XMLHttpRequest object.");
  else 
    return xmlHttp;
}



function ZobrazDalsiP(limit, limit1, kat, urlkat)	
{
var url="ajax-vypisprodukt.php" +"?limit="+limit+"&;limit1="+limit1+"&kat="+kat+"&urlkat="+urlkat;
xmlHttp.onreadystatechange=vypispStateChange;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function vypispStateChange()
{
	if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
	{
		var nText = document.getElementById("vypisprod");
		nText.innerHTML = xmlHttp.responseText;
	}
}


function ZobrazDetail(str, id, apa, sess)	
{
var url="ajax-produkt.php" +"?id="+id+"&co="+str+"&apa="+apa+"&sess="+sess;
xmlHttp.onreadystatechange=obsluhaStateChange;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
//alert(str);
/*xHttp.onreadystatechange=obsluhaStateChange;
xHttp.open("GET","text.txt",true);
xHttp.setRequestHeader("Content-Type", "text/html; charset=windows-1250"); 
xHttp.send(null);*/
}
function obsluhaStateChange()
{
	if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
	{
		var nText = document.getElementById("produkt");
		nText.innerHTML = xmlHttp.responseText;
	}
}
function ShowBas1(id, i)	
{
var url="ajax-showbas1.php" +"?id="+id;
xmlHttp.onreadystatechange=obsluhaShowBas1;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
document.getElementById('a1').style.fontWeight ="normal";
document.getElementById('a2').style.fontWeight ="normal";
document.getElementById('a3').style.fontWeight ="normal";
document.getElementById('a4').style.fontWeight ="normal";
document.getElementById('a5').style.fontWeight ="normal";
document.getElementById('a6').style.fontWeight ="normal";
document.getElementById('a7').style.fontWeight ="normal";
document.getElementById('a8').style.fontWeight ="normal";
document.getElementById('a9').style.fontWeight ="normal";
document.getElementById('a10').style.fontWeight ="normal";
document.getElementById(i).style.fontWeight ="bold";
//alert(str);
/*xHttp.onreadystatechange=obsluhaStateChange;
xHttp.open("GET","text.txt",true);
xHttp.setRequestHeader("Content-Type", "text/html; charset=windows-1250"); 
xHttp.send(null);*/
}
function obsluhaShowBas1()
{
	if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
	{
		var nText = document.getElementById("basimg1");
		nText.innerHTML = xmlHttp.responseText;
	}
}

function ShowBas2(id, i)	
{
var url="ajax-showbas1.php" +"?id="+id;
xmlHttp.onreadystatechange=obsluhaShowBas2;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
document.getElementById('b1').style.fontWeight ="normal";
document.getElementById('b2').style.fontWeight ="normal";
document.getElementById('b3').style.fontWeight ="normal";
document.getElementById('b4').style.fontWeight ="normal";
document.getElementById('b5').style.fontWeight ="normal";
document.getElementById('b6').style.fontWeight ="normal";
document.getElementById('b7').style.fontWeight ="normal";
document.getElementById('b8').style.fontWeight ="normal";
document.getElementById('b9').style.fontWeight ="normal";
document.getElementById('b10').style.fontWeight ="normal";
document.getElementById(i).style.fontWeight ="bold";
//alert(str);
/*xHttp.onreadystatechange=obsluhaStateChange;
xHttp.open("GET","text.txt",true);
xHttp.setRequestHeader("Content-Type", "text/html; charset=windows-1250"); 
xHttp.send(null);*/
}
function obsluhaShowBas2()
{
	if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
	{
		var nText = document.getElementById("basimg2");
		nText.innerHTML = xmlHttp.responseText;
	}
}

function ShowBas3(id,i)	
{
var url="ajax-showbas3.php" +"?id="+id;
xmlHttp.onreadystatechange=obsluhaShowBas3;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
document.getElementById('c1').style.fontWeight ="normal";
document.getElementById('c2').style.fontWeight ="normal";
document.getElementById('c3').style.fontWeight ="normal";
document.getElementById('c4').style.fontWeight ="normal";
document.getElementById('c5').style.fontWeight ="normal";
document.getElementById('c6').style.fontWeight ="normal";
document.getElementById('c7').style.fontWeight ="normal";
document.getElementById('c8').style.fontWeight ="normal";
document.getElementById('c9').style.fontWeight ="normal";
document.getElementById('c10').style.fontWeight ="normal";
document.getElementById(i).style.fontWeight ="bold";
}
function obsluhaShowBas3()
{
	if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
	{
		var nText = document.getElementById("basimg3");
		nText.innerHTML = xmlHttp.responseText;
	}
}
function ShowBas4(id,i)	
{
var url="ajax-showbas4.php" +"?id="+id;
xmlHttp.onreadystatechange=obsluhaShowBas4;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
document.getElementById('d1').style.fontWeight ="normal";
document.getElementById('d2').style.fontWeight ="normal";
document.getElementById('d3').style.fontWeight ="normal";
document.getElementById('d4').style.fontWeight ="normal";
document.getElementById('d5').style.fontWeight ="normal";
document.getElementById('d6').style.fontWeight ="normal";
document.getElementById('d7').style.fontWeight ="normal";
document.getElementById('d8').style.fontWeight ="normal";
document.getElementById('d9').style.fontWeight ="normal";
document.getElementById('d10').style.fontWeight ="normal";
document.getElementById(i).style.fontWeight ="bold";
}
function obsluhaShowBas4()
{
	if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
	{
		var nText = document.getElementById("basimg4");
		nText.innerHTML = xmlHttp.responseText;
	}
}

function NajdiLek() {
var mesto=document.getElementById("inputText").value;
var url="ajax-lekarny.php" +"?id="+mesto;
xmlHttp.onreadystatechange=obsluhaStateChangeLek;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function obsluhaStateChangeLek()
{
	if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
	{
		var nText = document.getElementById("clanekvypis");
		nText.innerHTML = xmlHttp.responseText;
	}
}
function UkazLekarnu(id) {
var url="ajax-lekarna.php" +"?id="+id;
xmlHttp.onreadystatechange=obsluhaStateChangeLek;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function obsluhaStateChangeLek1(i)
{
	if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
	{
		var nText = document.getElementById("clanek"+i);
		nText.innerHTML = xmlHttp.responseText;
	}
}



function ZobrazLR(id) {
var url="ajax-lecivka.php" +"?id="+id;
xmlHttp.onreadystatechange=obsluhaStateLR;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
ZobrazLRN(id);
}
function ZobrazLRN(id) {
var url="ajax-lecivkandp.php" +"?id="+id;
xmlHttp1 = createXmlHttpRequestObject();
xmlHttp1.onreadystatechange=obsluhaStateZobrazLRN;
xmlHttp1.open("GET",url,true);
xmlHttp1.send(null);
}
function obsluhaStateLR()
{
	if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
	{
		var nText = document.getElementById("clanek");
		nText.innerHTML = xmlHttp.responseText;
	}
}
function obsluhaStateZobrazLRN()
{
	if(xmlHttp1.readyState == 4 && xmlHttp1.status == 200)
	{
		var nNadpis = document.getElementById("mainnadpis");
		nNadpis.innerHTML = xmlHttp1.responseText;
		document.title = 'TVÉ ZDRAVÍ - '+xmlHttp1.responseText;	
		}
}



function ShowLek(co) {
document.getElementById('lekvideo').style.display='none';
document.getElementById('vyrobce').style.display='none';
document.getElementById('indikace').style.display='none'; 
document.getElementById('davkovani').style.display='none'; 
document.getElementById('kontraindikace').style.display='none'; 
document.getElementById('slozeni').style.display='none'; 
document.getElementById('kestazeni').style.display='none'; 
document.getElementById('posliodkaz').style.display='none'; 
document.getElementById('dotaz').style.display='none'; 
if(co=='1') document.getElementById('indikace').style.display=''; 
if(co=='2') document.getElementById('vyrobce').style.display=''; 
if(co=='3') document.getElementById('davkovani').style.display=''; 
if(co=='4') document.getElementById('kontraindikace').style.display=''; 
if(co=='5') document.getElementById('slozeni').style.display=''; 
if(co=='10') document.getElementById('lekvideo').style.display=''; 
if(co=='11') document.getElementById('kestazeni').style.display=''; 
if(co=='12') document.getElementById('posliodkaz').style.display=''; 
if(co=='13') document.getElementById('dotaz').style.display=''; 
}





function AnimHomeA(dataSource,kolik)
{
xmlHttp = createXmlHttpRequestObject();
	xmlHttp.open("GET", dataSource);
	xmlHttp.onreadystatechange = function()
	{
		if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
		{
//	alert(xmlHttp.responseText);
ShowBas1(xmlHttp.responseText, 'a'+kolik)	
		}
	
	}
	xmlHttp.send(null);
}
function AnimHomeB(dataSource,kolik)
{
xmlHttp = createXmlHttpRequestObject();
	xmlHttp.open("GET", dataSource);
	xmlHttp.onreadystatechange = function()
	{
		if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
		{
ShowBas2(xmlHttp.responseText, 'b'+kolik)	
		}
	
	}
	xmlHttp.send(null);
}





function AnimHome1()
{
cas1 =5000;
//if (obr==1) cas=10000;
if (obr1+1==4) obr1=1;
else obr1++;
if (obr2+1==4) obr2=1;
else obr2++;
//alert(obr1);
/*dataSource2="ajax-animhomeb.php?kolik="+obr2;
xmlHttp2 = createXmlHttpRequestObject();
	xmlHttp2.open("GET", dataSource2);
	xmlHttp2.onreadystatechange = function()
	{
		if (xmlHttp2.readyState == 4 && xmlHttp2.status == 200)
		{
ShowBas2(xmlHttp2.responseText, 'b'+obr2)	
		}
	
	}
	xmlHttp2.send(null);*/
dataSource1="ajax-animhomea.php?kolik="+obr1;
xmlHttp1 = createXmlHttpRequestObject();
	xmlHttp1.open("GET", dataSource1);
	xmlHttp1.onreadystatechange = function()
	{
		if (xmlHttp1.readyState == 4 && xmlHttp1.status == 200)
		{
ShowBas1(xmlHttp1.responseText, 'a'+obr1)	
		}
	
	}
	xmlHttp1.send(null);
//AnimHomeA("ajax-animhomea.php?kolik="+obr1,obr1);
//AnimHome2(obr);
//AnimHome1(obr);
casovac1=window.setTimeout('AnimHome1()',cas1);
}
function AnimHome2()
{
cas2 =5000;
//if (obr==1) cas=10000;
if (obr2+1==11) obr2=1;
else obr2++;
AnimHomeB("ajax-animhomeb.php?kolik="+obr2,obr2);
//AnimHome2(obr);
//AnimHome1(obr);
casovac2=window.setTimeout('AnimHome2()',cas2);
}


function GivePovinn(dataSource,typ, POV)
{
	document.getElementById("overlay").style.display='';
	document.getElementById("overlay").style.position='absolute';
	document.getElementById("overlay").style.top='0';
	document.getElementById("overlay").style.left='0';
	document.getElementById("overlay").style.height='100%';
	document.getElementById("overlay").style.width='100%'; 
	winHeight = document.documentElement.clientHeight;
	vyska=winHeight/2;
	var obr= document.getElementById("overlay");
	obr.innerHTML = '<div style="padding-top:'+vyska+'px; text-align:center; color:white; font-weight:bold">Ověřuji<img 			src="images/loading.gif" /></div>';
xmlHttp = createXmlHttpRequestObject();
	xmlHttp.open("GET", dataSource);
	xmlHttp.onreadystatechange = function()
	{
		if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
		{
			if(xmlHttp.responseText == "neni")
			{
				alert('Nesprávna hodnota');
				document.getElementById("form"+typ).value="";
				document.getElementById("form"+typ).focus();
					document.getElementById("form"+typ).style.backgroundColor="#F00";
					var obr= document.getElementById("over"+typ);
					obr.innerHTML = '';
				document.getElementById("overlay").style.display='none';
				if(pov=='P')
				{
					document.getElementById("form"+typ).style.backgroundColor="#F00";
					var obr= document.getElementById("over"+typ);
					obr.innerHTML = '';
				document.getElementById("overlay").style.display='none';
				}
			}
			else
			{
				document.getElementById("form"+typ).style.backgroundColor="white";
				var obr= document.getElementById("over"+typ);
			obr.innerHTML = '<img src="images/ok.png" alt="" />';
				document.getElementById("overlay").style.display='none';
			}
		}
	
	}
	xmlHttp.send(null);
}


function FormPovinn(udalost,typ,kolik,pov)
{
	udalost = (udalost) ? udalost: window.event;
	txt = (udalost.target) ? udalost.target : udalost.srcElement;
	
	if (udalost.type == "blur")
	{
				if (txt.value) {GivePovinn("validpovinn.php?co=" + txt.value +"&kolik=" + kolik,typ,pov);}
	}
}

function GivePsc(dataSource)
{
	document.getElementById("overlay").style.display='';
	document.getElementById("overlay").style.position='absolute';
	document.getElementById("overlay").style.top='0';
	document.getElementById("overlay").style.left='0';
	document.getElementById("overlay").style.height='100%';
	document.getElementById("overlay").style.width='100%'; 
	winHeight = document.documentElement.clientHeight;
	vyska=winHeight/2;
	var obr= document.getElementById("overlay");
	obr.innerHTML = '<div style="padding-top:'+vyska+'px; text-align:center; color:white; font-weight:bold">Ověřuji<img 			src="images/loading.gif" /></div>';
xmlHttp = createXmlHttpRequestObject();
	xmlHttp.open("GET", dataSource);
	xmlHttp.onreadystatechange = function()
	{
		if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
		{
			if(xmlHttp.responseText == "neni")
			{
				alert('Nesprávna hodnota');
				document.getElementById("formpsc").value="";
				document.getElementById("formpsc").focus();	
				document.getElementById("formpsc").style.backgroundColor="#F00";
					var obr= document.getElementById("over"+typ);
					obr.innerHTML = '';
				document.getElementById("overlay").style.display='none';
			}
			else
			{
				document.getElementById("formpsc").style.backgroundColor="white";
				var obr= document.getElementById("over"+typ);
			obr.innerHTML = '<img src="images/ok.png" alt="" />';
				document.getElementById("overlay").style.display='none';
			}
		}
	
	}
	xmlHttp.send(null);
}


function ControlPostcode(udalost)
{
	udalost = (udalost) ? udalost: window.event;
	txt = (udalost.target) ? udalost.target : udalost.srcElement;
	
	if (udalost.type == "blur")
	{
				if (txt.value) {GivePsc("validpsc.php?co=" + txt.value);}
	}
}

function GivePhone(dataSource,typ,pov)
{
xmlHttp = createXmlHttpRequestObject();
	xmlHttp.open("GET", dataSource);
	xmlHttp.onreadystatechange = function()
	{
		if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
		{
			if(xmlHttp.responseText == "neni")
			{
				alert('Nesprávna hodnota');
				document.getElementById("form"+typ).value="";
				document.getElementById("form"+typ).focus();
				if(pov=='P')
				{
					document.getElementById("form"+typ).style.backgroundColor="#F00";
				}
			}
			else
			{
				document.getElementById("form"+typ).style.backgroundColor="white";
			}

		}
	
	}
	xmlHttp.send(null);
}


function ControlPhone(udalost,typ, pov)
{
udalost = (udalost) ? udalost: window.event;
	txt = (udalost.target) ? udalost.target : udalost.srcElement;
	if (udalost.type == "blur")
	{
				if (txt.value) {GivePhone("validphone.php?co=" + txt.value,typ, pov);}
	}
}

function GivePovinnC(dataSource,typ, POV)
{
	document.getElementById("overlay").style.display='';
	document.getElementById("overlay").style.position='absolute';
	document.getElementById("overlay").style.top='0';
	document.getElementById("overlay").style.left='0';
	document.getElementById("overlay").style.height='100%';
	document.getElementById("overlay").style.width='100%'; 
	winHeight = document.documentElement.clientHeight;
	vyska=winHeight/2;
	var obr= document.getElementById("overlay");
	obr.innerHTML = '<div style="padding-top:'+vyska+'px; text-align:center; color:white; font-weight:bold">Ověřuji<img 			src="images/loading.gif" /></div>';
xmlHttp = createXmlHttpRequestObject();
	xmlHttp.open("GET", dataSource);
	xmlHttp.onreadystatechange = function()
	{
		if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
		{
			if(xmlHttp.responseText == "neni")
			{
				alert('Nesprávna hodnota');
				document.getElementById("form"+typ).value="";
				document.getElementById("form"+typ).focus();
					var obr= document.getElementById("over"+typ);
					obr.innerHTML = '';
				document.getElementById("overlay").style.display='none';
				if(pov=='P')
				{
					document.getElementById("form"+typ).style.backgroundColor="#F00";
					var obr= document.getElementById("over"+typ);
					obr.innerHTML = '';
				document.getElementById("overlay").style.display='none';
				}
			}
			else
			{
				document.getElementById("form"+typ).style.backgroundColor="white";
				var obr= document.getElementById("over"+typ);
			obr.innerHTML = '<img src="images/ok.png" alt="" />';
				document.getElementById("overlay").style.display='none';
			}
		}
	
	}
	xmlHttp.send(null);
}


function FormPovinnC(udalost,typ,kolik,pov)
{
	udalost = (udalost) ? udalost: window.event;
	txt = (udalost.target) ? udalost.target : udalost.srcElement;
	
	if (udalost.type == "blur")
	{
				if (txt.value) {GivePovinnC("validpovinnc.php?co=" + txt.value +"&kolik=" + kolik,typ,pov);}
	}
}

function GiveEmail(dataSource,typ,pov)
{
	document.getElementById("overlay").style.display='';
	document.getElementById("overlay").style.position='absolute';
	document.getElementById("overlay").style.top='0';
	document.getElementById("overlay").style.left='0';
	document.getElementById("overlay").style.height='100%';
	document.getElementById("overlay").style.width='100%'; 
	winHeight = document.documentElement.clientHeight;
	vyska=winHeight/2;
	var obr= document.getElementById("overlay");
	obr.innerHTML = '<div style="padding-top:'+vyska+'px; text-align:center; color:white; font-weight:bold">Ověřuji<img src="images/loading.gif" /></div>';
xmlHttp = createXmlHttpRequestObject();
	xmlHttp.open("GET", dataSource);
	xmlHttp.onreadystatechange = function()
	{
		if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
		{
			if(xmlHttp.responseText == "full")
			{
				alert('Emailová adresa je již zaregistrována');
				document.getElementById("form"+typ).value="";
				document.getElementById("form"+typ).focus();
				document.getElementById("form"+typ).style.backgroundColor="#F00";
				document.getElementById("overlay").style.display='none';
					var obr= document.getElementById("over"+typ);
					obr.innerHTML = '';
			}
			else
			{
				if(xmlHttp.responseText == "false")
				{
					alert('Nesprávna hodnota');
					document.getElementById("form"+typ).value="";
					document.getElementById("form"+typ).focus();	
					document.getElementById("form"+typ).style.backgroundColor="#F00";
					document.getElementById("overlay").style.display='none';
					var obr= document.getElementById("over"+typ);
					obr.innerHTML = '';
				}
				else
				{
					document.getElementById("form"+typ).style.backgroundColor="white";
					document.getElementById("overlay").style.display='none';
				var obr= document.getElementById("over"+typ);
			obr.innerHTML = '<img src="images/ok.png" alt="" />';
				}
			}
		}
	
	}
	xmlHttp.send(null);
}


function ControlEmail(udalost,typ, pov, cont)
{
	udalost = (udalost) ? udalost: window.event;
	txt = (udalost.target) ? udalost.target : udalost.srcElement;
	if (udalost.type == "blur")
	{
				if (txt.value) {GiveEmail("validemail.php?co=" + txt.value + "&cont=" + cont,typ, pov);}
	}
}


function GiveEmail1(dataSource,typ,pov)
{
	document.getElementById("overlay").style.display='';
	document.getElementById("overlay").style.position='absolute';
	document.getElementById("overlay").style.top='0';
	document.getElementById("overlay").style.left='0';
	document.getElementById("overlay").style.height='100%';
	document.getElementById("overlay").style.width='100%'; 
	winHeight = document.documentElement.clientHeight;
	vyska=winHeight/2;
	var obr= document.getElementById("overlay");
	obr.innerHTML = '<div style="padding-top:'+vyska+'px; text-align:center; color:white; font-weight:bold">Ověřuji<img src="images/loading.gif" /></div>';
xmlHttp = createXmlHttpRequestObject();
	xmlHttp.open("GET", dataSource);
	xmlHttp.onreadystatechange = function()
	{
		if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
		{
			if(xmlHttp.responseText.substr(0,4) == "full")
			{
//				alert('Emailová adresa je již zaregistrována');
//				document.getElementById("form"+typ).value="";
				document.getElementById("overlay").style.display='none';
				document.getElementById("over"+typ).innerHTML = '<img src="images/ok.png" alt="" />';
			}
			else
			{
				if(xmlHttp.responseText == "false")
				{
					alert('Nesprávna hodnota');
					document.getElementById("form"+typ).value="";
					document.getElementById("form"+typ).focus();	
					document.getElementById("form"+typ).style.backgroundColor="#F00";
					document.getElementById("overlay").style.display='none';
					var obr= document.getElementById("over"+typ);
					obr.innerHTML = '';
				}
				else
				{
					document.getElementById("form"+typ).style.backgroundColor="white";
					document.getElementById("overlay").style.display='none';
				var obr= document.getElementById("over"+typ);
			obr.innerHTML = '<img src="images/ok.png" alt="" />';
				}
			}
		}
	
	}
	xmlHttp.send(null);
}


function ControlEmail1(udalost,typ, pov, cont)
{
	udalost = (udalost) ? udalost: window.event;
	txt = (udalost.target) ? udalost.target : udalost.srcElement;
	if (udalost.type == "blur")
	{
				if (txt.value) {GiveEmail1("validemail1.php?co=" + txt.value + "&cont=" + cont,typ, pov);}
	}
}


function FormPass(udalost,typ)
{
	udalost = (udalost) ? udalost: window.event;
	txt = (udalost.target) ? udalost.target : udalost.srcElement;
	if (udalost.type == "blur")
	{
		txt1=document.getElementById("form"+typ).value;
		txt2=document.getElementById("form"+typ+"1").value;
		if (txt1==txt2)
		{
				document.getElementById("form"+typ+"1").style.backgroundColor="white";
				var obr= document.getElementById("over"+typ+"1");
			obr.innerHTML = '<img src="images/ok.png" alt="" />';
		}
		else
		{
				alert('Hesla se neshodují');
				document.getElementById("form"+typ+"1").value="";
				document.getElementById("form"+typ+"1").focus();
					document.getElementById("form"+typ+"1").style.backgroundColor="#F00";
					var obr= document.getElementById("over"+typ+"1");
					obr.innerHTML = '';
		}
	}
}


function SendOdkaz(form) {
var email1 = form.email1.value;
var email2 = form.email2.value;
var jmeno = form.jmeno.value;
var prod_id = form.prod_id.value;
var ses= form.ses.value;
var ntext = document.getElementById("produkt").innerHTML;
xmlHttp = createXmlHttpRequestObject();
	xmlHttp.open("GET", "ajax-sendodkaz.php?email1=" + email1+"&email2="+email2+"&jmeno="+jmeno+"&prod_id="+prod_id+"&ses="+ses+"&ntext="+ntext);
	xmlHttp.onreadystatechange = function()
	{
		if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
		{
		var nText = document.getElementById("produkt");
		nText.innerHTML = xmlHttp.responseText;

		}
	
	}
	xmlHttp.send(null);
}




function SendDotaz(form) {
var email1 = form.email1.value;
var text = form.text.value;
var jmeno = form.jmeno.value;
var prod_id = form.prod_id.value;
var ses= form.ses.value;
var ntext = document.getElementById("produkt").innerHTML;
xmlHttp = createXmlHttpRequestObject();
	xmlHttp.open("GET", "ajax-senddotaz.php?email1=" + email1+"&text="+text+"&jmeno="+jmeno+"&prod_id="+prod_id+"&ses="+ses+"&ntext="+ntext);
	xmlHttp.onreadystatechange = function()
	{
		if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
		{
		var nText = document.getElementById("produkt");
		nText.innerHTML = xmlHttp.responseText;

		}
	
	}
	xmlHttp.send(null);
}


