function abzObj(id,x,y,w,h){this.el=(document.getElementById)?document.getElementById(id):(document.all)?document.all[id]:(document.layers)?getLyrRef(id,document):null;if(!this.el)return null;this.doc=(document.layers)?this.el.document:this.el;this.css=(this.el.style)?this.el.style:this.el;var px=(document.layers||window.opera)?"":"px";this.x=x||0;if(x)this.css.left=this.x+px;this.y=y||0;if(y)this.css.top=this.y+px;this.width=w?w:(this.el.offsetWidth)?this.el.offsetWidth:(this.css.clip.width)?this.css.clip.width:0;this.height=h?h:(this.el.offsetHeight)?this.el.offsetHeight:(this.css.clip.height)?this.css.clip.height:0;if(w){(document.layers)?this.css.clip.width=w+px:this.css.width=w+px;}
if(h){(document.layers)?this.css.clip.height=h+px:this.css.height=h+px;}
this.obj=id+"abzObj";eval(this.obj+"=this");}
function dw_show(){this.css.visibility="visible";}
function dw_hide(){this.css.visibility="hidden";}
function dw_shiftTo(x,y){if(x!=null)this.x=x;if(y!=null)this.y=y;if(this.css.moveTo){this.css.moveTo(Math.round(this.x),Math.round(this.y));}else{this.css.left=Math.round(this.x)+"px";this.css.top=Math.round(this.y)+"px";}}
function dw_shiftBy(x,y){this.shiftTo(this.x+x,this.y+y);}
function dw_writeLyr(cntnt){if(typeof this.doc.innerHTML!="undefined"){this.doc.innerHTML=cntnt;}else if(document.layers){this.doc.write(cntnt);this.doc.close();}}
function dw_setBgClr(bg){if(document.layers)this.doc.bgColor=bg;else this.css.backgroundColor=bg;}
abzObj.prototype.show=dw_show;abzObj.prototype.hide=dw_hide;abzObj.prototype.shiftTo=dw_shiftTo;abzObj.prototype.shiftBy=dw_shiftBy;abzObj.prototype.writeLyr=dw_writeLyr;abzObj.prototype.setBgClr=dw_setBgClr;function getLyrRef(lyr,doc){if(document.layers){var theLyr;for(var i=0;i<doc.layers.length;i++){theLyr=doc.layers[i];if(theLyr.name==lyr)return theLyr;else if(theLyr.document.layers.length>0)
if((theLyr=getLyrRef(lyr,theLyr.document))!=null)
return theLyr;}
return null;}}
abzObj.prototype.getClipValues=function(){var clipVal=new Array();if(typeof this.css.clip!="undefined"&&typeof this.css.clip.top=="undefined"){clipVal=this.css.clip.substring(5,this.css.clip.length-1).split(' ');for(var i=0;i<4;i++){clipVal[i]=parseInt(clipVal[i]);}}else if(typeof this.css.clip.top!="undefined"){clipVal[0]=this.css.clip.top;clipVal[1]=this.css.clip.right;clipVal[2]=this.css.clip.bottom;clipVal[3]=this.css.clip.left;}
return clipVal;}
abzObj.prototype.clipBy=function(top,rt,btm,lft){if(typeof this.css.clip!="undefined"&&typeof this.css.clip.top=="undefined"){var clipVal=this.getClipValues();this.css.clip="rect("+Number(clipVal[0]+top)+"px, "+Number(clipVal[1]+rt)+"px, "+Number(clipVal[2]+btm)+"px, "+Number(clipVal[3]+lft)+"px)";}else if(typeof this.css.clip.top!="undefined"){this.css.clip.top+=top;this.css.clip.right+=rt;this.css.clip.bottom+=btm;this.css.clip.left+=lft;}}
abzObj.prototype.clipTo=function(top,rt,btm,lft){if(typeof this.css.clip!="undefined"&&typeof this.css.clip.top=="undefined"){this.css.clip="rect("+top+"px, "+rt+"px, "+btm+"px, "+lft+"px)";}else if(typeof this.css.clip.top!="undefined"){this.css.clip.top=top;this.css.clip.right=rt;this.css.clip.bottom=btm;this.css.clip.left=lft;}}
abzObj.prototype.centerIn=function(outer){var outWd,outHt,inWd,inHt,x,y;if(eval(outer)==window){outWd=getWinWidth();outHt=getWinHeight();}else{outWd=outer.width;outHt=outer.height;}
inWd=this.width;inHt=this.height;x=Math.round((outWd-inWd)/2);y=Math.round((outHt-inHt)/2);this.shiftTo(x,y);}
function getWidth(obj,id){var wd=0;if(document.getElementById||document.all){var elem;if(id)elem=(document.getElementById)?document.getElementById(id):document.all[id];else elem=obj;if(elem.offsetWidth)wd=elem.offsetWidth;}else if(obj.document)wd=obj.document.width;return wd;}
function getHeight(obj,id){var ht=0;if(document.getElementById||document.all){var elem;if(id)elem=(document.getElementById)?document.getElementById(id):document.all[id];else elem=obj;if(elem.offsetHeight)ht=elem.offsetHeight;}else if(obj.document)ht=obj.document.height;return ht;}
function getWinWidth(){var winWd=0;if(document.documentElement&&document.documentElement.clientWidth)
winWd=document.documentElement.clientWidth;else if(document.body&&document.body.clientWidth)
winWd=document.body.clientWidth;else if(document.body&&document.body.offsetWidth)
winWd=document.body.offsetWidth;else if(window.innerWidth)winWd=window.innerWidth-18;return winWd;}
function getWinHeight(){var winHt=0;if(window.innerHeight)winHt=window.innerHeight-18;else if(document.documentElement&&document.documentElement.clientHeight)
winHt=document.documentElement.clientHeight;else if(document.body&&document.body.clientHeight)
winHt=document.body.clientHeight;return winHt;}
function getScrollY(){var scroll_y=0;if(document.documentElement&&document.documentElement.scrollTop)
scroll_y=document.documentElement.scrollTop;else if(document.body&&document.body.scrollTop)
scroll_y=document.body.scrollTop;else if(window.pageYOffset)
scroll_y=window.pageYOffset;else if(window.scrollY)
scroll_y=window.scrollY;return scroll_y;}
function getScrollX(){var scroll_x=0;if(document.documentElement&&document.documentElement.scrollLeft)
scroll_x=document.documentElement.scrollLeft;else if(document.body&&document.body.scrollLeft)
scroll_x=document.body.scrollLeft;else if(window.pageXOffset)
scroll_x=window.pageXOffset;else if(window.scrollX)
scroll_x=window.scrollX;return scroll_x;}
(function($){$.fn.jqm=function(o){var p={overlay:50,overlayClass:'jqmOverlay',closeClass:'jqmClose',trigger:'.jqModal',ajax:F,ajaxText:'',target:F,modal:F,toTop:F,onShow:F,onHide:F,onLoad:F};return this.each(function(){if(this._jqm)return H[this._jqm].c=$.extend({},H[this._jqm].c,o);s++;this._jqm=s;H[s]={c:$.extend(p,$.jqm.params,o),a:F,w:$(this).addClass('jqmID'+s),s:s};if(p.trigger)$(this).jqmAddTrigger(p.trigger);});};$.fn.jqmAddClose=function(e){return hs(this,e,'jqmHide');};$.fn.jqmAddTrigger=function(e){return hs(this,e,'jqmShow');};$.fn.jqmShow=function(t){return this.each(function(){$.jqm.open(this._jqm,t);});};$.fn.jqmHide=function(t){return this.each(function(){$.jqm.close(this._jqm,t)});};$.jqm={hash:{},open:function(s,t){var h=H[s],c=h.c,cc='.'+c.closeClass,z=(parseInt(h.w.css('z-index'))),z=(z>0)?z:3000,o=$('<div></div>').css({height:'100%',width:'100%',position:'fixed',left:0,top:0,'z-index':z-1,opacity:c.overlay/100});if(h.a)return F;h.t=t;h.a=true;h.w.css('z-index',z);if(c.modal){if(!A[0])L('bind');A.push(s);}
else if(c.overlay>0)h.w.jqmAddClose(o);else o=F;h.o=(o)?o.addClass(c.overlayClass).prependTo('body'):F;if(ie6){$('html,body').css({height:'100%',width:'100%'});if(o){o=o.css({position:'absolute'})[0];for(var y in{Top:1,Left:1})o.style.setExpression(y.toLowerCase(),"(_=(document.documentElement.scroll"+y+" || document.body.scroll"+y+"))+'px'");}}
if(c.ajax){var r=c.target||h.w,u=c.ajax,r=(typeof r=='string')?$(r,h.w):$(r),u=(u.substr(0,1)=='@')?$(t).attr(u.substring(1)):u;r.html(c.ajaxText).load(u,function(){if(c.onLoad)c.onLoad.call(this,h);if(cc)h.w.jqmAddClose($(cc,h.w));e(h);});}
else if(cc)h.w.jqmAddClose($(cc,h.w));if(c.toTop&&h.o)h.w.before('<span id="jqmP'+h.w[0]._jqm+'"></span>').insertAfter(h.o);(c.onShow)?c.onShow(h):h.w.show();e(h);return F;},close:function(s){var h=H[s];if(!h.a)return F;h.a=F;if(A[0]){A.pop();if(!A[0])L('unbind');}
if(h.c.toTop&&h.o)$('#jqmP'+h.w[0]._jqm).after(h.w).remove();if(h.c.onHide)h.c.onHide(h);else{h.w.hide();if(h.o)h.o.remove();}return F;},params:{}};var s=0,H=$.jqm.hash,A=[],ie6=$.browser.msie&&($.browser.version=="6.0"),F=false,i=$('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({opacity:0}),e=function(h){if(ie6)if(h.o)h.o.html('<p style="width:100%;height:100%"/>').prepend(i);else if(!$('iframe.jqm',h.w)[0])h.w.prepend(i);f(h);},f=function(h){try{$(':input:visible',h.w)[0].focus();}catch(_){}},L=function(t){$()[t]("keypress",m)[t]("keydown",m)[t]("mousedown",m);},m=function(e){var h=H[A[A.length-1]],r=(!$(e.target).parents('.jqmID'+h.s)[0]);if(r)f(h);return!r;},hs=function(w,t,c){return w.each(function(){var s=this._jqm;$(t).each(function(){if(!this[c]){this[c]=[];$(this).click(function(){for(var i in{jqmShow:1,jqmHide:1})for(var s in this[i])if(H[this[i][s]])H[this[i][s]].w[i](this);return F;});}this[c].push(s);});});};})(jQuery);$(document).ready(function(){var closeModal=function(hash)
{var $modalWindow=$(hash.w);$modalWindow.fadeOut('2000',function()
{hash.o.remove();if(hash.refreshAfterClose==true)
{window.location.href=document.location.href;}});};var openInFrame=function(hash)
{var $trigger=$(hash.t);var $modalWindow=$(hash.w);var $modalContainer=$('iframe',$modalWindow);var myUrl=$trigger.attr('href');var myTitle=$trigger.attr('title');var newWidth=0,newHeight=0,newLeft=0,newTop=0;$modalContainer.html('').attr('src',myUrl);$('#jqmTitleText').text(myTitle);myUrl=(myUrl.lastIndexOf("#")>-1)?myUrl.slice(0,myUrl.lastIndexOf("#")):myUrl;var queryString=(myUrl.indexOf("?")>-1)?myUrl.substr(myUrl.indexOf("?")+1):null;if(queryString!=null&&typeof queryString!='undefined')
{var queryVarsArray=queryString.split("&");for(var i=0;i<queryVarsArray.length;i++)
{if(unescape(queryVarsArray[i].split("=")[0])=='width')
{var newWidth=queryVarsArray[i].split("=")[1];}
if(escape(unescape(queryVarsArray[i].split("=")[0]))=='height')
{var newHeight=queryVarsArray[i].split("=")[1];}
if(escape(unescape(queryVarsArray[i].split("=")[0]))=='jqmRefresh')
{hash.refreshAfterClose=queryVarsArray[i].split("=")[1]}else
{hash.refreshAfterClose=false;}}
if(newHeight!=0)
{if(newHeight.indexOf('%')>-1)
{newHeight=Math.floor(parseInt($(window).height())*(parseInt(newHeight)/100));}
var newTop=Math.floor(parseInt($(window).height()-newHeight)/2);}
else
{newHeight=$modalWindow.height();}
if(newWidth!=0)
{if(newWidth.indexOf('%')>-1)
{newWidth=Math.floor(parseInt($(window).width()/100)*parseInt(newWidth));}
var newLeft=Math.floor(parseInt($(window).width()/2)-parseInt(newWidth)/2);}
else
{newWidth=$modalWindow.width();}
$modalWindow.css({width:newWidth,height:newHeight,opacity:0}).jqmShow().animate({width:newWidth,height:newHeight,top:newTop,left:newLeft,marginLeft:0,opacity:1},'slow');}
else
{$modalWindow.jqmShow();}}
$('#modalWindow').jqm({overlay:70,modal:true,trigger:'a.thickbox',target:'#jqmContent',onHide:closeModal,onShow:openInFrame});});
