function loadFrame(url,layerObjNS, width) { 
 if (document.layers){
         document.layers[layerObjNS].load(url, width);
    } else{
         if (window.frames.length > -1){
             window.frames[layerObjNS].location.href = url;
}
}
document.MM_returnValue = false;
}

function potvrditOdkaz(theLink, theQuery)
{
    var is_confirmed = confirm(theQuery);
    return is_confirmed;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

function PopupPic(sPicURL, typStranky, tWidth, tHeight) {
      window.open( "popup.htm?"+sPicURL+"&"+typStranky+"&"+tWidth+"&"+tHeight, "", "resizable=1,HEIGHT=200,WIDTH=200");
}

function AdminPopupPic(sPicURL, typStranky, tWidth, tHeight) {
      window.open( "../cs/popup.htm?"+sPicURL+"&"+typStranky+"&"+tWidth+"&"+tHeight, "", "resizable=1,HEIGHT=200,WIDTH=200");
}


/*************************************************************************
  This code is from Dynamic Web Coding 
  at http://www.dyn-web.com/
  Copyright 2003 by Sharon Paine 
  See Terms of Use at http://www.dyn-web.com/bus/terms.html
  Permission granted to use this code 
  as long as this entire notice is included.
*************************************************************************/

// NOTE: The functions called onmouseover/out plus the message variables need to be included early in the document 
// or errors will be triggered if user hovers over tooltip-activating links before page completely loaded
function doTooltip(e, msg) {
  if ( typeof Tooltip == "undefined" || !Tooltip.ready ) return;
  Tooltip.clearTimer();
  Tooltip.show(e, msg);
}

function hideTip() {
  if ( typeof Tooltip == "undefined" || !Tooltip.ready ) return;
  Tooltip.timerId = setTimeout("Tooltip.hide()", 300);
}

/*************************************************************************

    dw_event.js
    version date June 2003
    to negotiate cross-browser differences in event models
    for browsers that support addEventListener and attachEvent 
        
    This code is from Dynamic Web Coding 
    at http://www.dyn-web.com/
    See Terms of Use at http://www.dyn-web.com/bus/terms.html
    Permission granted to use this code 
    as long as this entire notice is included.

*************************************************************************/

var dw_event = {
  
  add: function(obj, etype, fp, cap) {
    cap = cap || false;
    if (obj.addEventListener) obj.addEventListener(etype, fp, cap);
    else if (obj.attachEvent) obj.attachEvent("on" + etype, fp);
  }, 

  remove: function(obj, etype, fp, cap) {
    cap = cap || false;
    if (obj.removeEventListener) obj.removeEventListener(etype, fp, cap);
    else if (obj.detachEvent) obj.detachEvent("on" + etype, fp);
  }, 

  DOMit: function(e) {
    e = e? e: window.event;
    e.tgt = e.srcElement? e.srcElement: e.target;
    
    // location of event in document
    if (typeof e.pageX != "number") {
      e.pageX = e.clientX  + document.documentElement.scrollLeft + document.body.scrollLeft;
      e.pageY = e.clientY  + document.documentElement.scrollTop + document.body.scrollTop;
    }
    
    if (!e.preventDefault) e.preventDefault = function () { return false; }
    if (!e.stopPropogation) e.stopPropogation = function () { if (window.event) window.event.cancelBubble = true; }
        
    return e;
  }
  
}

/*************************************************************************

  dw_viewport.js
  version date July 2003
  
  This code is from Dynamic Web Coding 
  at http://www.dyn-web.com/
  Copyright 2003 by Sharon Paine 
  See Terms of Use at http://www.dyn-web.com/bus/terms.html
  Permission granted to use this code 
  as long as this entire notice is included.

  Example usage (after body tag or after page loaded):
  viewport.getWinWidth();
  alert(viewport.width)

*************************************************************************/  
  
viewport = {
  getIECanvas: function () {
    var canv = null;
    if (!window.opera && document.all && typeof document.body.clientWidth != "undefined") {
      var cm = document.compatMode && document.compatMode == "CSS1Compat";
      canv = cm? document.documentElement: document.body;
    } 
      return canv;
  },
  
  getWinWidth: function () {
    var canv;
    if ( canv = this.getIECanvas() ) this.width = canv.clientWidth;
    else this.width = window.innerWidth - 18;
  },
  
  getWinHeight: function () {
    var canv;
    if ( canv = this.getIECanvas() ) this.height = canv.clientHeight;
    else this.height = window.innerHeight - 18;
  },
  
  getScrollX: function () {
    var canv;
    if ( canv = this.getIECanvas() ) this.scrollX = canv.scrollLeft;
    else if (window.pageXOffset) this.scrollX = window.pageXOffset;
    else if (window.scrollX) this.scrollX = window.scrollX;
    else this.scrollX = 0;
  },
  
  getScrollY: function () {
    var canv;
    if ( canv = this.getIECanvas() ) this.scrollY = canv.scrollTop;
    else if (window.pageYOffset) this.scrollY = window.pageYOffset;
    else if (window.scrollY) this.scrollY = window.scrollY;
    else this.scrollY = 0;
  },
  
  getAll: function () {
    this.getWinWidth();   this.getWinHeight();
    this.getScrollX(); this.getScrollY();
  }
  
}

function jumpMenu(targ,selObj,restore){
  eval(targ+".location='nakupni-kosik.php?objednavka&dopravne="+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

/**
 * Displays an confirmation box beforme to submit a "DROP/DELETE/ALTER" query.
 * This function is called while clicking links
 *
 * @param   object   the link
 * @param   object   the sql query to submit
 *
 * @return  boolean  whether to run the query or not
 */
function confirmLink(theLink, theQuery)
{
    var is_confirmed = confirm(theQuery);
    if (is_confirmed) {
        theLink.href += '&IS_JS_CONFIRMED=1';
    }

    return is_confirmed;
} // end of the 'confirmLink()' function

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}