NAV = 0;
version = navigator.appVersion;

if (navigator.appName == "Netscape") {
  if (version.substring(0,3) >= "4.0")
    NAV = 1;
  else
    if (version.substring(0,3) >= "3.0")
      NAV = 1;
}
else
  if (navigator.appName == "Microsoft Internet Explorer") {
    if (version.substring(0,3) >= "4.0")
      NAV = 1;
  }
  else
    NAV=0;


var popUpWin=0;

function open_popup (URL, left, top, width, height) {
  if (popUpWin)
    if (!popUpWin.closed)
      popUpWin.close();
  popUpWin = open(URL, 'newWindow', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=' + width + ',height=' + height + '');
}

function change_main (URL) {
  opener.location.href = URL;
  opener.focus();
}

function close_site() {
  opener.focus();
  self.close();
}

function open_site() {
  self.focus();
}


function add_smilie (text, feld) {
  if (feld == 'pn')
    var txtarea = document.post.pn_nachricht;
  if (feld == 'forum')
    var txtarea = document.post.forum_nachricht;
  text = ' ' + text + ' ';
  if (txtarea.createTextRange && txtarea.caretPos) {
    var caretPos = txtarea.caretPos;
    caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
    txtarea.focus();
  }
  else {
    txtarea.value += text;
    txtarea.focus();
  }
}


function bookmark() {
  window.external.AddFavorite('http://www.cityclicks.de/','[www.cityclicks.de] - die entertaiment-community');
}


function sure (where, text) {
  if (confirm(text)) {
    window.location.href = where;
  }
}

var open_news = "";

function open_id (id, typ) {
  if (typ == "news") {
    if (open_news == id) {
      open_news = "";
    }
  }
  if(document.getElementById) {
    if(document.getElementById(id).style.display == "none") {
      document.getElementById(id).style.display = "";
    }
    else {
      document.getElementById(id).style.display = "none";
    }
    if (typ == "news") {
      if (open_news) {
        document.getElementById(open_news).style.display = "none";
      }
      open_news = id;
    }
  }
}
