var myWidth = 0;
var myHeight = 0;

function rozmerOkna(){//ziskano z http://www.howtocreate.co.uk/tutorials/javascript/browserwindow
    if( typeof( window.innerWidth ) == 'number' ) {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
        
    } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
        myHeight = document.documentElement.clientHeight;
        
    } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
        
    }

}

function shade(co){
cal = rozmerOkna();
    if (co == "zapnout"){
        document.getElementById('shade').style.width = myWidth+"px";
        document.getElementById('shade').style.height = myHeight+"px";
        document.getElementById('shade').style.zIndex = 190;
        stin = "zapnut";
    }
    if (co == "vypnout"){
        document.getElementById('shade').style.width = "0px";
        document.getElementById('shade').style.height = "0px";
        document.getElementById('shade').style.zIndex = 0;
        stin = "vypnut";
    }
    if (co == "zmena"){
        document.getElementById('shade').style.width = myWidth+"px";
        document.getElementById('shade').style.height = myHeight+"px";
    }
}































































function ukazObrazek(fid)
{
cal = shade("zapnout");
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("Prohlizec neumi xmlHttpRequest, takze si to neuzijete a STAHNETE SI FIREFOX!")
  return
  } 
else{
var url="fotka.php?fid="+fid; //odesila dotaz na server
xmlHttp.onreadystatechange=ukazObrazekStatus 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
} 
function ukazObrazekStatus()  //kdy a kde ukazat vysledek
{ 
document.getElementById("ram").innerHTML = "<center><img src=\"inc/obr/loading.gif\" alt=\"Nahrávám\" /></center>" ;
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("ram").innerHTML = xmlHttp.responseText ;
 } 
}












function GetXmlHttpObject() //objekt requestu 
{
var xmlHttp;
	try
		{
		xmlHttp = new XMLHttpRequest();
		}
	catch(e)
		{
			var XmlHttpVersions = new Array(	'MSXML2.XMLHTTP.6.0',
'MSXML2.XMLHTTP.5.0',
'MSXML2.XMLHTTP.4.0',
'MSXML2.XMLHTTP.3.0',
'MSXML2.XMLHTTP',
'Microsoft.XMLHttp');
			for (var i=0; i<XmlHttpVersions.length && !xmlHttp; i++)			
			{
				try
					{
					xmlHttp = new ActiveXObject(XmlHttpVersions[i]);				
					}		
				catch(e) {}
			}
		}
if (!xmlHttp)
	alert("Chyba pri vytvareni xmlHttp objektu. Your browser suX! Try FIREFOX!");
else 
	return xmlHttp;
}

