/* style XP communications scriptlibary - 2009 */

// changes images and text on popupwindow
function changeImage(imageID){
 if(document.getElementById(imageID) != null && document.getElementById(imageID+"Text") != null){
  // Inhalte auslesen und zwischenspeichern
  var img = document.getElementById(imageID).firstChild;
  if(document.getElementById("contentBig") != null && document.getElementById("contentImageDescription") != null){
    document.getElementById("contentBig").style.backgroundImage = "url("+img.src+")"; // neues Hintergrundbild
    document.getElementById("contentImageDescription").innerHTML = document.getElementById(imageID+"Text").innerHTML; // neuer Text
  }
 }
}

function showMoreContent(contentDiv, slidedirection){
if (slidedirection!= null){ 
    //show content
    if (slidedirection=='IN' || slidedirection=='In' || slidedirection=='in'){ slideDivIn(contentDiv);}
    //hide content
    if (slidedirection=='OUT' || slidedirection=='Out' || slidedirection=='out'){ slideDivOut(contentDiv);}
}
}

function slideDivIn(divId){ 
  var myFx = $(divId);
  var myFxFade = new Fx.Slide(divId);
  if(myFx != null && myFx.getStyle("display") == "none"){ myFx.setStyle("display", "block");myFxFade.hide();}
  if(myFx != null && myFx.getStyle("visibility") == "hidden"){ myFx.setStyle("visibility", "visible");}
  myFxFade.slideIn();
}
function slideDivOut(divId){
  if(document.getElementById(divId) != null){
    var myFxFade = new Fx.Slide(divId);
    myFxFade.slideOut();
  }
}
function fadeDivIn(divId){ 
  var myFx = $(divId);
  if(myFx != null && myFx.getStyle("display") == "none"){ myFx.setStyle("display", "block");myFx.setStyle("opacity",0)}
  if(myFx != null && myFx.getStyle("opacity") == 0){ myFx.set('tween', {duration: 500}).fade('in');}  
}

function fadeDivOut(divId){
  var myFx = $(divId);
  if(myFx != null && myFx.getStyle("opacity") == 1){ myFx.set('tween', {duration: 500}).fade('out');}  
}
