//on page load call tb_init
$(document).ready(function(){
	popup_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
});

//add thickbox to href & area elements that have a class of .thickbox
function popup_init(domChunk){
	$(domChunk).click(function(){
	var t = this.title || this.name || null;
	var a = this.href || this.alt;
	popup_show(t,a);
	this.blur();
	return false;
	});
}
var wpopup;
function popup_show(caption, url) {//function called when the user clicks on a thickbox link

	try {
        wpopup=window.open(url,'wpopup','width=800,height=750,location=1,menubar=1,scrollbars=1,resizable=1');
        if (window.focus) wpopup.focus();
    } catch(e) {
		//nothing here
	}
    
}

