// JavaScript Document
  function username(i){
		var user="用户名";
		if(i){
		if(document.getElementById("username").value==user){
			document.getElementById("username").value="";
			} 
		}else{
			
			if(document.getElementById("username").value=="")
			{
				document.getElementById("username").value=user;
				}}
    }
	function passwordchange(){
		document.getElementById("password").style.background="none";
	}
	/*
	CreateLink("css/test.css");
	CreateScript("js/test.js");
	*/
	function CreateScript(file){
		head=document.getElementsByTagName('head').item(0);
		var new_element;
		new_element=document.createElement("script");
		new_element.setAttribute("type","text/javascript");
		new_element.setAttribute("src",file);
		void(head.appendChild(new_element));
	}

	function CreateLink(file){
		head=document.getElementsByTagName('head').item(0);
		var new_element;
		new_element=document.createElement("link");
		new_element.setAttribute("type","text/css");
		new_element.setAttribute("rel","stylesheet");
		new_element.setAttribute("href",file);
		void(head.appendChild(new_element));
	}

/*************颜色、隐藏控制************************************************************/
function bgcolorchange(aid,anum,lid,locolor,chcolor,displayid){/*aid id前缀 anum 总共数量 lid以0为始点击的编号，locolor 一般颜色 chcolor需改变的颜色  */
	for(i=0;i<anum;i++)
	{
		document.getElementById(aid+i).style.backgroundColor=locolor;
	}
	document.getElementById(aid+lid).style.backgroundColor=chcolor;
	if(displayid)
	{	
		displayctrl(lid,anum,displayid);
	}
}
function colorchange(aid,anum,lid,locolor,chcolor,displayid){/*aid id前缀 anum 总共数量 lid以0为始点击的编号，locolor 一般颜色 chcolor需改变的颜色  */
	for(i=0;i<anum;i++)
	{
		document.getElementById(aid+i).style.color=locolor;
	}
	document.getElementById(aid+lid).style.color=chcolor;
	if(displayid)
	{	
		displayctrl(lid,anum,displayid);
	}
}
function displayctrl(did,dnum,lid){
	for(var j=0;j<dnum;j++)
	{
		document.getElementById(lid+j).style.display="none";
	}		
	document.getElementById(lid+did).style.display="block";
}

function csschange(aid,anum,lid,locss,chcss,displayid){
	
	for(i=0;i<anum;i++)
	{
		document.getElementById(aid+i).className=locss;
	}
	document.getElementById(aid+lid).className=chcss;
	if(displayid)
	{	
		displayctrl(lid,anum,displayid);
	}
}
/*************************************************************************/	
	
	function layshow(layname,relativename){
		document.getElementById(layname).style.display="block";
		if(relativename){
		document.getElementById(relativename).style.position="relative";/*实际使用时需要隐藏，另调css*/
		}
	}
	function layhidden(layname,relativename){
		document.getElementById(layname).style.display="none";
		if(relativename)
		{document.getElementById(relativename).style.position="";/*实际使用时需要隐藏，另调css*/
		}
	}
	
	function mousechangecss(changeid,cssname){
		document.getElementById(changeid).className=cssname;
	}
	function mousechangecss2(changeid,color){
		document.getElementById(changeid).style.backgroundColor=color;
	}
/***********************************************************************/
/*mainleft*/



function mainleft(){
	
	
	
	
		/*n=5;
			for(k=1;k<=n;k++)
			{
				
				document.getElementById("mainleft"+k).onmouseover=function(){
						alert("mainleft"+k+"_1");layshow("mainleft"+k+"_1","mainleft"+k);
						layshow("mainleft"+k+"_2","mainleft"+k);
					}
				document.getElementById("mainleft1").onmouseover=function(){
						layhidden("mainleft"+k+"_1","mainleft"+k);
						layhidden("mainleft"+k+"_2","mainleft"+k);
					}
			}*/
			
			document.getElementById("mainleft1").onmouseover=function(){
				layshow("mainleft1_1","mainleft1");
				layshow("mainleft1_2","mainleft1");
			}
			document.getElementById("mainleft1").onmouseout=function(){
				layhidden("mainleft1_1","mainleft1");
				layhidden("mainleft1_2","mainleft1");
				
			}
			document.getElementById("mainleft2").onmouseover=function(){
				layshow("mainleft2_1","mainleft2");
				layshow("mainleft2_2","mainleft2");
			}
			document.getElementById("mainleft2").onmouseout=function(){
				layhidden("mainleft2_1","mainleft2");
				layhidden("mainleft2_2","mainleft2");
			}
			document.getElementById("mainleft3").onmouseover=function(){
				layshow("mainleft3_1","mainleft3");
				layshow("mainleft3_2","mainleft3");
			}
			document.getElementById("mainleft3").onmouseout=function(){
				layhidden("mainleft3_1","mainleft3");
				layhidden("mainleft3_2","mainleft3");
			}
			document.getElementById("mainleft4").onmouseover=function(){
				layshow("mainleft4_1","mainleft4");
				layshow("mainleft4_2","mainleft4");
			}
			document.getElementById("mainleft4").onmouseout=function(){
				layhidden("mainleft4_1","mainleft4");
				layhidden("mainleft4_2","mainleft4");
			}
			document.getElementById("mainleft5").onmouseover=function(){
				layshow("mainleft5_1","mainleft5");
				layshow("mainleft5_2","mainleft5");
			}
			document.getElementById("mainleft5").onmouseout=function(){
				layhidden("mainleft5_1","mainleft5");
				layhidden("mainleft5_2","mainleft5");
			}
}







function TuneHeight(fm_name,fm_id){
 
    var subWeb="";
    var frm=document.getElementById(fm_id); 
	if(document.frames){
		subWeb=document.frames[fm_name].document;
	}else{
		subWeb=frm.contentDocument;
	}
    //var subWeb=document.frames?document.frames[fm_name].document:frm.contentDocument;
	//TuneHeight('content_frame','content_frame')
	
	
    if(frm != null && subWeb != null){
        frm.style.height = subWeb.documentElement.scrollHeight+"px";
		
    }  
	if(document.getElementById("itemmore")){
	document.getElementById("itemmore").style.display="none"; 
	}  
}
	
