var commonFn = {};
var showtv_index = 1;

(function($){
    $(document).ready(function(){
        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":"#000","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 #d6d6d6"});
		$(".value",this).css({"color":"#000","font-weight":"bold"});
		},function(){
		    $(this).css({"background":"#000","border":"none"});
		    $(".value",this).css({"color":"#fff","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");
		    }
		});
	    });

	    /*
	     * For select End 
	     * */ 
	   /* *******************************
	    * For catwalk select start
	    * ******************************/
	    $(".catwalk-select").each(function(){
			    	var inselect=0;
			    	var drop_list=$("ul",this);
				var select_text=$("a.select-text",this);
			    	$("a.select-text",this).click(function(){
						if(drop_list.css("display")=="block") 
							drop_list.css("display","none");
						else drop_list.css("display","block");
					});
				$(this).hover(function(){inselect=1;},function(){inselect=0;});
				$(document).click(function(){if(inselect==0) drop_list.css("display","none");
							     else            drop_list.css("display","block");
				});
				$("a.list",this).each(function(){
						$(this).click(function(){
								select_text.html('<span>'+$(".value",this).html()+'</span>');
								drop_list.css("display","none");
							});
					});
			    });
	   /*********************************
	    * For catwalk select End
	    * ******************************/

	    $(".tab",".gallery-body").each(function(i){
		$(this).hover(function(){
		    $(this).css("color","#dedede");
		    if(i==1){
			$(".head",".gallery-body").css("background-position","0 -41px");
			$(".tab:eq(0)",".gallery-body").css("color","#999");
			$(".tab:eq(2)",".gallery-body").css("color","#999");
		    }else if(i==2){
			$(".head",".gallery-body").css("background-position","0 -82px");
			$(".tab:eq(0)",".gallery-body").css("color","#999");
			$(".tab:eq(1)",".gallery-body").css("color","#999");
		    }else{
			$(".head",".gallery-body").css("background-position","0px 0px");
			$(".tab:eq(1)",".gallery-body").css("color","#999");
			$(".tab:eq(2)",".gallery-body").css("color","#999");
		    }
		});
	    });
	    $(".second-block",".final-template-scroll-block").jCarouselLite({
			btnNext:"#final-template-scroll-next",
			btnPrev:"#final-template-scroll-prev",
			speed:800,
			visible:5
	    });	
	    $("#award-list-scroll-block").jCarouselLite({
			btnNext:"#award-list-scroll-next",
			btnPrev:"#award-list-scroll-prev",
			speed:800,
			visible:4
	    });
	    $("#brand-tags-scroll-block").jCarouselLite({
			btnNext:"#btn-brand-tags-next",
			btnPrev:"#btn-brand-tags-prev",
			speed:500,
			vertical:true,
			visible:2
	    });
	    $("#brand-commence-scroll").jCarouselLite({
			btnNext:"#brand-commence-next",
			btnPrev:"#brand-commence-prev",
			speed:800,
			visible:8
	    });
	    //
            $("#fashiona_final_tabs_show").jCarouselLite({
			btnNext:"#fashiona_final_tabs_next",
			btnPrev:"#fashiona_final_tabs_prev",
			speed:800,
			visible:6
			})
	    $(".fashion_final form").each(function(){
	                    var inselect=0;	
			    var drop_list=$("ul",this);
				var select_text=$("a.select-text",this);
			    	$("a.select-text",this).click(function(){
						if(drop_list.css("display")=="block") 
							drop_list.css("display","none");
						else drop_list.css("display","block");
					});
				$(this).hover(function(){inselect=1;},function(){inselect=0;});
				$(document).click(function(){if(inselect==0) drop_list.css("display","none");});
				$("a.list",this).each(function(){
						$(this).click(function(){
								select_text.html($(".value",this).html());
								drop_list.css("display","none");
							});
					});
			    });
		     
	   //
	   // for blog_home
	   $("#blog_home_scroll").jCarouselLite({
	                       btnNext:"#blog_home_scroll_next",
	                       btnPrev:"#blog_home_scroll_prev",
	                       speed:800,
	                       visible:9
				});
	   $("#blog_home_tab_btn li").each(function(i){
	           $(this).mouseover(function(){
				  $("#blog_home_tab_btn li.on").removeClass("on");
				  $(this).addClass("on");
                                  $("#blog_home_tab_content>div").removeClass("show");
				  $("#blog_home_tab_content>div:eq("+i+")").addClass("show");
				   });       
		   });
           $("#blog_home_hottable tr:even").addClass("even");
           $("#blog_home_hottable tr:odd").addClass("odd");

	   // for celeb_home 
	   $("#celeb_home_gallery_show").jCarouselLite({
	                       btnNext:"#celeb_home_gallery_next",
	                       btnPrev:"#celeb_home_gallery_prev",
	                       speed:800,
	                       visible:6
				});



	  //bbs tab
	  $("#celeb_home_bbs_tab li").each(function(i){
			      $(this).mouseover(function(){
			  	      $("#celeb_home_bbs_tab li").addClass("tab2");
				      $(this).removeClass("tab2");  
				      var tab0=$("#celeb_home_bbs_tab0");
				      var tab1=$("#celeb_home_bbs_tab1");
				      tab0.removeClass("tabshow"); 
				      tab1.removeClass("tabshow");
                                      if(i==0){
				      	 	tab0.addClass("tabshow");
				      }
				      else{
				     		tab1.addClass("tabshow"); 
				      } 

				      });
			  
			  });
	  	//interative
	  	$("#interative_slide li").each(function(){
			           var node=$(this);
				   $(this).mouseover(function(){
					          $("#interative_slide li.top").removeClass("top");
						  node.addClass("top"); 
						   });
			  });
          // the end 
	    $("tr",".award-list-block").each(function(i){
					if(i%2==0 && i!=0){$(this).css("background","#f0f0f0");}});
	    $("#btn-beauty-brand-type1").hover(function(){
					$("#btn-beauty-brand-type1").addClass("current");
					$("#btn-beauty-brand-type2").removeClass("current");
					$("div.navi","div.beauty-brand-type").css("background-position","0 0");
					$("#beauty-brand-type1").css("display","block");
					$("#beauty-brand-type2").css("display","none");
			    });
	    $("#btn-beauty-brand-type2").hover(function(){
					$("#btn-beauty-brand-type1").removeClass("current");
					$("#btn-beauty-brand-type2").addClass("current");
				$("div.navi","div.beauty-brand-type").css("background-position","0 -21px");
					$("#beauty-brand-type2").css("display","block");
					$("#beauty-brand-type1").css("display","none");
			    });
	    //$("td",".award-list-block").each(function(i){
		//		    		if(i%6==2){
						//$(this).css("border-right","solid 1px #000");
		//			}
		//	    });
	    if(!!document.getElementById("channel-home-kv")) KV.init();
	    $("div.two-tabs2>div.tabs>a").each(function(i){
			    	$(this).hover(function(){
					if(i==1) {$("div.two-tabs2>div.tabs>a:eq(0)").addClass("not-current");
                                        $("#love_bbs_blog_tab1").css('display','none');
                                        $("#love_bbs_blog_tab2").css('display','block');
					}
					if(i==0){ 
                                        $("#love_bbs_blog_tab1").css('display','block');
                                        $("#love_bbs_blog_tab2").css('display','none');
					}
				},function(){
					if(i==1) $("div.two-tabs2>div.tabs>a:eq(0)").removeClass("not-current");
				});
			    });
	    $("div.two-tabs1>div.tabs>a").each(function(i){
			    	$(this).hover(function(){
					if(i==1){ $("div.two-tabs1>div.tabs>a:eq(0)").addClass("not-current");
                                        $("#love_test").css('display','none');
					$("#health_test").css('display','block');}
					if(i==0){
                                        $("#love_test").css('display','block');
					$("#health_test").css('display','none');}
				},function(){
					if(i==1) $("div.two-tabs1>div.tabs>a:eq(0)").removeClass("not-current");

				});
			    });
	    /* For brand top page Start */
	    if($("div.brand-home").length>0){
	    	$("a#brands-list2-fashion").click(function(){
					$("div.brands-list2>div.first-block").css("background-position","0 0");
                                         $("#fashion-brands-list").css({display:"block"});
                                         $("#beauty-brands-list").css({display:"none"});

				});
		$("a#brands-list2-beauty").click(function(){
					$("div.brands-list2>div.first-block").css("background-position","-72px 0");
			                 $("#fashion-brands-list").css({display:"none"});
                                         $("#beauty-brands-list").css({display:"block"});
                            });
		$("a#btn-beauty-news").mouseover(function(){
					$("div.brands-news>div.title").css("background-position","0 0");
					$(this).css("color","#000");
					$("a#btn-fashion-news").css("color","#666");
                                        $("#fashion-news-list").css({display:"none"});
                                        $("#beauty-news-list").css({display:"block"});
				});
		$("a#btn-fashion-news").mouseover(function(){
					$("div.brands-news>div.title").css("background-position","0 -24px");
					$(this).css("color","#000");
					$("a#btn-beauty-news").css("color","#666");
                                        $("#beauty-news-list").css({display:"none"});
                                        $("#fashion-news-list").css({display:"block"});
				});
		$("input.text").focus(function(){$(this).val("");});
		$("input.text").blur(function(){if($(this).val()=="") $(this).val("关键字搜索");});
	   	$("div.scroll-content","div.bottom-recommended-block").jCarouselLite({
	                       btnNext:"#bottom-recommended-next",
	                       btnPrev:"#bottom-recommended-pre",
			       vertical:true,
	                       speed:800,
	                       visible:2
				});
	    }

	    /* For brand top page End */
	    /***************************
		 * Add By Zengrong Start
	    * **************************/

	    idTabsEffect("#hot-info-tabs");
	    idTabsEffect("#hot-top5-tabs");
	    idTabsEffect("#show-and-tv-tabs");
	    idTabsEffect("#forum-and-blog-tabs");
	    idTabsEffect("#special-and-interactive-tabs");
	    idTabsEffect("#q-a-hot-top");
	    idTabsEffect("#expert-tabs");

	    idTabsEffect("#expert-tabs1");
	    idTabsEffect("#expert-tabs2");

	    //for fashion home collection
	    idTabsEffect("#fashion-collection-tabs");
	    idTabsEffect("#beauty-collection-tabs");
	    idTabsEffect("#bbs-blog-collection-tabs");
	    idTabsEffect("#beauty-people-collection-tabs");
	    idTabsEffect("#beauty-star-collection-tabs");

	    idTabsEffectSpecial("#life-cusine-and-music-tabs");
	    idTabsEffectSpecial("#life-bbs-and-blog-tabs");

	    idTabsEffectSpecial("#health-bbs-and-blog-tabs");
	    idTabsEffectSpecial("#health-test-tabs");
	    dlMouseover("#health_test");
	    dlMouseover("#love_test");
	    dlMouseover("#hot-top5-tab1");
	    dlMouseover("#hot-top5-tab2");
	    dlMouseover("#hot-top5-tab3");
	    dlMouseover("#hot-top5-tab4");

	    dlMouseover("#special-and-interactive-tab1");
	    dlMouseover("#special-and-interactive-tab2");

	    dlMouseover("#beauty-collection-tab1");
	    dlMouseover("#beauty-collection-tab2");

	    dlMouseover("#beauty-star-collection-tab1");
	    dlMouseover("#beauty-star-collection-tab2");
	    dlMouseover("#beauty-star-collection-tab3");

	    dlMouseover("#fashion-interactive-c");
	    dlMouseover("#health-test-tab1");
	    dlMouseover("#health-test-tab2");
	    dlMouseover("#health-collection-c");

	    $("#show-and-tv-jCarouselLite1").jCarouselLite({
			btnNext:"#show-and-tv-slide-next1",
			btnPrev:"#show-and-tv-slide-prev1",
			speed:800,
			visible:2
	    });

	    //for fashion home catwalk 
	    $("#catwalk-jCarouselLite").jCarouselLite({
			btnNext:"#catwalk-slide-next",
			btnPrev:"#catwalk-slide-prev",
			speed:800,
			visible:5
	    });

	    //for fashion home accessory
	    $("#accessory-jCarouselLite1").jCarouselLite({
			btnNext:"#accessory-slide-next1",
			btnPrev:"#accessory-slide-prev1",
			speed:800,
			visible:3
	    });

	    //for health home expert
	    $("#expert-jCarouselLite1").jCarouselLite({
			btnNext:"#expert-slide-next1",
			btnPrev:"#expert-slide-prev1",
			speed:800,
			visible:4
	    });

	    $("#expert-jCarouselLite2").jCarouselLite({
			btnNext:"#expert-slide-next2",
			btnPrev:"#expert-slide-prev2",
			speed:800,
			visible:4
	    });

	    $("#accessory-jCarouselLite2").jCarouselLite({
			btnNext:"#accessory-slide-next2",
			btnPrev:"#accessory-slide-prev2",
			speed:800,
			visible:3
	    });

	    $("#survey-jCarouselLite").jCarouselLite({
			btnNext:"#survey-slide-next",
			btnPrev:"#survey-slide-prev",
			speed:800,
			vertical:true,
			visible:7
	    });

	    /* for fashion home catwalk select start */
	    $("#br-seasons").click(function(e){
		if(e){
		    e.stopPropagation();
		}else{
		    e.cancelBublle=true;
		}
		if($("#br-seasons-i").is(":hidden")){
		    $("#br-seasons-i").show("slow");
		}else{
		    $("#br-seasons-i").hide("slow");
		}
	    });

	    $("#br-cities").click(function(e){
		if(e){
		    e.stopPropagation();
		}else{
		    e.cancelBublle=true;
		}
		if($("#br-cities-i").is(":hidden")){
		    $("#br-cities-i").show("slow");
		}else{
		    $("#br-cities-i").hide("slow");
		}
	    });

	    $("#br-designers").click(function(e){
		if(e){
		    e.stopPropagation();
		}else{
		    e.cancelBublle=true;
		}
		if($("#br-designers-i").is(":hidden")){
		    $("#br-designers-i").show("slow");
		}else{
		    $("#br-designers-i").hide("slow");
		}
	    });
            /*add by chunlei*/
	    $(".tryout_item input").each(function(i){
	        var hiddenurl = $("#tryout_hiddenurl").val();
		$(this).click(function(){
			if(i==0)
			 {
			 var url = "/beauty/" +  hiddenurl + '/(limit)/' + $(this).val();
			 window.location.href = url;
			 }
			if(i==1)
			{	
			 var url = "/beauty/" + hiddenurl + '/(limit)/' + $(this).val();
			 window.location.href = url;
			 }
			if(i==2)
			{
			 var url = "/beauty/" +  hiddenurl + '/(limit)/' + $(this).val();
			 window.location.href = url;
			 }
		});

	    });
            $(".beauty_font_size1").click(function(){
		 $("#bea_product_descr p").css('font-size','16px');
		 $(this).css('font-weight','bold');
		 $(".beauty_font_size2").css('font-weight','normal');
		 $(".beauty_font_size3").css('font-weight','normal');
	    });
            $(".beauty_font_size2").click(function(){
		 $("#bea_product_descr p").css('font-size','14px');
		 $(this).css('font-weight','bold');
		 $(".beauty_font_size1").css('font-weight','normal');
		 $(".beauty_font_size3").css('font-weight','normal');
	    });
            $(".beauty_font_size3").click(function(){
		 $("#bea_product_descr p").css('font-size','12px');
		 $(this).css('font-weight','bold');
		 $(".beauty_font_size1").css('font-weight','normal');
		 $(".beauty_font_size2").css('font-weight','normal');
	    });
 
           /*add by chunlei end*/ 
          /*  for celeb-home */
	$("#celeb-name").change(function(){
                                      if($(this).val()!=""){
				      var url ='/celeb/data/' + '(name)/' + $(this).val();
                                      window.location.href=url;  
	  			      }
                         });
	$("#celeb-astrology").change(function(){
                                  if($(this).val()!=""){
			          var url='/celeb/data/' + '(astrology)/' + $(this).val();
                                  window.location.href=url;
				  }
                              });
        $("#celeb-region").change(function(){
                                 if($(this).val()!=""){
				var  url='/celeb/data/' + '(region)/' + $(this).val();
                                window.location.href=url;
                                }
                               });
        $("#celeb-submit,#celeb-btn-search-block").click(function(){
                               var key=$(this).prev('input').val();
                               if(key!=""){
			      var url = '/celeb/data/' + '(key)/' + key;
                              window.location.href=url;
                              }
                          });

	/*open search*/
	$("#sel-occupation").change(function(){
                                      if($(this).val()!=""){
				      var url ='/celeb/data/' + '(name)/' + $(this).val();
                                      window.open(url);
	  			      }
                         });
	$("#sel-horoscope").change(function(){
                                  if($(this).val()!=""){
			          var url='/celeb/data/' + '(astrology)/' + $(this).val();
                                  window.open(url);
				  }
                              });
        $("#sel-district").change(function(){
                                 if($(this).val()!=""){
				var  url='/celeb/data/' + '(region)/' + $(this).val();
                                window.open(url);
                                }
                               });
        $("#btn-search-block").click(function(){
                               var key=$(this).prev('input').val();
                               if(key!=""){
			      var url = '/celeb/data/' + '(key)/' + key;
                              window.open(url);
                              }
                          });
         /* for celeb-list */
	 $("#celeb-list-order").change(function(){
		              var url='/celeb/data/' + '(order)/' + $(this).val();
	 	              window.location.href=url;			
	 				});
 	 /*end*/
	 /* zoomfontstar*/
        $("#select-font-large").click(function(){
			$(this).addClass("current");
			$("#select-font-small,#select-font-mid").removeClass("current");
		        $("#zoomfont-body p").css("font-size","16px");
			});
        $("#select-font-mid").click(function(){
			$(this).addClass("current");
			$("#select-font-small,#select-font-large").removeClass("current");
		        $("#zoomfont-body p").css("font-size","14px");
			});
        $("#select-font-small").click(function(){
			$(this).addClass("current");
			$("#select-font-large,#select-font-mid").removeClass("current");
		        $("#zoomfont-body p").css("font-size","12px");
			});
       /*end*/

















	    var seasons = $("#br-seasons-i li a");
	    $.each(seasons,function(i,n){
		$(n).click(function(e){
		    e.preventDefault();
		    if(e){
		        e.stopPropagation();
		    }else{
		        e.cancelBublle=true;
	            }
		    $("#br-seasons").text($(this).children().text());
		    $("#br-seasons-i").hide();
		});
	    });

	    var cities = $("#br-cities-i li a");
	    $.each(cities,function(i,n){
		$(n).click(function(e){
		    e.preventDefault();
		    if(e){
		        e.stopPropagation();
		    }else{
		        e.cancelBublle=true;
	            }
		    $("#br-cities").text($(this).children().text());
		    $("#br-cities-i").hide();
		});
	    });

	    /* for fashion home catwalk select end */

	    $("#show-and-tv-tab2-title").mouseover( function(){
		if( showtv_index == 1 ) {
		    $("#show-and-tv-jCarouselLite2").jCarouselLite({
			    btnNext:"#show-and-tv-slide-next2",
			    btnPrev:"#show-and-tv-slide-prev2",
			    speed:800,
			    visible:2,
			    start:0
		    });
		}
		showtv_index++;
	    });
	    /* For sub menu start */ 
	    $("#menu-bottom-block>div.current-sub-menu").css("display","block");
	    $("#menu-top-block li a").each(function(i){
			    	$(this).mouseover(function(){
					$("a.current-hover","#menu-top-block").removeClass("current-hover");
					if(!$(this).hasClass("current")) $(this).addClass("current-hover");
					$("#menu-bottom-block>div").each(function(ii){
							if(ii==i) $(this).css("display","block");
							else $(this).css("display","none");
						});
					});
				});
    	   $("#menu").mouseleave(function(){
				$("a.current-hover","#menu-top-block").removeClass("current-hover");
				$("#menu-bottom-block>div").each(function(ii){
						if($(this).hasClass("current-sub-menu")){
							$(this).css("display","block");
						}else{
							$(this).css("display","none");
						}
					});
				});
	   /* for sub menu End */

	    $("#realityshow-roll-jCarouselLite").jCarouselLite({
			btnNext:"#realityshow-slide-next",
			btnPrev:"#realityshow-slide-prev",
			speed:800,
			visible:6
	    });

	    $("#realityshow-small-img").mouseover(function(){
		$("#realityshow-intro-mouseover").show();
		$("#realityshow-intro").hide();
	    });

	    $("#realityshow-small-img").mouseout(function(){
		$("#realityshow-intro-mouseover").hide();
		$("#realityshow-intro").show();
	    });

	    $("#txt-keyword").focus(function(){
	        $(this).attr("value","");
	    });

	    $("#txt-keyword").blur(function(){
	        $(this).attr("value","关键字搜索");
	    });

	    $(".qa-final-list").each(function(i,n){
		var list_left_block = $(this).find(".qa-final-list-l");
		var list_right_block = $(this).find(".qa-final-list-r");

		setSameHeight(list_left_block,list_right_block);
	    });

	    setSameHeight("#centercol","#rightcol");

	    /******************
	      * End By Zengrong 
	    * ****************/
	    /*add by chunlei*/
	    $(".beauty_font_size1").click(function(){
                $(this).css("font-weight","bold");
                $(".beauty_font_size2").css("font-weight","normal");
                $(".beauty_font_size3").css("font-weight","normal");
                $("#bea_product_descr p").css("font-size","16px");
	
	     });
	    $(".beauty_font_size2").click(function(){
                $(this).css("font-weight","bold");
                $(".beauty_font_size1").css("font-weight","normal");
                $(".beauty_font_size3").css("font-weight","normal");
                $("#bea_product_descr p").css("font-size","14px");
	
	     });
	    $(".beauty_font_size3").click(function(){
                $(this).css("font-weight","bold");
                $(".beauty_font_size1").css("font-weight","normal");
                $(".beauty_font_size2").css("font-weight","normal");
                $("#bea_product_descr p").css("font-size","12px");
	
	     });

	    $('#font-0').click(function(){
		$(this).css('font-weight','bold');
		$('#font-1 span').css('font-weight','normal');
		$('#font-2').css('font-weight','normal');
		var FontSize = $(this).attr("title");
		$('.wrap p').css('font-size',FontSize+'px');
		});
	    $('#font-1 span').click(function(){
		$(this).css('font-weight','bold');
		$('#font-0').css('font-weight','normal');
		$('#font-2').css('font-weight','normal');
		var FontSize = $('#font-1').attr("title");
		$('.wrap p').css('font-size',FontSize+'px');
		});
	    $('#font-2').click(function(){
		$(this).css('font-weight','bold');
		$('#font-0').css('font-weight','normal');
	        $('#font-1 span').css('font-weight','normal');
		var FontSize = $(this).attr("title");
		$('.wrap p').css('font-size',FontSize+'px');
		});
	    

	    $('#font_0').click(function(){
		$(this).addClass('current').css("font-weight","bold");
		$('#font_1').removeClass('current');
		$('#font_2').removeClass('current');
		$('.body p').css('font-size','16px');
		});
	    $('#font_1').click(function(){
                $(this).addClass('current');
		$('#font_0').removeClass('current');
	        $('#font_2').removeClass('current');
  		$('.body p').css('font-size','14px');

		});
	    $('#font_2').click(function(){
		$(this).addClass('current');
		$('#font_0').removeClass('current');
	        $('#font_1').removeClass('current');
  		$('.body p').css('font-size','12px');

		});

	    //$("#magnifier img").attr("id","img");
	     if($("#magnifier").length>0){
		var src = $("#hidden_src").html();
                $("#magnifier img").attr("jqimg",src);
                $("#magnifier").mouseover(function(){
	           $("#magnifier div").css("display","none");
		   }).mouseout(function(){
                   $("#magnifier div").css("display","");
			   });
		jQuery("#magnifier").jqueryzoom({
		      xzoom: 285,
		      yzoom: 200,
		      offset:20
		});
	     }
	     if($("#magnifier-b").length>0){
	        var bigimg =$("#magnifier-b > img");
	         $("#magnifier-b > img").attr("jqimg",$("#hidden_small_src li").eq(0).html());
		 $("#fashion_final_pic_small > img").each(function(i){
				$(this).mouseover(function(){
			            var src = $("#hidden_small_src li").eq(i).html();
			            bigimg.attr("src",$(this)[0].src).attr("alt",$(this)[0].alt).attr("jqimg",src);	
				});
			 });
		 $("#magnifier-b > img").mouseover(function(){
                          $("#magnifier-b div p").css("display","none");
			}).mouseout(function(){
			  $("#magnifier-b div p").css("display",""); 
			  });
		jQuery("#magnifier-b").jqueryzoom({
		      xzoom: 285,
		      yzoom: 200,
		      offset:20
		});
	     }
	    /*add by chunlei end*/
	});

        function setSameHeight(leftblock,rightblock){
	   var left_height = parseInt($(leftblock).attr("offsetHeight"))-2;
	   var right_height = parseInt($(rightblock).attr("offsetHeight"))-2; 

	   var arVersion = navigator.appVersion.split("MSIE");
	   var version = parseFloat(arVersion[1]);
	   var vAttr="height";
	   if(version==7) vAttr="min-height";
	   if( left_height < right_height ){
		 if(rightblock!="#rightcol")
		 	$(leftblock).css(vAttr,right_height+"px");
	    }else{
		 if(rightblock!="#rightcol")
		 	$(rightblock).css(vAttr,left_height+"px");
		 else{
			$(rightblock).css("border-left","none");
		 	$(".content-container:first").css("border-right","solid 1px #d1d1d1");
		 }
	    }
	}

	function dlMouseover(parentObj){
	    var dt=$(parentObj+" dt");
	    $(parentObj+" dd").hide();
	    $(parentObj+" dt:first").hide();
	    $(parentObj+" dd:first").show();
	    $.each(dt,function(i,n){
	        $(n).mouseover(function(){
	            $(parentObj+" dt").show();
		    $(parentObj+" dd").hide();
		    $(this).next().show();
		    $(this).hide();
	        });
	    });
	}

	//idTabs
	function idTabsEffect( parentObj ) { 
	    $(parentObj+" ul li a").each( function(){
		$(this).click(function(e){
		    commonFn.stopDefault(e);
	    	});
	    });

	    try {
	        $(parentObj+" ul").myIdTabs({parentObj:parentObj+" ul"});
	    }
	    catch (e) {}
	}

	function idTabsEffectSpecial( parentObj ) { 
	    $(parentObj+" ul li a").each( function(){
		$(this).click(function(e){
		    commonFn.stopDefault(e);
	    	});
	    });

	    try {
	        $(parentObj+" ul").specialIdTabs({parentObj:parentObj+" ul"});
	    }
	    catch (e) {}
	}
	

})(jQuery);

