function switch_pack(id) {

	var children_links = document.getElementById('cont-wrap').childNodes;

    for (var i=0; i<=children_links.length; i++) {
		if(typeof(children_links[i]) !== 'undefined' && children_links[i] != null) {
			if(typeof(children_links[i].id) !== 'undefined' && children_links[i].id != null) {
				if (children_links[i].id.substr(0,8) == 'package-') {
					if (children_links[i].id == "package-"+id) {
						children_links[i].style.display = 'block';
						document.getElementById("menu-"+children_links[i].id.substr(8,9)).setAttribute("class", "fade-but-on");
					} else {
						children_links[i].style.display = 'none';
						document.getElementById("menu-"+children_links[i].id.substr(8,9)).setAttribute("class", "fade-but");
					}
				}
			}
		}
    }
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}
