

function openColorBox(k,txt,hoehe,breite,fileK,file,p){
  //alert(k+' : '+fileK+' : '+file);
  //var colorboxallwrap = document.getElementById('colorboxallwrap');
  //colorboxallwrap.style.display = '';
 // alert('open');
  /* if(document.getElementById(p)){
    FadeEffect(p);
    //FadeEffect('colorbox-fade'); 
  }   */
  if(document.getElementById(p)){
    FadeEffect(p);
    ShowEffect('colorbox_'+k, 1);
    //SquishEffect(p);       
   // blindUpEffect('colorbox_'+p);
  }
    
  var cbox = document.getElementById('colorbox_'+k);
  var colorboxwrap = document.getElementById('colorbox-wrap');
  
  breite = breite +20;
  if(breite > 896){
    var abstand = (1000 - breite) / 2;
    //colorboxwrap.style.width = breite+'px';
    colorboxwrap.style.left = abstand+'px';
  }else{
    var abstand = (896 - breite) / 2;
    cbox.style.marginLeft = abstand+'px';
  }
  var boxtxt1 = document.getElementById('boxtext1'+k);
  var boxtxt2 = document.getElementById('boxtext2'+k);
  boxtxt1.style.display = '';
  boxtxt2.style.display = 'none';
  if(txt == 2){
    boxtxt1.style.display = 'none';
    boxtxt2.style.display = '';
  }
  
  var fileK = document.getElementById(fileK);
  fileK.src = file;
  fileK.width = breite;
  fileK.height = hoehe;
  document.getElementById('img_'+k).style.display = ''; 
  
  if(!document.getElementById(p)){
    /* FadeEffect(p);
    ShowEffect('colorbox_'+k);
   // blindUpEffect('colorbox_'+p);
  }else{ */
   // blindDownEffect('colorbox_'+k);
  //  ShowEffect('colorbox-fade');
    setTimeout("ShowEffect('overlay', 0.8)",1000);
    ShowEffect('colorbox-wrap', 1);
    //GrowEffect('colorbox-wrap');
    colorboxwrap.style.display = '';
    colorboxwrap.style.zIndex = '1000';
  }
  
 // ShowEffect('colorbox-fade');
 // ShowEffect('colorbox-wrap');
  //cbox.style.display = '';
  showCBox(cbox);
 // ShowEffect('colorbox_'+k);
  
  /* if(document.getElementById(p)){
    closeColorBox(p);
  } */
 // document.getElementById('colorbox-fade').display = '';
  
}
function showCBox(cbox) {
  cbox.style.display = '';
}


function SquishEffect(element){
   new Effect.Squish(element);
}
function GrowEffect(element){
  new Effect.Grow(element);
}

function ShowEffect(element, fadeto){
   new Effect.Appear(element,{ duration: 2.0, from: 0, to: fadeto });
}
function FadeEffect(element){
  // new Effect.Fade(element,{ duration: 2.0, from: 1, to: 0 });
   new Effect.Fade(element,{ duration: 1.0});
}
function blindUpEffect(element){
   new Effect.BlindUp(element, {duration:3});
}
function blindDownEffect(element){
   new Effect.BlindDown(element, {duration:3});
}


function closeColorBox(k,anc){
  //alert('close');
    
  //FadeEffect('colorbox-wrap'); 
  //FadeEffect('colorbox-fade');
  FadeEffect('colorbox-wrap'); 
 // FadeEffect('colorbox-fade');
  FadeEffect('overlay');  
  FadeEffect(k);
 // document.getElementById('colorbox-fade').display = 'none';
  
    
  var colorboxwrap = document.getElementById('colorbox-wrap');
  colorboxwrap.style.display = 'none';
  var kbox = document.getElementById(k);
  kbox.style.display = 'none'; 
  
  document.getElementById('overlay').display = 'none';
}

 // go_anchor(anc);
/* function go_anchor(n){
  document.getElementById("motiongallery").scrollTop = document.getElementById(n).offsetTop;
} */


function openBox(k,file,bildbreite,bildhoehe,zeile1,zeile2,txt_url,file_ausstellung){
  
  var el = document.getElementById('colorbox-wrap');
  el.style.display = '';
  el.style.zIndex = '1000';
  
  var el1 = document.getElementById('colorbox');
  
  var img = document.getElementById('colorbox-img');  
  img.src = file;
  img.width = bildbreite;
  img.height = bildhoehe;
  
  var textwrap = document.getElementById('text-wrap2');
  
  var txt1 = document.getElementById('colorbox-zeile1');
  txt1.innerHTML = zeile1;  
  
  var txt2 = document.getElementById('colorbox-zeile2');
  txt2.innerHTML = zeile2;  
}

function closeBox(){
  var colorboxallwrap = document.getElementById('colorboxallwrap');
  colorboxallwrap.style.display = 'none';
  var el = document.getElementById('colorbox-wrap');
  el.style.display = 'none';
  el.style.zIndex = '0';  
}


function openWindowBox(width,height){  
  boxWindow = window.open("","boxWindow","width=" + (width + 60) + ",scrollbars=yes,menubar=no,location=no,toolbar=no,dependent=yes");
  boxWindow.focus();
}

function openWindowBox2(x,width,height,target){
  boxWindow = window.open(""+x+"",""+target+"","width=" + (width + 40) + ",height=" + (height + 98) + ",toolbar=no,menubar=no,locationbar=no,location=no,resizable=yes,scrollbars=no,dependent=yes");
  boxWindow.focus();
}

function openWindowBox3(x,width,height,target){
  boxWindow = window.open(""+x+"",""+target+"","width=" + (width + 40) + ",height=" + (height + 98) + ",toolbar=no,menubar=no,locationbar=no,location=no,resizable=yes,scrollbars=yes,dependent=yes");
  boxWindow.focus();
}

function resizeWindow(width,height){  
  window.resizeTo(width,height);
}

