//<![CDATA[
	var fade = { // Namespace
	ids	: {},
	step	: 0.1,
	delay	: 1, // ms
	timer	: null,
	setOpacity : function(elem, nOpacity) {
		if (typeof elem == 'string') elem = document.getElementById(elem);
		var props = ['MozOpacity', 'KhtmlOpacity', 'opacity'];
		for (var i in props) {
			if (typeof elem.style[props[i]] == 'string') {
				elem.style[props[i]] = nOpacity;
				return;
			}
		}
		// IE 6+
		try {
			nOpacity = 100 * parseFloat(nOpacity);
			if ((oAlpha = elem.filters['DXImageTransform.Microsoft.alpha'] || elem.filters.alpha)) oAlpha.opacity = nOpacity;
			else elem.style.filter += "progid:DXImageTransform.Microsoft.Alpha(opacity="+nOpacity+");";
		} catch (e) {
			// IE <= 5.5 OR Opera < 9 OR another browser. Do nothing
		}
	},
	_out : function(id, from, to, callback) {
		from -= this.step;
		from = from <= to ? to : from;
		if (this.doit(id, from, to, callback)) 
			this.timer = setTimeout("fade._out('"+id+"', "+from+", "+to+", '"+(callback ? callback : '')+"')", this.delay);
	},
	_in : function(id, from, to, callback) {
		from += this.step;
		from = from >= to ? to : from;
		if (this.doit(id, from, to, callback)) 
			this.timer = setTimeout("fade._in('"+id+"', "+from+", "+to+", '"+(callback ? callback : '')+"')", this.delay);
	},
	doit : function(id, from, to, callback) {
		this.setOpacity(id, from);
		clearTimeout(this.timer);
		if (from == to) {
			if (callback) eval(callback+'()');
		} else return true;
	}
}
//]]>

//<![CDATA[
	var fade2 = { // Namespace
	ids	: {},
	step	: 0.15,
	delay	: 1, // ms
	timer	: null,
	setOpacity : function(elem, nOpacity) {
		if (typeof elem == 'string') elem = document.getElementById(elem);
		var props = ['MozOpacity', 'KhtmlOpacity', 'opacity'];
		for (var i in props) {
			if (typeof elem.style[props[i]] == 'string') {
				elem.style[props[i]] = nOpacity;
				return;
			}
		}
		// IE 6+
		try {
			nOpacity = 100 * parseFloat(nOpacity);
			if ((oAlpha = elem.filters['DXImageTransform.Microsoft.alpha'] || elem.filters.alpha)) oAlpha.opacity = nOpacity;
			else elem.style.filter += "progid:DXImageTransform.Microsoft.Alpha(opacity="+nOpacity+");";
		} catch (e) {
			// IE <= 5.5 OR Opera < 9 OR another browser. Do nothing
		}
	},
	_out : function(id, from, to, callback) {
		from -= this.step;
		from = from <= to ? to : from;
		if (this.doit(id, from, to, callback)) 
			this.timer = setTimeout("fade2._out('"+id+"', "+from+", "+to+", '"+(callback ? callback : '')+"')", this.delay);
	},
	_in : function(id, from, to, callback) {
		from += this.step;
		from = from >= to ? to : from;
		if (this.doit(id, from, to, callback)) 
			this.timer = setTimeout("fade2._in('"+id+"', "+from+", "+to+", '"+(callback ? callback : '')+"')", this.delay);
	},
	doit : function(id, from, to, callback) {
		this.setOpacity(id, from);
		clearTimeout(this.timer);
		if (from == to) {
			if (callback) eval(callback+'()');
		} else return true;
	}
}
//]]>

var TT_1 = "";
var TT_2 = "";
var TT_3 = "";
var TT_1_1 = "";
var TT_1_2 = "";
var TT_2_1 = "";
var TT_2_2 = "";
var TT_2_3 = "";
var TT_2_4 = "";

//menu_1
function menu_1_in(){
	clearTimeout(TT_1);
	clearTimeout(TT_2);
	clearTimeout(TT_3);

	menu_2.style.display = 'none';
	menu_3.style.display = 'none';

	if(menu_1.style.display == 'none') {

		menu_1_1.style.display = 'none';
		menu_1_2.style.display = 'none';

		menu_1.style.display = '';

		fade._in('menu_1', 0, 1.0);

	}
}
function menu_1_out(){
	TT_1 = setTimeout(function() {fade._out('menu_1', 1.0, 0, 'menu_1_hide');},800);
}
function menu_1_hide() {
	menu_1.style.display = 'none';
}

function menu_1_1_in(){
	clearTimeout(TT_1_1);
	clearTimeout(TT_1_2);

	menu_1_2.style.display = 'none';

	if(menu_1_1.style.display == 'none') {

		menu_1_1.style.display = '';

		fade2._in('menu_1_1', 0, 1.0);
	}
}

function menu_1_1_out(){
	TT_1_1 = setTimeout(function() {fade2._out('menu_1_1', 1.0, 0, 'menu_1_1_hide');},500);
}
function menu_1_1_hide() {
	menu_1_1.style.display = 'none';
}

function menu_1_2_in(){
	clearTimeout(TT_1_1);
	clearTimeout(TT_1_2);

	menu_1_1.style.display = 'none';

	if(menu_1_2.style.display == 'none') {

		menu_1_2.style.display = '';

		fade2._in('menu_1_2', 0, 1.0);
	}
}

function menu_1_2_out(){
	TT_1_2 = setTimeout(function() {fade2._out('menu_1_2', 1.0, 0, 'menu_1_2_hide');},500);
}
function menu_1_2_hide() {
	menu_1_2.style.display = 'none';
}

function menu_1_3_in(){
	clearTimeout(TT_1_1);
	clearTimeout(TT_1_2);

	menu_1_1.style.display = 'none';
	menu_1_2.style.display = 'none';
}


//menu_2
function menu_2_in(){
	clearTimeout(TT_1);
	clearTimeout(TT_2);
	clearTimeout(TT_3);

	menu_1.style.display = 'none';
	menu_3.style.display = 'none';

	if(menu_2.style.display == 'none') {

		menu_2_1.style.display = 'none';
		menu_2_2.style.display = 'none';
		menu_2_3.style.display = 'none';
		menu_2_4.style.display = 'none';

		menu_2.style.display = '';

		fade._in('menu_2', 0, 1.0);
	}
}
function menu_2_out(){
	TT_2 = setTimeout(function() {fade._out('menu_2', 1.0, 0, 'menu_2_hide');},800);
}
function menu_2_hide() {
	menu_2.style.display = 'none';
}

function menu_2_1_in(){
	clearTimeout(TT_2_1);
	clearTimeout(TT_2_2);
	clearTimeout(TT_2_3);
	clearTimeout(TT_2_4);

	menu_2_2.style.display = 'none';
	menu_2_3.style.display = 'none';
	menu_2_4.style.display = 'none';

	if(menu_2_1.style.display == 'none') {

		menu_2_1.style.display = '';

		fade2._in('menu_2_1', 0, 1.0);
	}
}

function menu_2_1_out(){
	TT_2_1 = setTimeout(function() {fade2._out('menu_2_1', 1.0, 0, 'menu_2_1_hide');},500);
}
function menu_2_1_hide() {
	menu_2_1.style.display = 'none';
}

function menu_2_2_in(){
	clearTimeout(TT_2_1);
	clearTimeout(TT_2_2);
	clearTimeout(TT_2_3);
	clearTimeout(TT_2_4);

	menu_2_1.style.display = 'none';
	menu_2_3.style.display = 'none';
	menu_2_4.style.display = 'none';

	if(menu_2_2.style.display == 'none') {

		menu_2_2.style.display = '';

		fade2._in('menu_2_2', 0, 1.0);
	}
}

function menu_2_2_out(){
	TT_2_2 = setTimeout(function() {fade2._out('menu_2_2', 1.0, 0, 'menu_2_2_hide');},500);
}
function menu_2_2_hide() {
	menu_2_2.style.display = 'none';
}

function menu_2_3_in(){
	clearTimeout(TT_2_1);
	clearTimeout(TT_2_2);
	clearTimeout(TT_2_3);
	clearTimeout(TT_2_4);

	menu_2_1.style.display = 'none';
	menu_2_2.style.display = 'none';
	menu_2_4.style.display = 'none';

	if(menu_2_3.style.display == 'none') {

		menu_2_3.style.display = '';

		fade2._in('menu_2_3', 0, 1.0);
	}
}

function menu_2_3_out(){
	TT_2_3 = setTimeout(function() {fade2._out('menu_2_3', 1.0, 0, 'menu_2_3_hide');},500);
}
function menu_2_3_hide() {
	menu_2_3.style.display = 'none';
}

function menu_2_4_in(){
	clearTimeout(TT_2_1);
	clearTimeout(TT_2_2);
	clearTimeout(TT_2_3);
	clearTimeout(TT_2_4);

	menu_2_1.style.display = 'none';
	menu_2_2.style.display = 'none';
	menu_2_3.style.display = 'none';

	if(menu_2_4.style.display == 'none') {

		menu_2_4.style.display = '';

		fade2._in('menu_2_4', 0, 1.0);
	}
}

function menu_2_4_out(){
	TT_2_4 = setTimeout(function() {fade2._out('menu_2_4', 1.0, 0, 'menu_2_4_hide');},500);
}
function menu_2_4_hide() {
	menu_2_4.style.display = 'none';
}




//menu_3
function menu_3_in(){
	clearTimeout(TT_1);
	clearTimeout(TT_2);
	clearTimeout(TT_3);

	menu_1.style.display = 'none';
	menu_2.style.display = 'none';

	if(menu_3.style.display == 'none') {

		menu_3.style.display = '';

		fade._in('menu_3', 0, 1.0);
	}
}
function menu_3_out(){
	TT_3 = setTimeout(function() {fade._out('menu_3', 1.0, 0, 'menu_3_hide');},800);
}
function menu_3_hide() {
	menu_3.style.display = 'none';
}













function pop_hide() {
	pop_up.style.width = '1px';
	pop_up.style.height = '1px';
	window.document.flash.SetVariable("cloud_anim", "play");
}
function pop_in(){
	window.document.flash.SetVariable("cloud_anim", "stop");
	pop_up.style.width = '100%';
	pop_up.style.height = '1480px';

	fade._in('pop_up', 0, 0.85);
}
function pop_out(){
	fade._out('pop_up', 0.85, 0, 'pop_hide');
}
function gallery_hide() {
	gallery.style.display = 'none';
	gallery.style.width = '1px';
	gallery.style.height = '1px';
	gallery.style.left = '0px';
	gallery.style.top = '0px';

	pop_out();
}

function gallery_in_1(){
	gallery.style.display = '';
	gallery.style.width = '100%';
	gallery.style.height = '760px';
	gallery.style.left = '0px';
	gallery.style.top = '50%';

	fade._in('gallery', 0, 1.0, 'loadHTML_1');
}

function gallery_out(){
	gallery.style.display = 'none';
	sert.style.display = 'none';
	loadHTML_close();
}

function gallery_visible_1(){
	window.document.flash.SetVariable("cloud_anim", "stop");
	pop_up.style.width = '100%';
	pop_up.style.height = '1480px';

	fade._in('pop_up', 0, 0.85, 'gallery_in_1');
}
