// script.js
// zentrale JavaScript-Datei


// Eigene FileBrowser fuer tinyMCE
function myFileBrowser (field_name, url, type, win) {
  // alert("Field_Name: " + field_name + "\nURL: " + url + "\nType: " + type + "\nWin: " + win);
  var fileBrowserWindow = new Array();
  var searchString = "?path_cms=" + cmsPATH + "&opt_file=" + cmsOPTFILE + "&sid=" + cmsSID + "&actfile=" + url;
  if (searchString.length < 1) {
    searchString = "?";
  }
  fileBrowserWindow["file"] = cmsURL + searchString + "&type=" + type;
  fileBrowserWindow["title"] = "File Browser";
  fileBrowserWindow["width"] = "500";
  fileBrowserWindow["height"] = "360";
  fileBrowserWindow["close_previous"] = "no";
  tinyMCE.openWindow(fileBrowserWindow, {
    window : win,
    input : field_name,
    resizable : "yes",
    inline : "yes"
  });
  return false;
}


// Grafikwechsel allgemein
function swapPic (ImgName, ImgUrl) {
  if (document.images) document.images[ImgName].src=ImgUrl;
}


// Neues Browserfenster
function NewBrowserWin (url, name, options) {
  if (!name) { 
    name="NewBrowserWin";
  }
  if (!options) { 
    options="menubar=no,toolbar=no,status=no,scrollbars=yes,resizable=yes,dependent=yes,width=600,height=400";
  }
  NextPage=window.open(url, name, options);
}


// Wechsel der Hintergrundfarbe
function SetbackgroundColor (theElement, theColor) {
  theElement.style.backgroundColor = theColor;
  return true;
}

function doLink(ziel) {
  location.href=ziel;
}
