(function() {var settings={};
GB_getPageScrollTop = function(){
var yScrolltop;var xScrollleft;
if (self.pageYOffset || self.pageXOffset) {
yScrolltop = self.pageYOffset;
xScrollleft = self.pageXOffset;} else if(document.documentElement&& document.documentElement.scrollTop || document.documentElement.scrollLeft ){ // Explorer 6 Strict
yScrolltop = document.documentElement.scrollTop;xScrollleft = document.documentElement.scrollLeft;
} else if (document.body) { // all other Explorers
yScrolltop = document.body.scrollTop;xScrollleft = document.body.scrollLeft;}
arrayPageScroll = new Array(xScrollleft,yScrolltop);return arrayPageScroll;}
GB_overlay_size = function() {
try {
if(window.innerHeight && window.scrollMaxY || window.innerWidth && window.scrollMaxX) {
h = window.innerHeight + window.scrollMaxY;w = window.innerWidth + window.scrollMaxX;
var deff = document.documentElement;
var wff = (deff&&deff.clientWidth) || document.body.clientWidth || window.innerWidth || self.innerWidth;
var hff = (deff&&deff.clientHeight) || document.body.clientHeight || window.innerHeight || self.innerHeight;
w -= (window.innerWidth - wff);h -= (window.innerHeight - hff);
} else if(document.body.scrollHeight > document.body.offsetHeight
 || document.body.scrollWidth > document.body.offsetWidth) { // all but Explorer Mac
h = document.body.scrollHeight;w = document.body.scrollWidth;} else {
// Explorer Mac.would also work in Explorer 6 Strict, Mozilla and Safari
var left_top = GB_getPageScrollTop();
h = left_top[1] + settings.height;w = left_top[0] + settings.width;
if( h < document.body.offsetHeight) {h = document.body.offsetHeight;}
if( w < document.body.offsetWidth) {w = document.body.offsetWidth;}
}
} catch(err) {w = $(document.body).width();h = $(document.body).height();}
$("#GB_overlay").css({"height":h+"px", "width":w +"px"});}
GB_position = function() {
var boxWidth = settings.width;var boxHeight = settings.height;
$('#GB_window').css({marginLeft: '-' + parseInt(boxWidth / 2) + 'px',width: boxWidth + 'px',height: settings.height+"px"});
if( !($.browser.msie && typeof(XMLHttpRequest) == 'function')) {
// take away IE6
$('#GB_window').css({marginTop: '-' + parseInt(boxHeight / 2)+'px'});}
$("#GB_frame").css("height",settings.height - 32 +"px");}
$.GB_hide = function() {$("#GB_window,#GB_overlay").remove();}
$.GB_show = function(url, options) {
settings = $.extend({height:400,width:400,overlay_clickable:true,overflow:"auto",caption:""}, options || {});
$(document.body).append("<div id='GB_overlay'></div>" + "<div id='GB_window'><div id='GB_caption'></div>" + "<img class='close' src='close.gif' alt='Close Window'></div>");
$("#GB_window img").click($.GB_hide);
if(settings.overlay_clickable) {$("#GB_overlay").click($.GB_hide);}
$("#GB_window").append("<iframe id='GB_frame' src='"+url+"'></iframe>");$("#GB_frame").attr("overflow", settings.overflow);$("#GB_caption").html(settings.caption);
GB_overlay_size();$(window).resize(GB_overlay_size);$(window).scroll(GB_overlay_size);
$("#GB_overlay").show();$('#GB_overlay').animate({opacity:'.6'});GB_position();$("#GB_window").show();}
})();

