/*
 * Thickbox 2.1 - jQuery plugin for displaying content in a box above the page
 * Copyright (c) 2006, 2007 Cody Lindley (http://www.codylindley.com)
 * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
 */
$(document).ready(TB_init);function TB_init(){$("a.thickbox").click(function(){var t=this.title||this.name||null;TB_show(t,this.href);this.blur();return false;});}function TB_show(caption,url){if(document.getElementById("TB_HideSelect")==null){$("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");$("#TB_overlay").click(TB_remove);}if(caption==null){caption=""};$(window).scroll(TB_position);TB_overlaySize();$("body").append("<div id='TB_load'><img src='images/loading.gif' /></div>");TB_load_position();TB_WIDTH=600;TB_HEIGHT=400;var titlemargin=(typeof document.documentElement.style.msInterpolationMode!="undefined")?" style='margin-bottom:3px;'":"";c=caption;c_le=c.length;c_io=c.indexOf("/",0);c_sl1=c.slice(0,c_io);c_sl2=c.slice(c_io+1,c_le);$("#TB_window").append("<div id='TB_title'"+titlemargin+"><div id='TB_ajaxWindowTitle'>"+c_sl1+"<br /><span id='TB_ajaxWindowTitle2'>"+c_sl2+"</span></div><div id='TB_closeAjaxWindow'><a href='javascript:void(0);' id='TB_closeWindowButton'><span>close</span></a></div></div><iframe src='"+url+"' id='TB_iframeContent' style='width:"+TB_WIDTH+"px;height:"+(TB_HEIGHT-27)+"px; border: none;' frameborder='0' scrolling='no'></iframe>");$("#TB_closeWindowButton").click(TB_remove);TB_position();$("#TB_load").remove();$("#TB_window").css({display:"block"});$(window).resize(TB_position);}function TB_remove(){$("#TB_window").fadeOut("fast",function(){$('#TB_window,#TB_overlay,#TB_HideSelect').remove();});$("#TB_load").remove();return false;}function TB_position(){var pagesize=TB_getPageSize();var arrayPageScroll=TB_getPageScrollTop();$("#TB_window").css({width:TB_WIDTH+"px",left:(((pagesize[0]-TB_WIDTH)/2)-19)+"px",top:(arrayPageScroll[1]+((pagesize[1]-TB_HEIGHT)/2))+"px"});TB_overlaySize();}function TB_overlaySize(){if(window.innerHeight&&window.scrollMaxY){yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){yScroll=document.body.scrollHeight;}else{yScroll=document.body.offsetHeight;}$("#TB_overlay").css("height",yScroll+"px");$("#TB_HideSelect").css("height",yScroll+"px");}function TB_load_position(){var pagesize=TB_getPageSize();var arrayPageScroll=TB_getPageScrollTop();$("#TB_load").css({left:((pagesize[0]-100)/2)+"px",top:(arrayPageScroll[1]+((pagesize[1]-100)/2))+"px"}).css({display:"block"});}function TB_parseQuery (query){var Params=new Object();if(!query){return Params;}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]);var val=unescape(KeyVal[1]);val=val.replace(/\+/g,' ');Params[key]=val;}return Params;}function TB_getPageScrollTop(){var yScrolltop;if(self.pageYOffset){yScrolltop=self.pageYOffset;}else if(document.documentElement&&document.documentElement.scrollTop){yScrolltop=document.documentElement.scrollTop;}else if(document.body){yScrolltop=document.body.scrollTop;}arrayPageScroll=new Array('',yScrolltop);return arrayPageScroll;}function TB_getPageSize(){var de=document.documentElement;var w=window.innerWidth||self.innerWidth||(de&&de.clientWidth)||document.body.clientWidth;var h=window.innerHeight||self.innerHeight||(de&&de.clientHeight)||document.body.clientHeight;arrayPageSize=new Array(w,h);return arrayPageSize;}