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,"../food/index.php","Food");
	addChil(fontt,"../christmas/index.php","Christmas");
	addChil(fontt,"index.php","others");
	}
	else if(das == "life")
	{
	var tdr = document.getElementById("life");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"animals/index.php","Animal");
	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 == "arrow")
	{
	var tdr = document.getElementById("arrow");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"index.php","arrow I");
	addChil(fontt,"arrow2.php","arrow II");
	addChil(fontt,"small-up-icons.php","Small Up");
	addChil(fontt,"small-down-icons.php","Small Down");
	addChil(fontt,"small-left-icons.php","Tiny Left");
	addChil(fontt,"small-right-icons.php","Tiny Right");
	}
	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 == "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");
	}
	else if(das == "deco")
	{
	var tdr = document.getElementById("deco");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);

	addChil(fontt,"stationary/index.php","Stationary");
	addChil(fontt,"clothing/index.php","Clothing");
	addChil(fontt,"fashion/index.php","Fashion");
	addChil(fontt,"furniture/index.php","Furnitures");
	}
	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,"fruits/index.php","Fruits");
	addChil(fontt,"trees/index.php","Tree");
	addChil(fontt,"nature/index.php","Others");
	}
	else if(das == "maps")
	{
	var tdr = document.getElementById("maps");
	removeChilds(fontt);
	fontt = tdr.getElementsByTagName('font').item(0);
	removeChilds(fontt);
	addChil(fontt,"index.php","Country Index");
	addChil(fontt,"map-icons.php","Country A-B");
	addChil(fontt,"c-d-maps.php","Country C-D");
	addChil(fontt,"e-f-maps.php","Country E-F");
	addChil(fontt,"g-h-maps.php","Country G-H");
	addChil(fontt,"i-j-maps.php","Country I-J");
	addChil(fontt,"k-l-maps.php","Country K-L");
	addChil(fontt,"m-n-maps.php","Country M-N");
	addChil(fontt,"o-r-maps.php","Country O-R");
	addChil(fontt,"s-t-maps.php","Country S-T");
	addChil(fontt,"u-z-maps.php","Country U-Z");
	addChil(fontt,"india-map.php","India");
	}
	else if(das == "symbols")
	{
		var tdr = document.getElementById("symbols");
		removeChilds(fontt);
		fontt = tdr.getElementsByTagName('font').item(0);
		removeChilds(fontt);
	
		addChil(fontt,"famous/index.php","The Famous");
		addChil(fontt,"math/index.php","Math Signs");
		addChil(fontt,"shapes/index.php","Shapes");
		addChil(fontt,"greek/index.php","Greek Symbols");
		addChil(fontt,"traffic/index.php","Traffic Signs");
		addChil(fontt,"../planets/index.php","Planet Signs");
		addChil(fontt,"../dollar-icons.php","Dollar Symbol");
	}


}

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="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;
}
