
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("","",rozmery)
 if (newWindow != null) {
  // assemble content for new window
  var newContent = "<HTML><HEAD><TITLE>www.sivak.cz - 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/relaxpark/img.php?picID=" + picID + "&itemID=" + itemID;
		window.open(popupURL, "donetta", 'toolbar=0,location=0,directories=0,status=0,menubar=0,width=500,height=600,scrollbars=yes,resizable=yes');	
}

function AddFavorite(linkObj,addUrl,addTitle) 
{ 
  if (document.all && !window.opera) 
  { 
    window.external.AddFavorite(addUrl,addTitle); 
    return false; 
  } 
  else if (window.opera && window.print) 
  { 
    linkObj.title = addTitle; 
    return true; 
  } 
  else if ((typeof window.sidebar == 'object') && (typeof window.sidebar.addPanel == 'function')) 
  { 
    if (window.confirm('Přidat oblíbenou stránku jako nový panel?')) 
    { 
      window.sidebar.addPanel(addTitle,addUrl,''); 
      return false; 
    } 
  } 
  window.alert('Po potvrzení stiskněte CTRL-D,\nstránka bude přidána k vašim oblíbeným odkazům.'); 
  return false; 
} 



/* parseUri JS v0.1.1, by Steven Levithan <http://stevenlevithan.com>
Splits any well-formed URI into the following parts (all are optional):
----------------------
- source (since the exec method returns the entire match as key 0, we might as well use it)
- protocol (i.e., scheme)
- authority (includes both the domain and port)
  - domain (i.e., host; can be an IP address)
  - port
- path (includes both the directory path and filename)
  - directoryPath (supports directories with periods, and without a trailing backslash)
  - fileName
- query (does not include the leading question mark)
- anchor (i.e., fragment) */
function parseUri(sourceUri){
	var uriPartNames = ["source","protocol","authority","domain","port","path","directoryPath","fileName","query","anchor"],
		uriParts = new RegExp("^(?:([^:/?#.]+):)?(?://)?(([^:/?#]*)(?::(\\d*))?)((/(?:[^?#](?![^?#/]*\\.[^?#/.]+(?:[\\?#]|$)))*/?)?([^?#/]*))?(?:\\?([^#]*))?(?:#(.*))?").exec(sourceUri),
		uri = {};

	for(var i = 0; i < 10; i++){
		uri[uriPartNames[i]] = (uriParts[i] ? uriParts[i] : "");
	}

	/* Always end directoryPath with a trailing backslash if a path was present in the source URI
	Note that a trailing backslash is NOT automatically inserted within or appended to the "path" key */
	if(uri.directoryPath.length > 0){
		uri.directoryPath = uri.directoryPath.replace(/\/?$/, "/");
	}

	return uri;
}

function strpos(haystack, needle, offset) {
    // Finds position of first occurrence of a string within another
    //
    // version: 909.322
    // discuss at: http://phpjs.org/functions/strpos    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Onno Marsman
    // +   bugfixed by: Daniel Esteban
    // *     example 1: strpos('Kevin van Zonneveld', 'e', 5);
    // *     returns 1: 14
    var i = (haystack+'').indexOf(needle, (offset ? offset : 0));
    return i === -1 ? false : i;
}

function zobraz(name){
  if (document.getElementById(name).style.display=='none'){
    document.getElementById(name).style.display = "";
  }
  else {
    document.getElementById(name).style.display = "none";
  }
}


/*
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;
  }
}
*/
