
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 wClose() {
   window.close(self);
}

function win_open(url,winX,breite,hoehe) {
   //winmv = window.open(url,winX,"width=" +breite+",height="+hoehe);
   winmv = window.open(url,winX,"scrollbars=yes,width=" +breite+",height="+hoehe);
   winmv.erzeuger=self;
   mvcheck();
}


function mvcheck() {
   if (winmv == null) return;
   if (winmv.focus != null) winmv.focus();
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
   eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
   if (restore) selObj.selectedIndex=0;
}

function testit() {
   return true;
}

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


function FramesetTest() {
if (top.frames.length==0) {
  Address="index.php";
  if(document.images) top.location.replace(Address);
  else top.location.href=Address;
  }
}
function Jump() {
   if (top.location.search!="") {
       var Size=top.location.search.length;
        var Address=top.location.search.substring(1,Size);
   if(document.images)
      top.nachricht.location.replace(Address);
     else top.nachrict.location.href=Address;
   }
}

/* editor */
function newhtml(js_code) {
   document.news_edit.text.value += js_code;
   document.news_edit.text.focus();
}

function list(js_format) {
   text = prompt("Erstes Listenelement eingeben.","");
   if (text != "" && text != null) {
       js_code = "\n<"+js_format+">\n";
       while (text != "" && text != null) {
           js_code += " <li>"+text+"</li>\n";
           text = prompt("Nächstes Listenelement eingeben. (leer für ende)","");
       }
       js_code += "</"+js_format+">";
       newhtml(js_code);
   }
}

function js_link() {
   text = prompt("URL eingeben","http://");
   if (text != "" && text != null) {
       js_code = "<a href=\""+text+"\" target=\'_blank\'>";
       text2 = prompt("Linktext eingeben.","");
       if (text2 == "" || text2 == null) text2 = text;
       js_code += text2+"</a>";
       newhtml(js_code);
   }
}


function GoRessort(x,fl) {
   if(x == "nothing") {
      document.forms[0].reset();
      document.forms[0].elements[0].blur();
      return;
    } else {
      location.href=fl+".php?aktion=rs&ressort_id="+x;
      document.forms[0].reset();
      document.forms[0].elements[0].blur();
    }
}


function GoBundesland(x,fl) {

   if(x == "nothing") {
       document.forms[0].reset();
       document.forms[0].elements[0].blur();
       return;
   } else {
       location.href=fl+".php?aktion=rs&bundesland="+x;
       document.forms[0].reset();
       document.forms[0].elements[0].blur();
    }
}

function GoFeeds(x,fl) {
   if(x == "nothing") {
       document.forms[0].reset();
       document.forms[0].elements[0].blur();
       return;
   } else {
       location.href=fl+".php?aktion=ls&feed_id="+x;
       document.forms[0].reset();
       document.forms[0].elements[0].blur();
    }
}

function updateBundesland(x) {
   document.forms[0].bundesLand.value = x;
}


function show(x) {

   if(document.getElementById){
       if(x=="Deutschland"){
         document.getElementById("de").
          style.visibility = "visible";

           document.getElementById("at").
           style.visibility = "hidden";
           document.getElementById("ch").
           style.visibility = "hidden";

      }
      if(x=="Österreich"){
          document.getElementById("at").
          style.visibility = "visible";

           document.getElementById("de").
           style.visibility = "hidden";
           document.getElementById("ch").
           style.visibility = "hidden";


      }
      if(x=="Schweiz"){
          document.getElementById("ch").
          style.visibility = "visible";

           document.getElementById("de").
           style.visibility = "hidden";
           document.getElementById("at").
           style.visibility = "hidden";
      }
       if(x==""){
           document.getElementById("ch").
           style.visibility = "hidden";

           document.getElementById("de").
           style.visibility = "hidden";
           document.getElementById("at").
           style.visibility = "hidden";
       }
   }
}


function copy_media(user_id,fld){
   if (opener && !opener.closed){
      opener.document.forms["news_edit"].elements[fld].value = user_id;
   }
   wClose();
}

function GoMediakind(x,fl) {
   if(x == "nothing") {
       document.forms[0].reset();
       document.forms[0].elements[0].blur();
       return;
   } else {
       location.href=fl+"?aktion=sort&media="+x;
       document.forms[0].reset();
       document.forms[0].elements[0].blur();
    }
}
function GoSort1(x,fl) {
   if(x == "nothing") {
       document.forms[0].reset();
       document.forms[0].elements[0].blur();
       return;
   } else {
       location.href=fl+"?aktion=sort1&media="+x;
       document.forms[0].reset();
       document.forms[0].elements[0].blur();
    }
}
function GoPublDate(x,fl) {
   if(x == "nothing") {
       document.forms[0].reset();
       document.forms[0].elements[0].blur();
       return;
   } else {
       location.href=fl+"?aktion=ce&publ_datum="+x;
       document.forms[0].reset();
       document.forms[0].elements[0].blur();
    }
}
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;
}

function showInFrame(x) {
   if(x != "nothing") {
       parent['contentframe'].location.href = x;
   }
}

function GoMailRessort(x,fl) {
   if(x == "nothing") {
      document.forms[0].reset();
      document.forms[0].elements[0].blur();
      return;
    } else {
      location.href=fl+".php?aktion=search&search_what=tags&item="+x;
      document.forms[0].reset();
      document.forms[0].elements[0].blur();
    }
}