// JavaScript Document

function showSignup() {
	var url = "sign_up.php?keepThis=true&amp;TB_iframe=true&amp;height=600&amp;width=459&amp;modal=true";
	tb_show(null, url);
}

$(document).ready(function(){
	$('.ro img').hover( function() {
		this.src = this.src.replace("_off","_on");
	}, function() {
	 	this.src = this.src.replace("_on","_off");
	});
	
	$('.hide').hide();
	$('.dropdown').live('click', function() {
		var panel = $(this).attr('rel');
		
		if ($('#' + panel).hasClass('dropped')) {
			$('#' + panel).slideUp('slow');
			$('#' + panel).removeClass('dropped');
			$('#' + panel + 'span').text('+');
			$.cookie(panel, null);
		} else {
			$('#' + panel).slideDown('slow');
			$('#' + panel).addClass('dropped');
			$('#' + panel).removeClass('hide');
			$('#' + panel + 'span').text('-');
			$.cookie(panel, panel);
		}
		return false;
	});
	
	$("a.enlarge").live('click', function() {
		$.fancybox({
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'href'				: this.href
		});
		
		return false;
	});
	
	$("a[rel=gallery]").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'over',
		'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
			return '<span id="fancybox-title-over">(' + (currentIndex + 1) + ' / ' + currentArray.length + ')' + (title.length ? ' &nbsp; ' + title : '') + '</span>';
		}
	});
	
	$('.top').click( function() {
		$.scrollTo( this.hash , 1000, {easing:'swing'});
		return false
	});
	
	/*$('.work img').qtip({
		show: 'mouseover',
		hide: 'mouseout',
		position: {
			target: 'mouse',
			corner: 'leftMiddle',
			adjust: { x: 10, y: 0 }
		},
		style: {
			border: {
				width: 1,
				radius: 5,
				color: '#00ADEE'
			},
			background: '#333',
			color: '#FFF',
			padding: 8, 
			width: { max: 200 },
			tip: true // Give it a speech bubble tip with automatic corner detection
			//name: 'dark' 
		}
	});*/
	
	$('.keywords').focus(function() {
		if ($(this).val() == "Search Whiteroom //") {
			$(this).val('');;
		}
	});
	
	$('.keywords').blur(function() {
		if ($(this).val() == "") {
			$(this).val('Search Whiteroom //');
		}
	});
	
	$("#friend").fancybox({
		'width'				: 600,
		'height'			: 350,
        'autoScale'     	: false,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
	
	$(".bubble").live('click', function() {
		$.fancybox({
			'width'				: 320,
			'height'			: 480,
			'autoScale'     	: false,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'				: 'iframe',
			'href'				: this.href
		});
		
		return false;
	});
	
	/*$("#slider").cycle({
		fx: 'scrollLeft',
		timeout: 6000,
		speed: 1500,
		easing: "easeInOutQuint",
		pager: "#nav",
		after: onAfter
	});
	
	function onAfter() { 
		var alt = null;
		
		alt = $('img', this).attr('alt');
		if (alt == null || alt == "") alt = $(this).attr('alt');
		
		if (alt == null || alt == "") {
			$('#slidecopy').animate({
				bottom: -30
			}, 1000, 'swing', function() {
				// Animation complete.
				$('#slidecopy p').html(alt); 
			});
		} else {
			$('#slidecopy p').html(alt); 
			
			$('#slidecopy').animate({
				bottom: 0
			}, 1000, 'swing');
		}
	}*/
	
});
