// JavaScript Document

	$(function (){		
		var width=$("body").width();
		if(width<1180){
			$(".main").width(1180)
			}	
		//图片延迟加载
		$("img:visible").lazyload({ 
			placeholder : "/Templets/style/loading.gif",   
			effect : "fadeIn" 
		}); 
		setheight();

		$(".catelist li").prepend('<span></span>');
		$(".catelist > ul > li").eq(4).css("margin-top","20px");
		$(".catelist span").toggle(
			function(){
				$(this).parent().next("ul").slideDown();
				$(this).parent().children("ul").slideToggle();
				$(this).parent().toggleClass("openthis");
			},
			function(){
				$(this).parent().next("ul").slideUp();
				$(this).parent().children("ul").slideToggle();
				$(this).parent().toggleClass("openthis")			
			});
		
		$(window).scroll(function(){setheight()});
		$(".logo:last").html('<p>京公网安备：110105013147号</p>')
		var lang=$(".lang").html();
		if(lang=='en'){
			$("body").css("font-size","11px");
			$(".content_button a:first").html("<img src='/Templets/images/c_pdf_button_en.gif'>");
			$(".content_button a.showcc").html("<img src='/Templets/images/cc_button_en.gif'>");
			$(".lanmuc p").css("text-indent","0");
			$(".logo:last").html('')
			};
		var thisshowpic=$(".content_button .showcc").attr("href");
		$(".content_button .showcc").click(function(){
			$(this).attr("href",thisshowpic);
			var showpic=$(this).attr("href");
			var showtitle=$(this).attr("title");
			var showpiclink=('/showpic.html?showpic='+showpic+'&showtitle='+showtitle+'&lang='+lang);
			if(showpic!==""){				
				$(this).attr("href",showpiclink);
				$(this).attr("target","_blank");
				}
			else{
				$(this).attr("href","javascript:void(0)");
				}
			});
		$(".down_no").each(function(i){
			i=i+1;
			$(this).html(i+'.');
			})	
		$(".down_files").each(function(){
			if(lang=='cn'){$(this).children("a").html("点击下载");}
			else{$(this).children("a").html("Download");}			
			$(this).children("a").attr("target","_blank");
			$(this).show();
			});
		$(".yushilist li").each(function(){
			var thislink=$(this).children("div").clone();
			$(this).children("h1").after(thislink);
			$(this).children("div:last").remove();
			$(this).children("div").show();
			})
		$(".ca_menu:eq(4) li a").each(function(){
			$(this).removeAttr("href");
			var copythis=$(this).children("span").clone();
			$(this).after(copythis);
			})			
		$(".ca_menu:last li a").each(function(){
			$(this).removeAttr("href")
			})	
		$(".sortnews > li:eq(4)").children("a").removeAttr("href");		
		$(".sortnews > li:last").children("a").removeAttr("href");	
	
	});
	function setheight(){
		var rightheight=$(".right").height();
		var shareheight=rightheight-120;	
		if(shareheight>640){$(".catelist").height(shareheight);}
		}

function setUrl() {
    var votehref = document.location.href;
    var url = new Array();
    url = votehref.split('/');
    var m = url.length;
    var cookieVal = url[m - 1].split(".")[0];
	var lang=$(".lang").html();
    window.open("/GetPdf.aspx?newsurl=" + cookieVal +'&lang=' +lang, "", "", "");
}
