/* aurawaves lightbox
 * Required: http://jquery.com/
 * Written by: Waqas Zahoor
 * License: LGPL (read more in LGPL.txt)
 */

var al_d = false;
var al_h = 400;
var al_w = 400;

function al_show(caption, url, height, width) {
  al_h = height || 300;
  al_w = width || 400;
  if(!al_d) {
    $("#aboutright")
      .append("<div id='al_overlay'></div><div id='al_window'>"
        + "<img src='images/closelightbox.jpg' alt='Close window'/></div>");
    $("#al_window img").click(al_hide);
    $("#al_overlay").click(al_hide);
    $(window).resize(al_position);
    al_d = true;
  }

  $("#al_frame").remove();
  $("#al_window").append("<iframe id='al_frame' frameBorder='0' scrolling='no' src='"+url+"'></iframe>");

//<div id='al_caption'></div>
  //$("#al_caption").html(caption);
  //$("#al_overlay").show();
 // al_position();

 // if(al_ANIMATION)
  //  $("#al_window").slideDown("slow");
 // else
    $("#al_window").fadeIn("slow");
}

function al_hide() {
  $("#al_window,#al_overlay").fadeOut("slow");
}

function al_position() {
  var de = document.documentElement;
  var w = self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
  $("#al_window").css({width:al_w+"px",height:al_h+"px",
    left: ((w - al_w)/2)+"px" });
  $("#al_frame").css("height",al_h - 32 +"px");
}
