function question_init() {
	$(function(){
		$('[comment]').each(function(){
			var $input = $(this);
			var comment = $input.attr('comment');
			$input.each(function(){
				var val = $(this).val();
				var vallength = $.trim(val).length;
				if(vallength == 0){ 
					$input.val(comment).addClass('comment');
				}
			}).focus(function(){
				var val = $(this).val();
				var vallength = $.trim(val).length;
				if(vallength == 0 || val == comment){ 
					$input.val('').removeClass('comment');
				}
			}).blur(function(){
				var val = $input.val();
				var vallength = $.trim(val).length;
				if(vallength == 0){
					$input.addClass('comment').val(comment);
				}
			}).parents('form').submit(function(){
				var val = $input.val();
				var vallength = $.trim(val).length;
				return !(vallength == 0 || val == comment);
			});
		})
	});
}

function photo_init() {
	$(function(){
		if ( typeof( SexyLightbox ) != 'undefined' )
			SexyLightbox.initialize({ color:'white', dir: '/script/sexy-lightbox/sexyimages' });
		$('h3:gt(0)').each(function(){
			$(this).addClass('close').nextAll().hide();
		});
		$('h3').click(function(){
			if ($(this).hasClass('close')) {
				$(this).removeClass('close').nextAll().show();
			} else {
				$(this).addClass('close').nextAll().hide();
			}
		});
	});
}

function getPlayer(movieName) {
	return (navigator.appName.indexOf("Microsoft") != -1) ? window[movieName] : document[movieName];
}

var currentPlayer = '';

function album_init() {
	$(function(){
		$('.album_item div').mouseover(function(){
			var thisPlayer = $(this).find('object').attr('id');
			if (currentPlayer && (currentPlayer == thisPlayer)) {
				$(this).removeClass('overPlay').addClass('overStop');
			} else {
				$(this).removeClass('overStop').addClass('overPlay');
			}
		}).mouseout(function(){
			var thisPlayer = $(this).find('object').attr('id');
			if (currentPlayer && (currentPlayer == thisPlayer)) {
				$(this).removeClass('overPlay').addClass('overStop');
			} else {
				$(this).removeClass('overStop').removeClass('overPlay');
			}
		}).click(function(){
			var thisPlayer = $(this).find('object').attr('id');
			if (currentPlayer) {
				getPlayer(currentPlayer).stopMusic();
				$('.album_item div').removeClass('overStop').removeClass('overPlay');
			}
			if (currentPlayer == thisPlayer) {
				currentPlayer = ''; $(this).addClass('overPlay');
			} else {
				getPlayer(thisPlayer).playMusic(); currentPlayer = thisPlayer;
				$('.album_item div').removeClass('overStop').removeClass('overPlay');
				$(this).addClass('overStop');
			}
		});
	});
};
