// #################################################################################
// #	File Name	: willowbrookJ.js
// #	Project		: Web Site Localization
// #	System		: Willobrook Japanese Site
// #	Purpose		: Dynamic Contents Implementation
// #	Function	: setText, resumeText, swapCaps
// #	Model		: This program is based on the Document Object Model (DOM)
// #	Language	: JavaScript (Client Side Scripting. ver: 5.x)
// #	Include		: Not Specified
// #	Date Issued	: 2004/04/22(Thu)-03:00:29
// #	Base URL	: http://www.willowbrook.net.nz/
// #	Location	: Same as Base URL
// #	Usage		:
// #	Browsers	: IE, NN
// #	Requirement	: <img id='BIGPIC'> for the Large Picture image TAG
// #	Restriction	: A tag ID (eg.'BIGPIC') should be unique in the source file.
// #	Author		: Hiroto Sekine (Able LL Systems Dpt. CHC, NZL)
// #	Copyright	: (C) 2004 Southern Cross Virtual Co., Ltd. All Rights Reserved.
// #	Contact		: info@all.co.nz
// #	Tab Stop	: 4 (Suitable TAB stop size to view this Source Code)
// # ===============================================================================
// #	** Revision **
// # Date	Description												Sign	  Mark
// # ------+-------------------------------------------------------+---------+------
// #
// #################################################################################
@set @DEBUG = 0	// Program Debug Flag: ON(=1)/OFF(=0)

// ******************************************************************
// *	Common Use Global Variables Definition
// ******************************************************************

var	DOC = document.all;	// Document Object Collection
var saveText = "";		// Original string data store

// ******************************************************************
// *	Staff Name Object Constructor
// ******************************************************************

function NP(JN, EN){
	this.Jname	= JN ;	// JN: Japanese Name String
	this.Ename	= EN ;	// EN: English  Name String
}

function makeNP(){
	var	i = 0;
	this[i++] = new NP("ロイ＆タマキ・ルウェリン", "Roy & Tamaki Llewellyn");
	this[i++] = new NP("ケイト＆アラン・ラムジィ", "Kate & Allan Ramsay");
	this.length = i;
}

var	staffNames = new makeNP();

function setInitialName(SID, idx, lang){
	idx = (((0 <= idx) && (idx < staffNames.length)) ? idx : 0);
	var x = DOC[ SID ];
	if (x != null){
		x.innerText = ((lang == 'J') ? staffNames[idx].Jname : staffNames[idx].Ename);
	}
}
function findStaffName( sName ){
	for (var i=0; i<staffNames.length; i++){
		if ( staffNames[i].Jname.indexOf(sName) != -1 ){
			return( staffNames[i].Ename );
		} else if ( staffNames[i].Ename.indexOf(sName) != -1 ){
			return( staffNames[i].Jname );
		}
	}
	return sName;
}
function setText(){
	var e = event.srcElement;
	saveText = e.innerText;
	e.innerText = findStaffName(saveText);
}
function resumeText(){
	event.srcElement.innerText = saveText;
}
function swapImageCaps( SID ){
// SID: Target IMG Tag id (eg. BIGPIC)
	var	e = event.srcElement;
	var x = DOC[ SID ];
	if ((x != null) && (e.alt != "")){
		x.alt = e.alt;
	}
}

// #################################################################################
// #  << End of willowbrookJ.js >> (C) 2004 Southern Cross Virtual Co., Ltd. (v1.2)
// #################################################################################

