// popup
// aufruf z.B. mit:  onclick="return popup(this,630,650);"

var pop = null;
function popdown() {
  if (pop && !pop.closed) pop.close();
}

function popup(obj,w,h) {
  var url = (obj.getAttribute) ? obj.getAttribute('href') : obj.href;
  if (!url) return true;
  w = (w) ? w += 20 : 150;  // 150px*150px is the default size
  h = (h) ? h += 25 : 150;
  var args = 'width='+w+',height='+h+',resizable,scrollbars=yes';
  popdown();
  pop = window.open(url,'',args);
  return (pop) ? false : true;
}

// window.onunload = popdown;
// window.onfocus = popdown;





// ColorBox Configuration

$(document).ready(function(){
  $(".callFrame1").colorbox({width:"500", height:"650", transition:"fade", iframe:false});
  $(".callFrame2").colorbox({width:"500", height:"650", iframe:true});


  $(".callImg1").colorbox({width:"50%", height:"50%", iframe:false});
  $(".callImg2").colorbox({width:"70%", height:"70%", iframe:false});
  $(".callImg3").colorbox({width:"90%", height:"90%", iframe:false});

  $("a[rel='callMovie1']").colorbox({width:"570", height:"405", iframe:true});
  $("a[rel='callFrameB']").colorbox({width:"680", height:"840", iframe:true});
  $("a[rel='callSlide']").colorbox({iframe:false, slideshow:true, photo:true });


  $(".callprint").colorbox({width:"900px", height:"800px", iframe:true});
 
  $("a[rel='example1']").colorbox();
  $("a[rel='example2']").colorbox({transition:"fade"});
  $("a[rel='example3']").colorbox({transition:"none", width:"75%", height:"75%"});
  $("a[rel='example4']").colorbox({slideshow:true});
  $(".example5").colorbox();
  $(".example6").colorbox({iframe:true, innerWidth:425, innerHeight:344});
  $(".example8").colorbox({width:"50%", inline:true, href:"#inline_example1"});

  $("#energysaving").colorbox({width:"50%", inline:true, href:"#energysaving_text"});

});


