$(function() {

	$(".featuredslider").jCarouselLite({
		btnNext: ".next",
        btnPrev: ".prev",
		auto: 50000000,
	    speed: 1000
    });
	
	$('#latest_themes .latest_theme').hover(function(){
		$(this).find('.preview').fadeTo("fast", 0.7);
    },
	function(){
		$(this).find('.preview').fadeTo("fast", 1);
    });
	
	
	$('#featured_themes .featured_theme').hover(function(){
		$(this).find('.preview').fadeTo("fast", 0.7);
    },
	function(){
		$(this).find('.preview').fadeTo("fast", 1);
    });
	
	$('.preview img').hover(function(){
		$(this).fadeTo("fast", 0.7);
    },
	function(){
		$(this).fadeTo("fast", 1);
    });
	
	$('.flickr img').hover(function(){
		$(this).fadeTo("fast", 0.7);
    },
	function(){
		$(this).fadeTo("fast", 1);
    });
	
	$('img.fadey').hover(function(){
		$(this).fadeTo("fast", 0.7);
    },
	function(){
		$(this).fadeTo("fast", 1);
    });
	
	var searchstring = $('input#s').attr('value');
	$('input#s').each(function () {
		if ($(this).val() == '') {
			$(this).val(searchstring);
		}
	}).focus(function () {
		if ($(this).val() == searchstring) {
			$(this).val('');
		}
	}).blur(function () {
		if ($(this).val() == '') {
			$(this).val(searchstring);
		}
	});
	$('#user_login, #user_pass').focus(function () {
		if ($(this).val() == 'Username' || $(this).val() == 'Password') {
			$(this).val('');
		}
	});
	
	$("#loginbtn").toggle(
		function () {
			$("#custom_login").show("slow");
			$(this).html("Cancel login");
      	},
      	function () {
        	$("#custom_login").hide("slow");
			$(this).html("Login");
      	}
	);
	$("#twitter_bg a").each(
		function(){
			$(this).attr('target', '_blank');
	});
	

	$(".post_date").corner("left 30px");
	$(".post").corner("5px");
	$("#sidebar li.widget").corner("5px");
	
	if(jQuery.support.noCloneEvent){
		$(".lightboxlink").each(
				function() {
					$(this).imgbox({
						'zoomOpacity'	: true,
						'alignment'		: 'center'
					});
		});
	}
});
