document.write("<style type=\"text/css\">"); 
document.write(".companyintro p,.content_in{text-justify: inter-ideograph; text-align: justify;}");
document.write("#P01 ul.list1 li div p,#P02 ul.list1 li div p,#P03 ul.list1 li div p,#P04 ul.list1 li div p,#P05 ul.list1 li div p,#P06 ul.list1 li div p,#P07 ul.list1 li div p,#P08 ul.list1 li div p,#P09 ul.list1 li div p{*position:absolute;top:50%; left:0; display:table-cell; vertical-align:middle;width:100%;}");
document.write(".content_in,.content_in p,.content_in2,ul.list2 li p{text-justify: inter-ideograph; text-align: justify;}");
document.write("#sresult,#friend ul li p{filter:Alpha(Opacity=90);}");
document.write(".service ul li span{ font-size:12px; margin-left:0px; float:left; width:100px; margin-top:expression(this.previousSibling == null ? '10px' : '0px'); margin-left:10px}");
document.write("#online_serv li{ background:none; width:270px; height:20px;margin-top:expression(this.previousSibling == null ? '90px' : '0px');}");
document.write(".copyright p,#P02 .copyright p,#P04 .copyright p{ font-size:12px; text-align:center; color:#636363; margin-top:6px;margin-top:expression(this.previousSibling == null ? '50px' : '6px');}");
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.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"));
		}

		if (navigatorLI.eq(i-1).children("ol").length >0 && navigatorLI.eq(i-1).children("ol").children("li").length > 1){
			navigatorLI.eq(i-1).children("a").eq(0).addClass("hasul");
		}
	}

	$("#protree a.ac").parents("li").children("a").addClass("ac");
	$("div.navigator > ul > li > ol li:first-child").addClass("first");

   $("div.navigator ul li:has(ol)").hover(function(){
		if ($(this).children("ol").children("li").length > 1){
			//$(this).siblings().children("ol").hide();
			$(this).children("ol").slideDown(550);
			$(this).children("a").eq(0).addClass("ac")
			}
			$(this).children(".a00").css("background","url(images/bojianimg_04.jpg) left bottom no-repeat");
		},function(){
			if ($(this).children("ol").children("li").length > 1){
				//$(this).siblings().children("ol").hide();
				$(this).children("ol").slideUp(200);
				$(this).children("a").eq(0).removeClass("ac")
				}
			$(this).children(".a00").css("background","none");
   });

	if ($("ul.list1").length > 0 && $("body").attr("id") != "P03" ) {	$("ul.list1 li a.thumb").lightBox();}
	if ( $("body").attr("id") == "P01" && $("a.thumb").length > 0){$("a.thumb").lightBox();}

	$("#marquee_container").kxbdMarquee(true,0,'left',1,10);
	if ( jQuery.browser.msie && jQuery.browser.version < 7){DD_belatedPNG.fix('div,img,ul,ol,li,body');}

	$("ul.ul1 > li > ol > li > ol > li > a.ac").parent().parent().prev().addClass("ac");
	$("ul.ul1 > li > ol > li > ol > li > a.ac").parent().parent().show();

	$("ul.ul1 > li > ol > li > a").bind('mouseover',function(){ 
		$(this).parent().siblings().children("ol").hide();
		$(this).next().show();
	});

	if($("body").attr("id") == "P00") {$("div.flash").eq(0).html(fplay("images/home.swf","997","277"));}
	if($("body").attr("id") == "P03") {
		$("div.cont_flash2").eq(0).html(fplay("images/" + $("div.cont_flash2").eq(0).attr("id") + ".swf","714","196"));
		$("div.cont_flash").eq(0).html(fplay("images/" + "pp03.swf","714","131"));
	}
	if($("body").attr("id") != "P00" && $("body").attr("id") != "P03") {$("div.cont_flash").eq(0).html(fplay("images/t" + $("body").attr("id").substring(1,3) + ".swf","714","198"));}

	var width=-$(".marquee span").width();AutoScroll(".marquee",width);
	
	lastScrollY=0;
//	window.setInterval("heartBeat()",1);

/**/

    var map = $("#chinamap");
    var map_a = $(">div>a", map);
    map_a.each(function() {
        if($(this).attr("href").indexOf("#") > -1) {
            $(this).addClass("ok");
        }
    });
    map_a.hover(function() {
        $(this).addClass("over");
    }, function() {
        $(this).removeClass("over");
    });
    var prov_data = $("#map>dl.provdata");
    var viewb = $("#map>dl.desc");
    var bef = $("<div>");

    map_a.click(function() {
        bef.removeClass("ac");
        $(this).addClass("ac");
        bef = $(this);

        var href = $(this).attr("href");
        var st = href.indexOf("#");
        var myProv = prov_data.children("dt").filter("." + href.slice(st+1));

/*0608*/var dd = myProv.next("dd");
        var dd_br = dd.children("br");

        viewb.fadeOut("fast", function() {
            viewb.html("");
            viewb.append(myProv.clone()).append(myProv.next("dd").clone());

/*0608*/    if (dd_br.length > 15) {
                var t_pages = Math.ceil(dd_br.length/15);
                
                var temp_node = document.createDocumentFragment();

                var temp1 = $("<a class='up' href='javascript:void(null)'></a>")[0];
                var temp2 = $("<a class='down' href='javascript:void(null)'></a>")[0];
                var temp3 = $("<p class='c_page'>1</p>")[0];
                var temp5 = $("<p class='t_pages'>" + t_pages + "</p>")[0];

                temp_node.appendChild(temp1);
                temp_node.appendChild(temp2);
                temp_node.appendChild(temp3);
                temp_node.appendChild(temp5);

                viewb.append(temp_node);                    //fragment dom;

                var v_dd = $(">dd", viewb);
                v_dd.contents().wrapAll("<div>");                 //contents() method is very useful.

                /**/
                var up = $("a.up", viewb);
                var down = $("a.down", viewb);
                var step = 225;                             // 225 px / 15 lineheight =  15 lines;
                var cur_mg = 0;
                var page = 1;
                var wrap_div = $(">dd>div", viewb);
                var v_sp = $(">p.c_page", viewb);

                down.click(down_c = function() {
                    page += 1;
                    v_sp.text(page);
                    wrap_div.css("marginTop", cur_mg -= step);
                    if (page > 1) {
                        up.bind("click", up_c).removeClass("dis");
                    }
                    if (page >= t_pages) {
                        down.unbind("click", down_c).addClass("dis");
                    }
                });
                up.click(up_c = function() {
                    page -= 1;
                    v_sp.text(page);
                    wrap_div.css("marginTop", cur_mg += step);
                    if(page < t_pages) {
                        down.bind("click", down_c).removeClass("dis");
                    }
                    if (page <= 1) {
                        up.unbind("click", up_c).addClass("dis");
                    }
                });
                up.addClass("dis").unbind("click", up_c);    //first sight, up button must be disabled;
            }

            
            viewb.slideDown("fast");
        });

    });
/*map*/

});
	   
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>');}
    }
}

$.fn.kxbdMarquee = function(options){
    var opts = $.extend({},$.fn.kxbdMarquee.defaults,options);
    
    return this.each(function(){
        var $marquee = $(this);//滚动元素容器
        var _scrollObj = $marquee.get(0);//滚动元素容器DOM
        var scrollW = $marquee.width();//滚动元素容器的宽度
        var scrollH = $marquee.height();//滚动元素容器的高度
        var $element = $marquee.children(); //滚动元素
        var $kids = $element.children();//滚动子元素
        var scrollSize=0;//滚动元素尺寸
        var _type = (opts.direction == 'left' || opts.direction == 'right') ? 1:0;//滚动类型，1左右，0上下
        
        //防止滚动子元素比滚动元素宽而取不到实际滚动子元素宽度
        $element.css(_type?'width':'height',10000);
        //获取滚动元素的尺寸
        if (opts.isEqual) {
            scrollSize = $kids[_type?'outerWidth':'outerHeight']() * $kids.length;
        }else{
            $kids.each(function(){
                scrollSize += $(this)[_type?'outerWidth':'outerHeight']();
            });
        }
        //滚动元素总尺寸小于容器尺寸，不滚动
        if (scrollSize<(_type?scrollW:scrollH)) return; 
        //克隆滚动子元素将其插入到滚动元素后，并设定滚动元素宽度
        $element.append($kids.clone()).css(_type?'width':'height',scrollSize*2);
        
        var numMoved = 0;
        function scrollFunc(){
            var _dir = (opts.direction == 'left' || opts.direction == 'right') ? 'scrollLeft':'scrollTop';
            if (opts.loop > 0) {
                numMoved+=opts.scrollAmount;
                if(numMoved>scrollSize*opts.loop){
                    _scrollObj[_dir] = 0;
                    return clearInterval(moveId);
                } 
            }
            if(opts.direction == 'left' || opts.direction == 'up'){
                _scrollObj[_dir] +=opts.scrollAmount;
                if(_scrollObj[_dir]>=scrollSize){
                    _scrollObj[_dir] = 0;
                }
            }else{
                _scrollObj[_dir] -=opts.scrollAmount;
                if(_scrollObj[_dir]<=0){
                    _scrollObj[_dir] = scrollSize;
                }
            }
        }
        //滚动开始
        var moveId = setInterval(scrollFunc, opts.scrollDelay);
        //鼠标划过停止滚动
        $marquee.hover(
            function(){
                clearInterval(moveId);
            },
            function(){
                clearInterval(moveId);
                moveId = setInterval(scrollFunc, opts.scrollDelay);
            }
        );
        
    });
};
$.fn.kxbdMarquee.defaults = {
    isEqual:true,//所有滚动的元素长宽是否相等,true,false
    loop: 0,//循环滚动次数，0时无限
    direction: 'left',//滚动方向，'left','right','up','down'
    scrollAmount:1,//步长
    scrollDelay:10//时长

};
$.fn.kxbdMarquee.setDefaults = function(settings) {
    $.extend( $.fn.kxbdMarquee.defaults, settings );
};

function AutoScroll(obj,width){
	     $(obj).find("span").animate({   
                marginLeft:width  
            },30000, function() {   
               $(this).css({marginLeft:$(this).width()});
			   AutoScroll(obj,width);
            });   
         
	}

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.');}
		}	
	}
}

function heartBeat(){ 
  
    
		var diffY;
		var myclass = new RegExp('\\b'+"float_service"+'\\b');
		var elem = document.getElementsByTagName('*');
		for (var j = 0; j < elem.length; j++) {
          var classes = elem[j].className;
            if (myclass.test(classes))
			    classe=elem[j];
		 }
		if(!classe.style.left&&!classe.style.top)
		  {
			   classe.style.left ="0px";
			   classe.style.top = "100px";
		  }

    //alert(parseInt(classe.currentStyle.top));
	if (document.documentElement && document.documentElement.scrollTop)
        diffY = document.documentElement.scrollTop;
    else if (document.body)
        diffY = document.body.scrollTop;
    else
      {/*Netscape stuff*/} 
		var percent=.1*(diffY-lastScrollY); 
		if(percent>0) 
		percent=Math.ceil(percent); 
		else 
		percent=Math.floor(percent);
		classe.style.top=parseInt(classe.style.top)+percent;
		lastScrollY=lastScrollY+percent; 
		
     

}

document.write('<script type="text/javascript" src="http://kf.5251.net/jsp_admin/float_version_2.jsp?companyId=35146&style=71754&keyword=1&auto=1&locate=cn"></script>'); 

