
var newWindow = null
function makeNewWindow(name,width,height) {
  var rozmery = null
  
rozmery = "HEIGHT=" + height + ",WIDTH=" + width
  //if (text==undefined) text = ""
 // store new window object in global variable
 newWindow = window.open("","","scrollbars=no,"+rozmery)
 if (newWindow != null) {
  // assemble content for new window
  var newContent = "<HTML><HEAD><TITLE>Mebaco - kliknutim na obrazek okno zavrete</TITLE></HEAD>"
  newContent += "<BODY LEFTMARGIN=0 TOPMARGIN=0 MARGINHEIGHT=0 MARGINWIDTH=0 BGCOLOR='#C0C0CC'>"
  newContent += "<IMG SRC=" + name + " BORDER=0 ALIGN='CENTER' TITLE='Kliknutim na obrazek okno zavrete' VSPACE=0 onclick='self.close()'>"
     

  newContent += "</BODY></HTML>"
  // write HTML to new window document
  newWindow.document.write(newContent)
  newWindow.document.close()
 }
}

function ImageLauncher(url) { 
  window.open(url,"","toolbar=no,scrollbars=no,location=no,status=no,width=480,height=500,resizable=0");
}

function ImageLauncher1(url) { 
  window.open(url,"","toolbar=yes,scrollbars=no,location=no,status=no,width=320,height=550,resizable=0");
}

function showPic(picID, itemID){
		var popupURL = "http://localhost/pejskar/img.php?picID=" + picID + "&itemID=" + itemID;
		window.open(popupURL, "pejskar", 'toolbar=0,location=0,directories=0,status=0,menubar=0,width=500,height=600,scrollbars=yes,resizable=yes');	
}

/*
function kontrola() {
  var text = self.document.forms.inzerce.plemeno.value;
  var je_ok = text != "off";
  if (je_ok == false) {
    if (confirm(\"Nezvolili jste plemeno. Chcete pokračovat?\")) {
      return true;
    } else {
      return false;
    }
  } else {
    return true;
  }
}
*/

/*
AJAX dotaz
id  - id dom objektu kam se vlozi vysledek
url - url volaneho scriptu 
*/
function getText(id,url) {
    
    if (url != 0) {
	    if (window.ActiveXObject) {httpRequest = new ActiveXObject("Microsoft.XMLHTTP");}
        else {httpRequest = new XMLHttpRequest();}
            
        httpRequest.open("GET", url, true);
        httpRequest.onreadystatechange= function() {processRequest(id); } ;
        httpRequest.send(null);
    }
    else {document.getElementById(id).innerHTML = "";}
}
function processRequest(id) {
	if (httpRequest.readyState == 4) {
	   if(httpRequest.status == 200) {
          var mistoZobrazeni = document.getElementById(id);
          mistoZobrazeni.innerHTML = httpRequest.responseText;
        }
        else {alert("Chyba pri nacitani stranky "+ httpRequest.status +" : "+ httpRequest.statusText);}
	}
}
