$(document).ready(function(){

	// Color Box
	$('a.lightbox_youtube').colorbox( {innerWidth:"490px", innerHeight:"400px", iframe:true} );
	$('a.lightbox_small').colorbox( {width:"435px", height:"394px", iframe:true} );
	$('a.lightbox_medium').colorbox( {width:"700px", height:"500px", iframe:true} );
	$('a.lightbox_large').colorbox( {width:"900px", height:"700px", iframe:true} );
	$('a.lightbox').colorbox();
	
	$('table.details_table tr:even:not(:first-child)').addClass("alt_row");
	
	
	// Username input replace
	$('input.username_onfocus').focus(function(){
		
		if($(this).val() == "Username")
		{
			$(this).val("");
		}
		
	});
	$('input.username_onfocus').blur(function(){
		
		if($(this).val() == "")
		{
			$(this).val("Username");
		}
		
	});
	
	// Password input replace
	$('input.password_onfocus_text').show();
	$('input.password_onfocus').hide();
	
	$('input.password_onfocus_text').focus(function() {
	    $('input.password_onfocus_text').hide();
	    $('input.password_onfocus').show();
	    $('input.password_onfocus').focus();
	});
	$('input.password_onfocus').blur(function() {
	    if($('input.password_onfocus').val() == '') {
	        $('input.password_onfocus_text').show();
	        $('input.password_onfocus').hide();
	    }
	});


	// forms accordion
	$(".category_collapse").hover(function() {
						$(this).addClass('over_state');
				    	}, function() {
				    	$(this).removeClass('over_state');
				    });
				    
	$(".category_collapse").click(function(){
		var checkElement = $(this).next("div");
		if(checkElement.is(':visible'))
		{
			return false;
		}
		else
		{
			$(this).parent().find(".category_collapse").removeClass('current_state');
			$(this).parent().find(".category_collapse").next("div:visible").slideUp("normal");
			checkElement.slideDown("normal");
			$(this).addClass('current_state');
			return false;
		}
	});
	
	
	// Profiles
	$(".profile_click").hover(function() {
						$(this).addClass('profile_click_over');
						$(this).children("div.matches").show();
						$(this).find("div.actions").show();
				    }, function() {
				    	$(this).removeClass('profile_click_over');
				    	$(this).children("div.matches").hide();
				    	$(this).find("div.actions").hide();
				    });
	$(".profile_premium_click").hover(function() {
						$(this).addClass('profile_premium_over');
						$(this).children("div.matches").show();
						$(this).find("div.actions").show();
				    }, function() {
				    	$(this).removeClass('profile_premium_over');
				    	$(this).children("div.matches").hide();
				    	$(this).find("div.actions").hide();
				    });
				    
	/*$(".profile_premium_click, .profile_click").click(function(){
		window.location = $(this).attr('rel');
		return false;
	});*/

});
