﻿/*
 * 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
 */

var $j = jQuery.noConflict();

var tb_pathToImage = "files/loading.gif";

/*!!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/

//on page load call tb_init
$j(document).ready(function(){   
				   tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
				   imgLoader = new Image();// preload image
				   imgLoader.src = tb_pathToImage;
				   });

//add thickbox to href & area elements that have a class of .thickbox
function tb_init(domChunk){
	$j(domChunk).click(function(){
					   var t = this.title || this.name || null;
					   var a = this.href || this.alt;
					   var g = this.rel || false;
					   tb_show(t,a,g);
					   this.blur();
					   return false;
					   });
}

function tb_show(caption, url, imageGroup) {//function called when the user clicks on a thickbox link
	
	try {
		if (typeof document.body.style.maxHeight === "undefined") {//if IE 6
			$j("body","html").css({height: "100%", width: "100%"});
			$j("html").css("overflow","hidden");
			if (document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6
				$j("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div