jQuery.noConflict();

    jQuery(document).ready(function($){ 
    var ops = window.navigator.userAgent;
    var r = ops.indexOf("Mac");
    if(r>=0){
		
	}

	/* Pop Up function */
	
	$(window).resize(function(){
		//$("#gallery_pop .pop_club").fixPop(857,492);
	});
	
	$(".pop-up-inner").each(function(){
			$(this).fixPop(470,445,$(this).attr("id"));
	});
	$("#close-pop-up").click(function(){
			$(".pop-up").hide();
	})
	$(".our-people-link").click(function(){
			$("#new-pop-name").text($(this).text());
			$("#new-pop-img").attr("src","");
			$("#new-pop-img").attr("src",$(this).attr("img_src"));
			$("#" + $(this).attr("popupid")).show();
	})
	/* Make Latest News Items section lines up with right section of the page*/ 
	right_section = $(".right-c").height();
	left_section = $(".leftbar").height();
	minus_long = eval(right_section-left_section);
	//$("body").append(left_section + "/" +right_section);
	
	if($(".download_bgcolor_bg").attr("class")==null || $(".download_bgcolor_bg").attr("class")!="download_bgcolor_bg")if(minus_long>0) $(".lastest-news").height(minus_long+174);
	   else if(minus_long>0) $(".download_bgcolor_bg-news").height(minus_long+174);
	
	/* Category JS */
	$(".category-pro-bt").click(function(){
			$(".category-overview").hide();	
			$(".category-products").show();	
			$(".category-infor").hide();	
			$("#productimg").attr("src",$(this).attr("image_src"));
		 $("div[class^='category-page']").hide();
	});
	$(".category-infor-bt").click(function(){
			$(".category-overview").hide();	
			$(".category-products").hide();	
			$(".category-infor").show();		
			$("#productimg").attr("src",$(this).attr("image_src"));	
		 $("div[class^='category-page']").hide();				 
	});
	$(".category-infor-page").click(function(){
		 $("div[class^='category-page']").hide();
		 $(".category-page"+$(this).attr("hide_page")).show();
		 $(".category-overview").hide();
		 $(".category-products").hide();
		 $(".category-infor").hide();
		 
	});
});
    
    (function($){
	//window.onresize=findDimensions; 
        $.fn.extend({
			
			fixPop:function(w,h,id){
				// 获取窗口宽度
				var winWidth = 0;
				var winHeight = 0;
				
				if (window.innerWidth)
				
				winWidth = window.innerWidth;
				
				else if ((document.body) && (document.body.clientWidth))
				
				winWidth = document.body.clientWidth;
				
				// 获取窗口高度
				
				if (window.innerHeight)
				
				winHeight = window.innerHeight;
				
				else if ((document.body) && (document.body.clientHeight))
				
				winHeight = document.body.clientHeight;
				
				// 通过深入Document内部对body进行，获取窗口大
				
				if (document.documentElement  && document.documentElement.clientHeight && document.documentElement.clientWidth)
				
				{
				
				winHeight = document.documentElement.clientHeight;
				
				winWidth = document.documentElement.clientWidth;
				
				}
				
        		WLeft_f2   =   Math.ceil((winWidth   -   w)   /   2  );
    		    WTop_f2   =   Math.ceil((winHeight   -   h)   /   2   ); 
    			if(WTop_f2<0) WTop_f2=10;
    			$("#"+id).css('left',WLeft_f2 + "px");
    			$("#"+id).css('top',WTop_f2 + "px");
        	}
        })
    })(jQuery);
