/*
  Popup code. Based on Lightbox JS by Lokesh Dhakar.
  License agreement included below.
*/

/*
	Lightbox JS: Fullsize Image Overlays 
	by Lokesh Dhakar - http://www.huddletogether.com

	For more information on this script, visit:
	http://huddletogether.com/projects/lightbox/

	Licensed under the Creative Commons Attribution 2.5 License - http://creativecommons.org/licenses/by/2.5/
	(basically, do anything you want, just leave my name and link)
*/


//
// lightboxGetPageSize()
// Returns array with page width, height and window width, height
// Core code from - quirksmode.org
// Edit for Firefox by pHaez
//

var lightboxIsActive = false;
var currentLightBoxid = 0;

function lightboxGetPageSize() {
  return powerboxGetPageSize();
}

//
// lightboxGetPageScroll()
// Returns array with x,y page scroll values.
// Core code from - quirksmode.org
//
function lightboxGetPageScroll() {
  return powerboxGetPageScroll();
}


//
// lightboxShow()
// Preloads images. Pleaces new image in lightbox then centers and displays.
//
function lightboxShow(width, title, content, overlay, delParam, prefix, closeButtonCSS, closeButtonOnClick, multiOverlay, lId) {

  var temp = new Array();
  temp['id'] = (typeof(lId) != "undefined") ? "old"+lId : "old";

  temp['width'] = ""; //(typeof(width) != "undefined") ? width : "";
  temp['closeButton'] = false;

  while (typeof title == "object") {
    for(i=1 ; i<title.length ; i++) {
      if (typeof title[i] == "string") {
        if (title[i] == "notitle")
          temp['titleUse'] = false;
        if (title[i] == "lefttitle")
          temp['titleAlign'] = "left";
        if (title[i] == "closebutton")
          temp['closeButton'] = true;
      }
    }
    title = title[0];
  }

  temp['title'] = (typeof(title) != "undefined") ? title : "";
  temp['content'] = (typeof(content) != "undefined") ? content : "";
  temp['prefix'] = (typeof(prefix) != "undefined" && prefix != "") ? prefix : "";
  temp['closeButtonCSS'] = (typeof(closeButtonCSS) != "undefined" && closeButtonCSS != "") ? closeButtonCSS : "";
  temp['closeButtonOnClick'] = (typeof(closeButtonOnClick) != "undefined") ? closeButtonOnClick : "lightboxIsActive = false;";
  temp['border'] = 0;

  lightboxIsActive = true;
  return powerboxShow(temp);
}


//
// lightboxHide()
//
function lightboxHide(lId) {
  lightboxIsActive = false;
  powerboxHide(lId);
}


//
// lightboxSetPos()
//
function lightboxSetPos(x, y, lId) {
  powerboxSetPos(x, y, lId);
}


//
// lightboxSetPosX()
//
function lightboxSetPosX(x, lId) {
  powerboxSetPosX(x, lId);
}


//
// lightboxSetPosY()
//
function lightboxSetPosY(y, lId) {
  powerboxSetPosY(y, lId);
}


//
// lightboxSetPosRelativeMouse()
//
function lightboxSetPosRelativeMouse(x, y, lId) {
  powerboxSetPos(mx + x, my + y, lId);
}


//
// lightboxInit()
// Adds the following to the top of the body:
// <div id="overlay"></div>
// <div id="lightbox">
//   <div id="lightboxContent"></div>
// </div>
//
function lightboxInit(forceReplace) {
  return true;
}

function showLicenceAgreement(width, btnId, agreeAction, disagreeAction) {
  var disagreeBtn = createJSBtn(btnId+"_disagree", disagreeAction, "Disagree");
  var agreeBtn = createJSBtn(btnId+"_agree", agreeAction, "Agree", "account");
  
  var contentTest = "<table cellspacing=15 cellpadding=0 border=0>";
  contentTest += "<tr><td colspan=2>"+licenceText+"</td></tr><tr>";
  contentTest += "<td width='50%' align=center>"+disagreeBtn+"</td>";
  contentTest += "<td width='50%' align=center>"+agreeBtn+"</td></tr></table>";
  
	lightboxInit();
	lightboxShow(500,licenceTitle,contentTest);
}
