/*
***************************************************************
*  Copyright
*
*  (c) 2009 websedit AG
***************************************************************
**
 * Allgemeine Javascript-Funktionen
 *
 * $Id: functions.js 0001 2009-01-08 websedit AG, http://www.websedit.de $
 *
 * @author  Daniel Knubben <daniel.knubben (at) websedit.de>
 *

**
 * [CLASS/FUNCTION INDEX of SCRIPT]
 *
 *
 *
*/
function showPicture(title, close, url, katname, img, width, height, mb, sb, rs) {
  getlink = "/php/bilder_popup.php?close="+close+"&url="+url+"&katname="+katname+"&title="+title+"&width="+width+"&height="+height;
  popup = window.open(getlink, title, "width="+width+", height="+height+", menubar="+mb+", scrollbars="+sb+", resizable="+rs);
  popup.name = title;
  popup.focus();
  return false;
}


//PopUp mit allen Funktionen
function websPopupAll(url, width, height, mb, rs, sx, sy, scb, st, tb, top) { //, menubar, resizable, screenX, screenY, scrollbars, status, toolbar, top)
  newWindow = window.open(url,"popup","width=" + width + ",height=" + height + ",menubar=" + mb + ",scrollbars=" + scb + ",screenx="+ sx + ",screeny=" + sy + ",status="+st+",toolbar=" + tb + ",resizable=" + rs);
  newWindow.focus();
}

function bookmark() {
  var doc_title = document.title;
  var doc_url = document.URL;
  if (document.all && !window.opera){ //IE5+
      document.write(" | <a href=\"javascript:window.external.AddFavorite(document.URL,document.title);\" title=\"Lesezeichen f&uuml;r diese Seite setzen\" target=\"_self\">Lesezeichen</a></li>");
  }
  else if ((typeof window.sidebar == 'object') && (typeof window.sidebar.addPanel == 'function')){ //Gecko
      document.write(" | <a href=\"javascript:window.sidebar.addPanel ('" + doc_title + "', '" + doc_url + "','');\" title=\"Lesezeichen f&uuml;r " + doc_title + " setzen\" target=\"_self\">Lesezeichen</a>");
  }
  else{
      document.write(" | <a href=\"" + doc_url + "\" title=\"Lesezeichen f&uuml;r " + doc_title + " setzen\" rel=\"sidebar\" target=\"_self\">Lesezeichen</a>");
  }
}

function indexInArray(arr,val) {
  for(var i=0;i<arr.length;i++) {
    if(arr[i]==val) {
      return i;
    }
  }
    return -1;
}


function highlightCells(one, two, active) {
  if (active) {
    document.getElementById(one).style.backgroundColor='#CAD2E7';
    document.getElementById(two).style.backgroundColor='#CAD2E7';
    document.getElementById(one + '_' + two).style.backgroundColor='#CAD2E7';
  }
  else {
    document.getElementById(one).style.backgroundColor='#203B92';
    document.getElementById(two).style.backgroundColor='#203B92';
    document.getElementById(one + '_' + two).style.backgroundColor='#FFFFFF';
  }
}
