$(document).ready(function() {
	
	var linkSelector = "a#KAIJO-FORM";
	var iFrameTitle = "メルマガ配信解除フォーム";
	var iFrameWidth = 600;
	var iFrameHeight = 300;
	var thickboxWidth = 600;
	var thickboxHeight = 350;
	
	if ( $(linkSelector).length > 0 ) {
		$("div#CONTAINER").after('<div id="ThickboxWrapper" style="display:none"><div><a href="#" class="closeTB"><img src="/images/common/tb-close.gif" width="60" height="20" alt="閉じる" /></a></div><iframe name="ThickboxFrame" id="ThickboxFrame" frameborder="0" src="" width="'+iFrameWidth+'" height="'+iFrameHeight+'"></iframe></div>');
		
		$(linkSelector).click(function() {
			tb_show(iFrameTitle,"#TB_inline?height="+thickboxHeight+"&width="+thickboxWidth+"&inlineId=ThickboxWrapper&modal=true","");
			$("iframe#ThickboxFrame")[0].src = this.href;			
			return false;
		});
	}
	$("a.closeTB").click(function() {
		tb_remove();
		return false;
	});
});





