function showSearchNavi(){
  document.getElementById('navpointSearch').style.display = 'none';
  fadeInAndFocus('frmSearch', 'searchMoreServices');
  document.getElementById('frmSearch').search.focus();
}
          
function fadeInAndFocus(idToFade, idFocus){
  fadeInCore(idToFade, 0, 100, 500, idFocus);
}

function fadeInCore(id, from, to, millisec, idFocus){
  var speed = Math.round(millisec / 100);
  var timer = 0;

  if(from > to){
    for(i = from; i >= to; i--){
      setTimeout("setOpacity(" + i + ",'" + id + "','" + idFocus + "')",(timer * speed));
      timer++;
    }
  } 
  else if(from < to){
    for(i = from; i <= to; i++){
      setTimeout("setOpacity(" + i + ",'" + id + "','" + idFocus + "')",(timer * speed));
      timer++;
    }
  }
}

function setOpacity(opacity, id, idFocus) {
  var element = document.getElementById(id);
  element.style.display = 'block';
  if(idFocus){
    document.getElementById(idFocus).focus();
  }
  if(document.all){
    element.style.filter = "alpha(opacity=" + opacity + ")";
  }
  else{
    element.style.opacity    = opacity / 100;
    element.style.MozOpacity = opacity / 100;
  }
} 

var getUrlFunctionResult;
var resultFunctions = new Array();
var requests        = new Array();

function getUrlAjax(url, functionResult, variable){
  var requestObject = new requestObjectGET(url, functionResult, variable);
}

function embedString(elementId, string){
  document.getElementById(elementId).innerHTML = string;
}

function requestObjectGET(url, functionResult, variable){
  if(typeof functionResult == 'function'){
    var id              = resultFunctions.length;

    this.request        = null;

    if(document.all){
      this.request = new ActiveXObject("Microsoft.XMLHTTP");
    }
    else{
      this.request = new XMLHttpRequest();
    }

    resultFunctions.push(functionResult);

    requests.push(this.request);

    this.request.open('GET', url, true);

    this.request.onreadystatechange = function(){
      var requestObject = requests[id];
      if(requestObject.readyState == 4){

        if(requestObject.status == '200'){
          resultFunctions[id](requestObject.responseText, variable);
        }
      }
    }

    this.request.send('');
  }
}



function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


// Blendet Layer ein / aus

function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}


////////////////////////////////////////////////////////////////
//
// Beschreibung: Button Switch
//
////////////////////////////////////////////////////////////////

function hoverButton(bID,mode,context){
  var buttonOuter = document.getElementById(bID);
  
  if (context == 'small'){
    var class_off = 'formBuisness wglButtonCustomSmall';
    var class_on = 'formBuisness wglButtonCustomSmallOver';
  } else if (context == 'inline'){
    var class_off = 'formBuisness wglButtonCustom';
    var class_on = 'formBuisness wglButtonCustomOver';
  } else if (context == 'login'){
    var class_off = 'formBuisness wglButtonCustomLogin';
    var class_on = 'formBuisness wglButtonCustomLoginOver';
  } else if (context == 'registration'){
    var class_off = 'formBuisness wglButtonCustomRegistration';
    var class_on = 'formBuisness wglButtonCustomRegistrationOver';
  } else {
    var class_off = 'formBuisness wglButtonCustomStandard';
    var class_on = 'formBuisness wglButtonCustomStandardOver';
  }

  if (mode == 'over'){
    buttonOuter.className = class_on;
  } else {
    buttonOuter.className = class_off;
  }
}

