IMGBASE='/home/image/';
sel='home';
selimg=null;
function chgImg( img, name, flg ) {
	switch( flg ) {
	case 0:
		img.src=IMGBASE+name+'02.gif';
		break;
	case 1:
		if ( name == sel ) {
			img.src=IMGBASE+name+'03.gif';
		} else {
			img.src=IMGBASE+name+'01.gif';
		}
		break;
	case 2:
		img.src=IMGBASE+name+'03.gif';
		if ( selimg == null ) {
			selimg=document.imghome;
		}
		if ( name != sel && selimg != null ) {
			selimg.src=IMGBASE+sel+'01.gif';
		}
		sel=name;
		selimg = img;
		break;
	}
}

var imgs = new Array(
	'home01.gif', 'home02.gif', 'home03.gif',
	'product01.gif', 'product02.gif', 'product03.gif',
	'vfx01.gif', 'vfx02.gif', 'vfx03.gif',
	'company01.gif', 'company02.gif', 'company03.gif',
	'recruit01.gif', 'recruit02.gif', 'recruit03.gif',
	'link01.gif', 'link02.gif', 'link03.gif',
	'contact01.gif', 'contact02.gif', 'contact03.gif',
	'try01.gif', 'try02.gif', 'try03.gif'
);

window.onload = InitMenu;
function InitMenu() {
	preloadImage( IMGBASE, imgs );
	//parent.main.document.location='home/index.html';

	var loc = window.location.toString();
	if ( loc.indexOf( "/product/", 0 ) == 25 ) {
		chgImg( document.getElementById( "imgprd" ), 'product', 2 ); 
	} else
	if ( loc.indexOf( "/company/", 0 ) == 25 ) {
		chgImg( document.getElementById( "imgcmp" ), 'company', 2 ); 
	} else
	if ( loc.indexOf( "/recruit/", 0 ) == 25 ) {
		chgImg( document.getElementById( "imgrec" ), 'recruit', 2 ); 
	} else
	if ( loc.indexOf( "/support/", 0 ) == 25 ) {
		chgImg( document.getElementById( "imgcon" ), 'contact', 2 ); 
	} else
	if ( loc.indexOf( "/link/", 0 ) == 25 ) {
		chgImg( document.getElementById( "imglink" ), 'link', 2 ); 
	} else {
		chgImg( document.getElementById( "imghome" ), 'home', 2 ); 
	}
}

