

/* JavaScript */
function changeColor() {
    document.getElementById('searchstring').className = "searchstring_extra";
}

/******************************************************************/
/********** Visibility of JS-only Template-Elements ***************/
/******************************************************************/

document.write('<style type="text/css" media="screen">');
document.write('input.searchstring { color: #7A7A7A; font-weight: bold; }');
document.write('<\/style>');

/******************************************************************/
/********** Global popup call *************************************/
/******************************************************************/

function popup_zoom(link_adr,name,scroll,width,height){

      if (width < 300)
      {
        width = 300;
      }
      height = height + 175;
      width = width + 46;
      fen=window.open("" + link_adr,name,"resizable=yes,status=no,scrollbars="+scroll+",toolbar=no,menubar=no,width="+width+",height="+height);
}

/******************************************************************/
/********** Popup zoom image and popup gallery ********************/
/******************************************************************/

function getQueryVariable(variable) {
      var query = window.location.search.substring(1);
      var vars = query.split("&");
      for (var i=0;i<vars.length;i++) {
           var pair = vars[i].split("=");
        if (pair[0] == variable) {
          return pair[1];
        }
      } 
      alert('Query Variable ' + variable + ' not found');
}

function loadpopupimage() {
    var p_image                     = opener.document.getElementById("p_image").innerHTML;
    var p_title                     = opener.document.getElementById("p_image").title;
    
    document.getElementById("c_image").src = p_image;
    document.getElementById("c_image").title = p_title;
}

function loadgalleryimage(id) {
    var p_image                     = opener.document.getElementById("gi_" + id).innerHTML;
    var p_title                     = opener.document.getElementById("gi_" + id).title;
    
    document.getElementById("c_image").src = p_image;
}


/******************************************************************/
/***************** Popup Allgmein *********************************/
/******************************************************************/

function popup_default(URL, Name, width, height, res, scroll) {
    return window.open(URL, Name, "resizable=" + res + ",status=no,scrollbars=" + scroll + ",toolbar=no,menubar=no,width=" + width + ",height=" + height);
}


/******************************************************************/
/***************** Mediathek **************************************/
/******************************************************************/

function medRueck () {
    updateCurId();
    var goTo = curId-1;
    if (curId != 0) {
        document.getElementById('media_iframe').src = flashs1[goTo];
        hilite_media(flashs2[goTo]);
    }
}
function medVor () {
    updateCurId();
    var goTo = curId+1;
    if (curId != (flashs1.length-1)) {
        document.getElementById('media_iframe').src = flashs1[goTo];
        hilite_media(flashs2[goTo]);
    }      
}
function updateCurId() {
    var i;
    for (i=0; i < flashs2.length; i++) {
        if (flashs2[i] == lasthilite )
            curId = i;
    }
}
function enableText( enable, id ) {
    var countField = document.getElementById( id );
    if( enable ) if( countField.value == "" ) countField.value = "1";
    countField.disabled = ! enable;
}

