//高亮行
function mOver(obj){
    obj.style.backgroundColor='#f2f2f2';
}
function mOut(obj){
    obj.style.backgroundColor='#ffffff';
}
function doGuestbookSubmit(){
      if(form1.guest_name.value==""){return alert("姓名不能为空！");}
	  if(form1.guest_name.value.length>=200){return alert("姓名不能超过200字符！");}

      if(form1.guest_email.value==""){return alert("E-mail不能为空！");}
      if(!isEmail(form1.guest_email.value))return alert("E-Mail地址格式不正确！");
	  if(form1.guest_email.value.length>=200){return alert("邮箱不能超过200字符！");}

      if(form1.guest_subject.value==""){return alert("标题不能为空！");}
	  if(form1.guest_subject.value.length>=200){return alert("标题不能超过200字符！");}

      if(form1.guest_content.value==""){return alert("内容不能为空！");}
      if(form1.guest_content.value.length>=4096){return alert("内容不能超过4096字符！");}
      var obj=new JSPSoftCallBack();

      obj.callback=function(){
            postRequest(
            {action:"post_guestbook",subject:form1.guest_subject.value,guest_name:form1.guest_name.value,guest_email:form1.guest_email.value,guest_content:form1.guest_content.value,column_code:form1.column_code.value},//默认为顶
            function(responseData1){
				 if(responseData1=="OK") {alert("留言发送成功！"); top.location.reload();}
				 else alert("留言发送失败，请稍候重试！");
            }
            );
      }
     if(confirm("填写好了吗，真的要提交吗？"))obj.sendData();   
  }
  
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 changeDiv(name,id){
	if(id=="d_1"){
		document.getElementById("d_1").style.background="url(/resource/_tpl/jwjz/images/j_left_true.jpg?ab) no-repeat";
		document.getElementById("d_1").style.color="#0265ca";
		document.getElementById("d_1_1").style.display="block";
		document.getElementById("d_2").style.background="url(/resource/_tpl/jwjz/images/j_left_no.jpg?ab) no-repeat";
		document.getElementById("d_2").style.color="#717171";
		document.getElementById("d_2_1").style.display="none";
	}else if(id=="d_2"){
		document.getElementById("d_2").style.background="url(/resource/_tpl/jwjz/images/j_left_true.jpg?ab) no-repeat";
		document.getElementById("d_2").style.color="#0265ca";
		document.getElementById("d_2_1").style.display="block";
		document.getElementById("d_1").style.background="url(/resource/_tpl/jwjz/images/j_left_no.jpg?ab) no-repeat";
		document.getElementById("d_1").style.color="#717171";
		document.getElementById("d_1_1").style.display="none";
	}
}


