Flash Navigation

function scale_up(menu) {
	if ((this.x - menu._width) > 0.1) {
		menu._width += (this.x - menu._width) / 1.5;
		menu._height += (this.y - menu._height) / 1.5;
	}
	if ((0 - sub_bg._y) && !this.bg) {
		sub_bg._y += (0 - sub_bg._y) / 3;
	} else if ((32 - sub_bg._y) > 0.1 && this.bg) {
		sub_bg._y += (32 - sub_bg._y) / 3;
	}
}

function scale_restore(menu) {
	if ((menu._width - this.x_origin) > 0.1) {
		menu._width -= (menu._width - this.x_origin) / 1.5;
		menu._height -= (menu._height - this.y_origin) / 1.5;
	}
}

function view_submenu (submenu) {
	if ((32 - submenu._y) > 0.1) {
		submenu._y += (32 - submenu._y) / 3;
	}
}

function initialize(menu) {
	if (this.current_menu != menu) {
		hide_submenu ();
		if (this.no_current) {
			this.last_menu = menu;
		} else {
			this.x_origin = this.x_temp;
			this.y_origin = this.y_temp;
			this.last_menu = this.current_menu;
		}

		this.x = menu._width *1.3;
		this.y = menu._height *1.3;
		this.x_temp = menu._width;
		this.y_temp = menu._height;

		this.current_menu = menu;
	}
}

function hide_submenu () {
	submenu1._y = -30;
//	submenu2._y = -30;
//	submenu3._y = -30;
//	submenu4._y = -30;
	submenu5._y = -30;
	submenu6._y = -30;
	submenu7._y = -30;
}

//this.page = this.menu2;
if (this.page) {
	this.no_current = false;
	initialize (this.page);
} else {
	this.no_current = true;
}

this.onEnterFrame = function() {
	if (!no_current) {
		scale_up(this.current_menu);
		scale_restore(this.last_menu);
		view_submenu (this.submenu);
	}
//	trace(this.submenu);
}

this.menu1.onRollOver = function() {
	no_current = false;
	submenu = submenu1;
	bg = true;
	initialize (menu1);
}

this.menu2.onRollOver = function() {
	no_current = false;
	submenu = submenu2;
	bg = false;
	initialize (menu2);
}

this.menu3.onRollOver = function() {
	no_current = false;
	submenu = submenu3;
	bg = false;
	initialize (menu3);
}

this.menu4.onRollOver = function() {
	no_current = false;
	submenu = submenu4;
	bg = false;
	initialize (menu4);
}

this.menu5.onRollOver = function() {
	no_current = false;
	submenu = submenu5;
	bg = true;
	initialize (menu5);
}

this.menu6.onRollOver = function() {
	no_current = false;
	submenu = submenu6;
	bg = true;
	initialize (menu6);
}

this.menu7.onRollOver = function() {
	no_current = false;
	submenu = submenu7;
	bg = true;
	initialize (menu7);
}

this.hide.onRollOver = function() {
	submenu = '';
	bg = false;
	initialize ('');
//	no_current = true;
}