function SDMenu(id) {
	if (!document.getElementById || !document.getElementsByTagName)
		return false;
	this.menu = document.getElementById(id);
	this.submenus = this.menu.getElementsByTagName("div");
	this.remember = false;
	this.speed = 2;
	this.markCurrent = true;
	this.oneSmOnly = false;
}
SDMenu.prototype.init = function() {
	var mainInstance = this;
	
	for (var i = 0; i < this.submenus.length; i++)
		this.submenus[i].getElementsByTagName("span")[0].onclick = function() {
			mainInstance.toggleMenu(this.parentNode);
		};
/*
	for (var i = 0; i < this.submenus.length; i++)
		this.submenus[i].getElementsByTagName("span")[0].onmouseover = function() {
			mainInstance.expandMenu(this.parentNode);
		};
	for (var i = 0; i < this.submenus.length; i++)
		this.submenus[i].getElementsByTagName("span")[0].onclick = function() {
			mainInstance.collapseMenu(this.parentNode);
		};
*/
	if (this.markCurrent) {
		for (var k = 0; k < this.submenus.length; k++){
			/*if (document.location.href.indexOf(this.submenus[k].id)>0 && document.location.href.indexOf("store")<0){
				this.submenus[k].getElementsByTagName("span")[0].className = this.submenus[k].getElementsByTagName("span")[0].className+"current_menu";
				this.submenus[k].className = "";	
			}*/
			var links = this.submenus[k].getElementsByTagName("a");
			for (var i = 0; i < links.length; i++)
				if (links[i].href == document.location.href && links[i].className != "parent") {
					links[i].className = links[i].className+"current";
					this.submenus[k].getElementsByTagName("span")[0].className = this.submenus[k].getElementsByTagName("span")[0].className+"current_menu";
					this.submenus[k].className = "";
					/*mainInstance.expandMenu(this.submenus[k]);*/
				
				}
		}
	/*	var lonelylinks = document.getElementsByTagName("a");
		for (var i = 0; i < lonelylinks.length; i++)
			if (lonelylinks[i].href == document.location.href && lonelylinks[i].id == "lonelylink") {
				lonelylinks[i].className = "lonely_current";
				break;
			}*/

	}
	if (this.remember) {
		var regex = new RegExp("sdmenu_" + encodeURIComponent(this.menu.id) + "=([01]+)");
		var match = regex.exec(document.cookie);
		if (match) {
			var states = match[1].split("");
			for (var i = 0; i < states.length; i++)
				this.submenus[i].className = (states[i] == 0 ? "collapsed" : "");
		}
	}
};
SDMenu.prototype.toggleMenu = function(submenu) {
	if (submenu.className == "collapsed")
		this.expandMenu(submenu);
	else
		this.collapseMenu(submenu);
};
SDMenu.prototype.expandMenu = function(submenu) {
	var fullHeight = submenu.getElementsByTagName("span")[0].offsetHeight;
	var links = submenu.getElementsByTagName("a");
	for (var i = 0; i < links.length; i++)
		fullHeight += links[i].offsetHeight;
	var moveBy = Math.round(this.speed * links.length);
	
	var mainInstance = this;
	var intId = setInterval(function() {
		var curHeight = submenu.offsetHeight;
		var newHeight = curHeight + moveBy;
		if (newHeight < fullHeight)
			submenu.style.height = newHeight + "px";
		else {
			clearInterval(intId);
			submenu.style.height = "";
			submenu.className = "";
			mainInstance.memorize();
		}
	}, 30);
	this.collapseOthers(submenu);
};
SDMenu.prototype.collapseMenu = function(submenu) {
	var minHeight = submenu.getElementsByTagName("span")[0].offsetHeight;
	var moveBy = Math.round(this.speed * submenu.getElementsByTagName("a").length);
	var mainInstance = this;
	var intId = setInterval(function() {
		var curHeight = submenu.offsetHeight;
		var newHeight = curHeight - moveBy;
		if (newHeight > minHeight)
			submenu.style.height = newHeight + "px";
		else {
			clearInterval(intId);
			submenu.style.height = "";
			submenu.className = "collapsed";
			mainInstance.memorize();
		}
	}, 30);
};
SDMenu.prototype.collapseOthers = function(submenu) {
	if (this.oneSmOnly) {
		for (var i = 0; i < this.submenus.length; i++)
			if (this.submenus[i] != submenu && this.submenus[i].className != "collapsed")
				this.collapseMenu(this.submenus[i]);
	}
};
SDMenu.prototype.expandAll = function() {
	var oldOneSmOnly = this.oneSmOnly;
	this.oneSmOnly = false;
	for (var i = 0; i < this.submenus.length; i++)
		if (this.submenus[i].className == "collapsed")
			this.expandMenu(this.submenus[i]);
	this.oneSmOnly = oldOneSmOnly;
};
SDMenu.prototype.collapseAll = function() {
	for (var i = 0; i < this.submenus.length; i++)
		if (this.submenus[i].className != "collapsed")
			this.collapseMenu(this.submenus[i]);
};
SDMenu.prototype.memorize = function() {
	if (this.remember) {
		var states = new Array();
		for (var i = 0; i < this.submenus.length; i++)
			states.push(this.submenus[i].className == "collapsed" ? 0 : 1);
		var d = new Date();
		d.setTime(d.getTime() + (30 * 24 * 60 * 60 * 1000));
		document.cookie = "sdmenu_" + encodeURIComponent(this.menu.id) + "=" + states.join("") + "; expires=" + d.toGMTString() + "; path=/";
	}
};

function TPMenu(id) {
	if (!document.getElementById || !document.getElementsByTagName)
		return false;
	this.menu = document.getElementById(id);
	this.submenus = this.menu.getElementsByTagName("div");
	this.markCurrent = true;
}
TPMenu.prototype.init = function() {
	var mainInstance = this;

for (var i = 0; i < this.submenus.length; i++){
		this.submenus[i].onmouseover = function() {
			this.childNodes[1].style.display = "block";
			
		};
		this.submenus[i].onmouseout = function() {
			this.childNodes[1].style.display = "none";
		};
}

	if (this.markCurrent) {
		var links = this.menu.getElementsByTagName("a");
			for (var i = 0; i < links.length; i++)
				if (links[i].href == document.location.href && links[i].className!="tree") {
					links[i].className = "current";
					break;
				}
	}
};

function showIt1(){
	 document.getElementById("show1").style.visibility="visible";
	 document.getElementById("show1").style.opacity="1";
	 document.getElementById("show1").style.filter="alpha(opacity=100)";
	 setInterval('{showIt1()}', 1000);
return false;
}

function showIt2(){
	 document.getElementById("show2").style.visibility="visible";
	 document.getElementById("show2").style.opacity="1";
	 document.getElementById("show2").style.filter="alpha(opacity=100)";
	 setInterval('{showIt2()}', 1800);
return false;
}

var m = new Array(0,124);
var m1 = new Array(0,90);
var t = new Array();
function show1() {
m[0]+=1;
m[1]-=1;

document.getElementById("show1").style.height=+m[1]+"px";


t[0] = setTimeout("show1()",20);
if (m[0]>36) {
	clearTimeout(t[0]);
	document.getElementById("show2").style.visibility="visible";
};

}

function show2() {
m1[0]+=1;
m1[1]-=1;

document.getElementById("show2").style.visibility="visible";
document.getElementById("show2").style.opacity = m1[0]/100;
document.getElementById("show2").style.filter="alpha(opacity="+m1[0]+")";

t[1] = setTimeout("show2()",20);
if (m1[0]>98) clearTimeout(t[1]);
}

