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

if(das == "cart")
{
	var tdr = document.getElementById("cart");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);
	addChil(fontt,"medical/index.php","Medical");
	addChil(fontt,"money/index.php","Money");
	addChil(fontt,"christmas/index.php","Christmas");
	addChil(fontt,"cartoons/index.php","Cartoons");
	addChil(fontt,"clipart/index.php","others");
}

else if(das == "life")
{
	var tdr = document.getElementById("life");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);
	addChil(fontt,"domestic-animals/index.php","Domestic Animals");
	addChil(fontt,"wild-animals/index.php","Wild Animals");
	addChil(fontt,"sea-animals/index.php","Sea Lives");
	addChil(fontt,"birds/index.php","Birds");
	addChil(fontt,"human/index.php","Human");
	addChil(fontt,"religion/index.php","Religious");
}

else if(das == "season")
{
	var tdr = document.getElementById("season");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);
	addChil(fontt,"season/index.php","Summer Season");
}

else if(das == "people")
{
	var tdr = document.getElementById("people");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);
	addChil(fontt,"scientists/index.php","Scientists");
	addChil(fontt,"workers/index.php","Workers");
}

else if(das == "web")
{
	var tdr = document.getElementById("web");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);
	addChil(fontt,"web-basic-icons/index.php","Web Basic Icons");
	addChil(fontt,"mini-icons/index.php","Mini web icons");
}

else if(das == "travel")
{
	var tdr = document.getElementById("travel");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);
	addChil(fontt,"vehicle/index.php","Vehicles");
	addChil(fontt,"weapons/index.php","Weapons");
}

else if(das == "sports")
{
  var tdr = document.getElementById("sports");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);
	addChil(fontt,"games/index.php","Sports");
	addChil(fontt,"chess/index.php","Chess");
	addChil(fontt,"chess2/index.php","Chess2");
	addChil(fontt,"gymnastics/index.php","Gymnastics");
	addChil(fontt,"olympic-games/index.php","Olympic Games");
	addChil(fontt,"playing-cards/index.php","Playing Cards");
}

else if(das == "instrument")
{
	var tdr = document.getElementById("instrument");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);
	addChil(fontt,"instruments/index.php","General");
	addChil(fontt,"computer/index.php","Computer");
	addChil(fontt,"electronics/index.php","Electronics");
	addChil(fontt,"electrical/index.php","Electrical");
	addChil(fontt,"mechanical/index.php","Mechanical");
	addChil(fontt,"musical/index.php","Musical");
  addChil(fontt,"chemistry/index.php","Chemistry");
  addChil(fontt,"keyboard-keys/index.php","Keyboard Keys");
}

else if(das == "food")
{
	var tdr = document.getElementById("food");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);
	addChil(fontt,"food/index.php","Food");
	addChil(fontt,"fruits/index.php","Fruits");
	addChil(fontt,"vegetables/index.php","Vegetables");
}

else if(das == "deco")
{
	var tdr = document.getElementById("deco");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);
	addChil(fontt,"stationary/index.php","Stationery");
	addChil(fontt,"clothing/index.php","Clothing");
	addChil(fontt,"fashion/index.php","Fashion");
	addChil(fontt,"furniture/index.php","Furnitures");
	addChil(fontt,"stones/index.php","Gems");
	addChil(fontt,"tiles/index.php","Tiles");
}

else if(das == "nature")
{
  var tdr = document.getElementById("nature");
  removeChilds(fontt);
  fontt = tdr.getElementsByTagName('font').item(0);
  removeChilds(fontt);
  addChil(fontt,"flowers/index.php","Flowers");
	addChil(fontt,"states-flowers/index.php","States Flowers");
	addChil(fontt,"trees/index.php","Tree");
	addChil(fontt,"nature/index.php","Others");
	addChil(fontt,"buildings/index.php","Buildings");
}

else if(das == "symbols")
{
  var tdr = document.getElementById("symbols");
  removeChilds(fontt);
  fontt = tdr.getElementsByTagName('font').item(0);
  removeChilds(fontt);
  addChil(fontt,"symbols/famous/index.php","The Famous");
  addChil(fontt,"symbols/math/index.php","Math Signs");
  addChil(fontt,"symbols/shapes/index.php","Shapes");
	addChil(fontt,"symbols/geometrical-shapes/index.php","Geometrical Shapes");
	addChil(fontt,"symbols/greek/index.php","Greek Symbols");
	addChil(fontt,"symbols/planets/index.php","Planet Signs");
	addChil(fontt,"symbols/dollar-icons.php","Dollar Symbol");
	addChil(fontt,"symbols/hand-symbols/index.php","Hand Symbol");
	addChil(fontt,"symbols/religious/index.php","Religious Symbols");
}

else if(das == "yogas")
{
  var tdr = document.getElementById("yogas");
  removeChilds(fontt);
  fontt = tdr.getElementsByTagName('font').item(0);
  removeChilds(fontt);	
  addChil(fontt,"yogas/arm-balance-poses/index.php","Arm Balance Poses");
  addChil(fontt,"yogas/backbend-poses/index.php","Backbend Poses");
  addChil(fontt,"yogas/forward-bend-poses/index.php","Forward Bend Poses");
  addChil(fontt,"yogas/inversion-poses/index.php","Inversion Poses");
  addChil(fontt,"yogas/restorative-poses/index.php","Restorative Poses");
  addChil(fontt,"yogas/seated-and-twist-poses/index.php","Seated and Twist Poses");
	addChil(fontt,"yogas/standing-poses/index.php","Standing Poses");
}

else if(das == "traffic")
{
  var tdr = document.getElementById("traffic");
  removeChilds(fontt);
  fontt = tdr.getElementsByTagName('font').item(0);
  removeChilds(fontt);
  addChil(fontt,"traffic/regulatory-signs/index.php","Regulatory signs");
  addChil(fontt,"traffic/warning-signs/index.php","Warning Signs");
}
}

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","http://www.hscripts.com/freeimages/icons/"+linkname);
link.style.color="#aa300a";
divs.style.marginLeft="8px";
divs.style.marginRight="4px";
divs.style.paddingLeft="3px";
divs.style.fontSize="11px";
divs.style.lineHeight="16px";
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";
//link.setAttribute("style","background-color: white;");
var name = document.createTextNode(textname);
//parent.appendChild(breaka);
parent.appendChild(divs);
divs.appendChild(link);
link.appendChild(name);
}

function changebg(cal)
{
var ss = document.getElementById('mann');
ss.style.backgroundColor = cal;
}
