// JavaScript Document

//行为定义
/*var myrules = {
	'#menu-bottom img' : function(d){
			d.onmouseover = function(){
				document.getElementById("t"+d.src.substring(d.src.length-10,d.src.length-5)).style.font="normal normal bold 12px/20px tahoma";
			}
			d.onmouseout = function(){
				document.getElementById("t"+d.src.substring(d.src.length-10,d.src.length-5)).style.font="normal normal normal 12px/20px tahoma";
			}
		},
	'#input-r img':function(c){
			c.onmouseover = function(){
				c.src="img/new06/send2.gif";
			}
			c.onmouseout = function(){
				c.src="img/new06/send1.gif";
			}
		},
	'#box-main-r-l img':function(g){
			g.onclick = function(){
				resize(g);
			}
		},
	'#menu-top-c a' : function(w){
			w.onmouseover = function(){
				w.style.font="normal normal bold 12px/20px tahoma";
			}
			w.onmouseout = function(){
				w.style.font="normal normal normal 12px/20px tahoma";
			}
		}
	};
Behaviour.register(myrules);*/


function switchTab(tabpage, tabid)
{
  var oItem = document.getElementById(tabpage);
	for(var i=0; i<oItem.childNodes.length; i++)
  {
		var x = oItem.childNodes[i];
    if((i+1)==tabid.substring(4,tabid.length))
    {
      if(menus[i]=="")
      {
        document.getElementById("menu"+(i+1)).className = "leave_on";
        document.getElementById("input1").readOnly = true;
        document.getElementById("send_a").disabled = true;
      }
      else
      {
        document.getElementById("menu"+(i+1)).className = "on";
      }
    }
    else
    {
      if(menus[i]=="")
      {
        document.getElementById("menu"+(i+1)).className = "leave";
      }
      else
      {
        document.getElementById("menu"+(i+1)).className = "";
      }
    }
		
    /*try
    {
      if(document.getElementById("mname"+(i+1)).innerHTML==words_head[4])
      {
        x.className = "";
      }
    }catch(e){}*/
	}

  if(menus[tabid.substring(4,tabid.length)-1]=="")
  {
    document.getElementById(tabid).className = "leave_on";
  }
  else
  {
    document.getElementById(tabid).className = "on";
  }

	showTb(tabid.substring(4, tabid.length));
}

function resize(g)
{
	if( g.src.indexOf("c-pr.gif")>0)
  {
		document.getElementById('box-main-r-r').style.display='none';
		document.getElementById('box-main-r').style.width='8px';
		g.src='img/new06/c-pl.gif';
		document.getElementById('box-main-l').style.width='660px';
		document.getElementById('box-main-l-disp').style.width='636px';
		document.getElementById('input-l').style.width='564px';
	}
	else
  {
		document.getElementById('input-l').style.width='384px';
		document.getElementById('box-main-l-disp').style.width='456px';
		document.getElementById('box-main-l').style.width='480px';
		g.src='img/new06/c-pr.gif';
		document.getElementById('box-main-r').style.width='188px';
		document.getElementById('box-main-r-r').style.display='';
	}
}

