/*

	Royal Bank of Scotland
	jQuery plugins for RBSM and GBM sites

	Revision properties generated by SVN keywords
	---------------------------------------------
	$Rev:: 418                                             $:  Revision of last commit
	$Author:: geopat                                       $:  Author of last commit
	$Date:: 2010-02-23 17:18:10 +0000 (Tue, 23 Feb 2010)   $:  Date of last commit

*/
/*
 * Date prototype extensions. Doesn't depend on any
 * other code. Doens't overwrite existing methods.
 *
 * Adds dayNames, abbrDayNames, monthNames and abbrMonthNames static properties and isLeapYear,
 * isWeekend, isWeekDay, getDaysInMonth, getDayName, getMonthName, getDayOfYear, getWeekOfYear,
 * setDayOfYear, addYears, addMonths, addDays, addHours, addMinutes, addSeconds methods
 *
 * Copyright (c) 2006 Jörn Zaefferer and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
 *
 * Additional methods and properties added by Kelvin Luck: firstDayOfWeek, dateFormat, zeroTime, asString, fromString -
 * I've added my name to these methods so you know who to blame if they are broken!
 * 
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */
Date.dayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];Date.abbrDayNames=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];Date.monthNames=["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"];Date.abbrMonthNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Date.firstDayOfWeek=1;Date.format="dd/mm/yyyy";Date.fullYearStart="20";(function(){function b(c,d){if(!Date.prototype[c]){Date.prototype[c]=d}}b("isLeapYear",function(){var c=this.getFullYear();return(c%4==0&&c%100!=0)||c%400==0});b("isWeekend",function(){return this.getDay()==0||this.getDay()==6});b("isWeekDay",function(){return !this.isWeekend()});b("getDaysInMonth",function(){return[31,(this.isLeapYear()?29:28),31,30,31,30,31,31,30,31,30,31][this.getMonth()]});b("getDayName",function(c){return c?Date.abbrDayNames[this.getDay()]:Date.dayNames[this.getDay()]});b("getMonthName",function(c){return c?Date.abbrMonthNames[this.getMonth()]:Date.monthNames[this.getMonth()]});b("getDayOfYear",function(){var c=new Date("1/1/"+this.getFullYear());return Math.floor((this.getTime()-c.getTime())/86400000)});b("getWeekOfYear",function(){return Math.ceil(this.getDayOfYear()/7)});b("setDayOfYear",function(c){this.setMonth(0);this.setDate(c);return this});b("addYears",function(c){this.setFullYear(this.getFullYear()+c);return this});b("addMonths",function(d){var c=this.getDate();this.setMonth(this.getMonth()+d);if(c>this.getDate()){this.addDays(-this.getDate())}return this});b("addDays",function(c){this.setDate(this.getDate()+c);return this});b("addHours",function(c){this.setHours(this.getHours()+c);return this});b("addMinutes",function(c){this.setMinutes(this.getMinutes()+c);return this});b("addSeconds",function(c){this.setSeconds(this.getSeconds()+c);return this});b("zeroTime",function(){this.setMilliseconds(0);this.setSeconds(0);this.setMinutes(0);this.setHours(0);return this});b("asString",function(){var c=Date.format;return c.split("yyyy").join(this.getFullYear()).split("yy").join((this.getFullYear()+"").substring(2)).split("mmm").join(this.getMonthName(true)).split("mm").join(a(this.getMonth()+1)).split("dd").join(a(this.getDate()))});b("asFormattedString",function(c){return c.split("yyyy").join(this.getFullYear()).split("yy").join((this.getFullYear()+"").substring(2)).split("mmm").join(this.getMonthName(true)).split("mm").join(a(this.getMonth()+1)).split("dd").join(a(this.getDate()))});Date.fromString=function(g){var h=Date.format;var k=new Date("01/01/1977");var l=h.indexOf("yyyy");if(l>-1){k.setFullYear(Number(g.substr(l,4)))}else{k.setFullYear(Number(Date.fullYearStart+g.substr(h.indexOf("yy"),2)))}var c=h.indexOf("mmm");if(c>-1){var j=g.substr(c,3);for(var e=0;e<Date.abbrMonthNames.length;e++){if(Date.abbrMonthNames[e]==j){break}}k.setMonth(e)}else{k.setMonth(Number(g.substr(h.indexOf("mm"),2))-1)}k.setDate(Number(g.substr(h.indexOf("dd"),2)));if(isNaN(k.getTime())){return false}return k};var a=function(c){var d="0"+c;return d.substring(d.length-2)}})();
/**
 * Copyright (c) 2007 Kelvin Luck (http://www.kelvinluck.com/)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * $Id: jquery.datePicker.js 3739 2007-10-25 13:55:30Z kelvin.luck $
 **/
(function(d){d.fn.extend({renderCalendar:function(t){var C=function(i){return document.createElement(i)};t=d.extend({month:null,year:null,renderCallback:null,showHeader:d.dpConst.SHOW_HEADER_SHORT,dpController:null,hoverClass:"dp-hover",enabledDates:null},t);if(t.showHeader!=d.dpConst.SHOW_HEADER_NONE){var n=d(C("tr"));for(var x=Date.firstDayOfWeek;x<Date.firstDayOfWeek+7;x++){var h=x%7;var v=Date.dayNames[h];n.append(jQuery(C("th")).attr({scope:"col",abbr:v,title:v,"class":(h==0||h==6?"weekend":"weekday")}).html(t.showHeader==d.dpConst.SHOW_HEADER_SHORT?v.substr(0,1):v))}}var e=d(C("table")).attr({cellspacing:2,className:"jCalendar"}).append((t.showHeader!=d.dpConst.SHOW_HEADER_NONE?d(C("thead")).append(n):C("thead")));var f=d(C("tbody"));var z=(new Date()).zeroTime();var B=t.month==undefined?z.getMonth():t.month;var o=t.year||z.getFullYear();var l=new Date(o,B,1);var k=Date.firstDayOfWeek-l.getDay()+1;if(k>1){k-=7}var q=Math.ceil(((-1*k+1)+l.getDaysInMonth())/7);l.addDays(k-1);var A=function(){if(t.hoverClass){d(this).addClass(t.hoverClass)}};var g=function(){if(t.hoverClass){d(this).removeClass(t.hoverClass)}};var m=0;while(m++<q){var u=jQuery(C("tr"));for(var x=0;x<7;x++){var j=l.getMonth()==B;var p=l.getDate()+"/"+l.getMonth()+"/"+l.getFullYear();var y=d(C("td")).text(l.getDate()+"").attr("className",(j?"current-month ":"other-month ")+(l.isWeekend()?"weekend disabled ":"weekday ")+(j&&l.getTime()==z.getTime()?"today ":"")+((t.enabledDates&&!(t.enabledDates[p]))?" disabled ":"")).hover(A,g);if(t.renderCallback){t.renderCallback(y,l,B,o)}u.append(y);l.addDays(1)}f.append(u)}e.append(f);return this.each(function(){d(this).empty().append(e)})},datePicker:function(e){if(!d.event._dpCache){d.event._dpCache=[]}e=d.extend({month:undefined,year:undefined,startDate:undefined,endDate:undefined,inline:false,renderCallback:[],createButton:true,showYearNavigation:true,closeOnSelect:true,displayClose:false,selectMultiple:false,clickInput:false,verticalPosition:d.dpConst.POS_TOP,horizontalPosition:d.dpConst.POS_LEFT,verticalOffset:20,horizontalOffset:-125,hoverClass:"dp-hover",displayedDateFormat:"dd mmm yyyy"},e);return this.each(function(){var g=d(this);var i=true;if(!this._dpId){this._dpId=d.event.guid++;d.event._dpCache[this._dpId]=new a(this);i=false}if(e.inline){e.createButton=false;e.displayClose=false;e.closeOnSelect=false;g.empty()}var f=d.event._dpCache[this._dpId];f.init(e);if(!i&&e.createButton){f.button=d('<a href="#" class="dp-choose-date" title="'+d.dpText.TEXT_CHOOSE_DATE+'">'+d.dpText.TEXT_CHOOSE_DATE+"</a>").bind("click",function(){g.dpDisplay(this);this.blur();return false});g.after(f.button)}if(!i&&g.is(":text")){g.bind("dateSelected",function(k,j,l){if(e.displayedDateFormat){this.value=j.asFormattedString(e.displayedDateFormat)}else{this.value=j.asString()}}).bind("change",function(){var j=Date.fromString(this.value);if(j){f.setSelected(j,true,true)}});if(e.clickInput){g.bind("click",function(){g.dpDisplay()})}var h=Date.fromString(this.value);if(this.value!=""&&h){f.setSelected(h,true,true)}}g.addClass("dp-applied")})},dpSetDisabled:function(e){return b.call(this,"setDisabled",e)},dpSetStartDate:function(e){return b.call(this,"setStartDate",e)},dpSetEndDate:function(e){return b.call(this,"setEndDate",e)},dpGetSelected:function(){var e=c(this[0]);if(e){return e.getSelected()}return null},dpSetSelected:function(g,f,e){if(f==undefined){f=true}if(e==undefined){e=true}return b.call(this,"setSelected",Date.fromString(g),f,e)},dpSetDisplayedMonth:function(e,f){return b.call(this,"setDisplayedMonth",Number(e),Number(f))},dpDisplay:function(f){return b.call(this,"display",f)},dpSetRenderCallback:function(e){return b.call(this,"setRenderCallback",e)},dpSetPosition:function(e,f){return b.call(this,"setPosition",e,f)},dpSetOffset:function(e,f){return b.call(this,"setOffset",e,f)},dpClose:function(){return b.call(this,"_closeCalendar",false,this[0])},_dpDestroy:function(){}});var b=function(h,g,e,i){return this.each(function(){var f=c(this);if(f){f[h](g,e,i)}})};function a(e){this.ele=e;this.displayedMonth=null;this.displayedYear=null;this.startDate=null;this.endDate=null;this.showYearNavigation=null;this.closeOnSelect=null;this.displayClose=null;this.selectMultiple=null;this.verticalPosition=null;this.horizontalPosition=null;this.verticalOffset=null;this.horizontalOffset=null;this.button=null;this.renderCallback=[];this.selectedDates={};this.inline=null;this.context="#dp-popup";this.enabledDates=null}d.extend(a.prototype,{init:function(e){this.setStartDate(e.startDate);this.setEndDate(e.endDate);this.setDisplayedMonth(Number(e.month),Number(e.year));this.setRenderCallback(e.renderCallback);this.showYearNavigation=e.showYearNavigation;this.closeOnSelect=e.closeOnSelect;this.displayClose=e.displayClose;this.selectMultiple=e.selectMultiple;this.verticalPosition=e.verticalPosition;this.horizontalPosition=e.horizontalPosition;this.hoverClass=e.hoverClass;this.setOffset(e.verticalOffset,e.horizontalOffset);this.inline=e.inline;this.setEnabledDates(e.enabledDates);if(this.inline){this.context=this.ele;this.display()}},setEnabledDates:function(f){if(!f){return}this.enabledDates=new Object();for(var g=0;g<f.length;g++){var j=Date.fromString(f[g]);var k=j.getFullYear(),h=j.getMonth(),e=j.getDate();this.enabledDates[e+"/"+h+"/"+k]=true}},setStartDate:function(e){if(e){this.startDate=Date.fromString(e)}if(!this.startDate){this.startDate=(new Date()).zeroTime()}this.setDisplayedMonth(this.displayedMonth,this.displayedYear)},setEndDate:function(e){if(e){this.endDate=Date.fromString(e)}if(!this.endDate){this.endDate=(new Date("12/31/2999"))}if(this.endDate.getTime()<this.startDate.getTime()){this.endDate=this.startDate}this.setDisplayedMonth(this.displayedMonth,this.displayedYear)},setPosition:function(e,f){this.verticalPosition=e;this.horizontalPosition=f},setOffset:function(e,f){this.verticalOffset=parseInt(e)||0;this.horizontalOffset=parseInt(f)||0},setDisabled:function(e){$e=d(this.ele);$e[e?"addClass":"removeClass"]("dp-disabled");if(this.button){$but=d(this.button);$but[e?"addClass":"removeClass"]("dp-disabled");$but.attr("title",e?"":d.dpText.TEXT_CHOOSE_DATE)}if($e.is(":text")){$e.attr("disabled",e?"disabled":"")}},setDisplayedMonth:function(f,j){if(this.startDate==undefined||this.endDate==undefined){return}var h=new Date(this.startDate.getTime());h.setDate(1);var i=new Date(this.endDate.getTime());i.setDate(1);var g;if((!f&&!j)||(isNaN(f)&&isNaN(j))){g=new Date().zeroTime();g.setDate(1)}else{if(isNaN(f)){g=new Date(j,this.displayedMonth,1)}else{if(isNaN(j)){g=new Date(this.displayedYear,f,1)}else{g=new Date(j,f,1);if(f==-1&&g.getFullYear()==j){g=new Date(j-1,11,1)}}}}if(g.getTime()<h.getTime()){g=h}else{if(g.getTime()>i.getTime()){g=i}}this.displayedMonth=g.getMonth();this.displayedYear=g.getFullYear()},setSelected:function(g,e,f){if(this.selectMultiple==false){this.selectedDates={};d("td.selected",this.context).removeClass("selected")}if(f){this.setDisplayedMonth(g.getMonth(),g.getFullYear())}this.selectedDates[g.toString()]=e},isSelected:function(e){return this.selectedDates[e.toString()]},getSelected:function(){var e=[];for(s in this.selectedDates){if(this.selectedDates[s]==true){e.push(Date.parse(s))}}return e},display:function(e){if(d(this.ele).is(".dp-disabled")){return}e=e||this.ele;var l=this;var h=d(e);var k=h.offset();var m;var n;var g;var i;if(l.inline){m=d(this.ele);n={id:"calendar-"+this.ele._dpId,className:"dp-popup dp-popup-inline"};i={}}else{m=d("body");n={id:"dp-popup",className:"dp-popup"};i={top:k.top+l.verticalOffset,left:k.left+l.horizontalOffset};var j=function(q){var o=q.target;var p=d("#dp-popup")[0];while(true){if(o==p){return true}else{if(o==document){l._closeCalendar();return false}else{o=d(o).parent()[0]}}}};this._checkMouse=j;this._closeCalendar(true)}m.prepend(d("<div></div>").attr(n).css(i).append(d("<h2></h2>"),d('<div class="dp-nav-prev"></div>').append(d('<a class="dp-nav-prev-year" href="#" title="'+d.dpText.TEXT_PREV_YEAR+'">&lt;&lt;</a>').bind("click",function(){return l._displayNewMonth.call(l,this,0,-1)}),d('<a class="dp-nav-prev-month" href="#" title="'+d.dpText.TEXT_PREV_MONTH+'">&nbsp;&nbsp;&lt;</a>').bind("click",function(){return l._displayNewMonth.call(l,this,-1,0)})),d('<div class="dp-nav-next"></div>').append(d('<a class="dp-nav-next-year" href="#" title="'+d.dpText.TEXT_NEXT_YEAR+'">&gt;&gt;</a>').bind("click",function(){return l._displayNewMonth.call(l,this,0,1)}),d('<a class="dp-nav-next-month" href="#" title="'+d.dpText.TEXT_NEXT_MONTH+'">&nbsp;&nbsp;&gt;</a>').bind("click",function(){return l._displayNewMonth.call(l,this,1,0)})),d("<div></div>").attr("className","dp-calendar")).bgIframe());var f=this.inline?d(".dp-popup",this.context):d("#dp-popup");if(this.showYearNavigation==false){d(".dp-nav-prev-year, .dp-nav-next-year",l.context).css("display","none")}if(this.displayClose){f.append(d('<a href="#" id="dp-close">'+d.dpText.TEXT_CLOSE+"</a>").bind("click",function(){l._closeCalendar();return false}))}l._renderCalendar();d(this.ele).trigger("dpDisplayed",f);if(!l.inline){if(this.verticalPosition==d.dpConst.POS_BOTTOM){f.css("top",k.top+h.height()-f.height()+l.verticalOffset)}if(this.horizontalPosition==d.dpConst.POS_RIGHT){f.css("left",k.left+h.width()-f.width()+l.horizontalOffset)}d(document).bind("mousedown",this._checkMouse)}},setRenderCallback:function(e){if(e&&typeof(e)=="function"){e=[e]}this.renderCallback=this.renderCallback.concat(e)},cellRender:function(k,e,h,g){var l=this.dpController;var j=new Date(e.getTime());k.bind("click",function(){var m=d(this);if(!m.is(".disabled")){l.setSelected(j,!m.is(".selected")||!l.selectMultiple);var i=l.isSelected(j);d(l.ele).trigger("dateSelected",[j,k,i]);d(l.ele).trigger("change");if(l.closeOnSelect){l._closeCalendar()}else{m[i?"addClass":"removeClass"]("selected")}}});if(l.isSelected(j)){k.addClass("selected")}for(var f=0;f<l.renderCallback.length;f++){l.renderCallback[f].apply(this,arguments)}},_displayNewMonth:function(f,e,g){if(!d(f).is(".disabled")){this.setDisplayedMonth(this.displayedMonth+e,this.displayedYear+g);this._clearCalendar();this._renderCalendar();d(this.ele).trigger("dpMonthChanged",[this.displayedMonth,this.displayedYear])}f.blur();return false},_renderCalendar:function(){d("h2",this.context).html(Date.monthNames[this.displayedMonth]+" "+this.displayedYear);d(".dp-calendar",this.context).renderCalendar({month:this.displayedMonth,year:this.displayedYear,renderCallback:this.cellRender,dpController:this,hoverClass:this.hoverClass,enabledDates:this.enabledDates});if(this.displayedYear==this.startDate.getFullYear()&&this.displayedMonth==this.startDate.getMonth()){d(".dp-nav-prev-year",this.context).addClass("disabled");d(".dp-nav-prev-month",this.context).addClass("disabled");d(".dp-calendar td.other-month",this.context).each(function(){var h=d(this);if(Number(h.text())>20){h.addClass("disabled")}});var g=this.startDate.getDate();d(".dp-calendar td.current-month",this.context).each(function(){var h=d(this);if(Number(h.text())<g){h.addClass("disabled")}})}else{d(".dp-nav-prev-year",this.context).removeClass("disabled");d(".dp-nav-prev-month",this.context).removeClass("disabled");var g=this.startDate.getDate();if(g>20){var f=new Date(this.startDate.getTime());f.addMonths(1);if(this.displayedYear==f.getFullYear()&&this.displayedMonth==f.getMonth()){d("dp-calendar td.other-month",this.context).each(function(){var h=d(this);if(Number(h.text())<g){h.addClass("disabled")}})}}}if(this.displayedYear==this.endDate.getFullYear()&&this.displayedMonth==this.endDate.getMonth()){d(".dp-nav-next-year",this.context).addClass("disabled");d(".dp-nav-next-month",this.context).addClass("disabled");d(".dp-calendar td.other-month",this.context).each(function(){var h=d(this);if(Number(h.text())<14){h.addClass("disabled")}});var g=this.endDate.getDate();d(".dp-calendar td.current-month",this.context).each(function(){var h=d(this);if(Number(h.text())>g){h.addClass("disabled")}})}else{d(".dp-nav-next-year",this.context).removeClass("disabled");d(".dp-nav-next-month",this.context).removeClass("disabled");var g=this.endDate.getDate();if(g<13){var e=new Date(this.endDate.getTime());e.addMonths(-1);if(this.displayedYear==e.getFullYear()&&this.displayedMonth==e.getMonth()){d(".dp-calendar td.other-month",this.context).each(function(){var h=d(this);if(Number(h.text())>g){h.addClass("disabled")}})}}}},_closeCalendar:function(e,f){if(!f||f==this.ele){d(document).unbind("mousedown",this._checkMouse);this._clearCalendar();d("#dp-popup a").unbind();d("#dp-popup").empty().remove();if(!e){d(this.ele).trigger("dpClosed",[this.getSelected()])}}},_clearCalendar:function(){d(".dp-calendar td",this.context).unbind();d(".dp-calendar",this.context).empty()}});d.dpConst={SHOW_HEADER_NONE:0,SHOW_HEADER_SHORT:1,SHOW_HEADER_LONG:2,POS_TOP:0,POS_BOTTOM:1,POS_LEFT:0,POS_RIGHT:1};d.dpText={TEXT_PREV_YEAR:"Previous year",TEXT_PREV_MONTH:"Previous month",TEXT_NEXT_YEAR:"Next year",TEXT_NEXT_MONTH:"Next month",TEXT_CLOSE:"Close",TEXT_CHOOSE_DATE:"Choose date"};d.dpVersion="$Id: jquery.datePicker.js 3739 2007-10-25 13:55:30Z kelvin.luck $";function c(e){if(e._dpId){return d.event._dpCache[e._dpId]}return false}if(d.fn.bgIframe==undefined){d.fn.bgIframe=function(){return this}}d(window).bind("unload",function(){var f=d.event._dpCache||[];for(var e in f){d(f[e].ele)._dpDestroy()}})})(jQuery);
/*
 * Thickbox 3.1 - One Box To Rule Them All.
 * By Cody Lindley (http://www.codylindley.com)
 * Copyright (c) 2007 cody lindley
 * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
 *
 * Extended [optional transparent overlay] by LBi 13th Dec 2007
*/
jQuery(document).ready(function(){tb_init("a.popup, area.popup, input.popup")});function tb_init(a){jQuery(a).bind("mousedown",function(){var c=this.title||this.name||null;var b=this.href||this.alt;var d=this.rel||false;tb_show(c,b,d,this);this.blur()});jQuery(a).click(function(){return false})}function tb_show(t,f,c,b){if(jQuery(document.body).css("background-color")=="transparent"){throw ("")}try{if(t===null){t=""}var u;if(f.indexOf("?")!==-1){u=f.substr(0,f.indexOf("?"))}else{u=f}var o=/\.jpgjQuery|\.jpegjQuery|\.pngjQuery|\.gifjQuery|\.bmpjQuery/;var l=u.toLowerCase().match(o);var d=f.replace(/^[^\?]+\??/,"");var w=tb_parseQuery(d);TB_WIDTH=(w.width*1)+22||630;TB_HEIGHT=(w.height*1)+22||440;ajaxContentW=TB_WIDTH-22;ajaxContentH=TB_HEIGHT-22;if(w.overlay!="false"){if(document.getElementById("TB_overlay")===null){jQuery("body").append("<div id='TB_overlay'></div><div id='TB_window'></div>");jQuery("#TB_overlay").click(tb_remove)}if(tb_detectMacXFF()){jQuery("#TB_overlay").addClass("TB_overlayMacFFBGHack")}else{jQuery("#TB_overlay").addClass("TB_overlayBG")}}else{jQuery("#TB_window").remove();jQuery("body").append("<div id='TB_window'></div>")}if(f.indexOf("TB_iframe")!=-1){urlNoQuery=f.split("TB_");jQuery("#TB_iframeContent").remove();if(w.overlay!="false"){if(w.modal!="true"){jQuery("#TB_overlay").unbind()}}if(jQuery("#TB_window").css("display")=="block"){jQuery("#TB_window").html(jQuery("#TB_panel").html());jQuery("#TB_window .TB_title").html(t);jQuery("#TB_window .TB_ajaxcontent").html("<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW+7)+"px;height:"+(ajaxContentH+17)+"px;'></iframe>")}else{jQuery("#TB_window").html(jQuery("#TB_panel").html());jQuery("#TB_window .TB_title").html(t);jQuery("#TB_window .TB_ajaxcontent").html("<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW+7)+"px;height:"+(ajaxContentH+17)+"px;'></iframe>")}}else{if(jQuery("#TB_window").css("display")!="block"){if(w.overlay!="false"){if(w.modal=="true"){jQuery("#TB_overlay").unbind()}}if(w.clipboard=="true"){jQuery("#TB_window").html(jQuery("#TB_panel").html());jQuery("#TB_window .TB_title").html(t);var a=jQuery(b).parent().height();var j=jQuery(b).parent().width();var g=jQuery(b).parent().offset().top;var v=jQuery(b).parent().offset().left;var p=215;var i=220;var q=(g+a)-22;var k=(v+j)-111;var h;if(self.innerHeight){h=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){h=document.documentElement.clientHeight}else{if(document.body){h=document.body.clientHeight}}}var n,m;if(self.pageYOffset){m=self.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){m=document.documentElement.scrollTop}else{if(document.body){m=document.body.scrollTop}}}lastHeight=h+m;jQuery("#TB_window")[0].style.left=k+"px";if((q+i)>lastHeight){jQuery("#TB_window")[0].style.top=(lastHeight-i)+"px"}else{jQuery("#TB_window")[0].style.top=q+"px"}}else{if(w.bookmark=="true"){jQuery("#TB_window").html(jQuery("#TB_panel").html());jQuery("#TB_window .TB_title").html(t);var a=jQuery(b).parent().height();var j=jQuery(b).parent().width();var g=jQuery(b).parent().offset().top;var v=jQuery(b).parent().offset().left;var p=215;var i=220;var q=(g+a)-22;var k=(v+j)-111;var h;if(self.innerHeight){h=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){h=document.documentElement.clientHeight}else{if(document.body){h=document.body.clientHeight}}}var n,m;if(self.pageYOffset){m=self.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){m=document.documentElement.scrollTop}else{if(document.body){m=document.body.scrollTop}}}lastHeight=h+m;jQuery("#TB_window")[0].style.left=k+"px";if((q+i)>lastHeight){jQuery("#TB_window")[0].style.top=(lastHeight-i)+"px"}else{jQuery("#TB_window")[0].style.top=q+"px"}}else{if(w.forward=="true"){jQuery("#TB_window").html(jQuery("#TB_panel").html());jQuery("#TB_window .TB_title").html(t);var i=470;var q;var h;if(self.innerHeight){h=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){h=document.documentElement.clientHeight}else{if(document.body){h=document.body.clientHeight}}}var m;if(self.pageYOffset){m=self.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){m=document.documentElement.scrollTop}else{if(document.body){m=document.body.scrollTop}}}if(m<1){q=(h-i)/2}else{q=((h-i)/2)+m}jQuery("#TB_window")[0].style.top=q+"px"}else{jQuery("#TB_window").html(jQuery("#TB_panel").html());jQuery("#TB_window .TB_title").html(t)}}}}else{jQuery("#TB_window .TB_ajaxcontent")[0].style.width=ajaxContentW+"px";jQuery("#TB_window .TB_ajaxcontent")[0].style.height=ajaxContentH+"px";jQuery("#TB_window .TB_ajaxcontent")[0].scrollTop=0;jQuery("#TB_window .title").html(t)}}jQuery("#TB_window .TB_closeButton").bind("mousedown",tb_remove);jQuery("#TB_window .TB_closeButton").bind("click",function(){return false});if(f.indexOf("TB_inline")!=-1){jQuery("#TB_window .TB_ajaxcontent").append(jQuery("#"+w.inlineId).children());jQuery("#TB_window").unload(function(){jQuery("#"+w.inlineId).append(jQuery("#TB_window .TB_ajaxcontent").children())});tb_position();jQuery("#TB_window").css({display:"block"})}else{if(f.indexOf("TB_iframe")!=-1){jQuery().ready(function(){jQuery("#TB_window").jqDrag(".jqDrag")});tb_position();if(jQuery.browser.safari){jQuery("#TB_window").css({display:"block"})}}else{jQuery("#TB_window .TB_ajaxcontent").load(f+="&random="+(new Date().getTime()),function(){tb_position();tb_init("#TB_window a.popup");jQuery().ready(function(){jQuery("#TB_window").jqDrag(".jqDrag")});jQuery("#TB_window").css({display:"block"})})}}document.onkeyup=function(x){if(x==null){keycode=event.keyCode}else{keycode=x.which}if(keycode==27){tb_remove()}}}catch(r){}LBIbgiFrame.popup();}function tb_showIframe(){jQuery("#TB_window").css({display:"block"})}function tb_remove(){jQuery("#TB_imageOff").unbind("click");jQuery("#TB_closeWindowButton").unbind("click");jQuery("#TB_window").fadeOut("fast",function(){jQuery("#TB_window,#TB_overlay,#TB_HideSelect").trigger("unload").unbind().remove()});document.onkeydown="";document.onkeyup="";return false}function tb_position(){jQuery("#TB_window").css({marginLeft:"-"+parseInt((TB_WIDTH/2),10)+"px",width:TB_WIDTH+"px"})}function tb_parseQuery(d){var e={};if(!d){return e}var a=d.split(/[;&]/);for(var c=0;c<a.length;c++){var g=a[c].split("=");if(!g||g.length!=2){continue}var b=unescape(g[0]);var f=unescape(g[1]);f=f.replace(/\+/g," ");e[b]=f}return e}function tb_getPageSize(){var c=document.documentElement;var a=window.innerWidth||self.innerWidth||(c&&c.clientWidth)||document.body.clientWidth;var b=window.innerHeight||self.innerHeight||(c&&c.clientHeight)||document.body.clientHeight;arrayPageSize=[a,b];return arrayPageSize}function tb_detectMacXFF(){var a=navigator.userAgent.toLowerCase();if(a.indexOf("mac")!=-1&&a.indexOf("firefox")!=-1){return true}}(function(e){e.fn.jqDrag=function(f){return b(this,f,"d")};e.fn.jqResize=function(f){return b(this,f,"r")};e.jqDnR={dnr:{},e:0,drag:function(f){if(g.k=="d"){d.css({left:g.X+f.pageX-g.pX,top:g.Y+f.pageY-g.pY})}else{d.css({width:Math.max(f.pageX-g.pX+g.W,0),height:Math.max(f.pageY-g.pY+g.H,0)})}return false},stop:function(){e().unbind("mousemove",a.drag).unbind("mouseup",a.stop)}};var a=e.jqDnR,g=a.dnr,d=a.e,b=function(j,i,f){return j.each(function(){i=(i)?e(i,j):j;i.bind("mousedown",{e:j,k:f},function(h){var m=h.data,l={};d=m.e;if(d.css("position")!="relative"){try{d.position(l)}catch(k){}}g={X:l.left||c("left")||0,Y:l.top||c("top")||0,W:c("width")||d[0].scrollWidth||0,H:c("height")||d[0].scrollHeight||0,pX:h.pageX,pY:h.pageY,k:m.k,o:d.css("opacity")};e().mousemove(e.jqDnR.drag).mouseup(e.jqDnR.stop);return false})})},c=function(f){return parseInt(d.css(f))||false}})(jQuery);
/* 
 * Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * $LastChangedDate: 2010-02-23 17:18:10 +0000 (Tue, 23 Feb 2010) $
 * $Rev: 418 $
 *
 * Version 2.1.1
 */
(function($){$.fn.bgIframe=$.fn.bgiframe=function(s){if($.browser.msie&&/6.0/.test(navigator.userAgent)){s=$.extend({top:'auto',left:'auto',width:'auto',height:'auto',opacity:true,src:'javascript:false;'},s||{});var prop=function(n){return n&&n.constructor==Number?n+'px':n;},html='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"'+'style="display:block;position:absolute;z-index:-1;'+(s.opacity!==false?'filter:Alpha(Opacity=\'0\');':'')+'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';'+'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';'+'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+'"/>';return this.each(function(){if($('> iframe.bgiframe',this).length==0)this.insertBefore(document.createElement(html),this.firstChild);});}return this;};})(jQuery);
