/* vrati pointer na dany objekt */
function getObject(objectName){
  return document.getElementById(objectName);
}
function isNull(a) {
    return typeof a == 'object' && !a;
}
function LTrim(str){
   var whitespace = new String(" \t\n\r");

   var s = new String(str);

   if (whitespace.indexOf(s.charAt(0)) != -1) {
      var j=0, i = s.length;
      while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
         j++;
      s = s.substring(j, i);
   }
   return s;
}

function RTrim(str){
   var whitespace = new String(" \t\n\r");
   var s = new String(str);

   if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {
      var i = s.length - 1;
      while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
         i--;
      s = s.substring(0, i+1);
   }
   return s;
}	

function trim(str){
	return RTrim(LTrim(str));
}

function js_contain(the_needle, the_haystack){
    if(the_haystack == ''){
        return false;
    }
    var the_pattern = new RegExp(the_needle, 'g');
    var matched = the_pattern.test(the_haystack);
    return matched;
}

/* 29.11.2005 21:28:37 - Otevre obrazek podle parametru */
function openPic(pictureId,width,height){
  popupWin = window.open("/img.php?image_id="+pictureId,"window_"+pictureId,"width="+width+",height="+height+",resizable,scrollbars=no,status=0");
  if(window.moveTo) popupWin.moveTo(((screen.availWidth-width)/2),((screen.availHeight-height)/2) );
  if (window.focus) {popupWin.focus()}  
  return false;
}

function openParam(url){
  return opnWin(url,410,200);
}

function opnWin(url,width,height){
  popupWin = window.open(url,"_blank","width="+width+",height="+height+",resizable,scrollbars=no,status=0");
  if(window.moveTo) popupWin.moveTo(((screen.availWidth-width)/2),((screen.availHeight-height)/2) );
  if (window.focus) {popupWin.focus()}  
  return false;
}

function tisk(){
  self.print();
}
