function Bird(tag, name, number, sex, age, location, colorTag, parents, hatchLocation)
{
	this.tag = tag;
	this.name = name;
	this.number = number;
	this.sex = sex;
	this.age = age;
	this.location = location;
	this.colorTag = colorTag;
	this.parents = parents;
	this.hatchLocation = hatchLocation;
}

Bird.prototype.doMatch = function(toMatch)
{
	var returnVal = 0;
	if (this.tag == toMatch)
	{
		returnVal = 3;
	}
	else
	{
		for (var i = 0; i < toMatch.length; i++)
		{
			mChar = toMatch.substring(i, i+1);
			bChar = this.tag.substring(i, i+1);
			if (mChar == 'I')
			{
				mChar = "1";
			}
			if (bChar == 'I')
			{
				bChar = "1";
			}	
			if (mChar == "O")
			{
				mChar = "0";
			}
			if (bChar == "O")
			{
				bChar = "0";
			}	
			if (mChar == bChar && mChar != '_')
			{
				returnVal++;
			}
			else if (mChar != '_' && mChar != bChar)
			{
				returnVal = 0;
				break;
			}
		}
	}	
	// alert(toMatch + " :: " + this.tag + " :: " + returnVal);
	return returnVal;
}	

Bird.prototype.getBarNumber = function()
{
	return this.tag.substring(0,1);
}

Bird.prototype.getTagColorCombo = function()
{
	var colorCombo = 5;	// default is black with white
	var thisColor = parseInt(this.number.toString().substring(0,1));
	if (this.colorTag || thisColor == metaColorTag)
	{
		colorCombo = thisColor;
	}
	return colorCombo;
}

Bird.prototype.getTagNumbers = function()
{
	var modString = this.tag.substring(1,3);
	if (modString.indexOf('_') == 0)
	{
		modString = "&nbsp;" + this.tag.substring(2,3);
	}
	return modString;
}	

Bird.prototype.getDoColor = function()
{
	var thisColor = parseInt(this.number.toString().substring(0,1));
	return (this.colorTag || thisColor == metaColorTag);
}	

Bird.prototype.hasParents = function()
{
	return this.parents.length > 0;
}

Bird.prototype.hasKids = function(birds)
{
	var hasKids = false;
	for (var i in birds)
	{
		if (birds[i].hasParents() && (this.tag == birds[i].parents[0] || this.tag == birds[i].parents[1]))
		{
			hasKids = true;
			break;
		}
	}
	return hasKids;
}

Bird.prototype.getKids = function(birds)
{
	var kids = new Array();
	var kidsIndex = 0;
	for (var i in birds)
	{
		if (birds[i].hasParents() && (this.tag == birds[i].parents[0] || this.tag == birds[i].parents[1]))
		{
			kids[kidsIndex++] = birds[i].tag;
		}
	}
	return kids;
}


			

var birds = new Array();
var metaColorTag = -1;

birds["161"] = new Bird("161", "Matriarch", 161, "female", "May 10, 1997", "Big Sur", false, new Array(), null);
birds["167"] = new Bird("167", "Kingpin", 167, "male", "May 6, 1997", "Big Sur", true, new Array(), null);
birds["168"] = new Bird("168", "Beak Boy", 168, "male", "May 9, 1997", "Big Sur", true, new Array(), null);
birds["171"] = new Bird("171", "Traveler", 171, "female", "May 26, 1997", "Big Sur", true, new Array(), null);
birds["190"] = new Bird("190", "Redwood Queen", 190, "female", "May 10, 1998", "Big Sur", true, new Array(), null);
birds["192"] = new Bird("192", "Purist", 192, "female", "May 27, 1998", "Big Sur", false, new Array(), null);
birds["194"] = new Bird("194", "Whalewatcher", 194, "male", "June 29, 1998", "Big Sur", true, new Array(), null);
birds["199"] = new Bird("199", "The Great One", 199, "male", "April 8, 1999", "Big Sur", true, new Array(), null);
birds["2_4"] = new Bird("2_4", "Amigo", 204, "male", "April 28, 1999", "Big Sur", true, new Array(), null);
birds["2_8"] = new Bird("2_8", "Solo", 208, "female", "May 14, 1999", "Big Sur", true, new Array(), null);
birds["2_9"] = new Bird("2_9", "Shadow", 209, "male", "May 15, 1999", "Big Sur", true, new Array(), null);
birds["219"] = new Bird("219", "Rock", 219, "male", "April 8, 2000", "Big Sur", true, new Array(), null);
birds["222"] = new Bird("222", "Cosmo", 222, "female", "April 17, 2000", "Big Sur", true, new Array(), null);
birds["231"] = new Bird("231", "Wild1", 231, "female", "April 30, 2000", "Big Sur", false, new Array(), null);
birds["236"] = new Bird("236", "Tiny", 236, "female", "March 22, 2001", "Big Sur", true, new Array(), null);
birds["242"] = new Bird("242", "Red", 242, "male", "April 20, 2001", "Big Sur", true, new Array(), null);
birds["251"] = new Bird("251", "Crush", 251, "male", "May 10, 2001", "Big Sur", true, new Array(), null);
birds["286"] = new Bird("286", "Pinns", 286, "male", "May 16, 2002", "Big Sur", false, new Array(), null);
birds["294"] = new Bird("294", "Late Bloomer", 294, "female", "April 7, 2003", "Big Sur", true, new Array(), null);
birds["298"] = new Bird("298", "Plain Jane", 298, "female", "April 11, 2003", "Big Sur", true, new Array(), null);
birds["3_3"] = new Bird("3_3", "Lucia", 303, "female", "April 22, 2003", "Big Sur", false, new Array(), null);
birds["311"] = new Bird("311", "Loner", 311, "female", "May 12, 2003", "Big Sur", true, new Array(), null);
birds["318"] = new Bird("318", "Benito", 318, "male", "June 9, 2003", "Big Sur", true, new Array(), null);
birds["375"] = new Bird("375", "Survivor", 375, "female", "May 2, 2005", "Big Sur", false, new Array(), null);
birds["044"] = new Bird("044", "Ventana", 444, "female", "May 5, 2007", "Big Sur", true, new Array('167', '190'), null);
birds["570"] = new Bird("570", "Fuego", 470, "male", "April 12, 2008", "Big Sur", true, new Array('2_4', '222'), null);
birds["577"] = new Bird("577", "Phoenix", 477, "unknown", "April 22, 2008", "Big Sur", true, new Array('199', '231'), null);
birds["599"] = new Bird("599", "Gypsy", 499, "female", "March 28, 2009", "Big Sur", true, new Array('167', '190'), null);
birds["6_1"] = new Bird("6_1", "Spirit", 501, "female", "April 4, 2009", "Big Sur", true, new Array('194', '171'), null);
birds["638"] = new Bird("638", "Miracle", 538, "female", "May 23, 2009", "Big Sur", true, new Array('236', '2_9'), null);
birds["667"] = new Bird("667", "McWay", 567, "male", "April 25, 2010", "Big Sur", true, new Array('194', '171'), null);
birds["659"] = new Bird("659", null, 559, "male", "April 2010", "Big Sur", true, new Array(), "LA Zoo");
birds["666"] = new Bird("666", null, 566, "male", "April 2010", "Big Sur", true, new Array(), "LA Zoo");
birds["669"] = new Bird("669", null, 569, "female", "April 2010", "Big Sur", true, new Array(), "LA Zoo");
birds["674"] = new Bird("674", "Nomad", 574, "male", "May 10th 2010", "Big Sur", true, new Array('219', '310'), null);
birds["683"] = new Bird("683", null, 583, "male", "May 2010", "Big Sur", true, new Array(), "World Center for Birds of Prey, ID");

birds["306"] = new Bird("306", null, 306, "female", "May 4, 2003", "Pinnacles", false, new Array(), null);
birds["112"] = new Bird("112", null, 112, "female", "May 15, 1994", "Pinnacles", false, new Array(), null); // has a tag with a 12 above one dot
birds["310"] = new Bird("310", null, 310, "female", "May 11, 2003", "Pinnacles", false, new Array(), null);
birds["312"] = new Bird("312", null, 312, "female", "May 14, 2003", "Pinnacles", false, new Array(), null);
birds["313"] = new Bird("313", null, 313, "male", "May 15, 2003", "Pinnacles", false, new Array(), null);
birds["317"] = new Bird("317", null, 317, "female", "May 26, 2003", "Pinnacles", false, new Array(), null);
birds["330"] = new Bird("330", null, 330, "male", "April 19, 2004", "Pinnacles", false, new Array(), null);
birds["332"] = new Bird("332", null, 332, "male", "April 22, 2004", "Pinnacles", false, new Array(), null);
birds["335"] = new Bird("335", null, 335, "male", "April 23, 2004", "Pinnacles", false, new Array(), null);
birds["336"] = new Bird("336", null, 336, "female", "April 28, 2004", "Pinnacles", false, new Array(), null);
birds["340"] = new Bird("340", "Kun-wak-shun", 340, "male", "May 9, 2008", "Pinnacles", false, new Array(), null); // http://www.oregonzoo.org/Condors/condorBios.htm
birds["345"] = new Bird("345", null, 345, "male", "May 16, 2004", "Pinnacles", false, new Array(), null);
birds["351"] = new Bird("351", null, 351, "male", "May 28. 2004", "Pinnacles", false, new Array(), null);
birds["4_0"] = new Bird("4_0", null, 400, "female", "April 11, 2006", "Pinnacles", false, new Array(), null);
birds["401"] = new Bird("401", null, 401, "male", "April 13, 2006", "Pinnacles", true, new Array(), null);
birds["4_5"] = new Bird("4_5", null, 405, "male", "April 18. 2006", "Pinnacles", false, new Array(), null);
birds["411"] = new Bird("411", null, 411, "male", "April 26, 2006", "Pinnacles", false, new Array(), null);
birds["418"] = new Bird("418", null, 418, "female", "May 10, 2006", "Pinnacles", true, new Array(), null); // has a tag with an 18 above one long bar - bar not seen in real life - moved to a 0
birds["421"] = new Bird("421", null, 421, "male", "May 13, 2009", "Pinnacles", false, new Array(), null); // has a tag with a 21 above one long bar
birds["431"] = new Bird("431", null, 431, "male", "April 12, 2007", "Pinnacles", false, new Array('168', '2_8'), null);
birds["438"] = new Bird("438", null, 438, "female", "April 21, 2007", "Pinnacles", true, new Array(), null);
birds["448"] = new Bird("448", null, 448, "male", "May 8 ,2007", "Pinnacles", false, new Array(), null);
birds["460"] = new Bird("460", null, 460, "female", "March 24, 2008", "Pinnacles", true, new Array(), null); // has a white tag!
birds["463"] = new Bird("463", null, 463, "male", "April 2, 2008", "Pinnacles", true, new Array(), null); // has a tag with a 63 above one long bar
birds["478"] = new Bird("478", null, 478, "male", "April 23, 2008", "Pinnacles", true, new Array(), null); // has a tag with a 78 above one long bar
birds["481"] = new Bird("481", null, 481, "male", "April 27, 2008", "Pinnacles", true, new Array(), null); // has a tag with a 81 above one long bar 
birds["4VI"] = new Bird("4VI", null, 451, "male", "May 15, 2007", "Pinnacles", false, new Array(), null);
birds["414"] = new Bird("414", null, 514, "unknown", "2009", "Pinnacles", false, new Array(), null);
birds["425"] = new Bird("425", null, 525, "male", "May 4, 2009", "Pinnacles", false, new Array(), null);
birds["434"] = new Bird("434", null, 534, "female", "May 18, 2009", "Pinnacles", false, new Array(), null);
birds["443"] = new Bird("443", null, 543, "female", "May 29, 2009", "Pinnacles", false, new Array(), null);
birds["047"] = new Bird("047", null, 547, "female", "June 5, 2009", "Pinnacles", false, new Array(), null);

// preload images
var b1 = new Image();
b1.src = "/image/condorwing_bar1.png";
var b2 = new Image();
b2.src = "/image/condorwing_bar2.png";
var b3 = new Image();
b3.src = "/image/condorwing_bar3.png";
var b4 = new Image();
b4.src = "/image/condorwing_bar4.png";
var b5 = new Image();
b5.src = "/image/condorwing_bar5.png";
var b6 = new Image();
b6.src = "/image/condorwing_bar6.png";
var rb0 = new Image();
rb0.src = "/image/condorwing_res_bar0.png";
var rb1 = new Image();
rb1.src = "/image/condorwing_res_bar1.png";
var rb2 = new Image();
rb2.src = "/image/condorwing_res_bar2.png";
var rb3 = new Image();
rb3.src = "/image/condorwing_res_bar3.png";
var rb4 = new Image();
rb4.src = "/image/condorwing_res_bar4.png";
var rb5 = new Image();
rb5.src = "/image/condorwing_res_bar5.png";
var rb6 = new Image();
rb6.src = "/image/condorwing_res_bar6.png";

function getNewTagString(getAlt)
{
	var toMatchBar = document.getElementById("toMatchBar");
	var tmb = toMatchBar.options[toMatchBar.selectedIndex].value;
	if (tmb.length == 2)
	{
		metaColorTag = parseInt(tmb.substring(0,1));
	}
	else
	{
		metaColorTag = -1;
	}	
	var toMatchDigits = document.getElementById("toMatchDigits");
	var digits = toMatchDigits.value.toUpperCase();
	if (digits.length == 0)
	{
		digits = "__";
	}
	else if (digits.length == 1)
	{
		if (getAlt)
		{
			digits = digits + "_";
		}
		else
		{
			digits = "_" + digits;
		}	
	}
	return (tmb.substring(0,1) + digits);
}


function getTagString()
{
	var toMatchBar = document.getElementById("toMatchBar");
	var toMatchDigits = document.getElementById("toMatchDigits");
	var digits = toMatchDigits.value;
	if (digits.length == 0)
	{
		digits = "00";
	}
	else if (digits.length == 1)
	{
		digits = "0" + digits;
	}
	return (toMatchBar.options[toMatchBar.selectedIndex].value + digits);
}

function doMatch(showLearnMore)
{
	var tagToMatch = getNewTagString(false);
	var altTagToMatch = getNewTagString(true);
	var hasAlt = altTagToMatch != tagToMatch;
	
	var exact = new Array();
	var close = new Array();
	var weak = new Array();
	var matchCount;
	for (var i in birds)
	{
		matchCount = birds[i].doMatch(tagToMatch);
		if (matchCount == 0 && hasAlt)
		{
			matchCount = birds[i].doMatch(altTagToMatch);
		}	
		if (matchCount == 3)
		{
			exact[exact.length] = birds[i];
		}	
		else if (matchCount == 2)
		{
			close[close.length] = birds[i];
		}
		else if (matchCount == 1)
		{
			weak[weak.length] = birds[i];
		}
	}
	var matches = document.getElementById("matches");
	removeChildren(matches);

	if (exact.length == 1)
	{
		showMatches("Bird Information: Exact Match", exact, matches, false, showLearnMore);
		fillTag(exact[0]);
	}
	else if (exact.length == 0 && close.length == 1)
	{
		showMatches("Bird Information: Close Match", close, matches, false, showLearnMore);
		fillTag(close[0]);
	}
	else if (exact.length == 0 && close.length == 0 && weak.length == 1)
	{
		showMatches("Bird Information: Potential Match", weak, matches, false, showLearnMore);
		fillTag(weak[0]);
	}
	else if (exact.length > 0 || close.length > 0 || weak.length > 0)
	{
		clearTag();
		showMatches("Exact Matches", exact, matches, true, showLearnMore);
		showMatches("Close Matches", close, matches, true, showLearnMore);
		showMatches("Potential Matches", weak, matches, true, showLearnMore);
	}
	else
	{
		clearTag();
		matches.appendChild(document.createTextNode("No Match Found"));
	}
}

function showMatches(headerString, matches, addTo, showShowTag, showLearnMore)
{
	var headerDiv;
	var matchDiv;
	var miniTag;
	var miniTagNum;
	var miniTagBar;
	var textDiv;
	var clearDiv;
	var num;
	var eLine;
	if (matches.length > 0)
	{
		headerDiv = document.createElement("div");
		headerDiv.appendChild(document.createTextNode(headerString));
		addTo.appendChild(headerDiv);
		for (var i in matches)
		{
			matchDiv = document.createElement("div");
			matchDiv.className = "matchDiv";
			addTo.appendChild(matchDiv);
			
			num = matches[i].number;
			// add mini tag
			
			miniTag = getMiniTag(matches[i], 'tag');
			
			matchDiv.appendChild(miniTag);
			
			fillResultTag(matches[i], 'tag');

			if (showLearnMore)
			{
				textDiv = document.createElement("div");
				textDiv.className = "matchTagText";
				matchDiv.appendChild(textDiv);
				
				clearDiv = document.createElement("div");
				clearDiv.className = "clear";
				matchDiv.appendChild(clearDiv);

				var stringTag= "";
				if (false) // (showShowTag)
				{
					stringTag = '<div class="matchDivTag"><a href="javascript:fillTag(birds[\'' + matches[i].tag + '\'])">show tag</a></div>';
				}
				else
				{
					stringTag = "";
				}	
				stringTag += matches[i].number + "";
				if (matches[i].name != null)
				{
					stringTag += ' - "' + matches[i].name + '"';
				}
				stringTag += "<br/>Location: " + matches[i].location;
				eLine = '&nbsp;&nbsp;&nbsp;';
				if (showLearnMore)
				{
					eLine = '<br/>';
				}
				stringTag += "<br/>Sex: " + matches[i].sex + eLine + "Hatched: " + matches[i].age;
				if (showLearnMore)
				{
					var hrefString = "http://mycondor.org/condorprofiles/condor" + matches[i].number + ".html";
					if (matches[i].location == 'Pinnacles')
					{
						hrefString = "http://www.nps.gov/pinn/naturescience/profiles.htm";
					}	
					stringTag += "<br/><a href=\"" + hrefString + "\" target=\"_blank\">Learn More...</a>";
				}	
				textDiv.innerHTML = stringTag;
			}
		}
	}
}

function getMiniTag(bird, tag)
{
	var miniTag = document.createElement("div");
	miniTag.className = "matchTag";
	miniTag.id = tag + "BirdDiv_" + bird.number;
	miniTag.onclick = new Function("fillTag(birds['" + bird.tag + "'])");
	
	var miniTagNum = document.createElement("div");
	miniTagNum.className = "matchTagNum";
	miniTagNum.id = tag + "Number_" + bird.number;
	
	var miniTagImg = document.createElement("img");
	miniTagImg.className = "matchTagImg";
	miniTagImg.id = tag + "BarImg_" + bird.number;
	miniTag.appendChild(miniTagNum);
	miniTag.appendChild(miniTagImg);
	
	return miniTag;
}

function fillResultTag(bird, tag)
{
	var num = bird.number;
	var tagNumber = document.getElementById(tag + "Number_" + num);
	var tagBarImg = document.getElementById(tag + "BarImg_" + num);
	var imgNumber = bird.getBarNumber();
	var doColor = bird.getDoColor();
	if (doColor)
	{
		imgNumber = 0;
	}	
	var modString = bird.getTagNumbers();
	tagBarImg.src = "/image/condorwing_res_bar" + imgNumber + ".png";
	tagNumber.innerHTML = modString;
	var color = bird.getTagColorCombo();
	var bkColor = '#1d1d1d';
	var fgColor = '#cccccc';
	switch(color)
	{
		case 1:
			bkColor = '#dc1d1d';
			fgColor = '#cccccc';
			break;
		case 2:
			bkColor = '#dcc41d';
			fgColor = '#1d1d1d';
			break;
		case 3:
			// bkColor = '#a1c6f3';
			// fgColor = '#1d1d1d';
			bkColor = '#006699';
			fgColor = '#cccccc';
			break;
		case 4:
			bkColor = '#cccccc';
			fgColor = '#1d1d1d';
			break;
	}		
	var mainDiv = document.getElementById(tag + "BirdDiv_" + num);
	tagNumber.style.color = fgColor;
	mainDiv.style.backgroundColor = bkColor;
}

function fillTag(bird)
{
	var tagNumber = document.getElementById("tagNumber");
	var tagBarImg = document.getElementById("tagBarImg");
	var imgNumber = bird.getBarNumber();
	var doColor = bird.getDoColor();
	if (doColor)
	{
		imgNumber = 0;
	}	
	var modString = bird.getTagNumbers();
	tagBarImg.src = "/image/condorwing_bar" + imgNumber + ".png";
	tagNumber.innerHTML = modString;
	var tagCaption = document.getElementById("tagCaption");
	if (tagCaption)
	{
		var stringTag = "Condor: " + bird.number;
		if (bird.name != null)
		{
			stringTag += ' - "' + bird.name + '"';
		}
		tagCaption.innerHTML = stringTag;
	}
	else
	{
		// assume iPhone
		var stringTag = bird.number + "";
		if (bird.name != null)
		{
			stringTag += ' - "' + bird.name + '"';
		}
		stringTag += "<br/>Location: " + bird.location;
		stringTag += "<br/>Sex: " + bird.sex + "<br/>Hatched: " + bird.age;
		if (bird.hatchLocation != null)
		{
			stringTag += '<br/>' + bird.hatchLocation;
		}
		stringTag += "<br/>";
		// stringTag += '<div id="infoBoxButton">OK</div>';
		var infoBox = document.getElementById("infoBox");
		infoBox.innerHTML = stringTag;
		if (bird.hasParents())
		{
			infoBox.appendChild(document.createTextNode('Parents'));
			var pMatches = document.createElement('div');
			var p1 = document.createElement('div');
			var p2 = document.createElement('div');
			pMatches.appendChild(p1);
			pMatches.appendChild(p2);
			p1.className = "matchDiv";
			p2.className = "matchDiv";
			p1.appendChild(getMiniTag(birds[bird.parents[0]], 'par'));
			p2.appendChild(getMiniTag(birds[bird.parents[1]], 'par'));
			infoBox.appendChild(pMatches);
			fillResultTag(birds[bird.parents[0]], 'par');
			fillResultTag(birds[bird.parents[1]], 'par');
			var cDiv = document.createElement('div');
			cDiv.className = "clear";
			pMatches.appendChild(cDiv);
		}
		if (bird.hasKids(birds))
		{
			infoBox.appendChild(document.createTextNode('Offspring'));
			var pMatches = document.createElement('div');
			var kid;
			var kids = bird.getKids(birds);
			for (var i = 0; i < kids.length; i++)
			{
				kid = document.createElement('div');
				pMatches.appendChild(kid);
				kid.className = "matchDiv";
				kid.appendChild(getMiniTag(birds[kids[i]], 'kid'));
			}
			infoBox.appendChild(pMatches);
			for (var i = 0; i < kids.length; i++)
			{
				fillResultTag(birds[kids[i]], 'kid');
			}
			var cDiv = document.createElement('div');
			cDiv.className = "clear";
			pMatches.appendChild(cDiv);
		}
		var okButton = document.createElement('div');
		okButton.id = 'infoBoxButton';
		okButton.appendChild(document.createTextNode('OK'));
		okButton.onclick = new Function("clearInfoBox()");
		infoBox.appendChild(okButton);
		infoBox.style.opacity = 1;
		scroll(0,0);
	}	
	var color = bird.getTagColorCombo();
	var bkColor = '#1d1d1d';
	var fgColor = '#cccccc';
	switch(color)
	{
		case 1:
			bkColor = '#dc1d1d';
			fgColor = '#cccccc';
			break;
		case 2:
			bkColor = '#dcc41d';
			fgColor = '#1d1d1d';
			break;
		case 3:
			// bkColor = '#a1c6f3';
			// fgColor = '#1d1d1d';
			bkColor = '#006699';
			fgColor = '#cccccc';
			break;
		case 4:
			bkColor = '#cccccc';
			fgColor = '#1d1d1d';
			break;
	}		
	var mainDiv = document.getElementById("mainDiv");
	tagNumber.style.color = fgColor;
	mainDiv.style.backgroundColor = bkColor;
		
}

function clearTag()
{
	var tagNumber = document.getElementById("tagNumber");
	var tagBarImg = document.getElementById("tagBarImg");
	tagNumber.innerHTML = "";
	tagBarImg.src = "/image/condorwing_bar0.png";
	var tagCaption = document.getElementById("tagCaption");
	if (tagCaption)
	{
		tagCaption.innerHTML = "";
	}	
	else
	{
		var infoBox = document.getElementById("infoBox");
		infoBox.style.opacity = 0;
	}
	var mainDiv = document.getElementById("mainDiv");
	mainDiv.style.backgroundColor = '#1d1d1d';
}

function clearInfoBox()
{
	var infoBox = document.getElementById("infoBox");
	infoBox.style.opacity = 0;
}

function removeChildren(ele)
{
	if(!ele)
	{
		return false;
	}
	if(ele.hasChildNodes())
	{
		while(ele.childNodes.length >= 1)
		{
			ele.removeChild(ele.firstChild);
		}
	}
	return ele;
}

function hide()
{
	var s = document.getElementById("show");
	var f = document.getElementById("faq");
	s.style.display = "block";
	f.style.display = "none";
}

function show()
{
	var s = document.getElementById("show");
	var f = document.getElementById("faq");
	s.style.display = "none";
	f.style.display = "block";
}

