var commonFn = {};
var showtv_index = 1;

(function($){
    $(document).ready(function(){
	$("#shareicon").mouseover( function() { $("#sharefull").show(); } );
	$("#shareicon-close").click( function() { $("#sharefull").hide(); } );
	$("#shareicon-below").mouseover( function() { $("#sharefull").show(); } );
        commonFn.stopDefault = function(e){
	if (e)
	    e.preventDefault();
	else 
	    window.event.returnValue = false;
	};

	$("li","#menu-top-block").each(function(i){
	    var_image=$(this).css("background-image");	
	    var_repeat=$(this).css("background-repeat");
	    var_position=$(this).css("background-position");
	    $(this).hover(function(){
		$(this).css({"background":"#F5F5F5","color":"#fff"});
		},function(){
		    $(this).css({"background-image":var_image,"background-repeat":var_repeat,"background-position":var_position,"color":"#eeeeee"});
	    });
	});

	var_bg_menu_keyword=$("#txt-menu-keyword").css("background-image");
	$("#txt-menu-keyword").click(function(){
	    $(this).css("background","#fff");
	});
	$("#txt-menu-keyword").blur(function(){
	    $(this).css("background-image",var_bg_menu_keyword);
	});
	$("li:last","#menu-bottom-block").css("background","none");
	/* 
	 * For select start
	 * */	
	$("div.select").each(function(){
	    var_select=this;
	    var_inselect=0;
	    $("li",this).hover(function(){
		$(this).css({"background":"#fff","border":"solid 1px #ccc"});
		$(".value",this).css({"color":"#000","font-weight":"normal"});
		},function(){
		    $(this).css({"background":"#F5F5F5","border":"none"});
		    $(".value",this).css({"color":"#000","font-weight":"normal"});
	    });
	    $("li",this).click(function(){
		$("ul",var_select).hide();
		$(".text",var_select).removeClass("drop-down");
		$(".text",var_select).html($(".value",this).html());
		/*location.href=$(".key",this).html();*/
	    });
	    $("ul",this).css("display","none");
		$(".text",this).click(function(){
		//if($("ul",var_select).css("display")=="block"){
		    //$("ul",var_select).slideUp("slowly");
		    //$(this).removeClass("drop-down");
		//}else{
		    $("ul",var_select).slideDown("slowly");
		    $(this).addClass("drop-down");
		//}
	    });
	    $(".last-block",this).hover(function(){var_inselect=1;},function(){var_inselect=0;});
		$(document).click(function(){
		    if(var_inselect==0){
			$("ul",var_select).slideUp("slowly");
			$(".text",var_select).removeClass("drop-down");
		    }
		});
	    });
	});
	/*my book
	$("div.book-sort").each(function(){
	    var_select=this;
	    var_inselect=0;
	    $("li",this).hover(function(){
		$(".value",this).css({"color":"#992927","font-weight":"normal"});
		},function(){
		    $(this).css({"background":"#F5F5F5","border":"none"});
		    $(".value",this).css({"color":"#992927","font-weight":"normal"});
	    });
	    $("li",this).click(function(){
		$("ul.drop-down-list",var_select).hide();
		$(".text",var_select).removeClass("drop-down");
		$(".text",var_select).html($(".value",this).html());

	    });
	    $("ul.drop-down-list",this).css("display","none");
		$(".bookcagetory",this).click(function(){
		if($("ul.drop-down-list",var_select).css("display")=="block"){
		    $("ul.drop-down-list",var_select).slideUp("slowly");
		    $(this).removeClass("drop-down");
		}else{
		    $("ul.drop-down-list",var_select).slideDown("slowly");
		    $(this).addClass("drop-down");
		}
	    });
	    $(".last-block",this).hover(function(){var_inselect=1;},function(){var_inselect=0;});
		$(document).click(function(){
		    if(var_inselect==0){
			$("ul",var_select).slideUp("slowly");
			$(".text",var_select).removeClass("drop-down");
		    }
		});
	    });
	*/
	

})(jQuery);




