document.write("<style type=\"text/css\">"); 
document.write("ul.list1 li div p{*position:absolute;top:50%; left:0; display:table-cell; vertical-align:middle;width:100%;}");
document.write(".content_in{text-justify: inter-ideograph; text-align: justify;}");
document.write("</style>"); 

$(function(){
	$("div.logo").eq(0).append("<span id=\"sresult\"><img src=\"images/lightbox-ico-loading.gif\" width=\"24\" height=\"24\" alt=\"正在传送数据...\" /></span>");
	$("#sresult").css("opacity","0.95");
	$("#frmsearch").submit(function(){searchinput();return false;});
	$("#searchGo").click(function(){searchinput();return false;});
	$("#searchArea").click(function(){
		if ($("input[name='keywords']").val() == "关键词"){
		$("input[name='keywords']").val("");
		}
	});

	var navigatorLI = $("div.sub_navigator li");
	for (var i = navigatorLI.length; i > 0; i--){
		var childA = navigatorLI.eq(i-1).children("a");
		if(childA.attr("href").indexOf(":") > 0) {
			childA.attr("href", $("li:eq(0)>a", childA.next()).attr("href"));
		}
	}
	
	$("div.sub_navigator a.ac").parents("li").children("a").addClass("ac");
	$("div.sub_navigator li:has(ol)").hover(function(){
		if ($(this).children("ol").children("li").length > 1){$(this).children("ol").show();}
	},function(){
		if ($(this).children("ol").children("li").length > 1){$(this).children("ol").hide();}
	});

	if ($("a.thumb").length > 0){$("a.thumb").lightBox();}

	$("div.navigator ul li ol li:last-child").css('border-bottom','0');
	$("div.trademarkpara table tr:odd").css('background-color','#ccffff');
	$("div.trademarkpara table tr:eq(0)").css('height','33px').css('background-color','#ccffff');
	$("div.trademarkpara table tr:eq(0)").children().eq(0).css('padding-top','36px');
	$("div.trademarkpara table tr td").first().css('width','103px');
	$("#P00 .navigator ul li#menu00 a.a00").addClass("acurrent");
	$("#P01 .navigator ul li#menu01 a.a00").addClass("acurrent");
	$("#P02 .navigator ul li#menu02 a.a00").addClass("acurrent");
	$("#P03 .navigator ul li#menu03 a.a00").addClass("acurrent");
	$("#P04 .navigator ul li#menu04 a.a00").addClass("acurrent");
	$("#P05 .navigator ul li#menu05 a.a00").addClass("acurrent");
	$("#P06 .navigator ul li#menu06 a.a00").addClass("acurrent");
	$("#P00 .flash").html(fplay("images/frame.swf","982","300"));
	if($("body").attr("id") != "P00") {$("div.flash").eq(0).html(fplay("images/in.swf","981","190"));}

	var outer_width=0;
	var len=$('.outer>div').length;
	for(var i=1;i<=len;i++)
		outer_width+=$('.outer>div').eq(i-1).outerWidth();
	if($(".outer").children().length>1){
		for(var i=$(".outer").children().length-1; i>1; i--)
			outer_width+=$(".outer").children().eq(i).outerWidth();
			}
	$('.outer').css("width",outer_width);

	var maxheight=$('.outer>div').eq(0).outerHeight();
	for(var j=1; j<len; j++)
		if(maxheight<$('.outer>div').eq(j).outerHeight())
			maxheight=$('.outer>div').eq(j).outerHeight();
	$('.outer>div').css('height',maxheight);
	$('.outer>div').eq(len-1).css('border-right','0');
	var maxheight1=$('.maincontent .contentdetail .content_in').eq(0).outerHeight();
	for(var j=1; j<len; j++)
		if(maxheight<$('.maincontent .contentdetail .content_in').eq(j).outerHeight())
			maxheight=$('.maincontent .contentdetail .content_in').eq(j).outerHeight();
	$('.maincontent .contentdetail .content_in').css('height',maxheight1);
	$('.maincontent .contentdetail0_2 .content_in').css('height',maxheight1+2);
	var maxheight11=$('.maincontent .contentdetail .content_in ul.list0').eq(0).outerHeight();
	for(var j=1; j<len; j++)
		if(maxheight<$('.maincontent .contentdetail .content_in ul.list0').eq(j).outerHeight())
			maxheight=$('.maincontent .contentdetail .content_in ul.list0').eq(j).outerHeight();
	$('.maincontent .contentdetail .content_in ul.list0').css('height',maxheight11);
	$('.maincontent .contentdetail0_2 .content_in ul.list0').css('height',maxheight11-39);

});


function fplay(swf, swfwidth, swfheight,full) { 
    if (navigator.userAgent.indexOf('Firefox') > - 1) {
		if (full == "full"){
	        return('<embed src="' + swf + '" width="' + swfwidth + '" height="' + swfheight + '" quality="high" wmode="Opaque" allowFullScreen="true" allowScriptAccess="always"></embed>');
		}else{
        return('<embed src="' + swf + '" width="' + swfwidth + '" height="' + swfheight + '" quality="high" wmode="transparent"></embed>');}
    } else {
		if (full == "full"){
			return('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + swfwidth + '" height="' + swfheight + '"><param name="movie" value="' + swf + '" /><param name="quality" value="high" /><param name="menu" value="false" /><param name="wmode" value="Opaque" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /></object>');
		}else{
        return('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + swfwidth + '" height="' + swfheight + '"><param name="movie" value="' + swf + '" /><param name="quality" value="high" /><param name="menu" value="false" /><param name="wmode" value="transparent" /></object>');}
    }
}

function searchinput(){
	if ($("input[name='keywords']").attr("value") == "" || $("input[name='keywords']").attr("value") == "请输入关键词"){
		alert("请输入关键词");
		$("input[name='keywords']").val("");
	    $("input[name='keywords']").focus();
		return false;
    }else{
		$("input[name='keywords']").attr("value",trim($("input[name='keywords']").attr("value")));
		$("#sresult").css("display","block");
		$("#sresult").html("<img src=\"images/lightbox-ico-loading.gif\" width=\"24\" height=\"24\" alt=\"正在传送数据...\" />");
		showrequest("search_ajax.aspx?keywords=" + encodeURIComponent(escape($("input[name='keywords']").attr("value"))),"sresult",false);
		cls_button();
	}
}

function trim(a_strVarContent) {
var pos1, pos2, newstring;pos1 = 0;pos2 = 0;newstring = "";
	if ( a_strVarContent.length > 0 ) {
		for( i=0; i<=a_strVarContent.length; i++) { 
			if ( a_strVarContent.charAt(i) == " " ) pos1 = pos1 + 1;
			else break;
		} 
		for( i=a_strVarContent.length; i>=0 ; i--) {
			if ( a_strVarContent.charAt(i) == " " ) pos2 = pos2 + 1;
			else break;
		}
		newstring = a_strVarContent.substring(pos1, a_strVarContent.length-pos2) 
	} 
	return newstring; 
} 

function searchp(keywords,r,p,ttype){
	showrequest("search_ajax.aspx?keywords=" + keywords + "&r=" + r + "&p=" + p + "&type=" + ttype,"sresult",false);cls_button();
	return false;
}

function cls_button(){
	nCol = $("#sresult > A");
	for (i=0;i<nCol.length;i++){
		if (nCol[i].className == "cls"){
			nCol[i].onclick = function(){
				this.parentNode.style.display = "none";
			}
		}
	}
}

var http_request = false;
function showrequest(url,element,asyn) {
	var isFFCLS = true;
	http_request = false;
    if (window.XMLHttpRequest) {
        http_request = new XMLHttpRequest();
        if (http_request.overrideMimeType) {
            http_request.overrideMimeType('text/xml');
        }
    } else if (window.ActiveXObject) {
        try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
            http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
        }
    }
    if (!http_request) {alert('Giving up :( Cannot create an XMLHTTP instance');return false;}
    http_request.onreadystatechange = sub_showrequest;
    http_request.open('GET', url, asyn);
    http_request.send(null);
	if ((!asyn) && (isFFCLS)) sub_showrequest();
	function sub_showrequest(){
	    if (http_request.readyState == 4) {
        if (http_request.status == 200) {
			isFFCLS = false;
			document.getElementById(element).innerHTML = http_request.responseText;
        } else {alert('There was a problem with the request.');}
		}	
	}
}

var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Fa5c7879fc56defd0d1a156921789e0a2' type='text/javascript'%3E%3C/script%3E"));
