$(function() {
	$("ul.sf-menu").superfish({
		autoArrows: false,
		delay: 500, // one second delay on mouseout
		animation: {opacity:'toggle', height:'show'}, // fade-in and slide-down animation
		speed: 500, // faster animation speed
		autoArrows: false, // disable generation of arrow mark-up
		dropShadows: false // disable drop shadows
	});
	
	$('#tabs ul#tabs_menu').tabs({ fx: { opacity: 'toggle' } }).tabs('rotate', 7000);
	
	$('#latest_themes .latest_theme').hover(function(){
		//$(this).find('.latest_theme_title').animate({"top": "-35px"});
		$(this).find('.preview').fadeTo("fast", 0.7);
		//$(this).find('.preview').animate({"top": "50px"}, 3000);
    },
	function(){
		//$(this).find('.latest_theme_title').animate({"top": "0px"});
		$(this).find('.preview').fadeTo("fast", 1);
    });
	
	

	
	$('.preview img').hover(function(){
		//$(this).find('.featured_theme_title').animate({"top": "-40px"});
		$(this).fadeTo("fast", 0.7);
    },
	function(){
		//$(this).find('.featured_theme_title').animate({"top": "0px"});
		$(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);
		}
	});
	
	$("#loginbtn").toggle(
		function () {
			$("#custom_login").show("slow");
			$(this).html("Cancel login");
      	},
      	function () {
        	$("#custom_login").hide("slow");
			$(this).html("Konichiwa guest, plese Login");
      	}
	);
	$("#twitter_bg a").each(
		function(){
			$(this).attr('target', '_blank');
	});
	
	/*$("#full_view, #screen").toggle(
		function () {
        	var new_height = $("#screen_pic img").height();
			$("#screen_pic").animate({ 
				height: new_height
			}, 900 );
      	},
      	function () {
        	var new_height = 298;
			$("#screen_pic").animate({ 
				height: new_height
			}, 900 );
      	}
	);*/


});