/**
 * OmniBox
 * OmniTools v1.2.0
 *
 * Copyright 2008-2010 NOTOsoft Web Designs Inc.
 * Licensed under the GPLv3 license
 *
 * You should have received a copy of the GNU General Public License
 * along with this file.  If not, see <http://www.gnu.org/licenses/>.
 */
(function(a){function f(){a("#"+b.BOX_OVERLAY_ID+", #"+b.BOX_BORDER_ID).remove();a(document.createElement("div")).attr({id:b.BOX_OVERLAY_ID}).appendTo(a("body"));var c=a(document.createElement("div")).attr({id:b.BOX_BORDER_ID}).appendTo(a("body"));a(document.createElement("div")).attr({id:b.BOX_TOPSPACE_ID}).appendTo(c);a(document.createElement("div")).attr({id:b.BOX_CONTAINER_ID,className:"loading",innerHTML:'<div id="lbLoadMessage"></div>'}).appendTo(c);a(document.createElement("div")).attr({id:b.BOX_BOTTOMSPACE_ID}).appendTo(c)}
function i(c){a.ajax({type:"POST",url:c,data:b.options.params,success:j,error:function(){throw Error("Ajax request failed");}})}function j(c){var d=a(document.createElement("div")).attr({id:b.BOX_CONTENTAREA_ID}).prependTo(a("#"+b.BOX_CONTAINER_ID)),k=a(document.createElement("div")).attr({id:"closeBox"}).appendTo(d);a(document.createElement("div")).attr({id:"closeBoxIcon",title:"Close this window"}).click(function(){a.OmniBox.deactivate()}).appendTo(k);d.append(c);a("#"+b.BOX_CONTAINER_ID).attr({className:"done"});
g();b.options.boxload()}function g(){var c=a("#"+b.BOX_BORDER_ID).height()+150,d=a(window).width();if(c<a(window).height())a("#"+b.BOX_OVERLAY_ID).css({width:d,height:"130%"});else if(c<a(document).height()&&c>a(window).height()){a("#"+b.BOX_OVERLAY_ID).css({width:d,height:c});a("html").css({overflow:"auto"});if(document.getElementById(b.BOX_OVERLAY_ID).scrollHeight!=c){a("#"+b.BOX_OVERLAY_ID).height(a(document).height());e("100%","auto")}}else{e("100%","auto");a("#"+b.BOX_OVERLAY_ID).css({width:d,
height:c})}h()}function h(){a("#"+b.BOX_BORDER_ID).css("left",(a(window).width()-a("#"+b.BOX_BORDER_ID).width())/2+a(window).scrollLeft()+"px")}function e(c,d){a("body").css({height:c,overflow:d});a("html").css({height:c,overflow:d})}var b={BOX_OVERLAY_ID:"omniBoxOverlay",BOX_CONTAINER_ID:"omniBox",BOX_BORDER_ID:"omniBoxBorder",BOX_TOPSPACE_ID:"omniBoxTopSpace",BOX_BOTTOMSPACE_ID:"omniBoxBottomSpace",BOX_CONTENTAREA_ID:"lbContent",b_LightboxActive:false,yPos:0,options:{}};a(window).ready(function(){f();
a(window).resize(function(){b.b_LightboxActive&&g()})});a.OmniBox={activate:function(c,d){if(c)if(b.b_LightboxActive)alert("Please refresh the this page to use this function");else{b.b_LightboxActive=true;b.options=a.extend({},{params:{},boxcss:{},bordercss:{},overlaycss:{},boxload:function(){},boxunload:function(){}},!d?{}:d);a("#"+b.BOX_OVERLAY_ID).css({opacity:0.8});a("#"+b.BOX_OVERLAY_ID).css(b.options.overlaycss);a("#"+b.BOX_BORDER_ID).css(b.options.bordercss);a("#"+b.BOX_CONTAINER_ID).css(b.options.boxcss);
if(self.pageYOffset)b.yPos=self.pageYOffset;else if(document.documentElement&&document.documentElement.scrollTop)b.yPos=document.documentElement.scrollTop;else if(document.body)b.yPos=document.body.scrollTop;e("100%","hidden");window.scrollTo(0,0);h();a("#"+b.BOX_OVERLAY_ID).fadeIn("slow");a("#"+b.BOX_BORDER_ID).fadeIn("slow");i(c);a("#"+b.BOX_CONTAINER_ID).attr({className:"loading"});a("#"+b.BOX_OVERLAY_ID).focus()}else throw Error("OmniBox param 1 must be defined!");},deactivate:function(){a("#"+
b.BOX_BORDER_ID).fadeOut("slow",function(){b.b_LightboxActive=false;f();e("100%","visible");window.scrollTo(0,b.yPos)});a("#"+b.BOX_OVERLAY_ID).fadeOut("slow");b.options.boxunload()}}})(jQuery);

/**
 * OmniGallery
 * OmniTools v1.2.0
 *
 * Copyright 2008-2010 NOTOsoft Web Designs Inc.
 * Licensed under the GPLv3 license
 *
 * You should have received a copy of the GNU General Public License
 * along with this file.  If not, see <http://www.gnu.org/licenses/>.
 */
(function(c){function l(){c("."+a.GAL_PORTRAITBOX_CLASSID+", ."+a.GAL_IMAGE_CLASSID).live("click",function(b){b.stopPropagation()});c("body:not(."+a.GAL_IMAGE_CLASSID+")").live("click",function(){j()})}function m(b){var g=c(document.createElement("div")).attr({className:a.GAL_OUTERCONTAINER_CLASSID}).appendTo(b);c(document.createElement("div")).attr({id:a.GAL_CONTAINER_ID+a.galCount,className:a.GAL_CONTAINER_ID}).appendTo(g);if(a.numOfPages>1){c(document.createElement("div")).attr({className:a.GAL_ARROW_LEFT_CLASSID}).css({top:b.innerHeight()/
2-d.imgMargin,left:5}).hide().click(function(){k(c(this),"LEFT")}).prependTo(g);c(document.createElement("div")).attr({className:a.GAL_ARROW_RIGHT_CLASSID}).css({top:b.innerHeight()/2-d.imgMargin,left:b.width()-d.imgMargin-5}).click(function(){k(c(this),"RIGHT")}).prependTo(g)}b=c(document.createElement("div")).attr({className:a.GAL_PORTRAITBOX_CLASSID}).appendTo(b).draggable({handle:"div"});b=c(document.createElement("div")).attr({className:a.GAL_PORTRAITBOX_HANDLE_CLASSID,title:"Drag me!"}).appendTo(b);
c(document.createElement("div")).attr({className:a.GAL_PORTRAITBOX_HANDLE_MOVEIMG_CLASSID}).appendTo(b);c(document.createElement("div")).attr({className:a.GAL_PORTRAITBOX_HANDLE_CLOSEIMG_CLASSID,title:"Close Image"}).appendTo(b).click(function(){j()})}function n(b,g){var e=parseInt(g-1,10),f="#"+a.GAL_CONTAINER_ID+a.galCount;e=c(document.createElement("div")).attr({className:a.GAL_IMAGE_CLASSID}).appendTo(c(f+" > div:eq("+e+")")).css({margin:d.imgMargin+"px"});var h=d.portraitBoxWidth,i=d.portraitBoxHeight;
c(document.createElement("img")).attr({src:d.imgsFolder+b.src,alt:""}).height(a.imageHeight).width(a.imageWidth).click(function(){o(c(this),h,i,b)}).appendTo(e)}function o(b,g,e,f){if(!a.b_InAnimation){a.b_InAnimation=true;j();var h=b.parent().parent().parent().parent().siblings("."+a.GAL_PORTRAITBOX_CLASSID),i=parseFloat(c("."+a.GAL_PORTRAITBOX_HANDLE_CLASSID).css("height"));h.find("img:not(."+a.GAL_PORTRAITBOX_HANDLE_CLASSID+" img)").remove();h.css({top:b.offset().top,left:b.offset().left,width:b.width(),
height:b.height()});b=c(document.createElement("img")).attr({src:d.imgsFolder+f.src,alt:""}).appendTo(h).width(g).height(e-i);f.href&&b.click(function(){window.open(f.href)}).hover(function(){c(this).css("cursor","pointer")});h.show();h.animate({width:g+"px",height:e+"px",top:(c(window).height()-e)/2+c(window).scrollTop()+"px",left:(c(window).width()-g)/2+c(window).scrollLeft()+"px",opacity:1},700,function(){a.b_InAnimation=false})}}function k(b,g){var e=b.parent().parent().find("."+a.GAL_CONTAINER_ID),
f=e.find("."+a.GAL_ACTIVE_PAGE_CLASSID);switch(g){case "LEFT":f.prev().attr("class",a.GAL_ACTIVE_PAGE_CLASSID);f.attr("class",a.GAL_INACTIVE_PAGE_CLASSID);e.animate({left:"+="+parseInt(a.pageWidth,10)},1E3);b.parent().parent().find("."+a.GAL_ARROW_RIGHT_CLASSID).show();f.prev().prev().length==0&&b.parent().parent().find("."+a.GAL_ARROW_LEFT_CLASSID).hide();break;case "RIGHT":f.next().attr("class",a.GAL_ACTIVE_PAGE_CLASSID);f.attr("class",a.GAL_INACTIVE_PAGE_CLASSID);e.animate({left:"-="+parseInt(a.pageWidth,
10)},1E3);b.parent().parent().find("."+a.GAL_ARROW_LEFT_CLASSID).show();f.next().next().length==0&&b.parent().parent().find("."+a.GAL_ARROW_RIGHT_CLASSID).hide();break;default:throw Error("OmniGallery::changePage parameter 2 can only be 'LEFT', or 'RIGHT'");}}function j(){c("."+a.GAL_PORTRAITBOX_CLASSID).height(0).width(0).hide()}c(function(){l()});var a={GAL_OUTERCONTAINER_CLASSID:"omniGalleryContainer",GAL_CONTAINER_ID:"omniGallery",GAL_ARROW_LEFT_CLASSID:"omniGalleryLeftArrow",GAL_ARROW_RIGHT_CLASSID:"omniGalleryRightArrow",
GAL_PAGE_CLASSID:"omniGalleryPage",GAL_IMAGE_CLASSID:"omniGalleryImage",GAL_ACTIVE_PAGE_CLASSID:"omniGalleryActivePage",GAL_INACTIVE_PAGE_CLASSID:"omniGalleryInactivePage",GAL_PORTRAITBOX_CLASSID:"omniGalleryPortraitBox",GAL_PORTRAITBOX_HANDLE_CLASSID:"omniGalleryPortraitBoxHandle",GAL_PORTRAITBOX_HANDLE_MOVEIMG_CLASSID:"omniGalleryPortraitBoxHandleMoveImg",GAL_PORTRAITBOX_HANDLE_CLOSEIMG_CLASSID:"omniGalleryPortraitBoxHandleCloseImg",GAL_PAGE_MARGIN_TOTAL:40,numOfPages:1,imagesPerPage:5,pageWidth:0,
imageWidth:0,imageHeight:0,galCount:1,visiblePage:1,b_InAnimation:false},d={rows:1,cols:5,imgMargin:10,imgsFolder:"resources/images/",portraitBoxWidth:400,portraitBoxHeight:320};c.OmniGallery={create:function(b,g,e){if(b.exists("OmniGallery.create")&&c.isArray(g)){d=c.extend(d,!e||typeof e!="object"?{}:e);a.imagesPerPage=d.cols*d.rows;a.numOfPages=Math.ceil(g.length/a.imagesPerPage);a.pageWidth=b.width();a.imageWidth=(b.width()-a.GAL_PAGE_MARGIN_TOTAL-d.cols*d.imgMargin*2)/d.cols;a.imageHeight=(b.height()-
d.rows*d.imgMargin*2)/d.rows;m(b);e=0;for(var f=1;f<=a.numOfPages;f++){var h=f;c(document.createElement("div")).attr({className:h==1?a.GAL_ACTIVE_PAGE_CLASSID:a.GAL_INACTIVE_PAGE_CLASSID}).appendTo(c("#"+a.GAL_CONTAINER_ID+a.galCount)).width(a.pageWidth-a.GAL_PAGE_MARGIN_TOTAL);for(h=1;h<=d.rows;h++)for(var i=1;i<=d.cols;i++)if(typeof g[e]=="object"){n(g[e],f);e++}}b.find("#"+a.GAL_PAGE_CLASSID+a.visiblePage).show();a.galCount++}else throw Error("The OmniGallery container must exist, and the images parameter must be an array.");
}}})(jQuery);

/**
 * OmniMenu
 * OmniTools v1.2.0
 *
 * Copyright 2008-2010 NOTOsoft Web Designs Inc.
 * Licensed under the GPLv3 license
 *
 * You should have received a copy of the GNU General Public License
 * along with this file.  If not, see <http://www.gnu.org/licenses/>.
 */
(function(a){function h(){a("#"+d.MENU_BOX_ID+" div").live("mouseover",function(){a(this).fadeOut(100);a(this).fadeIn(300)});a(document.createElement("div")).attr("id",d.MENU_BOX_ID).css("display","none").mouseleave(function(c){c.relatedTarget!==b.hoverEle[0]?a.OmniMenu.hide():g()}).appendTo(a("body"))}function i(){var c=a(b.hoverEle).offset(),e=a(b.hoverEle).outerHeight();a("#"+d.MENU_BOX_ID).css({left:c.left+"px",top:c.top+e+"px"})}function j(){var c=a(document.createElement("div")).attr("id","OmniMenuDepth1").appendTo("#"+
d.MENU_BOX_ID);a.each(b.buttons,function(e,f){if(typeof f=="object")a.each(b.buttons,function(){});else typeof f=="string"&&a(document.createElement("div")).html(e).attr("class",d.MENU_ITEM).appendTo(c).click(function(){window.location=f})})}function g(){b.hoverEle.mouseleave(function(c){b.hoverEle.unbind("mouseleave");b.isVisible&&c.relatedTarget.id!=d.MENU_BOX_ID&&c.relatedTarget.className!=d.MENU_ITEM&&c.relatedTarget&&a.OmniMenu.hide()})}a(window).ready(function(){h()});var d={MENU_BOX_ID:"omniMenuContainer",
MENU_ITEM:"omniMenuItem"},b={hoverEle:null,buttons:null,isVisible:false};a.OmniMenu={show:function(c,e,f){if(!b.isVisible)if(a(c).exists()&&e&&typeof e=="object"){f&&typeof f=="object"&&a("#"+d.MENU_BOX_ID).css(f);a("#"+d.MENU_BOX_ID).html("");b.hoverEle=c;b.buttons=e;g();a("#"+d.MENU_BOX_ID).css("minWidth",b.hoverEle.outerWidth());j();i();a("#"+d.MENU_BOX_ID).show(0,function(){b.isVisible=true})}},hide:function(){b.isVisible&&a("#"+d.MENU_BOX_ID).hide(0,function(){b.hoverEle.unbind("mouseleave");
b.isVisible=false})}}})(jQuery);
