/*
	set Configuration
*/
$(document).ready(function(){
	if ($.Lightbox.ie6){
		//nothing
	}else{
		$.Lightbox.construct({
			'files': {
				css: {
					lightbox:	'/jslib/lightbox/css/jquery.lightbox.modifiedFG.css'
				},
				'images': {
					'prev': 	'/jslib/lightbox/FGimages/LB_modoru.gif',
					'next': 	'/jslib/lightbox/FGimages/LB_tugihe.gif',
					'blank':		'/jslib/lightbox/images/blank.gif',
					'loading':	'/jslib/lightbox/images/loading.gif'
				}
			},
			text: {
				// For translating
				image:		'',
				of:			'／',
				close:		'閉じる',
				closeInfo:	'画像の外側をクリックしても閉じることができます。',
				download:	'新しいウィンドウに画像を表示します。.',
				help: {
					close:		'Click to close',
					interact:	'Hover to interact'
				},
				about: {
					text: 	'jQuery Lightbox Plugin (balupton edition)',
					title:	'Licenced under the GNU Affero General Public License.',
					link:	''
				}
			},
			opacity:	0.3,
			padding:		null,		// if null - autodetect
			download_link:	true,		// Display the download link
			show_linkback:		false,	// true, false
			show_info:			true,	// auto - automaticly handle, true - force
			show_extended_info:	true	// auto - automaticly handle, true - force	
		});
	}
});

/*
Jquery Lightbox のグループを作成する
*/
function makeLightboxGroup(gname,tid,iname,inum,itype,text,textcolor){
	if (textcolor == undefined) {
		textcolor = "#000000";
	} 
	var fpath = "/users/" + tid + "/" + iname + "01";
	var descriptionMsg = (inum==1 ? "" : "画像の右半分をクリックすると次の画像が表示されます。");
	fpath += "." + itype;
	var html = '<a href="' + fpath + '" title="画像の単独表示" description="' + descriptionMsg + '" style="color:' + textcolor +'">'+ text +'</a>';
	$(html).appendTo("#" + gname);
	for(var i=2;i<=inum;i++){
		fpath = "/users/" + tid + "/" + iname;
		fpath += ("0"+String(i)).substr(("0"+String(i)).length-2,2);
		fpath += "." + itype;
		html = '<a href="' + fpath + '" title="画像の単独表示" description="画像の右半分をクリックすると次の画像が表示されます。<br>左半分をクリックすると前に戻ります"></a>';
		$(html).appendTo("#" + gname);
	}
	$('#' + gname + ' a').lightbox();
	$.Lightbox.relify();
	$('#lightbox-caption-seperator').html('<br>');
	
}

