var roll = new Array(); //rollover imgs
var norm = new Array(); //normal imgs
var navitems = new Array("news", "archive", "workshops", "consulting", "portfolio", "about", "contact", "gallery", "forum", "chat", "community", "tips", "dixi", "radio");

for (i=0;i<navitems.length;i++) {
  curritem=navitems[i];
  roll[curritem] = new Image(); roll[curritem].src="/img/nav_"+curritem+"_r.gif";
  norm[curritem] = new Image(); norm[curritem].src="/img/nav_"+curritem+"_n.gif";
}

//mouse(over|out)
function moo(img_name,moo_action) {
  if (document.images) {
    switch(moo_action)
      {
      case 1: document.images[img_name].src = roll[img_name].src;break;
      case 2: document.images[img_name].src = norm[img_name].src;break;
      }
  }
}

function check_contactform() {
  var missing_fields="";
  var imel=document.cofo.input_email.value;
  if (imel.indexOf("@")==-1 || imel.indexOf(".")==-1) 	missing_fields+="\n- Your email";
  if (document.cofo.input_text.value=="") 		missing_fields+="\n- Your message";
  if (missing_fields!="") {
    alert("The following field(s) are not filled out correctly: "+missing_fields);
    return false;
  }
  else return true;
}
function check_forumform() {
  var missing_fields="";
  if (document.forms[0].f_title.value=="")	missing_fields+="\n- Titel Ihres Beitrages";
  if (document.forms[0].f_text.value=="") 	missing_fields+="\n- Text Ihres Beitrages";
  if (document.forms[0].f_name.value=="") 	missing_fields+="\n- Ihr Name";
  if (missing_fields!="") {
    alert("Bitte noch die folgenden Felder ausfüllen: "+missing_fields);
    return false;
  }
  else return true;
}

function gallery_slide(gid) { //top=230,left=300,screenX=300,screenY=230, 
    var winHeight=550;
    var winWidth=440;
    winTop=(screen.height-winHeight)/2 - 20;
    winLeft=(screen.width-winWidth)/2;
    winPosStr="screenX="+winLeft+",left="+winLeft+",screenY="+winTop+",top="+winTop;

    galwin=window.open("gallery_slide.php?gid="+gid, "gallery", "width="+winWidth+",height="+winHeight+",innerWidth="+winWidth+",location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no,"+winPosStr);
  if (galwin.focus) galwin.focus();
}

function explain(term) {
    var winHeight=580;
    var winWidth=440;
    winTop=(screen.height-winHeight)/2 - 20;
    winLeft=(screen.width-winWidth)/2;
    winPosStr="screenX="+winLeft+",left="+winLeft+",screenY="+winTop+",top="+winTop;

    glosswin=window.open("glossary_explanation.php?term="+term, "glossary", "width="+winWidth+",height="+winHeight+",innerWidth="+winWidth+",location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no,"+winPosStr);
  if (glosswin.focus) glosswin.focus();
}

function explain_en(term) {
    var winHeight=580;
    var winWidth=440;
    winTop=(screen.height-winHeight)/2 - 20;
    winLeft=(screen.width-winWidth)/2;
    winPosStr="screenX="+winLeft+",left="+winLeft+",screenY="+winTop+",top="+winTop;

    glosswin=window.open("glossary_explanation_en.php?term="+term, "glossary", "width="+winWidth+",height="+winHeight+",innerWidth="+winWidth+",location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no,"+winPosStr);
  if (glosswin.focus) glosswin.focus();
}



