function initPhotoMark() {
	$('div.photo-box').each(function(){
		var _holder = $(this);
		var _links = _holder.find('a.mark');

		_links.each(function(_ind){
			var _opener = $(this);
			var _info = _opener.find('span');

			_opener.css({
				visibility:'visible',
				zIndex:_ind,
				opacity:0
			});
			_opener.hover(function(){
				_opener.css({opacity:($.browser.msie ? 'auto':1)});
			},function(){
				_opener.css({opacity:0});
			});
			_info.css({left:_opener.outerWidth(true)/2-_info.outerWidth(true)/2});
		});
	});
}

function initContentChanger() {
	var _activeClass = 'active';
	$('div.slideset').each(function(){
		var _holder = $(this);
		var _opener = _holder.find('ul.slide-toggler li');
		var _slides = _holder.find('div.box-img > div.slide');
		var _activeIndex = _opener.index(_opener.filter('.'+_activeClass).eq(0));
		if(_activeIndex<0) _activeIndex=0;

		_opener.each(function(_ind){
			$(this).find('a').click(function(){
				_activeIndex=_ind;
				switchSlide();
				return false;
			});
		});

		function switchSlide() {
			_opener.removeClass(_activeIndex).show().eq(_activeIndex).addClass(_activeClass).hide();
			_slides.removeClass(_activeIndex).hide().eq(_activeIndex).addClass(_activeClass).show();
		}
		switchSlide();
	});
}

$(function() {
	initPhotoMark();
	initContentChanger();
});