var scripts = document.getElementsByTagName('script');
var index = scripts.length - 1;
var gtmScriptUrl = scripts[index];
var queryString = gtmScriptUrl.src.replace(/^[^\?]+\??/, '');

function parseQuery(query) {
  var Params = new Object();
  if (!query) return Params; // return empty object
  var Pairs = query.split(/[;&]/);
  for (var i = 0; i < Pairs.length; i++) {
    var KeyVal = Pairs[i].split('=');
    if (!KeyVal || KeyVal.length != 2) continue;
    var key = unescape(KeyVal[0]); alert(key);
    var val = unescape(KeyVal[1]); alert(val);
    val = val.replace(/\+/g, ' ');
    Params[key] = val;
  }
  return Params;
}

var params = parseQuery(queryString);
var popUpID = popID = params['page'];
alert(popUpId);
var popUpID2 = popID2 = params['id'];
alert(popUpID2);

var exitsplashmessage = 'Stay on our site to give you 20% off.';

window['xyz_pbx_until_cookcheck' + popID] = 0;
window['xyz_pbx_show_splash' + popID] = true;
window['xyz_pbx_rendered' + popID] = false;
window['xyz_pbx_content_showing_option' + popID] = 0;
window['pbx_trigger' + popID] = 1;

window['pbx_trigger_element' + popID] = '';
window['pbx_trigger_onclick_method' + popID] = 1;

window['pbx_id' + popID] = popUpID;
window['pbx_pagecount' + popID] = 1;
window['pbx_repeat' + popID] = 0;
window['pbx_clbt' + popID] = 0;
window['pbx_clbtopt' + popID] = 1;
window['xyz_pbx_pc_cookie_name' + popID];
window['xyz_pbx_pc_cookie_val' + popID];
window['pbx_displayoutopt' + popID] = 1;
window['pbx_draggab' + popID] = 0;
window['pbx_slideab' + popID] = 0;
window['pbx_slidestart' + popID] = 0;
window['pbx_meditpos' + popID] = 1;

window['pbx_wiadjust' + popID];
window['pbx_posit' + popID] = 2;
window['pbx_def_disp' + popID] = 9;
window['pbx_lbxwid' + popID] = 640;
window['pbx_lbxwiddim' + popID] = 'px';
window['pbx_lbxhe' + popID] = 480;
window['pbx_lbxhedim' + popID] = 'px';
window['pbx_lbxtop' + popID] = 25;
window['pbx_lbxtopdim' + popID] = '%';
window['pbx_lbxleft' + popID] = 25;
window['pbx_lbxledim' + popID] = '%';
window['pbx_lbxright' + popID] = 25;
window['pbx_lbxrightdim' + popID] = '%';
window['pbx_lbxbdwidth' + popID] = 10;
window['pbx_lbxbottom' + popID] = 25;
window['pbx_lbxbodim' + popID] = '%';
var screenheight = 0;
var screenwidth = 0;

var xyz_pbx_custom_today = new Date();

window['pbx_hadjust' + popID];
window['pbx_newwidth' + popID];
window['pbx_newheight' + popID];
window['pbx_lbxhedimold' + popID] = window['pbx_lbxhedim' + popID];
window['pbx_lbxwiddimold' + popID] = window['pbx_lbxwiddim' + popID];
window['jqload' + popID] = -1;
window['jqminload' + popID] = -1;

function pbx_hide_lightbox_custom(
  evt
) {


	var id = window['pbx_id' + popID];
	var triggonclickmeth = window['pbx_trigger_onclick_method' + popID];
	var trigger = window['pbx_trigger' + popID];
	var def_disp = window['pbx_def_disp' + popID];
	var displayoutopt = window['pbx_displayoutopt' + popID];
	var slideab = window['pbx_slideab' + popID];
	var slidestart = window['pbx_slidestart' + popID];
	var lbxtop = window['pbx_lbxtop' + popID];
	var lbxtopdim = window['pbx_lbxtopdim' + popID];
	var lbxleft = window['pbx_lbxleft' + popID];
	var lbxleftdim = window['pbx_lbxledim' + popID];
	var lbxright = window['pbx_lbxright' + popID];
	var lbxrightdim = window['pbx_lbxrightdim' + popID];
	var lbxbottom = window['pbx_lbxbottom' + popID];
	var lbxbodim =  window['pbx_lbxbodim' + popID];
	var lbxhe = window['pbx_lbxhe' + popID];
	var lbxhedim = window['pbx_lbxhedim' + popID];
	var lbxwid = window['pbx_lbxwid' + popID];
	var lbxwiddim = window['pbx_lbxwiddim' + popID];
	var lbxbdwidth = window['pbx_lbxbdwidth' + popID]
		
		
  if (!evt) var evt = window.event;

  evt.cancelBubble = true;
  if (evt.stopPropagation) evt.stopPropagation();

  var screenheight = jQuery(window).height();
  var screenwidth = jQuery(window).width();

  var hadnjust;
  var wiadnjust;
  if (lbxhedim == '%') {
    hadnjust = (screenheight * lbxhe) / 100;
    lbxhe = hadnjust - 2 * lbxbdwidth;

    lbxhedim = 'px';
  }

  if (lbxwiddim == '%') {
    wiadnjust = (screenwidth * lbxwid) / 100;
    lbxwid = wiadnjust - 2 * lbxbdwidth;

    lbxwiddim = 'px';
  }

  if (lbxhedim == 'px') {
    hadjust = (screenheight - lbxhe) / 2;
  } else {
    hadjust = (100 - lbxhe) / 2;
  }
  if (lbxwiddim == 'px') {
    wiadjust = (screenwidth - lbxwid) / 2;
  } else {
    wiadjust = (100 - lbxwid) / 2;
  }

  if (displayoutopt == 4 && slideab == 1) {
    var lbxhetos;
    var lbxwidtos;

    var lbxwidtos = lbxwid + 2 * lbxbdwidth;
    var lbxhetos = lbxhe + 2 * lbxbdwidth;
    var returnslide = lbxhe + 2 * lbxbdwidth;
    if (slidestart == 0) {
      jQuery('#pbx_light_' + id).animate(
        { top: '-=' + lbxhetos + lbxhedim },
        'slow'
      );
      jQuery('#lbx_trig_div_' + id).animate(
        { top: '-=' + lbxhetos + lbxhedim },
        'slow'
      );
    }
    if (slidestart == 1) {
      jQuery('#pbx_light_' + id).animate(
        { left: '-=' + lbxwidtos + lbxwiddim },
        'slow'
      );
      jQuery('#lbx_trig_div_' + id).animate(
        { left: '-=' + lbxwidtos + lbxwiddim },
        'slow'
      );
    }

    if (slidestart == 2) {
      jQuery('#pbx_light_' + id).animate(
        { right: '-=' + lbxwidtos + lbxwiddim },
        'slow'
      );
      jQuery('#lbx_trig_div_' + id).animate(
        { right: '-=' + lbxwidtos + lbxwiddim },
        'slow'
      );
    }
    if (slidestart == 3) {
      jQuery('#pbx_light_' + id).animate(
        { top: '+=' + lbxhetos + lbxhedim },
        'slow'
      );
      jQuery('#lbx_trig_div_' + id).animate(
        { bottom: '-=' + returnslide + lbxhedim },
        'slow'
      );
    }
  } else {
    document.getElementById('pbx_light_' + id).style.display = 'none';

    document.getElementById('pbx_fade_' + id).style.display = 'none';
  }

  if (displayoutopt == 4) {
    var widtr = document.getElementById('lbx_trig_div_' + id).offsetWidth;
    var hetr = document.getElementById('lbx_trig_div_' + id).offsetHeight;
    if (slideab == 0) {
      if (slidestart == 0) {
        document.getElementById('lbx_trig_div_' + id).style.top = '0px';
        if (def_disp == 1) {
          var calcu = (lbxwid - widtr) / 2;
          document.getElementById('lbx_trig_div_' + id).style.left =
            calcu + 'px';
        }
        if (def_disp == 8) {
          var calcu = (screenwidth - widtr) / 2;
          document.getElementById('lbx_trig_div_' + id).style.left =
            calcu + 'px';
        }
        if (def_disp == 7) {
          var calcu = (lbxwid - widtr) / 2;

          document.getElementById('lbx_trig_div_' + id).style.right =
            calcu + 'px';
        }
      }

      if (slidestart == 1) {
        document.getElementById('lbx_trig_div_' + id).style.left = '0px';
        if (def_disp == 1) {
          var calcu = (lbxhe - hetr) / 2;
          document.getElementById('lbx_trig_div_' + id).style.top =
            calcu + 'px';
        }
        if (def_disp == 2) {
          var calcu = (screenheight - hetr) / 2;
          document.getElementById('lbx_trig_div_' + id).style.top =
            calcu + 'px';
        }
        if (def_disp == 3) {
          var calcu = (lbxhe - hetr) / 2;

          document.getElementById('lbx_trig_div_' + id).style.bottom =
            calcu + 'px';
        }
      }
      if (slidestart == 2) {
        document.getElementById('lbx_trig_div_' + id).style.right = '0px';
        if (def_disp == 7) {
          var calcu = (lbxhe - hetr) / 2;
          document.getElementById('lbx_trig_div_' + id).style.top =
            calcu + 'px';
        }
        if (def_disp == 6) {
          var calcu = (screenheight - hetr) / 2;
          document.getElementById('lbx_trig_div_' + id).style.top =
            calcu + 'px';
        }
        if (def_disp == 5) {
          var calcu = (lbxhe - hetr) / 2;

          document.getElementById('lbx_trig_div_' + id).style.bottom =
            calcu + 'px';
        }
      }
      if (slidestart == 3) {
        document.getElementById('lbx_trig_div_' + id).style.bottom = '0px';

        if (def_disp == 3) {
          var calcu = (lbxwid - widtr) / 2;
          document.getElementById('lbx_trig_div_' + id).style.left =
            calcu + 'px';
        }
        if (def_disp == 4) {
          var calcu = (screenwidth - widtr) / 2;
          document.getElementById('lbx_trig_div_' + id).style.left =
            calcu + 'px';
        }
        if (def_disp == 5) {
          var calcu = (lbxwid - widtr) / 2;

          document.getElementById('lbx_trig_div_' + id).style.right =
            calcu + 'px';
        }
      }
    }
  }

  if (trigger != 1 && triggonclickmeth == 2) {
    eval('xyz_pbx_rendered' + id + '=false');
  } else {
    eval('xyz_pbx_rendered' + id + '=true');
    document.getElementById('pbx_light_' + id).innerHTML = '';
  }
  if (document.getElementById('pbx_closediv' + id) != null) {
    document.getElementById('pbx_closediv' + id).style.display = 'none';
  }
}
function pbx_show_closebutton_custom(id) {
  document.getElementById('pbx_closediv' + id).style.display = 'block';
}
function pbx_show_lightbox_custom(
  id,
  xyz_pbx_pc_cookie_val,
  mode,
  pagecount,
  repeat,
  clbtopt,
  clbt,
  trigger,
  triggonclickmeth,
  displayoutopt,
  posit,
  def_disp,
  slideab,
  slidestart,
  lbxhe,
  lbxhedim,
  meditpos,
  lbxleft,
  lbxledim,
  lbxwid,
  lbxwiddim,
  wiadjust,
  hadjust,
  lbxbdwidth,
  lbxtop,
  lbxtopdim,
  lbxbottom,
  lbxbodim,
  lbxright,
  lbxrightdim
) {
  var topf;
  var leftf;
  var topof;
  var leftof;
  var rightf;
  var rightof;
  var bottomf;
  var bottomof;
  var screenheight = jQuery(window).height();
  var screenwidth = jQuery(window).width();

  var lbxwidtos;
  var lbxhetos;
  var dispche = 0;
  var xyz_pbx_tracking_cookie_name = '_xyz_pbx_until_' + id;

  var xyz_pbx_tracking_cookie_val = xyz_pbx_get_cookie_custom(
    xyz_pbx_tracking_cookie_name
  );
  if (
    trigger != 1 &&
    triggonclickmeth == 2 &&
    xyz_pbx_tracking_cookie_val != 1
  ) {
    dispche = 1;
  }

  if (dispche == 0) {
    if (xyz_pbx_tracking_cookie_val == 1) return;
  }
  if (mode == 'page_count_only' || mode == 'both') {
    if (xyz_pbx_pc_cookie_val != pagecount) return;
  }

  document.getElementById('pbx_light_' + id).style.display = 'block';
  if (displayoutopt == 1) {
    document.getElementById('pbx_fade_' + id).style.display = 'block';
  } else {
    document.getElementById('pbx_fade_' + id).style.display = 'none';
  }
  var hadjust;
  var wiadjust;
  var leftadjust;
  var rightadjust;
  var topadjust;
  var bottomadjust;

  if (lbxhedim == 'px') {
    hadjust = (screenheight - lbxhe) / 2;
    topadjust = screenheight - lbxhe;
    bottomadjust = screenheight - lbxhe;
  } else {
    hadjust = (100 - lbxhe) / 2;
    topadjust = 100 - lbxhe;
    bottomadjust = 100 - lbxhe;
  }
  if (lbxwiddim == 'px') {
    leftadjust = screenwidth - lbxwid;
    rightadjust = screenwidth - lbxwid;
    wiadjust = (screenwidth - lbxwid) / 2;
  } else {
    wiadjust = (100 - lbxwid) / 2;
    leftadjust = 100 - lbxwid;
    rightadjust = 100 - lbxwid;
  }
  hadjust = hadjust - lbxbdwidth;
  wiadjust = wiadjust - lbxbdwidth;
  if (posit == 2) {
    if (displayoutopt == 1 || (displayoutopt == 2 && slideab == 0)) {
      if (def_disp == 2) {
        document.getElementById('pbx_light_' + id).style.top =
          hadjust + lbxhedim;
        document.getElementById('pbx_light_' + id).style.left = '0px';
      }
      if (def_disp == 1) {
        document.getElementById('pbx_light_' + id).style.top = '0px';
        document.getElementById('pbx_light_' + id).style.left = '0px';
      }
      if (def_disp == 3) {
        document.getElementById('pbx_light_' + id).style.bottom = '0px';
        document.getElementById('pbx_light_' + id).style.left = '0px';
      }
      if (def_disp == 4) {
        document.getElementById('pbx_light_' + id).style.bottom = '0px';
        document.getElementById('pbx_light_' + id).style.left =
          wiadjust + lbxwiddim;
      }
      if (def_disp == 5) {
        document.getElementById('pbx_light_' + id).style.bottom = '0px';
        document.getElementById('pbx_light_' + id).style.right = '0px';
      }
      if (def_disp == 6) {
        document.getElementById('pbx_light_' + id).style.top =
          hadjust + lbxhedim;

        document.getElementById('pbx_light_' + id).style.right = '0px';
      }
      if (def_disp == 7) {
        document.getElementById('pbx_light_' + id).style.top = '0px';
        document.getElementById('pbx_light_' + id).style.right = '0px';
      }
      if (def_disp == 8) {
        document.getElementById('pbx_light_' + id).style.top = '0px';
        document.getElementById('pbx_light_' + id).style.left =
          wiadjust + lbxwiddim;
      }
      if (def_disp == 9) {
        document.getElementById('pbx_light_' + id).style.top =
          hadjust + lbxhedim;
        document.getElementById('pbx_light_' + id).style.left =
          wiadjust + lbxwiddim;
      }
    }
  }
  if (posit == 1) {
    if (displayoutopt == 2 && slideab == 0) {
      if (meditpos == 1) {
        document.getElementById('pbx_light_' + id).style.top =
          lbxtop + lbxtopdim;
        document.getElementById('pbx_light_' + id).style.left =
          lbxleft + lbxledim;
      }
      if (meditpos == 2) {
        document.getElementById('pbx_light_' + id).style.top =
          lbxtop + lbxtopdim;
        document.getElementById('pbx_light_' + id).style.left =
          wiadjust + lbxwiddim;
        document.getElementById('pbx_light_' + id).style.right =
          lbxright + lbxrightdimdim;
      }

      if (meditpos == 3) {
        document.getElementById('pbx_light_' + id).style.top =
          hadjust + lbxhedim;
        document.getElementById('pbx_light_' + id).style.left =
          lbxleft + lbxledim;
        document.getElementById('pbx_light_' + id).style.bottom =
          lbxbottom + lbxbodim;
      }
      if (meditpos == 4) {
        document.getElementById('pbx_light_' + id).style.top =
          hadjust + lbxhedim;
        document.getElementById('pbx_light_' + id).style.left =
          wiadjust + lbxwiddim;
        document.getElementById('pbx_light_' + id).style.right =
          lbxright + lbxrightdim;
        document.getElementById('pbx_light_' + id).style.bottom =
          lbxbottom + lbxbodim;
      }
    }
  }
  if (posit == 2 && displayoutopt == 4 && slideab == 1) {
    var topsl;
    if (slidestart == 0) {
      document.getElementById('pbx_light_' + id).style.top = -lbxhe + lbxhedim;
      if (def_disp == 1) {
        document.getElementById('pbx_light_' + id).style.left = '0px';
        bottomf = document.getElementById('pbx_light_' + id).style.top;

        if (lbxhedim == '%') {
          tt = bottomf.split('%');
        } else {
          tt = bottomf.split('px');
        }

        bottomof = eval(tt[0]);
        topsl = eval(tt[0] - 2 * lbxbdwidth);

        jQuery('#pbx_light_' + id).animate(
          { top: '-=' + bottomof + lbxhedim },
          'slow'
        );
        jQuery('#lbx_trig_div_' + id).animate(
          { top: '-=' + topsl + lbxhedim },
          'slow'
        );
      }

      if (def_disp == 7) {
        document.getElementById('pbx_light_' + id).style.right = '0px';
        bottomf = document.getElementById('pbx_light_' + id).style.top;

        if (lbxhedim == '%') {
          tt = bottomf.split('%');
        } else {
          tt = bottomf.split('px');
        }

        bottomof = eval(tt[0]);
        topsl = eval(tt[0] - 2 * lbxbdwidth);

        jQuery('#pbx_light_' + id).animate(
          { top: '-=' + bottomof + lbxhedim },
          'slow'
        );
        jQuery('#lbx_trig_div_' + id).animate(
          { top: '-=' + topsl + lbxhedim },
          'slow'
        );
      }
      if (def_disp == 8) {
        var setleft = (screenwidth - lbxwid) / 2 - lbxbdwidth;
        document.getElementById('pbx_light_' + id).style.left =
          setleft + lbxwiddim;
        bottomf = document.getElementById('pbx_light_' + id).style.top;

        if (lbxhedim == '%') {
          tt = bottomf.split('%');
        } else {
          tt = bottomf.split('px');
        }

        bottomof = eval(tt[0]);
        topsl = eval(tt[0] - 2 * lbxbdwidth);

        jQuery('#pbx_light_' + id).animate(
          { top: '-=' + bottomof + lbxhedim },
          'slow'
        );
        jQuery('#lbx_trig_div_' + id).animate(
          { top: '-=' + topsl + lbxhedim },
          'slow'
        );
      }
    }
    if (slidestart == 1) {
      var leftsl;
      document.getElementById('pbx_light_' + id).style.left =
        -lbxwid + lbxwiddim;
      if (def_disp == 2) {
        document.getElementById('pbx_light_' + id).style.top =
          hadjust + lbxhedim;
        leftf = document.getElementById('pbx_light_' + id).style.left;

        if (lbxwiddim == '%') {
          tt = leftf.split('%');
        } else {
          tt = leftf.split('px');
        }

        leftof = eval(tt[0]);
        leftsl = eval(tt[0] - 2 * lbxbdwidth);

        jQuery('#pbx_light_' + id).animate(
          { left: '-=' + leftof + lbxwiddim },
          'slow'
        );
        jQuery('#lbx_trig_div_' + id).animate(
          { left: '-=' + leftsl + lbxwiddim },
          'slow'
        );
      }
      if (def_disp == 1) {
        document.getElementById('pbx_light_' + id).style.top = '0px';
        leftf = document.getElementById('pbx_light_' + id).style.left;

        if (lbxwiddim == '%') {
          tt = leftf.split('%');
        } else {
          tt = leftf.split('px');
        }

        leftof = eval(tt[0]);
        leftsl = eval(tt[0] - 2 * lbxbdwidth);

        jQuery('#pbx_light_' + id).animate(
          { left: '-=' + leftof + lbxwiddim },
          'slow'
        );
        jQuery('#lbx_trig_div_' + id).animate(
          { left: '-=' + leftsl + lbxwiddim },
          'slow'
        );
      }
      if (def_disp == 3) {
        document.getElementById('pbx_light_' + id).style.bottom = '0px';
        leftf = document.getElementById('pbx_light_' + id).style.left;

        if (lbxwiddim == '%') {
          tt = leftf.split('%');
        } else {
          tt = leftf.split('px');
        }

        leftof = eval(tt[0]);
        leftsl = eval(tt[0] - 2 * lbxbdwidth);

        jQuery('#pbx_light_' + id).animate(
          { left: '-=' + leftof + lbxwiddim },
          'slow'
        );
        jQuery('#lbx_trig_div_' + id).animate(
          { left: '-=' + leftsl + lbxwiddim },
          'slow'
        );
      }
    }

    if (slidestart == 2) {
      document.getElementById('pbx_light_' + id).style.right =
        -lbxwid + lbxwiddim;
      var rightsl;
      if (def_disp == 5) {
        var tt;
        document.getElementById('pbx_light_' + id).style.bottom = '0px';
        rightf = document.getElementById('pbx_light_' + id).style.right;
        if (lbxwiddim == '%') {
          tt = rightf.split('%');
        } else {
          tt = rightf.split('px');
        }

        rightof = eval(tt[0]);
        rightsl = eval(tt[0] - 2 * lbxbdwidth);

        jQuery('#pbx_light_' + id).animate(
          { right: '-=' + rightof + lbxwiddim },
          'slow'
        );
        jQuery('#lbx_trig_div_' + id).animate(
          { right: '-=' + rightsl + lbxwiddim },
          'slow'
        );
      }
      if (def_disp == 6) {
        var tt;
        document.getElementById('pbx_light_' + id).style.top =
          hadjust + lbxhedim;
        rightf = document.getElementById('pbx_light_' + id).style.right;
        if (lbxwiddim == '%') {
          tt = rightf.split('%');
        } else {
          tt = rightf.split('px');
        }

        rightof = eval(tt[0]);
        rightsl = eval(tt[0] - 2 * lbxbdwidth);

        jQuery('#pbx_light_' + id).animate(
          { right: '-=' + rightof + lbxwiddim },
          'slow'
        );
        jQuery('#lbx_trig_div_' + id).animate(
          { right: '-=' + rightsl + lbxwiddim },
          'slow'
        );
      }
      if (def_disp == 7) {
        var tt;
        document.getElementById('pbx_light_' + id).style.top = '0px';
        rightf = document.getElementById('pbx_light_' + id).style.right;
        if (lbxwiddim == '%') {
          tt = rightf.split('%');
        } else {
          tt = rightf.split('px');
        }

        rightof = eval(tt[0]);

        rightsl = eval(tt[0] - 2 * lbxbdwidth);
        jQuery('#pbx_light_' + id).animate(
          { right: '-=' + rightof + lbxwiddim },
          'slow'
        );
        jQuery('#lbx_trig_div_' + id).animate(
          { right: '-=' + rightsl + lbxwiddim },
          'slow'
        );
      }
    }
    if (slidestart == 3) {
      document.getElementById('pbx_light_' + id).style.top =
        screenheight + 'px';
      var bottsl;
      toptof = lbxhe + 2 * lbxbdwidth;
      topsl = lbxhe + 2 * lbxbdwidth;
      if (def_disp == 3) {
        var tt;
        document.getElementById('pbx_light_' + id).style.left = '0px';

        jQuery('#pbx_light_' + id).animate(
          { top: '-=' + toptof + lbxhedim },
          'slow'
        );
        jQuery('#lbx_trig_div_' + id).animate(
          { bottom: '+=' + topsl + lbxhedim },
          'slow'
        );
      }
      if (def_disp == 4) {
        var tt;
        document.getElementById('pbx_light_' + id).style.left =
          wiadjust + lbxwiddim;

        jQuery('#pbx_light_' + id).animate(
          { top: '-=' + toptof + lbxhedim },
          'slow'
        );
        jQuery('#lbx_trig_div_' + id).animate(
          { bottom: '+=' + topsl + lbxhedim },
          'slow'
        );
      }
      if (def_disp == 5) {
        var tt;
        document.getElementById('pbx_light_' + id).style.right = '0px';

        jQuery('#pbx_light_' + id).animate(
          { top: '-=' + toptof + lbxhedim },
          'slow'
        );
        jQuery('#lbx_trig_div_' + id).animate(
          { bottom: '+=' + topsl + lbxhedim },
          'slow'
        );
      }
    }
  }
  if (displayoutopt == 4 && slideab == 0) {
    var widtr = document.getElementById('lbx_trig_div_' + id).offsetWidth;
    var hetr = document.getElementById('lbx_trig_div_' + id).offsetHeight;

    lbxwidtos = lbxwid + 2 * lbxbdwidth;

    lbxhetos = lbxhe + 2 * lbxbdwidth;

    if (slidestart == 0) {
      if (def_disp == 1) {
        var calcut = lbxhetos;
        var calcul = (lbxwidtos - widtr) / 2;
        document.getElementById('lbx_trig_div_' + id).style.top = calcut + 'px';

        document.getElementById('lbx_trig_div_' + id).style.left =
          calcul + 'px';
      }

      if (def_disp == 8) {
        var calcut = lbxhetos;
        var calcul = (screenwidth - widtr) / 2;
        document.getElementById('lbx_trig_div_' + id).style.top = calcut + 'px';

        document.getElementById('lbx_trig_div_' + id).style.left =
          calcul + 'px';
      }
      if (def_disp == 7) {
        var calcut = lbxhetos;
        var calcul = (lbxwidtos - widtr) / 2;
        document.getElementById('lbx_trig_div_' + id).style.top = calcut + 'px';

        document.getElementById('lbx_trig_div_' + id).style.right =
          calcul + 'px';
      }
    }

    if (slidestart == 1) {
      if (def_disp == 1) {
        var calcut = lbxwidtos;
        var calcul = (lbxhetos - hetr) / 2;
        document.getElementById('lbx_trig_div_' + id).style.left =
          calcut + 'px';

        document.getElementById('lbx_trig_div_' + id).style.top = calcul + 'px';
      }
      if (def_disp == 2) {
        var calcut = lbxwidtos;
        var calcul = (screenheight - hetr) / 2;
        document.getElementById('lbx_trig_div_' + id).style.left =
          calcut + 'px';

        document.getElementById('lbx_trig_div_' + id).style.top = calcul + 'px';
      }
      if (def_disp == 3) {
        var calcut = lbxwidtos;
        var calcul = (lbxhetos - hetr) / 2;
        document.getElementById('lbx_trig_div_' + id).style.left =
          calcut + 'px';

        document.getElementById('lbx_trig_div_' + id).style.bottom =
          calcul + 'px';
      }
    }
    if (slidestart == 2) {
      if (def_disp == 7) {
        var calcut = lbxwidtos;
        var calcul = (lbxhetos - hetr) / 2;
        document.getElementById('lbx_trig_div_' + id).style.right =
          calcut + 'px';

        document.getElementById('lbx_trig_div_' + id).style.top = calcul + 'px';
      }
      if (def_disp == 6) {
        var calcut = lbxwidtos;
        var calcul = (screenheight - hetr) / 2;
        document.getElementById('lbx_trig_div_' + id).style.right =
          calcut + 'px';

        document.getElementById('lbx_trig_div_' + id).style.top = calcul + 'px';
      }
      if (def_disp == 5) {
        var calcut = lbxwidtos;
        var calcul = (lbxhetos - hetr) / 2;
        document.getElementById('lbx_trig_div_' + id).style.right =
          calcut + 'px';

        document.getElementById('lbx_trig_div_' + id).style.bottom =
          calcul + 'px';
      }
    }
    if (slidestart == 3) {
      if (def_disp == 3) {
        var calcut = (lbxwid - widtr) / 2;
        var calcul = lbxhetos;
        document.getElementById('lbx_trig_div_' + id).style.left =
          calcut + 'px';

        document.getElementById('lbx_trig_div_' + id).style.bottom =
          calcul + 'px';
      }
      if (def_disp == 4) {
        var calcut = (screenwidth - widtr) / 2;
        var calcul = lbxhetos;

        document.getElementById('lbx_trig_div_' + id).style.left =
          calcut + 'px';

        document.getElementById('lbx_trig_div_' + id).style.bottom =
          calcul + 'px';
      }
      if (def_disp == 5) {
        var calcut = (lbxwid - widtr) / 2;
        var calcul = lbxhetos;
        document.getElementById('lbx_trig_div_' + id).style.right =
          calcut + 'px';

        document.getElementById('lbx_trig_div_' + id).style.bottom =
          calcul + 'px';
      }
    }
  }
  if (posit == 2 && displayoutopt == 2 && slideab == 1) {
    if (slidestart == 0) {
      document.getElementById('pbx_light_' + id).style.top = -lbxhe + lbxhedim;
      if (def_disp == 2) {
        document.getElementById('pbx_light_' + id).style.left = '0px';
        bottomf = document.getElementById('pbx_light_' + id).style.top;

        if (lbxhedim == '%') {
          tt = bottomf.split('%');
        } else {
          tt = bottomf.split('px');
        }

        bottomof = eval(hadjust - tt[0]);

        jQuery('#pbx_light_' + id).animate(
          { top: '+=' + bottomof + lbxhedim },
          'slow'
        );
      }
      if (def_disp == 1) {
        document.getElementById('pbx_light_' + id).style.left = '0px';
        bottomf = document.getElementById('pbx_light_' + id).style.top;

        if (lbxhedim == '%') {
          tt = bottomf.split('%');
        } else {
          tt = bottomf.split('px');
        }

        bottomof = eval(tt[0]);

        jQuery('#pbx_light_' + id).animate(
          { top: '-=' + bottomof + lbxhedim },
          'slow'
        );
      }
      if (def_disp == 3) {
        document.getElementById('pbx_light_' + id).style.left = '0px';
        bottomf = document.getElementById('pbx_light_' + id).style.top;
        var calcu;
        if (lbxhedim == '%') {
          tt = bottomf.split('%');
          calcu = 100 - lbxhe;
        } else {
          tt = bottomf.split('px');
          calcu = screenheight - lbxhe;
        }

        bottomof = eval(calcu - tt[0] - 2 * lbxbdwidth);

        jQuery('#pbx_light_' + id).animate(
          { top: '+=' + bottomof + lbxhedim },
          'slow'
        );
      }
      if (def_disp == 4) {
        var leftset = (screenwidth - lbxwid) / 2;
        document.getElementById('pbx_light_' + id).style.left = leftset + 'px';
        bottomf = document.getElementById('pbx_light_' + id).style.top;
        var calcu;
        if (lbxhedim == '%') {
          tt = bottomf.split('%');
          calcu = 100 - lbxhe;
        } else {
          tt = bottomf.split('px');
          calcu = screenheight - lbxhe;
        }

        bottomof = eval(calcu - tt[0] - 2 * lbxbdwidth);

        jQuery('#pbx_light_' + id).animate(
          { top: '+=' + bottomof + lbxhedim },
          'slow'
        );
      }
      if (def_disp == 5) {
        var leftset = screenwidth - lbxwid - 2 * lbxbdwidth;
        document.getElementById('pbx_light_' + id).style.left = leftset + 'px';
        bottomf = document.getElementById('pbx_light_' + id).style.top;
        var calcu;
        if (lbxhedim == '%') {
          tt = bottomf.split('%');
          calcu = 100 - lbxhe;
        } else {
          tt = bottomf.split('px');
          calcu = screenheight - lbxhe;
        }

        bottomof = eval(calcu - tt[0] - 2 * lbxbdwidth);

        jQuery('#pbx_light_' + id).animate(
          { top: '+=' + bottomof + lbxhedim },
          'slow'
        );
      }
      if (def_disp == 6) {
        var leftset = screenwidth - lbxwid - 2 * lbxbdwidth;
        document.getElementById('pbx_light_' + id).style.left = leftset + 'px';
        bottomf = document.getElementById('pbx_light_' + id).style.top;

        if (lbxhedim == '%') {
          tt = bottomf.split('%');
        } else {
          tt = bottomf.split('px');
        }

        bottomof = eval(hadjust - tt[0]);

        jQuery('#pbx_light_' + id).animate(
          { top: '+=' + bottomof + lbxhedim },
          'slow'
        );
      }
      if (def_disp == 7) {
        var leftset = screenwidth - lbxwid - 2 * lbxbdwidth;
        document.getElementById('pbx_light_' + id).style.left = leftset + 'px';
        bottomf = document.getElementById('pbx_light_' + id).style.top;

        if (lbxhedim == '%') {
          tt = bottomf.split('%');
        } else {
          tt = bottomf.split('px');
        }

        bottomof = eval(tt[0]);

        jQuery('#pbx_light_' + id).animate(
          { top: '-=' + bottomof + lbxhedim },
          'slow'
        );
      }
      if (def_disp == 8) {
        var rightset = (screenwidth - lbxwid) / 2;
        document.getElementById('pbx_light_' + id).style.left = rightset + 'px';
        bottomf = document.getElementById('pbx_light_' + id).style.top;

        if (lbxhedim == '%') {
          tt = bottomf.split('%');
        } else {
          tt = bottomf.split('px');
        }

        bottomof = eval(tt[0]);

        jQuery('#pbx_light_' + id).animate(
          { top: '-=' + bottomof + lbxhedim },
          'slow'
        );
      }
      if (def_disp == 9) {
        var rightset = (screenwidth - lbxwid) / 2;
        document.getElementById('pbx_light_' + id).style.left = rightset + 'px';
        bottomf = document.getElementById('pbx_light_' + id).style.top;

        if (lbxhedim == '%') {
          tt = bottomf.split('%');
        } else {
          tt = bottomf.split('px');
        }

        bottomof = eval(hadjust - tt[0]);

        jQuery('#pbx_light_' + id).animate(
          { top: '+=' + bottomof + lbxhedim },
          'slow'
        );
      }
    }
    if (slidestart == 1) {
      document.getElementById('pbx_light_' + id).style.left =
        -lbxwid + lbxwiddim;
      if (def_disp == 2) {
        document.getElementById('pbx_light_' + id).style.top =
          hadjust + lbxhedim;
        leftf = document.getElementById('pbx_light_' + id).style.left;

        if (lbxwiddim == '%') {
          tt = leftf.split('%');
        } else {
          tt = leftf.split('px');
        }

        leftof = eval(tt[0]);

        jQuery('#pbx_light_' + id).animate(
          { left: '-=' + leftof + lbxwiddim },
          'slow'
        );
      }
      if (def_disp == 1) {
        document.getElementById('pbx_light_' + id).style.top = '0px';
        leftf = document.getElementById('pbx_light_' + id).style.left;

        if (lbxwiddim == '%') {
          tt = leftf.split('%');
        } else {
          tt = leftf.split('px');
        }

        leftof = eval(tt[0]);

        jQuery('#pbx_light_' + id).animate(
          { left: '-=' + leftof + lbxwiddim },
          'slow'
        );
      }
      if (def_disp == 3) {
        var bottomset = screenheight - lbxhe - 2 * lbxbdwidth;
        document.getElementById('pbx_light_' + id).style.top = bottomset + 'px';
        leftf = document.getElementById('pbx_light_' + id).style.left;

        if (lbxwiddim == '%') {
          tt = leftf.split('%');
        } else {
          tt = leftf.split('px');
        }

        leftof = eval(tt[0]);

        jQuery('#pbx_light_' + id).animate(
          { left: '-=' + leftof + lbxwiddim },
          'slow'
        );
      }
      if (def_disp == 4) {
        var bottomset = screenheight - lbxhe - 2 * lbxbdwidth;
        document.getElementById('pbx_light_' + id).style.top = bottomset + 'px';
        leftf = document.getElementById('pbx_light_' + id).style.left;

        if (lbxwiddim == '%') {
          tt = leftf.split('%');
        } else {
          tt = leftf.split('px');
        }

        leftof = eval(wiadjust - tt[0]);

        jQuery('#pbx_light_' + id).animate(
          { left: '+=' + leftof + lbxwiddim },
          'slow'
        );
      }
      if (def_disp == 5) {
        var bottomset = screenheight - lbxhe - 2 * lbxbdwidth;
        document.getElementById('pbx_light_' + id).style.top = bottomset + 'px';
        leftf = document.getElementById('pbx_light_' + id).style.left;
        var calcu;
        if (lbxwiddim == '%') {
          tt = leftf.split('%');
          calcu = 100 - lbxwid;
        } else {
          tt = leftf.split('px');
          calcu = screenwidth - lbxwid;
        }

        leftof = eval(calcu - tt[0] - 2 * lbxbdwidth);

        jQuery('#pbx_light_' + id).animate(
          { left: '+=' + leftof + lbxwiddim },
          'slow'
        );
      }
      if (def_disp == 6) {
        document.getElementById('pbx_light_' + id).style.top =
          hadjust + lbxhedim;
        leftf = document.getElementById('pbx_light_' + id).style.left;
        var calcu;
        if (lbxwiddim == '%') {
          tt = leftf.split('%');
          calcu = 100 - lbxwid;
        } else {
          tt = leftf.split('px');
          calcu = screenwidth - lbxwid;
        }

        leftof = eval(calcu - tt[0] - 2 * lbxbdwidth);

        jQuery('#pbx_light_' + id).animate(
          { left: '+=' + leftof + lbxwiddim },
          'slow'
        );
      }
      if (def_disp == 7) {
        document.getElementById('pbx_light_' + id).style.top = '0px';
        leftf = document.getElementById('pbx_light_' + id).style.left;
        var calcu;
        if (lbxwiddim == '%') {
          tt = leftf.split('%');
          calcu = 100 - lbxwid;
        } else {
          tt = leftf.split('px');
          calcu = screenwidth - lbxwid;
        }

        leftof = eval(calcu - tt[0] - 2 * lbxbdwidth);

        jQuery('#pbx_light_' + id).animate(
          { left: '+=' + leftof + lbxwiddim },
          'slow'
        );
      }
      if (def_disp == 8) {
        document.getElementById('pbx_light_' + id).style.top = '0px';
        leftf = document.getElementById('pbx_light_' + id).style.left;

        if (lbxwiddim == '%') {
          tt = leftf.split('%');
        } else {
          tt = leftf.split('px');
        }

        leftof = eval(wiadjust - tt[0]);

        jQuery('#pbx_light_' + id).animate(
          { left: '+=' + leftof + lbxwiddim },
          'slow'
        );
      }
      if (def_disp == 9) {
        document.getElementById('pbx_light_' + id).style.top =
          hadjust + lbxhedim;
        leftf = document.getElementById('pbx_light_' + id).style.left;

        if (lbxwiddim == '%') {
          tt = leftf.split('%');
        } else {
          tt = leftf.split('px');
        }

        leftof = eval(wiadjust - tt[0]);

        jQuery('#pbx_light_' + id).animate(
          { left: '+=' + leftof + lbxwiddim },
          'slow'
        );
      }
    }
    if (slidestart == 2) {
      document.getElementById('pbx_light_' + id).style.left =
        screenwidth + 'px';
      if (def_disp == 2) {
        var calcu;
        var tt;
        document.getElementById('pbx_light_' + id).style.top =
          hadjust + lbxhedim;

        var slpx = screenwidth;

        jQuery('#pbx_light_' + id).animate(
          { left: '-=' + slpx + 'px' },
          'slow'
        );
      }
      if (def_disp == 1) {
        var calcu;
        var tt;
        document.getElementById('pbx_light_' + id).style.top = '0px';
        var slpx = screenwidth;

        jQuery('#pbx_light_' + id).animate(
          { left: '-=' + slpx + 'px' },
          'slow'
        );
      }
      if (def_disp == 3) {
        var tt;
        var calcu;

        var setpx = screenheight - lbxhe - 2 * lbxbdwidth;
        document.getElementById('pbx_light_' + id).style.top = setpx + 'px';
        var slpx = screenwidth;

        jQuery('#pbx_light_' + id).animate(
          { left: '-=' + slpx + 'px' },
          'slow'
        );
      }
      if (def_disp == 4) {
        var tt;

        var setpx = screenheight - lbxhe - 2 * lbxbdwidth;
        document.getElementById('pbx_light_' + id).style.top = setpx + 'px';
        var slpx = screenwidth / 2 + lbxwid / 2;

        jQuery('#pbx_light_' + id).animate(
          { left: '-=' + slpx + 'px' },
          'slow'
        );
      }
      if (def_disp == 5) {
        var tt;
        var setpx = screenheight - lbxhe - 2 * lbxbdwidth;
        document.getElementById('pbx_light_' + id).style.top = setpx + 'px';
        rightf = document.getElementById('pbx_light_' + id).style.right;
        var slpx = lbxwid + 2 * lbxbdwidth;

        jQuery('#pbx_light_' + id).animate(
          { left: '-=' + slpx + 'px' },
          'slow'
        );
      }
      if (def_disp == 6) {
        var tt;
        document.getElementById('pbx_light_' + id).style.top =
          hadjust + lbxhedim;
        var slpx = lbxwid + 2 * lbxbdwidth;

        jQuery('#pbx_light_' + id).animate(
          { left: '-=' + slpx + 'px' },
          'slow'
        );
      }
      if (def_disp == 7) {
        var tt;
        document.getElementById('pbx_light_' + id).style.top = '0px';
        var slpx = lbxwid + 2 * lbxbdwidth;

        jQuery('#pbx_light_' + id).animate(
          { left: '-=' + slpx + 'px' },
          'slow'
        );
      }
      if (def_disp == 8) {
        var tt;

        document.getElementById('pbx_light_' + id).style.top = '0px';
        var slpx = screenwidth / 2 + lbxwid / 2;

        jQuery('#pbx_light_' + id).animate(
          { left: '-=' + slpx + 'px' },
          'slow'
        );
      }
      if (def_disp == 9) {
        var tt;

        document.getElementById('pbx_light_' + id).style.top =
          hadjust + lbxhedim;
        rightf = document.getElementById('pbx_light_' + id).style.right;
        var slpx = screenwidth / 2 + lbxwid / 2;

        jQuery('#pbx_light_' + id).animate(
          { left: '-=' + slpx + 'px' },
          'slow'
        );
      }
    }
    if (slidestart == 3) {
      document.getElementById('pbx_light_' + id).style.top =
        screenheight + 'px';
      if (def_disp == 2) {
        var tt;
        document.getElementById('pbx_light_' + id).style.left = '0px';
        var slpx = (screenheight + lbxhe) / 2 + lbxbdwidth;

        jQuery('#pbx_light_' + id).animate({ top: '-=' + slpx + 'px' }, 'slow');
      }
      if (def_disp == 1) {
        var tt;
        var calcu;
        document.getElementById('pbx_light_' + id).style.left = '0px';
        var slpx = screenheight;

        jQuery('#pbx_light_' + id).animate({ top: '-=' + slpx + 'px' }, 'slow');
      }
      if (def_disp == 3) {
        var tt;
        document.getElementById('pbx_light_' + id).style.left = '0px';
        var slpx = lbxhe + 2 * lbxbdwidth;

        jQuery('#pbx_light_' + id).animate({ top: '-=' + slpx + 'px' }, 'slow');
      }
      if (def_disp == 4) {
        var tt;
        document.getElementById('pbx_light_' + id).style.left =
          wiadjust + lbxwiddim;
        var slpx = lbxhe + 2 * lbxbdwidth;

        jQuery('#pbx_light_' + id).animate({ top: '-=' + slpx + 'px' }, 'slow');
      }
      if (def_disp == 5) {
        var tt;
        var setright = screenwidth - lbxwid - 2 * lbxbdwidth;
        document.getElementById('pbx_light_' + id).style.left = setright + 'px';
        var slpx = lbxhe + 2 * lbxbdwidth;

        jQuery('#pbx_light_' + id).animate({ top: '-=' + slpx + 'px' }, 'slow');
      }
      if (def_disp == 6) {
        var tt;
        var setright = screenwidth - lbxwid - 2 * lbxbdwidth;
        document.getElementById('pbx_light_' + id).style.left = setright + 'px';
        var slpx = (screenheight + lbxhe) / 2 + lbxbdwidth;

        jQuery('#pbx_light_' + id).animate({ top: '-=' + slpx + 'px' }, 'slow');
      }
      if (def_disp == 7) {
        var tt;
        var setright = screenwidth - lbxwid - 2 * lbxbdwidth;
        document.getElementById('pbx_light_' + id).style.left = setright + 'px';
        var slpx = screenheight;

        jQuery('#pbx_light_' + id).animate({ top: '-=' + slpx + 'px' }, 'slow');
      }
      if (def_disp == 8) {
        var calcu;
        var tt;
        document.getElementById('pbx_light_' + id).style.left =
          wiadjust + lbxwiddim;
        var slpx = screenheight;

        jQuery('#pbx_light_' + id).animate({ top: '-=' + slpx + 'px' }, 'slow');
      }
      if (def_disp == 9) {
        var tt;
        document.getElementById('pbx_light_' + id).style.left =
          wiadjust + lbxwiddim;
        var slpx = (screenheight + lbxhe) / 2;

        jQuery('#pbx_light_' + id).animate({ top: '-=' + slpx + 'px' }, 'slow');
      }
    }
  }

  if (posit == 1 && displayoutopt == 2 && slideab == 1) {
    if (slidestart == 3) {
      document.getElementById('pbx_light_' + id).style.top =
        screenheight + 'px';
      if (meditpos == 1) {
        document.getElementById('pbx_light_' + id).style.left =
          lbxleft + lbxledim;

        var toptosl;

        if (lbxtopdim == '%') {
          toptosl = 100 - lbxtop;
        } else {
          toptosl = screenheight - lbxtop;
        }

        jQuery('#pbx_light_' + id).animate(
          { top: '-=' + toptosl + lbxtopdim },
          'slow'
        );
      }

      if (meditpos == 3) {
        document.getElementById('pbx_light_' + id).style.left =
          lbxleft + lbxledim;

        var toptosl;
        if (lbxbodim == '%') {
          var botpix = (screenheight * lbxbottom) / 100;
          toptosl = lbxhe + botpix;
        } else {
          toptosl = lbxhe + lbxbottom;
        }

        jQuery('#pbx_light_' + id).animate(
          { top: '-=' + toptosl + 'px' },
          'slow'
        );
      }

      if (meditpos == 4) {
        var tt;
        var wicpx;
        var wicps;

        var calcu;
        if (lbxrightdim == '%') {
          rightpx = (screenwidth * lbxright) / 100;
        } else {
          rightpx = lbxright;
        }

        var setleft = screenwidth - lbxwid - rightpx - 2 * lbxbdwidth;

        document.getElementById('pbx_light_' + id).style.left = setleft + 'px';

        var toptosl;
        if (lbxbodim == '%') {
          var botpix = (screenheight * lbxbottom) / 100;
          toptosl = lbxhe + botpix + 2 * lbxbdwidth;
        } else {
          toptosl = lbxhe + lbxbottom + 2 * lbxbdwidth;
        }

        jQuery('#pbx_light_' + id).animate(
          { top: '-=' + toptosl + 'px' },
          'slow'
        );
      }

      if (meditpos == 2) {
        var rightpx;
        if (lbxrightdim == '%') {
          rightpx = (screenwidth * lbxright) / 100;
        } else {
          rightpx = lbxright;
        }

        var setleft = screenwidth - lbxwid - rightpx - 2 * lbxbdwidth;

        document.getElementById('pbx_light_' + id).style.left = setleft + 'px';
        var toptosl;

        if (lbxtopdim == '%') {
          toptosl = 100 - lbxtop;
        } else {
          toptosl = screenheight - lbxtop;
        }

        jQuery('#pbx_light_' + id).animate(
          { top: '-=' + toptosl + lbxtopdim },
          'slow'
        );
      }
    }
    if (slidestart == 1) {
      document.getElementById('pbx_light_' + id).style.left =
        -lbxwid + lbxwiddim;

      if (meditpos == 1) {
        var tt;
        var wicpx;
        var wicps;

        var calcu;
        document.getElementById('pbx_light_' + id).style.top =
          lbxtop + lbxtopdim;
        leftf = document.getElementById('pbx_light_' + id).style.left;

        if (lbxwiddim == '%') {
          tt = leftf.split('%');
          var ri = eval(tt[0]);
          wicpx = (screenwidth * ri) / 100;
        } else {
          tt = leftf.split('px');
          var ri = eval(tt[0]);
          wicps = (100 * ri) / screenwidth;
        }
        if (lbxledim == '%') {
          if (lbxwiddim == '%') {
            leftof = eval(lbxleft - tt[0]);
          } else {
            leftof = eval(lbxleft - wicps);
          }
        }
        if (lbxledim == 'px') {
          if (lbxwiddim == 'px') {
            leftof = eval(lbxleft - tt[0]);
          } else {
            leftof = eval(lbxleft - wicpx);
          }
        }

        jQuery('#pbx_light_' + id).animate(
          { left: '+=' + leftof + lbxledim },
          'slow'
        );
      }

      if (meditpos == 2) {
        var tt;
        var wicpx;
        var wicps;
        var ttc;
        var calcu;
        document.getElementById('pbx_light_' + id).style.top =
          lbxtop + lbxtopdim;
        rightf = document.getElementById('pbx_light_' + id).style.left;

        if (lbxwiddim == '%') {
          tt = rightf.split('%');
          wicpx = (screenwidth * lbxwid) / 100;
          ttc = (screenwidth * tt[0]) / 100;
        } else {
          tt = rightf.split('px');
          wicps = (100 * lbxwid) / screenwidth;
          ttc = (100 * tt[0]) / screenwidth;
        }
        if (lbxrightdim == '%') {
          if (lbxwiddim == '%') {
            calcu = 100 - lbxright - lbxwid;
          } else {
            calcu = 100 - lbxright - wicps;
          }
        }
        if (lbxrightdim == 'px') {
          if (lbxwiddim == 'px') {
            calcu = screenwidth - lbxright - lbxwid;
          } else {
            calcu = screenwidth - lbxright - wicpx;
          }
        }

        rightof = eval(calcu - ttc);

        jQuery('#pbx_light_' + id).animate(
          { left: '+=' + rightof + lbxrightdim },
          'slow'
        );
      }
      if (meditpos == 3) {
        var tt;
        var wicpx;
        var wicps;

        var calcu;
        var botpx;
        if (lbxbodim == '%') {
          botpx = (screenheight * lbxbottom) / 100;
        } else {
          botpx = lbxbottom;
        }
        var topset = screenheight - lbxhe - botpx;
        document.getElementById('pbx_light_' + id).style.top = topset + 'px';
        leftf = document.getElementById('pbx_light_' + id).style.left;

        if (lbxwiddim == '%') {
          tt = leftf.split('%');
          var ri = eval(tt[0]);
          wicpx = (screenwidth * ri) / 100;
        } else {
          tt = leftf.split('px');
          var ri = eval(tt[0]);
          wicps = (100 * ri) / screenwidth;
        }
        if (lbxledim == '%') {
          if (lbxwiddim == '%') {
            leftof = eval(lbxleft - tt[0]);
          } else {
            leftof = eval(lbxleft - wicps);
          }
        }
        if (lbxledim == 'px') {
          if (lbxwiddim == 'px') {
            leftof = eval(lbxleft - tt[0]);
          } else {
            leftof = eval(lbxleft - wicpx);
          }
        }

        jQuery('#pbx_light_' + id).animate(
          { left: '+=' + leftof + lbxledim },
          'slow'
        );
      }
      if (meditpos == 4) {
        var tt;
        var wicpx;
        var wicps;
        var ttc;
        var calcu;
        var botpx;
        if (lbxbodim == '%') {
          botpx = (screenheight * lbxbottom) / 100;
        } else {
          botpx = lbxbottom;
        }
        var topset = screenheight - lbxhe - botpx;
        document.getElementById('pbx_light_' + id).style.top = topset + 'px';
        rightf = document.getElementById('pbx_light_' + id).style.left;

        if (lbxwiddim == '%') {
          tt = rightf.split('%');
          wicpx = (screenwidth * lbxwid) / 100;
          ttc = (screenwidth * tt[0]) / 100;
        } else {
          tt = rightf.split('px');
          wicps = (100 * lbxwid) / screenwidth;
          ttc = (100 * tt[0]) / screenwidth;
        }
        if (lbxrightdim == '%') {
          if (lbxwiddim == '%') {
            calcu = 100 - lbxright - lbxwid;
          } else {
            calcu = 100 - lbxright - wicps;
          }
        }
        if (lbxrightdim == 'px') {
          if (lbxwiddim == 'px') {
            calcu = screenwidth - lbxright - lbxwid;
          } else {
            calcu = screenwidth - lbxright - wicpx;
          }
        }

        rightof = eval(calcu - ttc);

        jQuery('#pbx_light_' + id).animate(
          { left: '+=' + rightof + lbxrightdim },
          'slow'
        );
      }
    }
    if (slidestart == 2) {
      document.getElementById('pbx_light_' + id).style.left =
        screenwidth + 'px';

      if (meditpos == 1) {
        var tt;
        var wicpx;
        var wicps;
        var ttc;
        var calcu;
        document.getElementById('pbx_light_' + id).style.top =
          lbxtop + lbxtopdim;

        if (lbxledim == '%') {
          calcu = 100 - lbxleft;
        }
        if (lbxledim == 'px') {
          calcu = screenwidth - lbxleft;
        }

        rightof = eval(calcu);

        jQuery('#pbx_light_' + id).animate(
          { left: '-=' + rightof + lbxledim },
          'slow'
        );
      }

      if (meditpos == 2) {
        var calcu;
        document.getElementById('pbx_light_' + id).style.top =
          lbxtop + lbxtopdim;

        if (lbxrightdim == '%') {
          calcu = (screenwidth * lbxright) / 100;
        }
        if (lbxrightdim == 'px') {
          calcu = lbxright;
        }

        rightof = eval(lbxwid + calcu);

        jQuery('#pbx_light_' + id).animate(
          { left: '-=' + rightof + 'px' },
          'slow'
        );
      }
      if (meditpos == 3) {
        var tt;
        var wicpx;
        var wicps;
        var ttc;
        var calcu;
        var bottpx;
        if (lbxbodim == '%') {
          bottpx = (lbxbottom * screenheight) / 100;
        } else {
          bottpx = lbxbottom;
        }
        var topset = screenheight - (lbxhe + bottpx);
        document.getElementById('pbx_light_' + id).style.top = topset + 'px';

        if (lbxledim == '%') {
          calcu = 100 - lbxleft;
        }
        if (lbxledim == 'px') {
          calcu = screenwidth - lbxleft;
        }

        rightof = eval(calcu);

        jQuery('#pbx_light_' + id).animate(
          { left: '-=' + rightof + lbxledim },
          'slow'
        );
      }
      if (meditpos == 4) {
        var tt;
        var wicpx;
        var wicps;

        var calcu;
        if (lbxbodim == '%') {
          bottpx = (lbxbottom * screenheight) / 100;
        } else {
          bottpx = lbxbottom;
        }
        var topset = screenheight - (lbxhe + bottpx);
        document.getElementById('pbx_light_' + id).style.top = topset + 'px';

        if (lbxrightdim == '%') {
          calcu = (screenwidth * lbxright) / 100;
        }
        if (lbxrightdim == 'px') {
          calcu = lbxright;
        }

        rightof = eval(lbxwid + calcu);

        jQuery('#pbx_light_' + id).animate(
          { left: '-=' + rightof + 'px' },
          'slow'
        );
      }
    }

    if (slidestart == 0) {
      document.getElementById('pbx_light_' + id).style.top = -lbxhe + lbxhedim;

      if (meditpos == 1) {
        var tt;
        var wicpx;
        var wicps;

        var calcu;
        document.getElementById('pbx_light_' + id).style.left =
          lbxleft + lbxledim;
        topf = document.getElementById('pbx_light_' + id).style.top;

        if (lbxhedim == '%') {
          tt = topf.split('%');
          var ri = eval(tt[0]);
          wicpx = (screenheight * ri) / 100;
        } else {
          tt = topf.split('px');
          var ri = eval(tt[0]);
          wicps = (100 * ri) / screenheight;
        }
        if (lbxtopdim == '%') {
          if (lbxhedim == '%') {
            topof = eval(lbxtop - tt[0]);
          } else {
            topof = eval(lbxtop - wicps);
          }
        }
        if (lbxtopdim == 'px') {
          if (lbxwiddim == 'px') {
            topof = eval(lbxtop - tt[0]);
          } else {
            topof = eval(lbxtop - wicpx);
          }
        }

        jQuery('#pbx_light_' + id).animate(
          { top: '+=' + topof + lbxtopdim },
          'slow'
        );
      }

      if (meditpos == 2) {
        var tt;
        var wicpx;
        var wicps;

        var calcu;
        var rightpx;
        if (lbxrightdim == '%') {
          rightpx = (lbxright * screenwidth) / 100;
        } else {
          rightpx = lbxright;
        }
        var leftset = screenwidth - rightpx - lbxwid;
        document.getElementById('pbx_light_' + id).style.left = leftset + 'px';
        topf = document.getElementById('pbx_light_' + id).style.top;

        if (lbxhedim == '%') {
          tt = topf.split('%');
          var ri = eval(tt[0]);
          wicpx = (screenheight * ri) / 100;
        } else {
          tt = topf.split('px');
          var ri = eval(tt[0]);
          wicps = (100 * ri) / screenheight;
        }
        if (lbxtopdim == '%') {
          if (lbxhedim == '%') {
            topof = eval(lbxtop - tt[0]);
          } else {
            topof = eval(lbxtop - wicps);
          }
        }
        if (lbxtopdim == 'px') {
          if (lbxwiddim == 'px') {
            topof = eval(lbxtop - tt[0]);
          } else {
            topof = eval(lbxtop - wicpx);
          }
        }

        jQuery('#pbx_light_' + id).animate(
          { top: '+=' + topof + lbxtopdim },
          'slow'
        );
      }
      if (meditpos == 3) {
        var tt;
        var wicpx;
        var wicps;
        var ttc;
        var calcu;
        var bottpx;

        document.getElementById('pbx_light_' + id).style.left =
          lbxleft + lbxledim;
        topf = document.getElementById('pbx_light_' + id).style.top;

        if (lbxhedim == '%') {
          tt = topf.split('%');

          wicpx = (screenheight * lbxhe) / 100;
          ttc = (screenheght * tt[0]) / 100;
        } else {
          tt = topf.split('px');

          wicps = (100 * lbxhe) / screenheight;
          ttc = (100 * tt[0]) / screenheight;
        }
        if (lbxbodim == '%') {
          if (lbxhedim == '%') {
            calcu = 100 - lbxhe - lbxbottom;
          } else {
            calcu = 100 - wicps - lbxbottom;
          }
        }
        if (lbxtopdim == 'px') {
          if (lbxwiddim == 'px') {
            calcu = screenheight - lbxhe - lbxbottom;
          } else {
            calcu = screenheight - wicpx - lbxbottom;
          }
        }

        topof = eval(calcu - ttc);

        jQuery('#pbx_light_' + id).animate(
          { top: '+=' + topof + lbxbodim },
          'slow'
        );
      }

      if (meditpos == 4) {
        var tt;
        var wicpx;
        var wicps;
        var ttc;
        var calcu;
        if (lbxrightdim == '%') {
          rightpx = (lbxright * screenwidth) / 100;
        } else {
          rightpx = lbxright;
        }
        var leftset = screenwidth - rightpx - lbxwid;
        document.getElementById('pbx_light_' + id).style.left = leftset + 'px';
        topf = document.getElementById('pbx_light_' + id).style.top;

        if (lbxhedim == '%') {
          tt = topf.split('%');

          wicpx = (screenheight * lbxhe) / 100;
          ttc = (screenheght * tt[0]) / 100;
        } else {
          tt = topf.split('px');

          wicps = (100 * lbxhe) / screenheight;
          ttc = (100 * tt[0]) / screenheight;
        }
        if (lbxbodim == '%') {
          if (lbxhedim == '%') {
            calcu = 100 - lbxhe - lbxbottom;
          } else {
            calcu = 100 - wicps - lbxbottom;
          }
        }
        if (lbxtopdim == 'px') {
          if (lbxwiddim == 'px') {
            calcu = screenheight - lbxhe - lbxbottom;
          } else {
            calcu = screenheight - wicpx - lbxbottom;
          }
        }

        topof = eval(calcu - ttc);

        jQuery('#pbx_light_' + id).animate(
          { top: '+=' + topof + lbxbodim },
          'slow'
        );
      }
    }
  }
  //alert(lbx_tracking_cookie_val);

  if (clbtopt == 1) {
    setTimeout('pbx_show_closebutton_custom(' + id + ')', clbt * 1000);
  }
  expires_date = new Date(xyz_pbx_custom_today.getTime() + repeat * 60 * 1000);
  document.cookie =
    xyz_pbx_tracking_cookie_name +
    '=1;expires=' +
    expires_date.toGMTString() +
    ';path=/';
  eval('xyz_pbx_rendered' + id + '=true');
}

function xyz_pbx_get_cookie_custom(name) {
  var start = document.cookie.indexOf(name + '=');
  //alert(document.cookie);
  var len = start + name.length + 1;
  if (!start && name != document.cookie.substring(0, name.length)) {
    return null;
  }
  if (start == -1) return null;
  var end = document.cookie.indexOf(';', len);
  if (end == -1) end = document.cookie.length;
  return unescape(document.cookie.substring(len, end));
}

function xyz_lbx_trigerback89(evt) {
  pbx_hide_lightbox_custom(
    evt
  );
}

function xyz_lbx_trig89() {
  window['xyz_pbx_pc_cookie_name' + popID] = '_xyz_pbx_pc_' + popID;
  window['xyz_pbx_pc_cookie_val' + popID] = xyz_pbx_get_cookie_custom(window['xyz_pbx_pc_cookie_name' + popID]);

  if (window['xyz_pbx_pc_cookie_val' + popID] == null) window['xyz_pbx_pc_cookie_val' + popID] = 1;
  else
	window['xyz_pbx_pc_cookie_val' + popID] = (window['xyz_pbx_pc_cookie_val' + popID] % window['pbx_pagecount' + popID]) + 1;

  expires_date = new Date(xyz_pbx_custom_today.getTime() + 24 * 60 * 60 * 1000);
  document.cookie =
    window['xyz_pbx_pc_cookie_name' + popID] +
    '=' +
    window['xyz_pbx_pc_cookie_val' + popID] +
    ';expires=' +
    expires_date.toGMTString() +
    ';path=/';

  if ('delay_only' == 'page_count_only')
    pbx_show_lightbox_custom(
      window['pbx_id' + popID],
      window['xyz_pbx_pc_cookie_val' + popID],
      'delay_only',
      window['pbx_pagecount' + popID],
      window['pbx_repeat' + popID],
      window['pbx_clbtopt' + popID],
      window['pbx_clbt' + popID],
      window['pbx_trigger' + popID],
      window['pbx_trigger_onclick_method' + popID],
      window['pbx_displayoutopt' + popID],
      window['pbx_posit' + popID],
      window['pbx_def_disp' + popID],
      window['pbx_slideab' + popID],
      window['pbx_slidestart' + popID],
      window['pbx_lbxhe' + popID],
      window['pbx_lbxhedim' + popID],
      window['pbx_meditpos' + popID],
      window['pbx_lbxleft' + popID],
      window['pbx_lbxledim' + popID],
      window['pbx_lbxwid' + popID],
      window['pbx_lbxwiddim' + popID],
      window['pbx_wiadjust' + popID],
      window['pbx_hadjust' + popID],
      window['pbx_lbxbdwidth' + popID],
      window['pbx_lbxtop' + popID],
      window['pbx_lbxtopdim' + popID],
      window['pbx_lbxbottom' + popID],
      window['pbx_lbxbodim' + popID],
      window['pbx_lbxright' + popID],
      window['pbx_lbxrightdim' + popID]
    );
  else
    setTimeout(
      'pbx_show_lightbox_custom(' +
        window['pbx_id' + popID] +
        ',' +
        window['xyz_pbx_pc_cookie_val' + popID] +
        ',"delay_only" ,' +
        window['pbx_pagecount' + popID] +
        ',' +
        window['pbx_repeat' + popID] +
        ',' +
        window['pbx_clbtopt' + popID] +
        ',' +
        window['pbx_clbt' + popID] +
        ',' +
        window['pbx_trigger' + popID] +
        ',' +
        window['pbx_trigger_onclick_method' + popID] +
        ',' +
        window['pbx_displayoutopt' + popID] +
        ',' +
        window['pbx_posit' + popID] +
        ',' +
        window['pbx_def_disp' + popID] +
        ',' +
        window['pbx_slideab' + popID] +
        ',' +
        window['pbx_slidestart' + popID] +
        ',' +
        window['pbx_lbxhe' + popID] +
        ',"' +
        window['pbx_lbxhedim' + popID] +
        '",' +
        window['pbx_meditpos' + popID] +
        ',' +
        window['pbx_lbxleft' + popID] +
        ',"' +
        window['pbx_lbxledim' + popID] +
        '",' +
        window['pbx_lbxwid' + popID] +
        ',"' +
        window['pbx_lbxwiddim' + popID] +
        '",' +
        window['pbx_wiadjust' + popID] +
        ',' +
        window['pbx_hadjust' + popID] +
        ',' +
        window['pbx_lbxbdwidth' + popID] +
        ',' +
        window['pbx_lbxtop' + popID] +
        ',"' +
        window['pbx_lbxtopdim' + popID] +
        '",' +
        window['pbx_lbxbottom' + popID] +
        ',"' +
        window['pbx_lbxbodim' + popID] +
        '",' +
        window['pbx_lbxright' + popID] +
        ',"' +
        window['pbx_lbxrightdim' + popID] +
        '")',
      100
    );

  window['xyz_pbx_rendered' + popID] = true;
}

function executejs89() {
  jQuery(document).ready(function() {
    var screenheight = jQuery(window).height();
    var screenwidth = jQuery(window).width();
    
    if (window['pbx_displayoutopt' + popID] == 3) {
      window['pbx_lbxhe' + popID] = screenheight - 2 * window['pbx_lbxbdwidth' + popID];
      window['pbx_lbxwid' + popID] = screenwidth - 2 * window['pbx_lbxbdwidth' + popID];
      // document.getElementById('pbx_light_' + popID).style.height =
      //   window['pbx_lbxhe' + popID] + 'px';
      document.getElementById('pbx_light_' + popID).style.width =
        window['pbx_lbxwid' + popID] + 'px';
    } else {
      if (window['pbx_lbxhedim' + popID] == '%') {
        var hadnjust = (screenheight * window['pbx_lbxhe' + popID]) / 100;
        window['pbx_lbxhe' + popID] = hadnjust - 2 * window['pbx_lbxbdwidth' + popID];
        // document.getElementById('pbx_light_' + popID).style.height =
        //   window['pbx_lbxhe' + popID] + 'px';
        window['pbx_lbxhedim' + popID] = 'px';
      } else {
        window['pbx_lbxhe' + popID] = window['pbx_lbxhe' + popID] - 2 * window['pbx_lbxbdwidth' + popID];
        // document.getElementById('pbx_light_' + popID).style.height =
        //   window['pbx_lbxhe' + popID] + 'px';
      }

      if (window['pbx_lbxwiddim' + popID] == '%') {
        var wiadnjust = (screenwidth * window['pbx_lbxwid' + popID]) / 100;
        window['pbx_lbxwid' + popID] = wiadnjust - 2 * window['pbx_lbxbdwidth' + popID];
        document.getElementById('pbx_light_' + popID).style.width =
          window['pbx_lbxwid' + popID] + 'px';
        window['pbx_lbxwiddim' + popID] = 'px';
      } else {
        window['pbx_lbxwid' + popID] = window['pbx_lbxwid' + popID] - 2 * window['pbx_lbxbdwidth' + popID];
        // document.getElementById('pbx_light_' + popID).style.width =
        //   window['pbx_lbxwid' + popID] + 'px';
      }
    }

    if (window['pbx_lbxhedim' + popID] == 'px') {
      window['pbx_hadjust' + popID] = (screenheight - window['pbx_lbxhe' + popID]) / 2;
    } else {
      window['pbx_hadjust' + popID] = (100 - window['pbx_lbxhe' + popID]) / 2;
    }
    if (window['pbx_lbxwiddim' + popID] == 'px') {
      window['pbx_wiadjust' + popID] = (screenwidth - window['pbx_lbxwid' + popID]) / 2;
    } else {
      window['pbx_wiadjust' + popID] = (100 - window['pbx_lbxwid' + popID]) / 2;
    }

    if (window['pbx_displayoutopt' + popID] == 4) {
      var widtr = document.getElementById('lbx_trig_div_' + popID).offsetWidth;
      var hetr = document.getElementById('lbx_trig_div_' + popID).offsetHeight;
      var pbx_lbxwidtos;
      var pbx_lbxhetos;
      if (window['pbx_lbxwiddimold' + popID] == '%') {
        pbx_lbxwidtos = window['pbx_lbxwid' + popID] + 2 * window['pbx_lbxbdwidth' + popID];
      } else {
        pbx_lbxwidtos = window['pbx_lbxwid' + popID];
      }
      if (window['pbx_lbxhedimold' + popID] == '%') {
        pbx_lbxhetos = window['pbx_lbxhe' + popID] + 2 * window['pbx_lbxbdwidth' + popID];
      } else {
       pbx_lbxhetos = window['pbx_lbxhe' + popID];
      }

      if (window['pbx_slidestart' + popID] == 0) {
        document.getElementById('lbx_trig_div_' + popID).style.top = '0px';

        if (window['pbx_def_disp' + popID] == 1) {
          var calcu = (pbx_lbxwidtos - widtr) / 2;

          document.getElementById('lbx_trig_div_' + popID).style.left =
            calcu + 'px';
          if (window['pbx_slideab' + popID] == 0) {
            document.getElementById('pbx_light_' + popID).style.top = '0px';
            document.getElementById('pbx_light_' + popID).style.left = '0px';
          }
        }
        if (window['pbx_def_disp' + popID] == 8) {
          var calcu = (screenwidth - widtr) / 2;

          document.getElementById('lbx_trig_div_' + popID).style.left =
            calcu + 'px';
          if (window['pbx_slideab' + popID] == 0) {
            document.getElementById('pbx_light_' + popID).style.top = '0px';
            document.getElementById('pbx_light_' + popID).style.left =
              window['pbx_wiadjust' + popID] + window['pbx_lbxwiddim' + popID];
          }
        }
        if (window['pbx_def_disp' + popID] == 7) {
          var calcu = (pbx_lbxwidtos - widtr) / 2;

          document.getElementById('lbx_trig_div_' + popID).style.right =
            calcu + 'px';
          if (window['pbx_slideab' + popID] == 0) {
            document.getElementById('pbx_light_' + popID).style.top = '0px';
            document.getElementById('pbx_light_' + popID).style.right = '0px';
          }
        }
      }

      if (window['pbx_slidestart' + popID] == 1) {
        document.getElementById('lbx_trig_div_' + popID).style.left = '0px';
        if (window['pbx_def_disp' + popID] == 1) {
          var calcu = (pbx_lbxhetos - hetr) / 2;
          document.getElementById('lbx_trig_div_' + popID).style.top =
            calcu + 'px';
          if (window['pbx_slideab' + popID] == 0) {
            document.getElementById('pbx_light_' + popID).style.top = '0px';
            document.getElementById('pbx_light_' + popID).style.left = '0px';
          }
        }
        if (window['pbx_def_disp' + popID] == 2) {
          var calcu = (screenheight - hetr) / 2;
          document.getElementById('lbx_trig_div_' + popID).style.top =
            calcu + 'px';
          if (window['pbx_slideab' + popID] == 0) {
            document.getElementById('pbx_light_' + popID).style.top =
              window['pbx_hadjust' + popID] + window['pbx_lbxhedim' + popID];
            document.getElementById('pbx_light_' + popID).style.left = '0px';
          }
        }
        if (window['pbx_def_disp' + popID] == 3) {
          var calcu = (pbx_lbxhetos - hetr) / 2;

          document.getElementById('lbx_trig_div_' + popID).style.bottom =
            calcu + 'px';
          if (window['pbx_slideab' + popID] == 0) {
            document.getElementById('pbx_light_' + popID).style.bottom = '0px';
            document.getElementById('pbx_light_' + popID).style.left = '0px';
          }
        }
      }
      if (window['pbx_slidestart' + popID] == 2) {
        document.getElementById('lbx_trig_div_' + popID).style.right = '0px';
        if (window['pbx_def_disp' + popID] == 7) {
          var calcu = (pbx_lbxhetos - hetr) / 2;
          document.getElementById('lbx_trig_div_' + popID).style.top =
            calcu + 'px';
          if (window['pbx_slideab' + popID] == 0) {
            document.getElementById('pbx_light_' + popID).style.top = '0px';
            document.getElementById('pbx_light_' + popID).style.right = '0px';
          }
        }
        if (window['pbx_def_disp' + popID] == 6) {
          var calcu = (screenheight - hetr) / 2;
          document.getElementById('lbx_trig_div_' + popID).style.top =
            calcu + 'px';
          if (window['pbx_slideab' + popID] == 0) {
            document.getElementById('pbx_light_' + popID).style.top =
						window['pbx_hadjust' + popID] + window['pbx_lbxhedim' + popID];
            document.getElementById('pbx_light_' + popID).style.right = '0px';
          }
        }
        if (window['pbx_def_disp' + popID] == 5) {
          var calcu = (pbx_lbxhetos - hetr) / 2;

          document.getElementById('lbx_trig_div_' + popID).style.bottom =
            calcu + 'px';
          if (window['pbx_slideab' + popID] == 0) {
            document.getElementById('pbx_light_' + popID).style.bottom = '0px';
            document.getElementById('pbx_light_' + popID).style.right = '0px';
          }
        }
      }
      if (window['pbx_slidestart' + popID] == 3) {
        document.getElementById('lbx_trig_div_' + popID).style.bottom = '0px';

        if (window['pbx_def_disp' + popID] == 3) {
          var calcu = (pbx_lbxwidtos - widtr) / 2;
          document.getElementById('lbx_trig_div_' + popID).style.left =
            calcu + 'px';
          if (window['pbx_slideab' + popID] == 0) {
            document.getElementById('pbx_light_' + popID).style.bottom = '0px';
            document.getElementById('pbx_light_' + popID).style.left = '0px';
          }
        }
        if (window['pbx_def_disp' + popID] == 4) {
          var calcu = (screenwidth - widtr) / 2;

          document.getElementById('lbx_trig_div_' + popID).style.left =
            calcu + 'px';
          if (window['pbx_slideab' + popID] == 0) {
            document.getElementById('pbx_light_' + popID).style.bottom = '0px';
            document.getElementById('pbx_light_' + popID).style.left =
						window['pbx_wiadjust' + popID] + window['pbx_lbxwiddim' + popID];
          }
        }
        if (window['pbx_def_disp' + popID] == 5) {
          var calcu = (pbx_lbxwidtos - widtr) / 2;

          document.getElementById('lbx_trig_div_' + popID).style.right =
            calcu + 'px';
          if (window['pbx_slideab' + popID] == 0) {
            document.getElementById('pbx_light_' + popID).style.bottom = '0px';
            document.getElementById('pbx_light_' + popID).style.right = '0px';
          }
        }
      }
      document.getElementById('lbx_trig_div_' + popID).style.visibility =
        'visible';
    }

    if (window['pbx_displayoutopt' + popID] == 5) {
      window['hatoset' + popID];
      window['widtoset' + popID];

      window['widtoset' + popID] = window['pbx_wiadjust' + popID] - window['pbx_lbxbdwidth' + popID];

      window['hatoset' + popID] = window['pbx_hadjust' + popID] - window['pbx_lbxbdwidth' + popID];

      if (window['pbx_def_disp' + popID] == 2) {
        document.getElementById('pbx_light_' + popID).style.top =
				window['hatoset' + popID] + window['pbx_lbxhedim' + popID];
        document.getElementById('pbx_light_' + popID).style.left = '0px';
      }
      if (window['pbx_def_disp' + popID] == 1) {
        document.getElementById('pbx_light_' + popID).style.top = '0px';
        document.getElementById('pbx_light_' + popID).style.left = '0px';
      }
      if (window['pbx_def_disp' + popID] == 3) {
        document.getElementById('pbx_light_' + popID).style.bottom = '0px';
        document.getElementById('pbx_light_' + popID).style.left = '0px';
      }
      if (window['pbx_def_disp' + popID] == 4) {
        document.getElementById('pbx_light_' + popID).style.bottom = '0px';
        document.getElementById('pbx_light_' + popID).style.left =
				window['widtoset' + popID] + window['pbx_lbxwiddim' + popID];
      }
      if (window['pbx_def_disp' + popID] == 5) {
        document.getElementById('pbx_light_' + popID).style.bottom = '0px';
        document.getElementById('pbx_light_' + popID).style.right = '0px';
      }
      if (window['pbx_def_disp' + popID] == 6) {
        document.getElementById('pbx_light_' + popID).style.top =
				window['hatoset' + popID] + window['pbx_lbxhedim' + popID];
        document.getElementById('pbx_light_' + popID).style.right = '0px';
      }
      if (window['pbx_def_disp' + popID] == 7) {
        document.getElementById('pbx_light_' + popID).style.top = '0px';
        document.getElementById('pbx_light_' + popID).style.right = '0px';
      }
      if (window['pbx_def_disp' + popID] == 8) {
        document.getElementById('pbx_light_' + popID).style.top = '0px';
        document.getElementById('pbx_light_' + popID).style.left =
				window['widtoset' + popID] + window['pbx_lbxwiddim' + popID];
      }
    }

    if (document.getElementById('pbx_closediv' + popID) != null) {
      document.getElementById('pbx_closediv' + popID).style.position = 'absolute';
    }
    if (window['pbx_displayoutopt' + popID] == 2) {
      if (window['pbx_draggab' + popID] == 1) {
        jQuery('#pbx_light_' + popID).draggable({
          containment: 'window',
          scroll: false
        });
      }
    }
  });

  jQuery(document).ready(function() {
    
    function addClickEvent(a, i, func) {
      if (typeof a[i].onclick != 'function') {
        a[i].onclick = func;
      }
    }
    var a = document.getElementsByTagName('A');
    for (var i = 0; i < a.length; i++) {
      addClickEvent(a, i, function() {
        window['xyz_pbx_show_splash' + popID] = false;
      });
    }

    var f = document.getElementsByTagName('FORM');
    for (var i = 0; i < f.length; i++) {
      if (!f[i].onclick) {
        f[i].onclick = function() {
          window['xyz_pbx_show_splash' + popID] = false;
        };
      } else if (!f[i].onsubmit) {
        f[i].onsubmit = function() {
          window['xyz_pbx_show_splash' + popID] = false;
        };
      }
    }

    if (window['pbx_trigger' + popID] == 1) {
      //xyz_lbx_trig89();
    } else {
      window['trigelement' + popID];
      if (window['pbx_displayoutopt' + popID] != 4) {
        window['trigelement' + popID] = '';
        if (window['trigelement' + popID] == '') {
          window['trigelement' + popID] = 'body';
        }
      } else {
        window['trigelement' + popID] = '#lbx_trig_div_' + popID;
      }

      if (window['pbx_trigger' + popID] == 3) {
        window['trigelement' + popID] = '#xyz_pbx_exit_' + popID;

        window.onbeforeunload = function() {
          if (
            window['xyz_pbx_rendered' + popID] == false &&
            window['xyz_pbx_show_splash' + popID] == true &&
            window['xyz_pbx_until_cookcheck' + popID] == 0
          ) {
            setTimeout(function() {
              setTimeout(function() {
                jQuery('#xyz_pbx_exit_' + popID).trigger('click');
              }, 300);
            }, 1);
            return '';
            //return exitsplashmessage;
            //xyz_lbx_trig89();
          }
        };
      }

      jQuery(window['trigelement' + popID]).click(function(event) {
        if (window['xyz_pbx_rendered' + popID] == false) {
          window['xyz_lbx_trig' + popID]();
        } else {
          if (window['pbx_displayoutopt' + popID] == 4 && window['xyz_pbx_rendered' + popID] == true) {
            window['xyz_lbx_trigerback' + popID](event);
          }
        }
      });
    }

    
  });
}

function loadScript(url, callback) {
  // adding the script tag to the head as suggested before
  var head = document.getElementsByTagName('head')[0];
  var script = document.createElement('script');
  script.type = 'text/javascript';
  script.src = url;

  // then bind the event to the callback function
  // there are several events for cross browser compatibility
  if (script.readyState) {
    //IE
    script.onreadystatechange = function() {
      if (script.readyState == 'loaded' || script.readyState == 'complete') {
        script.onreadystatechange = null;
        callback();
        
      }
    };
  } else {
    //Others
    script.onload = function() {
      callback();
      getPopupHtml(popID)
    };
  }
  //script.onreadystatechange = callback;
  //script.onload = callback;

  // fire the loading
  head.appendChild(script);
  
}
var url1 = 'https://lpp.t2connect.com/common/js/jquery.js';
var url2 = 'https://lpp.t2connect.com/common/js/jquery-ui-1.8.21.custom.min.js';

function jqloader89() {
  if (window['jqload' + popID] == -1) {
    window['jqload' + popID] = 2;
    loadScript(url2, jqminloader89);
  }
}
function jqminloader89() {
  if (window['jqminload' + popID] == -1) {
    window['jqminload' + popID] = 2;

    executejs89();
  }
}

loadScript(url1, jqloader89);


function getPopupHtml(ID) {
  if(typeof $ == 'undefined') return;
  $.ajax({
    url:"https://next.t2connect.com/landing/lpp/index_html.php?page=popup/display/" + ID,
    method:"POST",
    crossDomain: true,
    data:{ID:ID},
  
    success:function(data){ 
      if(!data) return;
        $("#data").append(
          '			<style type="text/css">#parent{width: 740px !important;}	#data button{ margin-top: -60px; height: 45px;}					#pbx_fade_' + popID + '{			display: none;			position: fixed;						top: 0%;			left: 0%;			width: 100%;			height: 100%;			background-color:#000000;			z-index:10000;			-moz-opacity: 0.6;			opacity:0.6;			filter: alpha(opacity=60);									}						#pbx_light_' + popID + '{			display: none;										-moz-opacity: 1;			opacity:1;			filter: alpha(opacity=100);					width: 740px !important;		height: auto !important;			padding: 0px;			margin: 0px;			background-color: #cccccc;						z-index:10001;						overflow: hidden;			border-radius:5px;						}						.pbx_iframe{						width:100%;			height:100%;			border:0;									}						.lbx_trig_' + popID + '{		visibility: hidden;		position: fixed;		cursor:pointer;			background: #cccccc; /* Old browsers */		font-size:14px;		padding:5px 10px;		z-index:10001;		float: right;		color: #000000;				}			.pbx_dbx' + popID + '{			background: #cccccc; /* Old browsers */				color: #000000;		font-size:14px;		min-height:25px;		}					#pbx_closediv' + popID + '{		position:absolute;		cursor:pointer;				top: 0px;		right:0px;				}			</style>			<div id="pbx_fade_' + popID + '"   class="fade"></div>	<span style="display:none;" id="xyz_pbx_exit_' + popID + '"></span>			<div id="pbx_light_' + popID + '" class="light"><img id="pbx_closediv' + popID + '"  src="https://lpp.t2connect.com/images/close.png " onclick = "javascript:pbx_hide_lightbox_custom(event)">'+data+'</div>'	
        );
        xyz_lbx_trig89();
        document.getElementById('pbx_light_' + popID).style.position = 'fixed';
    }
  });
}