var as = 1;
var fontt;
var expo;

function addChilds(das,exps)
{
	var nam =das;
	expo = exps;

	if(das== "acommand")
	{
		var tdr = document.getElementById("acommand");
		removeChilds(fontt);
		fontt = tdr.getElementsByTagName('font').item(0);
		removeChilds(fontt);

		addChil(fontt,"alias.html","alias");
                addChil(fontt,"awk.html","awk");
              
	}
	else if(das == "bcommand")
	{
		var tdr = document.getElementById("bcommand");
		removeChilds(fontt);
		fontt = tdr.getElementsByTagName('font').item(0);
		removeChilds(fontt);

		addChil(fontt,"bc.html","bc");
                addChil(fontt,"bg.html","bg");
                addChil(fontt,"bzip2.html","bzip2");
	}
	else if(das == "ccommand")
	{
		var tdr = document.getElementById("ccommand");
		removeChilds(fontt);
		fontt = tdr.getElementsByTagName('font').item(0);
		removeChilds(fontt);

		addChil(fontt,"cal.html","cal");
                addChil(fontt,"cat.html","cat");
                addChil(fontt,"cd.html","cd");
                addChil(fontt,"chattr.html","chattr");
                addChil(fontt,"chgrp.html","chgrp");
                addChil(fontt,"chkconfig.html","chkconfig");
                addChil(fontt,"chmod.html","chmod");
                addChil(fontt,"chown.html","chown");
                addChil(fontt,"chpasswd.html","chpasswd");
                addChil(fontt,"clear.html","clear");
                addChil(fontt,"cmp.html","cmp");
                addChil(fontt,"cp.html","cp");
                addChil(fontt,"cpio.html","cpio");
                addChil(fontt,"cut.html","cut");
  
	}  
	else if(das == "dcommand")
	{
		var tdr = document.getElementById("dcommand");
		removeChilds(fontt);
		fontt = tdr.getElementsByTagName('font').item(0);
		removeChilds(fontt);

		addChil(fontt,"date.html","date");
                addChil(fontt,"dd.html","dd");
                addChil(fontt,"df.html","df");
                addChil(fontt,"diff.html","diff");
                addChil(fontt,"du.html","du");
                addChil(fontt,"dump.html","dump");
	}
	else if(das == "ecommand")
	{
		var tdr = document.getElementById("ecommand");
		removeChilds(fontt);
		fontt = tdr.getElementsByTagName('font').item(0);
		removeChilds(fontt);

		addChil(fontt,"echo.html","echo");
                addChil(fontt,"egrep.html","egrep");
     
       }
	else if(das == "fcommand")
	{
		var tdr = document.getElementById("fcommand");
		removeChilds(fontt);
		fontt = tdr.getElementsByTagName('font').item(0);
		removeChilds(fontt);

                addChil(fontt,"fdisk.html","fdisk");
                addChil(fontt,"fg.html","fg");
                addChil(fontt,"fgrep.html","fgrep");
                addChil(fontt,"file.html","file");
                addChil(fontt,"find.html","find");
                addChil(fontt,"finger.html","finger");
                addChil(fontt,"free.html","free");
	}
	else if(das == "gcommand")
	{
		var tdr = document.getElementById("gcommand");
		removeChilds(fontt);
		fontt = tdr.getElementsByTagName('font').item(0);
		removeChilds(fontt);

		addChil(fontt,"grep.html","grep");
                addChil(fontt,"groupadd.html","groupadd");
                addChil(fontt,"groupdel.html","groupdel");
                addChil(fontt,"groupmod.html","groupmod");
                addChil(fontt,"groups.html","groups");


	}    
	else if(das == "hcommand")
	{
		var tdr = document.getElementById("hcommand");
		removeChilds(fontt);
		fontt = tdr.getElementsByTagName('font').item(0);
		removeChilds(fontt);

		addChil(fontt,"halt.html","halt");
                addChil(fontt,"head.html","head");
                addChil(fontt,"host.html","host");
                addChil(fontt,"hostid.html","hostid");
                addChil(fontt,"hostname.html","hostname");
           
 
	}
	else if(das == "icommand")
	{
		var tdr = document.getElementById("icommand");
		removeChilds(fontt);
		fontt = tdr.getElementsByTagName('font').item(0);
		removeChilds(fontt);

		addChil(fontt,"id.html","id");
                addChil(fontt,"info.html","info");
                addChil(fontt,"ifconfig.html","ifconfig");
 
	}
	else if(das == "jcommand")
	{
		var tdr = document.getElementById("jcommand");
		removeChilds(fontt);
		fontt = tdr.getElementsByTagName('font').item(0);
		removeChilds(fontt);

		addChil(fontt,"jobs.html","jobs");
	}
	else if(das == "kcommand")
	{
		var tdr = document.getElementById("kcommand");
		removeChilds(fontt);
		fontt = tdr.getElementsByTagName('font').item(0);
		removeChilds(fontt);

		addChil(fontt,"kill.html","kill");
	}
	else if(das == "lcommand")
	{
		var tdr = document.getElementById("lcommand");
		removeChilds(fontt);
		fontt = tdr.getElementsByTagName('font').item(0);
		removeChilds(fontt);
                
                addChil(fontt,"last.html","last");
                addChil(fontt,"lastlog.html","lastlog");  
                addChil(fontt,"less.html","less");
		addChil(fontt,"link.html","link");
                addChil(fontt,"ln.html","ln");
                addChil(fontt,"ls.html","ls");
                addChil(fontt,"lsattr.html","lsattr");
 
	}
	else if(das == "mcommand")
	{
		var tdr = document.getElementById("mcommand");
		removeChilds(fontt);
		fontt = tdr.getElementsByTagName('font').item(0);
		removeChilds(fontt);

		addChil(fontt,"mail.html","mail");
                addChil(fontt,"man.html","man");
                addChil(fontt,"mkdir.html","mkdir");
                addChil(fontt,"more.html","more");
                addChil(fontt,"mv.html","mv");

	}
	else if(das == "ncommand")
	{
		var tdr = document.getElementById("ncommand");
		removeChilds(fontt);
		fontt = tdr.getElementsByTagName('font').item(0);
		removeChilds(fontt);

		addChil(fontt,"netstat.html","netstat");
	}
	/*else if(das == "ocommand")
	{
		var tdr = document.getElementById("ocommand");
		removeChilds(fontt);
		fontt = tdr.getElementsByTagName('font').item(0);
		removeChilds(fontt);


	}*/
	else if(das == "pcommand")
	{
		var tdr = document.getElementById("pcommand");
		removeChilds(fontt);
		fontt = tdr.getElementsByTagName('font').item(0);
		removeChilds(fontt);

		addChil(fontt,"passwd.html","passwd");
                addChil(fontt,"paste.html","paste");
                addChil(fontt,"pidof.html","pidof");
                addChil(fontt,"ping.html","ping");
                addChil(fontt,"printf.html","printf");
                addChil(fontt,"ps.html","ps");
                addChil(fontt,"pwd.html","pwd");

 
	}   
        /*else if(das == "qcommand")
        {
               var tdr = document.getElementById("pcommand");
               removeChilds(fontt);
               fontt = tdr.getElementsByTagName('font').item(0);
               removeChilds(fontt);
        } */
	else if(das == "rcommand")
	{
		var tdr = document.getElementById("rcommand");
		removeChilds(fontt);
		fontt = tdr.getElementsByTagName('font').item(0);
		removeChilds(fontt);
                 
                addChil(fontt,"restore.html","restore");
		addChil(fontt,"rm.html","rm");
                addChil(fontt,"rmdir.html","rmdir");
                addChil(fontt,"route.html","route");
                            
	}
	else if(das == "scommand")
	{
		var tdr = document.getElementById("scommand");
		removeChilds(fontt);
		fontt = tdr.getElementsByTagName('font').item(0);
		removeChilds(fontt);

		addChil(fontt,"sort.html","sort");
                addChil(fontt,"sed.html","sed");

	}
	else if(das == "tcommand")
	{
		var tdr = document.getElementById("tcommand");
		removeChilds(fontt);
		fontt = tdr.getElementsByTagName('font').item(0);
		removeChilds(fontt);

		addChil(fontt,"tail.html","tail");
                addChil(fontt,"tar.html","tar");
	}
	else if(das == "ucommand")
	{
		var tdr = document.getElementById("ucommand");
		removeChilds(fontt);
		fontt = tdr.getElementsByTagName('font').item(0);
		removeChilds(fontt);

		addChil(fontt,"useradd.html","useradd");
	}
	/*else if(das == "vcommand")
	{
		var tdr = document.getElementById("vcommand");
		removeChilds(fontt);
		fontt = tdr.getElementsByTagName('font').item(0);
		removeChilds(fontt);

	
	}*/
	else if(das == "wcommand")
	{
		var tdr = document.getElementById("wcommand");
		removeChilds(fontt);
		fontt = tdr.getElementsByTagName('font').item(0);
		removeChilds(fontt);

		addChil(fontt,"who.html","who");
                addChil(fontt,"whois.html","whois");
 
	}
	/*else if(das == "xcommand")
	{
		var tdr = document.getElementById("xcommand");
		removeChilds(fontt);
		fontt = tdr.getElementsByTagName('font').item(0);
		removeChilds(fontt);

		
	}*/
	else if(das == "ycommand")
	{
		var tdr = document.getElementById("ycommand");
		removeChilds(fontt);
		fontt = tdr.getElementsByTagName('font').item(0);
		removeChilds(fontt);

		addChil(fontt,"yes.html","yes");
	}
/*	else if(das == "zcommand")
	{
		var tdr = document.getElementById("zcommand");
		removeChilds(fontt);
		fontt = tdr.getElementsByTagName('font').item(0);
		removeChilds(fontt);

		//addChil(fontt,"zebra.html","zebra");
	}*/
}

function removeChilds(fontt)
{
	if(fontt != null)
	{		
		while(fontt.hasChildNodes() && fontt.childNodes.length>1)
		{	
		if(as > 1)
		{
		fontt.removeChild(fontt.lastChild);

		}
		as = as+1;

		}
	}
}

var love = "yes";
function addChil(parent,linkname,textname)
{
var breaka = document.createElement("br");
var divs= document.createElement("div");
var link = document.createElement("a");
link.setAttribute("href",ajss+expo+linkname);
link.style.color="#aa300a";
divs.style.marginLeft="8px";
divs.style.marginRight="4px";
divs.style.paddingLeft="3px";
divs.style.fontSize="12px";
divs.style.lineHeight="20px";
divs.style.border="0px green solid";

if(love == "yes")
{
divs.style.backgroundColor="#beefec";
love = "no";
}
else
{
divs.style.backgroundColor="#dfffdf";
love = "yes";
}
link.style.textDecoration="none";
var name = document.createTextNode(textname);
parent.appendChild(divs);
divs.appendChild(link);
link.appendChild(name);
}
