$(document).ready(function() {
	$("a[href$='.jpg']").fancybox({
		'overlayShow': true 
	}); 


	// Clear/restore default text in search boxes etc
	$('.input-text').focus(function() {
		if (this.value==this.defaultValue)
		this.value = ''
	});
	$('.input-text').blur(function() {
		if (this.value=='')
		this.value = this.defaultValue
	});
	$('textarea').focus(function() {
		if (this.value==this.defaultValue)
		this.value = ''
	});
	$('textarea').blur(function() {
		if (this.value=='')
		this.value = this.defaultValue
	});
	
	// Look for special links and enhance according to relationship
	$('a[@rel=external]').addClass('externalLink').attr('target','_blank');
	$('a[@rel=email]').addClass('email');
	$('a[@rel=episode]').addClass('episodeLink');
	
	// Creating custom :external selector
    $.expr[':'].external = function(obj){
        return !obj.href.match(/^mailto\:/)
                && (obj.hostname != location.hostname)
                && (obj.hostname != 'mk2systems.com')
                && (obj.hostname != 'memekast.com');
    };
    
    // Add 'external' CSS class to all external links
    $('a:external').attr('target','_blank');
	
	
	//$('#profile-stalking').hide();
	//$('#profile-stalkers').hide();
	//$('#mod-relationships').addClass('loading');
	
	
	// Tabbed interface for sectioned content
	//$('#profile-stalking').slideDown();
	//$('.sectioned-content').removeClass('loading');
	$('.sectioned-content > ul').tabs({ fx: { height: 'toggle', opacity: 'toggle' } });
	
	
	//$('#profile-stalkers').hide();
	
	// Site notice show/hide
	$('.notice').append('<span class="notice-close">[close]</a>');
	
	$('.notice-show-more').click(function() {
		$(this).removeClass('notice-show-more');
		$(this).parents('.notice').find('.notice-more').slideDown();
	});
	
	$('.notice-close').click(function() {
		$(this).parents('.notice').children().fadeOut('fast');
		$(this).parents('.notice').slideUp();
	});
	
	
});
