

p = new Image();
p.src="obr/pink.gif";



sip_r = new Image();
sip_r.src="obr/sipka.gif";

sip_l = new Image();
sip_l.src="obr/sipka_l.gif";


// window.defaultStatus = "ABI TUNING";
// window.status = "ABI Status";

function uprform(cislo)
	{
	if(cislo == 4) 	{document.getElementById('include_php').style.display='block';	}
	else			{document.getElementById('include_php').style.display='none';	}
	}
	

function vymazkos(polozka)
	{
	document.getElementById(polozka).value = 0;
	document.getElementById('kos_form').submit();
	}
	

function sub(elem)
	{
	// alert(document.body.scrollTop);
	document.getElementById('scroll').value = document.body.scrollTop;
	//document.body.getElementById("scroll").value = document.body.scrollTop;
	document.getElementById(elem).innerHTML="<br><br><br><br><br><div  class='transfer' align=\"center\">Odesílám data, čekejte prosím.<img src=\"obr/pink.gif\" width=\"90\" height=\"13\" border=\"0\" alt=\"transfer\" vspace=\"0\" hspace=\"1\" align=\"absbottom\"></div>"; 

	document.getElementById('edit_p').style.visibility = "hidden";
	//document.body.scrollTop = 0;
	
/* */
	 //alert(document.getElementById("scroll").value);
	 //alert("stop");
	}
	
function shop()
	{	
	if (document.getElementById('cena').value != "") 
		{
		document.getElementById('eshop').checked = true; 
		}
	}
	
function sub1(elem)
	{
	// alert(document.body.scrollTop);
	document.getElementById('eshop').focus();
	document.getElementById('scroll').value = document.body.scrollTop;
	document.getElementById(elem).innerHTML="<br><br><div  class='transfer' align=\"center\">Odesílám data, čekejte prosím.<img src=\"obr/pink.gif\" width=\"90\" height=\"13\" border=\"0\" alt=\"transfer\" vspace=\"0\" hspace=\"1\" align=\"absbottom\"></div>"; 
	}
	
function rozbal(pid)
	{
	// alert(pid+" --- "+document.getElementById(pid).style.display);
	if (document.getElementById(pid) != null) 	//alert("existuje");
		{
		if (document.getElementById(pid).style.display == "block")
			{
			return true;
			}
		else
			{
			document.getElementById(pid).style.display = "block";
			return false;	
			}
		}
	else return true;
	}	
	
function folders(pid)
	{
	// alert(pid+" --- "+document.getElementById(pid).style.display);
	if (document.getElementById(pid) != null) 	//alert("existuje");
		{
		if (document.getElementById(pid).style.display == "block")
			{
			document.getElementById(pid).style.display = "none";
			}
		else
			{
			document.getElementById(pid).style.display = "block";
			}
		}
	}		
	
function pozice(poloha)
	{
	document.body.scrollTop = poloha;
	}
	
	
	
function dosad(kam,co)
	{
	document.getElementById(kam).value = co;
	}	
	
	
	
	//  copy z poryby
function pol2()
	{
	document.all['zapi'].style.visibility = "hidden";
	// <?  if(!$p2) $p2=0 ?>
	// document.body.scrollTop=<? echo $p2;?> ; 
	}
	// xxx copy z poryby
	

function smazat(co)
	{
	pokracovat = confirm("Opravdu chcete nenávratně smazat "+co+"?");
	if( pokracovat )
		{
		//alert ("true");
		// sub('load'); 
		return true;
		}
	else 
		{
		//alert ("false");
		return false;
		}
	}
	
function move(id,akce)
	{
	var hlaska;
	// alert(id);
	// alert(akce);
	document.getElementById("move_id").value = id;
	document.getElementById("move_akce").value = akce;
	sub('load');
	document.edit_p.submit();
	}	
	
function edit(id_str)
	{
	var hlaska;
	// alert(id);
	// alert(akce);
	document.getElementById("edit_str").value = id_str;
	document.edit_p.submit();
	}	
	
	
	
	
function foto_move(id,akce)
	{
	var hlaska;
	document.getElementById("foto_move_id").value = id;
	document.getElementById("foto_move_akce").value = akce;
	document.edit_p.submit();
	}	
	
	
function detail(id)
	{
	if ( document.getElementById(id).style.display == "block" )  document.getElementById(id).style.display="none";
	else document.getElementById(id).style.display = "block";
	}


function detail_sezs(id)
	{
	if ( document.getElementById(id).style.display == "block" )  document.getElementById(id).style.display="none";
	else 
		{
		document.getElementById(id).style.display = "block";
		window.seznam_stranek.location.href = "seznam_stranek.php";
		}
	}	
	
	
	
function list_foto(id_str)
	{
	window.open("edit_foto.php", "fotos", "width=800,height=600,menubar=yes,resizable=yes,left=0,top=0")
	//alert('listuju');

	}	
	
		
function vlozit_foto(id_foto,kam)
	{
	var tm;
	window.opener.document.getElementById("foto_new"+kam).value = id_foto;
	//alert(id_foto);
	window.opener.document.getElementById("nahled_obr_server"+kam).innerHTML='náhled :<br><img src="img.php?src='+id_foto+'" border="0" width="200" height="150" >';
	//if (!id_foto) document.getElementById("nahled_obr"+kam).innerHTML = "";
	window.opener.document.getElementById("i_alt_s"+kam).style.display = "block";

	window.opener.focus();
	/*
	tm = setTimeout('window.opener.moveBy(4,0)', 50);
	tm = setTimeout('window.opener.moveBy(-8,0)', 100);
	tm = setTimeout('window.opener.moveBy(8,0)', 150);
	tm = setTimeout('window.opener.moveBy(-6,0)', 200);
	tm = setTimeout('window.opener.moveBy(2,0)', 250);
	*/
	// tm = setTimeout('window.opener.document.edit_p.submit()', 300);
	}	
	
	
		
function vlozit_soubor(jm_souboru)
	{
	var tm;
	window.opener.document.getElementById("soubor_new0").value = jm_souboru;
	window.opener.document.getElementById("soubor_ze_serveru").innerHTML = "<b>"+jm_souboru+"</b>";
	
	//alert(jm_souboru);
	//window.opener.document.getElementById("nahled_obr_server"+kam).innerHTML='náhled :<br><img src="img.php?src='+jm_souboru+'" border="0" width="200" height="150" >';

	//if (!jm_souboru) document.getElementById("nahled_obr"+kam).innerHTML = "";
	//window.opener.document.getElementById("i_alt_s"+kam).style.display = "block";

	window.opener.focus();
	tm = setTimeout('window.opener.moveBy(4,0)', 50);
	tm = setTimeout('window.opener.moveBy(-8,0)', 100);
	tm = setTimeout('window.opener.moveBy(8,0)', 150);
	tm = setTimeout('window.opener.moveBy(-6,0)', 200);
	tm = setTimeout('window.opener.moveBy(2,0)', 250);
	// tm = setTimeout('window.opener.document.edit_p.submit()', 300);
	}	
			
function sipka_n()
	{
	window.opener.focus();
	//alert(id);
	window.opener.document.getElementById('novy_obr_1').innerHTML="<img src=\"obr/sipka.gif\" border=\"0\" width=\"25\" height=\"7\" >";
	window.opener.document.getElementById('novy_obr_2').innerHTML="<img src=\"obr/sipka_l.gif\" border=\"0\" width=\"25\" height=\"7\" >";
	//window.opener.document.body.scrollTop = 500;
	}	
	
	
	

function sipka(id_str,id_odst,id_fot)
	{
	if (window.opener.document.getElementById("f"+id_fot) == "[object]")
		{
		window.opener.focus();
		window.opener.document.getElementById("f"+id_fot).innerHTML="<img src=\"obr/sipky.gif\" border=\"0\" width=\"120\" height=\"20\" >";	
		}
	else
		{
		//alert(id);
		nahled = window.open("index.php?id_str="+id_str+"&id_fot="+id_fot, "nahled", "width=1000,height=700,location=yes,status=yes,menubar=yes,resizable=yes,scrollbars=yes,left=0,top=0");
		nahled.focus();
		}	
	}	
	
function sipka_doc(id_str,id_odst,id_doc)
	{
	if (window.opener.document.getElementById("d"+id_doc) == "[object]")
		{
		window.opener.focus();
		window.opener.document.getElementById("d"+id_doc).innerHTML="<img src=\"obr/sipka.gif\" border=\"0\" >";	
		}
	else
		{
		//alert(id);
		nahled = window.open("index.php?id_str="+id_str+"&id_doc="+id_doc, "nahled", "width=1000,height=700,location=yes,status=yes,menubar=yes,resizable=yes,scrollbars=yes,left=0,top=0");
		nahled.focus();
		}	
	}		
	
	
function tab_move(id,akce)
	{
	document.getElementById("tab_move_id").value = id;
	document.getElementById("tab_move_akce").value = akce;
	document.edit_p.submit();
	}	
	
	
	
	/*
	
	if (id=="novy_obr" && window.opener.document.getElementById("new_foto").value != ""; )
				{
				alert('odesilam');
				window.opener.document.edit_p.submit();
				}*/
