//高亮行
function mOver(obj){
    obj.style.backgroundColor='#f2f2f2';
}
function mOut(obj){
    obj.style.backgroundColor='#ffffff';
}
function show(objli,index){
 if(objli.id=="current")return;
 var obj_ul=document.all("objul");
   for(var i=0;obj_ul&&obj_ul.children&&obj_ul.children.length&&i<obj_ul.children.length;i++){
     if(obj_ul.children[i].id){
         obj_ul.children[i].removeAttribute("id");
	   break;
	 }
   }
   if(objli.id!="current"){objli.setAttribute("id","current");}
   var kind=document.all("kind");
   for(var i=0;kind&&kind.length&&i<kind.length;i++){
     kind[i].style.display=(parseInt(kind[i].tab_index)==index?"":"none"); 
   }
}


function doApplyFormSubject(column_code){
	if(column_code==null||column_code=="")return alert("建设中....未指定归属栏目");
	if($("apply_username").value==""){
		alert("申请人不能为空！");
		return $("apply_username").focus();
	}
	if($("apply_project_name").value==""){
		alert("项目名称不能为空！");
		return $("apply_project_name").focus();
	}
	var obj=new JSPSoftCallBack();

      obj.callback=function(){
			var contentx=replaceEx(applyForm.innerHTML," class=\"apply_input\""," class=\"apply_input_disabled\" disabled readonly");
			contentx=replaceEx(contentx," class=apply_input"," class=\"apply_input_disabled\" disabled readonly");
			contentx=replaceEx(contentx," class='apply_input'"," class=\"apply_input_disabled\" disabled readonly");
			contentx=replaceEx(contentx," style=\"display: none\"","");
			contentx=replaceEx(contentx," style='display: none'","");
            postRequest(
            {action:"post_news",subject:$("apply_username").value+" - "+$("apply_project_name").value,is_pub:0,content:contentx,column_code:column_code,path_url:location.pathname,article_author:applyForm.apply_username.value},//默认为顶
            function(responseData1){
				 if(responseData1=="OK") {alert("恭喜你，你的项目申请发送成功！请等待审核结果公布！"); top.location.reload();}
				 else alert("申请发送失败，请稍候重试！");
            }
            );
      }
     if(confirm("填写好了吗，真的要提交吗？"))obj.sendData();   
}
function doSiteSearch(surl,target_name){
 	var qstr =search_form.search.value;
 	if(qstr=="")return  alert("请输入要搜索的关键字");
	var stype="1";
	if(search_form.search_type[0].checked)stype="1";
	else if(search_form.search_type[1].checked)stype="2";
	else if(search_form.search_type[2].checked)stype="3";
	else return alert("请正确选择搜索类别");

	top.open(surl+"?q="+qstr+"&t="+stype,target_name?target_name:"_blank");
}
function show(objli, index){
    if (objli.id == "current")return;
    var obj_ul = document.all("objul");
    for (var i = 0; obj_ul && obj_ul.children && obj_ul.children.length && i < obj_ul.children.length; i++) {
        if (obj_ul.children[i].id) {
            obj_ul.children[i].removeAttribute("id");
			obj_ul.children[i].className="outMo";
            break;
        }
    }
    if (objli.id != "current")objli.setAttribute("id", "current");
	objli.className="onMo"
    var news = document.all("news");
    for(var i = 0; news && news.length && i < news.length; i++){
        news[i].style.display = (parseInt(news[i].tab_index) == index ? "" : "none");
    }
}

function changeClass(objli){
	var objs = $("objul").children;
	for (var i = 0; objs && objs.length && i < objs.length; i++) 
	  objs[i].className = (objli == objs[i] ? replaceEx(objs[i].className, "0", "1") : replaceEx(objs[i].className, "1", "0"));
}

function Alors(){
	Alpha=Alpha-I_Alpha;
	for (x=0;x<Nb;x++){
		Alpha1=Alpha+Decal*x;
		Cosine=Math.cos(Alpha1);
		Ob=document.all("L"+x);
		Ob.style.posLeft=Midx+100*Math.sin(Alpha1)+50;
		Ob.style.zIndex=20*Cosine;
		Ob.style.fontSize=Taille+20*Cosine;
		Ob.style.color="rgb("+ (27+Cosine*80+50) + ","+ (127+Cosine*80+50) + ",0)";
	}
}
function showColumnMenu(aObj){
    var xmlobj=$("xmldoc");
    if(xmlobj==null||xmlobj.readyState!="complete")return;
    try{
	xmlobj.setProperty("SelectionLanguage","XPath");
	var current_code=aObj.code;
	if(current_code==""){
		$("column_menu").innerHTML="";
		return;
	}
	var nodes=xmlobj.selectNodes("/a/b[starts-with(@b,'"+current_code+"')]");
	var menuObj=document.createElement("SPAN");
	menuObj.style.cssText="position:absolute;top:0";
	for(var i=0;nodes&&i<nodes.length;i++){
		if(nodes[i].getAttribute("b")==current_code)continue;
		var newmenu=document.createElement("A");
		newmenu.href="/pub/jspcms/p1_l"+nodes[i].getAttribute("a")+".htm";
		newmenu.id="submenu";
		newmenu.innerText=nodes[i].getAttribute("c");
		menuObj.appendChild(newmenu);
	}
	$("column_menu").innerHTML="";
	$("column_menu").appendChild(menuObj);
	var pos=getElementRect(aObj);
	var rect=getElementRect(menuObj);
	var left_min=parseInt(pos.x-getAbsolutePosition($("column_menu")).x+(pos.w/2)-(rect.w/2));
	if(left_min+rect.w>=960)menuObj.style.left=960-rect.w;
	else menuObj.style.left=left_min;
    }catch(exp){}
}
function doSubmitProductOrder(){
    if(!confirm("确定填写好了吗？现在就提交吗？"))return;
    doEmailSubmit("llc@jspsoft.cn","产品网上定购",document.htmlForm.innerHTML);
}
//浮动导航
function AotoScrollToView(){
        var yMenuFrom, yMenuTo, yButtonFrom, yButtonTo, yOffset, timeoutNextCheck;

	yButtonFrom = parseInt (divMenu.style.top, 10);
	yButtonTo   = document.body.scrollTop + document.body.clientHeight - 108;
   
        timeoutNextCheck = 500;

        if(Math.abs (yButtonFrom - (yMenuTo + 152)) < 6 && yButtonTo < yButtonFrom){
                setTimeout ("AotoScrollToView()", timeoutNextCheck);
                return;
        }

        if(yButtonFrom != yButtonTo){
		yOffset = Math.ceil( Math.abs( yButtonTo - yButtonFrom )/10 );
		if(yButtonTo < yButtonFrom )yOffset = -yOffset;
		divMenu.style.top = parseInt (divMenu.style.top, 10) + yOffset;
		timeoutNextCheck = 10;
        }
        if(yMenuFrom != yMenuTo){
		yOffset = Math.ceil( Math.abs( yMenuTo - yMenuFrom )/20 );
		if(yMenuTo < yMenuFrom )yOffset = -yOffset;
		divMenu.style.top = parseInt (divMenu.style.top, 10) + yOffset;
		timeoutNextCheck = 10;
        }

        setTimeout ("AotoScrollToView()", timeoutNextCheck);
}

function goTop(){
 /*      try{
		var objs=document.getElementsByTagName("INPUT");
		for(var i=0;i<objs.length;i++){
			if(objs[i].type.toLowerCase()=="button")objs[i].className="global_btn";
		}
       }catch(exptxt){}*/
//页面
       var y;
       var divMenu=null;
       var win_height=document.body.scrollHeight;
       var rect1=getElementRect($("jspsoft_main_div"));
       var local_width=parseInt(rect1.x)+parseInt(rect1.w)-9;//(document.body.clientWidth-((Math.max(975,document.body.clientWidth)-975)/2)-9);
      // alert(local_width);
       if(divMenu==null){
          document.body.insertAdjacentHTML("beforeEnd",'<DIV id=divMenu style="VISIBILITY: hidden;top:0;left:'+local_width+'; WIDTH: 17px; POSITION: absolute"><a href="#top" onclick="this.blur();"><img src="/web/images/top.gif" border="0"></a></DIV>');
          divMenu=document.all("divMenu");
       }
      divMenu.style.top = document.body.scrollTop + document.body.clientHeight - 108;
      if(win_height>1000){
           divMenu.style.visibility = "visible";
           AotoScrollToView();
       }
}
function resizeWin(){
        window.status=document.body.clientWidth;
	document.all('divMenu').style.left=(document.body.clientWidth-((Math.max(975,document.body.clientWidth)-975)/2)-9);
}
