
function DispContent1( i , count )
{
 var div = document.getElementById( 'div' + i );
 for( x=1; x<=count; x++)
 {
  css="ts"+x;
  if( x != i)
  {
   document.getElementById( 'div' + x ).style.display = "none";
   document.getElementById(css).className   =   "menu2";
  }
  else
  {
  		div.style.display = '';
		document.getElementById(css).className   =   "menu1";
  }
 }
}

function DispContent2( i , count )
{
 var div = document.getElementById( 'dv' + i );
 for( x=6; x<=count; x++)
 {
	  css="css"+x;
	  if( x != i)
	  {
	   document.getElementById( 'dv' + x ).style.display = "none";
	   document.getElementById(css).className   =   "menu2";
	  }
	  else
	  {
		div.style.display = '';
		document.getElementById(css).className   =   "menu1";
	  }
 }

}

  function isHidden(div1,div2,div)
  {
    var div = document.getElementById(div);
    div.style.display = (div.style.display == 'none')?'block':'none';
    if (document.getElementById(div1).innerHTML=="点击隐藏")
	  {
	  document.getElementById(div1).innerHTML="点击展开";
	  document.getElementById(div2).innerHTML="<img src=/toursline/images/showline_qianzheng5.jpg width=27 height=28>";
	  }
	  else
	  {
	   document.getElementById(div1).innerHTML="点击隐藏";
	   document.getElementById(div2).innerHTML="<img src=/toursline/images/showline_qianzheng4.jpg width=27 height=28>";
	   }
  }
  
function question()
{
	if (document.all["title"].value.length==0)
	{
	   alert("标题不能为空!")
	   document.all["title"].focus();
	   return false;
	}
	if (document.all["content"].value.length==0)
	{
	   alert("内容不能为空!")
	   document.all["content"].focus();
	   return false;
	}
}

function  secBoard(n)
{

for (k=1;k<5;k++)
{
	temp="ul"+k
	if (k==(n+1))
	{
	document.getElementById(temp).className="menu1"
	}
	else
	{
	document.getElementById(temp).className="menu2"
	}
}

for(i=0;i<mainTable.tBodies.length;i++)
{
mainTable.tBodies[i].style.display="none";
mainTable.tBodies[n].style.display="block";
}
}

function sub_clear()
{
var flag = true;
if(flag) 
{
document.all["beizhu"].value=""
flag = false;
}
}

function DispContent3( i , count )
{
 var div = document.getElementById( 'divb' + i );
 for( x=11; x<=count; x++)
 {
  if( x != i)
  {
   document.getElementById( 'divb' + x ).style.display = "none";
  }
  else
  {
    div.style.display = '';
  }
 }

}


function DispContent4(i,count )
{
 var div = document.getElementById( 'diva' + i );
 for( x=13; x<=count; x++)
 {
	  css="css"+x;
	  if( x != i)
	  {
	   document.getElementById( 'diva' + x ).style.display = "none";
	   document.getElementById(css).className   =   "menu2";
	  }
	  else
	  {
		div.style.display = '';
		document.getElementById(css).className   =   "menu1";
	  }
 }
}

function check_email(email){
	var reEmail=/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
	var b_email=reEmail.test(email);
	if(!b_email)
	{
	alert("请输入正确的邮箱")
	}
}

var global_html_pool = [];    
var global_script_pool = [];    
var global_script_src_pool = [];    
var global_lock_pool = [];    
var innerhtml_lock = null;    
var document_buffer = "";    
   
function set_innerHTML(obj_id, html, time) {    
    if (innerhtml_lock == null) {    
        innerhtml_lock = obj_id;    
    }    
    else if (typeof(time) == "undefined") {    
        global_lock_pool[obj_id + "_html"] = html;    
        window.setTimeout("set_innerHTML('" + obj_id + "', global_lock_pool['" + obj_id + "_html']);", 10);    
        return;    
    }    
    else if (innerhtml_lock != obj_id) {    
        global_lock_pool[obj_id + "_html"] = html;    
        window.setTimeout("set_innerHTML('" + obj_id + "', global_lock_pool['" + obj_id + "_html'], " + time + ");", 10);    
        return;    
    }    
   
    function get_script_id() {    
        return "script_" + (new Date()).getTime().toString(36)    
          + Math.floor(Math.random() * 100000000).toString(36);    
    }    
   
    document_buffer = "";    
   
    document.write = function (str) {  
 
        document_buffer += str;    
    }    
    document.writeln = function (str) {    
        document_buffer += str + "\n";    
    }    
   
    global_html_pool = [];    
   
    var scripts = [];    
    html = html.split(/<\/script>/i);    
    for (var i = 0; i < html.length; i++) {    
        global_html_pool[i] = html[i].replace(/<script[\s\S]*$/ig, "");    
        scripts[i] = {text: ", src: " };    
        scripts[i].text = html[i].substr(global_html_pool[i].length);    
        scripts[i].src = scripts[i].text.substr(0, scripts[i].text.indexOf('>') + 1);    
        scripts[i].src = scripts[i].src.match(/src\s*=\s*(\"([^\"]*)\"|\'([^\']*)\'|([^\s]*)[\s>])/i);    
        if (scripts[i].src) {    
            if (scripts[i].src[2]) {    
                scripts[i].src = scripts[i].src[2];    
            }    
            else if (scripts[i].src[3]) {    
                scripts[i].src = scripts[i].src[3];    
            }    
            else if (scripts[i].src[4]) {    
                scripts[i].src = scripts[i].src[4];    
            }    
            else {    
                scripts[i].src = "";    
            }    
            scripts[i].text = "";    
        }    
        else {    
            scripts[i].src = "";    
            scripts[i].text = scripts[i].text.substr(scripts[i].text.indexOf('>') + 1);    
            scripts[i].text = scripts[i].text.replace(/^\s*<\!–\s*/g, "");    
        }    
    }    
   
    var s;    
    if (typeof(time) == "undefined") {    
        s = 0;    
    }    
    else {    
        s = time;    
    }    
   
    var script, add_script, remove_script;    
   
    for (var i = 0; i < scripts.length; i++) {    
        var add_html = "document_buffer += global_html_pool[" + i + "];\n";    
        add_html += "document.getElementById('" + obj_id + "').innerHTML = document_buffer;\n";    
        script = document.createElement("script");    
        if (scripts[i].src) {    
            script.src = scripts[i].src;    
            if (typeof(global_script_src_pool[script.src]) == "undefined") {    
                global_script_src_pool[script.src] = true;    
                s += 2000;    
            }    
            else {    
                s += 10;    
            }    
        }    
        else {    
            script.text = scripts[i].text;    
            s += 10;    
        }    
        script.defer = true;    
        script.type =  "text/javascript";    
        script.id = get_script_id();    
        global_script_pool[script.id] = script;    
        add_script = add_html;    
        add_script += "document.getElementsByTagName('head').item(0)";    
        add_script += ".appendChild(global_script_pool['" + script.id + "']);\n";    
        window.setTimeout(add_script, s);    
        remove_script = "document.getElementsByTagName('head').item(0)";    
        remove_script += ".removeChild(document.getElementById('" + script.id + "'));\n";    
        remove_script += "delete global_script_pool['" + script.id + "'];\n";    
        window.setTimeout(remove_script, s + 10000);    
    }    
   
    var end_script = "if (document_buffer.match(/<\\/script>/i)) {\n";    
    end_script += "set_innerHTML('" + obj_id + "',document_buffer, " + s + ");\n";    
    end_script += "}\n";    
    end_script += "else {\n";    
    end_script += "document.getElementById('" + obj_id + "').innerHTML = document_buffer;\n";    
    end_script += "innerhtml_lock = null;\n";    
    end_script += "}";    
    window.setTimeout(end_script, s);    
  } 

function getHTTPObject()
{
　var xmlhttp=false; 
　try { 
　　xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
　     }
 catch (e) 
      { 
　　try { 
　　　xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
　　     } 
       catch (E)
     { 
　　　xmlhttp = false; 
　　} 
　}
　if (!xmlhttp && typeof XMLHttpRequest!='undefined') { 
　　xmlhttp = new XMLHttpRequest(); 
　} 
　return xmlhttp;
} 
function update(url,div,id,linecode)
{
var xmlhttp=getHTTPObject();
  var post="";
  xmlhttp.open('POST', '/toursline/'+url+'?id='+id+'&linecode='+linecode+'&random='+Math.random(), true); 
  xmlhttp.setrequestheader("content-length",post.length); 
  xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
  xmlhttp.onreadystatechange = function()
     {
    if (xmlhttp.readyState == 4 && xmlhttp.status == 200 )
     {

     var msg = xmlhttp.responseText;

	set_innerHTML(div+id,msg);

      return true;
         }
    }
 
  xmlhttp.send("act="+encodeURIComponent(escape(post)));
  }


function update1(url,div,id,linecode)
{

var xmlhttp=getHTTPObject();
  var post="";
  xmlhttp.open('POST', '/toursline/'+url+'?id='+id+'&linecode='+linecode+'&random='+Math.random(), true); 
  xmlhttp.setrequestheader("content-length",post.length); 
  xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
  xmlhttp.onreadystatechange = function()
     {
    if (xmlhttp.readyState == 4 && xmlhttp.status == 200 )
     {

     var msg = xmlhttp.responseText;

	set_innerHTML(div+id,msg);

      return true;
         }
    }
 
  xmlhttp.send("act="+encodeURIComponent(escape(post)));
  }
function update(url,div,id,linecode,mon)
{
var xmlhttp=getHTTPObject();
  var post="";
  xmlhttp.open('POST', '/toursline/'+url+'?id='+id+'&linecode='+linecode+'&mon='+mon+'&random='+Math.random(), true); 
  xmlhttp.setrequestheader("content-length",post.length); 
  xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); 
  xmlhttp.onreadystatechange = function()
     {
    if (xmlhttp.readyState == 4 && xmlhttp.status == 200 )
     {

     var msg = xmlhttp.responseText;

	set_innerHTML(div+id,msg);

      return true;
         }
    }
 
  xmlhttp.send("act="+encodeURIComponent(escape(post)));
  }

