//UpDownMenu
//Written by Vam.
//2007-4-25
function UpDownMenuClass()
{
	this.Menu = new Array();
	this.MenuCount = 0;
	
	this.AddFather = function(Text,Link)
	{
		this.Menu[this.MenuCount] = new Array();
		this.Menu[this.MenuCount][0] = "<a href='"+Link+"'>"+Text+"</a>";
		this.Menu[this.MenuCount][1] = new Array();
		this.MenuCount += 1;
	}
	
	this.AddSon = function(Text,Link)
	{
		var FatherIndex = this.MenuCount - 1;
		var SonIndex = this.Menu[FatherIndex][1].length;
		this.Menu[FatherIndex][1][SonIndex] = "<a href='"+Link+"'>"+Text+"</a>";
	}
	
	this.Creat = function()
	{
		var HTMLContent = "";
		for ( i=0; i<this.Menu.length; i++ )
		{
			HTMLContent += "<div id=\"Father1\" class=\"Father\" onclick=\""+ this.SwitchMenu(i) +"\">" + this.Menu[i][0] + "</div>";
			HTMLContent += "<div id=\"SonContainer" + i + "\" style = \"display : none\">";
			for (m=0; m<this.Menu[i][1].length; m++)
			{
				HTMLContent += "<div class=\"Son\" >" + this.Menu[i][1][m] + "</div>";
			}
			HTMLContent += "</div>";
		}
		document.write(HTMLContent);
	}
	
	this.SwitchMenu = function(Index)
	{
		if (Index != null)
		{
			var FunctionString = "";
			
			for (n = 0; n<this.Menu.length; n++)
			{
				FunctionString += "document.getElementById('SonContainer" + n + "').style.display = 'none'; ";
			}
			FunctionString += "document.getElementById('SonContainer" + Index + "').style.display = ''; ";
			
			return FunctionString;
		}
		
	}
}


function QueryString(name){
var qs=name+"=";
var str=location.search;
if(str.length>0){
begin=str.indexOf(qs);
if(begin!=-1){
begin+=qs.length;
end=str.indexOf("&",begin);
if(end==-1)end=str.length;
return(str.substring(begin,end));
}
}
return null;
}