function openPopup(img, width, height) {
   if (img && width && height) {
      width = Math.min(width, 640);
      height = Math.min(height, 480);
      var popUp = window.open(img,"popUp","toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=" + width + ",height=" + height);
   }
   return;
}

function win_open(url,winX,breite,hoehe) {
   winmv = window.open(url,winX,"scrollbars=yes,width=" +breite+",height="+hoehe);
   winmv.erzeuger=self;
   mvcheck();
}
function wopen(url,winX,breite,hoehe) {
   win1 = window.open(url,winX,"width=" +breite+",height="+hoehe);
   check();
}
function check() {
   if (win1 == null) return;
   if(win1.focus != null) win1.focus();
}
function mvcheck() {
   if (win1 == null) return;
   if(win1.focus != null) win1.focus();
}

function wClose() {
   window.close(self);
}

function textCounter(field, countfield, maxlimit) {
   if (field.value.length > maxlimit)
      field.value = field.value.substring(0, maxlimit);
   else
   countfield.value = maxlimit - field.value.length;
}



function chk_links(){
  if(document.speichern.mail.value == ""){
     alert("bitte die e-mailadresse eingeben");
     document.speichern.mail.focus();
     return false;
  }
  if(document.speichern.thema.value == ""){
     alert("bitte die linkbezeichnung eingeben");
     document.speichern.thema.focus();
     return false;
  }
  if(document.speichern.link.value == ""){
     alert("bitte die url eingeben");
     document.speichern.link.focus();
     return false;
  }
}

function printWindow() {
  bV = parseInt(navigator.appVersion);
       if (bV >= 4) window.print();
}

function GoSearch(x,fl,it) {
   if(x == "nothing") {
         document.forms[0].reset();
         document.forms[0].elements[0].blur();
         return;
    } else {
         location.href=fl+it+"="+x;
         document.forms[0].reset();
         document.forms[0].elements[0].blur();
    }
}

/* amazon */
var current = -1;
var names = Array("amazon");
function set_select(num) {
  if (current != -1)
    document.getElementById( "div_select_"+names[current] ).style.display = 'none';
    document.getElementById( "div_select_"+names[num] ).style.display = 'block';
    current = num;
}

/* angebote */
var cur = -1;
var ang = Array("sitesearch","angebot");
function show_cont(num) {
  if (cur != -1)
    document.getElementById( "div_show_"+ang[cur] ).style.display = 'none';
    document.getElementById( "div_show_"+ang[num] ).style.display = 'block';
    cur = num;
  if (cur == 0)
    document.getElementById( "div_show_"+ang[1] ).style.display = 'none';
  if (cur == 1)
    document.getElementById( "div_show_"+ang[0] ).style.display = 'none';

}
function Bestaetigung() {
    var x = window.confirm("Diese Funktion löscht den Eintrag unwiederbringlich!\nWollen Sie den Eintrag wirklich löschen?\nBenutzen Sie alternativ die Freigabeoption um die Anzeige zu verhindern.");
    return x;
}