var ns4=document.layers
var ie4=document.all
var ns6=document.getElementById&&!document.all

var menuArray = new Array();

function forceInactivateMenu(force) {
	if (over == true && force == false) {
		return;
	}
	// hide submenu layer
	if ( this.fake == false ) {
		if (ie4||ns6) {
			menuLayer = document.getElementById('menu_' + this.id);
			menuLayer.style.visibility = 'hidden';
		} else if (ns4) {
			document.layers["menu_" + this.id].visibility="hide";
		}
	}
	// inactivate menuimage button (back to normal state expect of current menu)
	if ( this.current == false ) {
			if (document.images[ this.key ].src.match(/menu_en/)) {
				document.images[ this.key ].src = '/images/menu_en/menu_' + this.key + '-off.gif';
			} else {
				document.images[ this.key ].src = '/images/menu/menu_' + this.key + '-off.gif';
			}
	}
}

function inactivateMenu() {
	this.forceInactivateMenu(false);
}

function activateMenu() {
	inactivateAllMenu();
	// show submenu layer
	if ( this.fake == false ) {
		if (ie4||ns6) {
			menuLayer = document.getElementById('menu_' + this.id);
			menuLayer.style.visibility = 'visible';
		} else if (ns4) {
			document.layers["menu_" + this.id].visibility="visible";
		}
	}
	// activate menuimage button (back to normal state expect of current menu)
	if ( this.current == false ) {
			if (document.images[ this.key ].src.match(/menu_en/)) {
				document.images[ this.key ].src = '/images/menu_en/menu_' + this.key + '-on.gif';
			} else {
				document.images[ this.key ].src = '/images/menu/menu_' + this.key + '-on.gif';
			}
	}
}

//Class
function BigMenu( id, key, current, fake) {
	this.id = id;
	this.key = key;
	this.current = current;
	this.fake = fake;
	// functions
	this.forceInactivateMenu = forceInactivateMenu;
	this.inactivateMenu = inactivateMenu;
	this.activateMenu = activateMenu;
}


// global menu handler functions
function inactivateAllMenu() {
	for (i=0; i < menuArray.length; i++) {
		menuArray[i].forceInactivateMenu(true);
	}
}

function displayFlashObject( path, w, h, id, bg ) {
	if ( document.all ) {
		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="' + w + '" height="' + h + '" id="' + id + '" align="middle">');
		document.write('	<param name="allowScriptAccess" value="sameDomain">');
		document.write('	<param name="movie" value="' + path + '">');
		document.write('	<param name="quality" value="high">');
		document.write('	<param name="bgcolor" value="' + bg + '">');
		document.write('</object>');
	} else {
		document.write('<object data="' + path + '" width="' + w + '" height="' + h + '" id="' + id + '" type="application/x-shockwave-flash">');
		document.write('	<param name="quality" value="high">');
		document.write('	<param name="bgcolor" value="' + bg + '">');
		document.write('	<param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer">');
		document.write('</object>');
	}
}

function showGallery( oid ) {
	ww = 660;
	wh = 580;
	if ( screen.availWidth < ww ) {
		ww = screen.availWidth;
	}
	if ( screen.availHeight < wh ) {
		wh = screen.availHeight;
	}
	props = "toolbar=0,location=0,status=0,scrollbars=0,menubar=0,resizable=0,width=" + ww + ",height=" + wh + ",top=0,left=0";
	var gwin = window.open( "/gallery-frame.php?oid=" + oid, "GalleryPopup" + oid, props );
	gwin.focus();
}
