// getrdy_cnts.js
// $Revision: 1.1 $
var arrayTabOptions = new Array();
var arrayTabOptionLabels = new Array();
var arrayEachBriefOptions = new Array();
var arrayJammers = new Array();
var arrayShokushuSecondLevels = new Array();
var arrayJobtypeCrumb1sts = new Array();
var arrayJobtypeCrumb2nds = new Array();
var arrayJobtypeCrumb3rds = new Array();
var arrayJobtypeYajirushi1sts = new Array();
var arrayJobtypeYajirushi2nds = new Array();

var flgAlready = new Array();
// flgAlready[ 'jobtype' ] = 0;
flgAlready[ 'gystype' ] = 0;
// flgAlready[ 'knmtype' ] = 0;
// flgAlready[ 'shztype' ] = 0;

function OnClickDetailSearch() {
	LetVisible( 'bgbaseOption' );
	LetVisible( 'baseOption' );
	GetReadyJobtype();
	OnClickTabs( 'shokushu' );
	return( false );
}

function OnClickTabs ( tabName ) {
	FlushArrayBGColor( arrayTabOptions, '#009933' );
	FlushArrayColor( arrayTabOptionLabels, '#ffffff' );
	LetInvisibleArray( arrayEachBriefOptions );
	LetDisplayNoneArray( arrayEachBriefOptions );
	SetBGColor( tabName + 'TabOption', '#ffffff' );
	SetColor( tabName + 'TabOptionLabel', '#990099' );
	LetVisible( tabName + 'BriefOption' );
	LetDisplayAsBlock( tabName + 'BriefOption' );
	return( false );
}

function GetReadyContents () {
	var d = document;
	var allElements;
	allElements=d.all || d.getElementsByTagName("*");
	for(var i=0,len=allElements.length; i<len; i++) {
		if(allElements[i].className=='tabOption') {
			arrayTabOptions.push( allElements[i].id );
		}
		if(allElements[i].className=='tabOptionLabel') {
			arrayTabOptionLabels.push( allElements[i].id );
		}
		if(allElements[i].className=='eachBriefOption') {
			arrayEachBriefOptions.push( allElements[i].id );
		}
		if(allElements[i].className=='jammer') {
			arrayJammers.push( allElements[i] );
		}
	}

	return( false );
}

function GetReadyJobtypeThirdLevel ( strCode ) {
	LetDisplayNone( 'shokushuThirdLevelWarning' );
	document.getElementById( 'thirdSelectionJobtype' ).innerHTML =
	MkHtmlFromHash(
		jC,
		jN,
		strCode,
		shokushuThirdLevelTemplate,
		shokushuEachEntryTemplateOfLevel[ 3 ],
		''
	);
	SetBGColor( 'columnOfSecondSelectionJobtype', '#ddf5dd' );
	FlushClassBGColor( 'jobtypeCrumb2nd', '#ddf5dd' );
	LetInvisibleByClass( 'jobtypeYajirushi2nd' );
	LetVisible( 'jobtypeYajirushiFrom' + strCode );
	SetBGColor( 'jobtypeCrumb' + strCode, '#e8ffdb' );
	SetBGColor( 'columnOfThirdSelectionJobtype', '#e8ffdb' );
	FlushClassBGColor( 'jobtypeCrumb3rd', '#e8ffdb' );
	return( false );
}

function GetReadyJobtypeSecondLevel ( strCode ) {
	LetDisplayNone( 'shokushuSecondLevelWarning' );
	document.getElementById( 'secondSelectionJobtype' ).innerHTML =
		MkHtmlFromHash(
			jC,
			jN,
			strCode,
			shokushuSecondLevelTemplate,
			shokushuEachEntryTemplateOfLevel[ 2 ],
			''
		);
	document.getElementById( 'thirdSelectionJobtype' ).innerHTML = '';
	LetDisplayAsBlock( 'shokushuThirdLevelWarning' );
	FlushClassBGColor( 'jobtypeCrumb1st', '#ddf5dd' );
	LetInvisibleByClass( 'jobtypeYajirushi1st' );
	LetVisible( 'jobtypeYajirushiFrom' + strCode );
	SetBGColor( 'jobtypeCrumb' + strCode, '#e8ffdb' );
	SetBGColor( 'columnOfSecondSelectionJobtype', '#e8ffdb' );
	SetBGColor( 'columnOfThirdSelectionJobtype', '#ddf5dd' );
	FlushClassBGColor( 'jobtypeCrumb2nd', '#e8ffdb' );
	return( false );
}

function GetReadyJobtype () {
	SetContent(
		'topSelectionJobtype',
		MkHtmlFromHash(
			jC,
			jN,
			'1000000',
			shokushuTopLevelTemplate,
			shokushuEachEntryTemplateOfLevel[ 1 ],
			''
		)
	);
	document.getElementById( 'secondSelectionJobtype' ).innerHTML = '';
	document.getElementById( 'thirdSelectionJobtype' ).innerHTML = '';
	LetDisplayAsBlock( 'shokushuSecondLevelWarning' );
	LetDisplayAsBlock( 'shokushuThirdLevelWarning' );
	SetBGColor( 'columnOfSecondSelectionJobtype', '#ddf5dd' );
	return( false );
}

function GetReadyGystypeSecondLevel ( strCode ) {
	LetDisplayNone( 'gyoushuSecondLevelWarning' );
	document.getElementById( 'secondSelectionGystype' ).innerHTML =
		MkHtmlFromHash(
			gC,
			gN,
			strCode,
			gyoushuSecondLevelTemplate,
			gyoushuEachEntryTemplateOfLevel[ 2 ],
			''
		);
	FlushClassBGColor( 'gystypeCrumb1st', '#ddf5dd' );
	LetInvisibleByClass( 'gystypeYajirushi1st' );
	LetVisible( 'gystypeYajirushiFrom' + strCode );
	SetBGColor( 'gystypeCrumb' + strCode, '#e8ffdb' );
	SetBGColor( 'columnOfSecondSelectionGystype', '#e8ffdb' );
//	FlushClassBGColor( 'jobtypeCrumb2nd', '#e8ffdb' );
	return( false );
}


function GetReadyGystype () {
//	if ( flgAlready[ 'gystype' ] != 0 ) {
//		return( false );
//	}
//	flgAlready[ 'gystype' ] = 1;
	SetContent(
		'topSelectionGystype',
		MkHtmlFromHash(
			gC,
			gN,
			'10000',
			gyoushuTopLevelTemplate,
			gyoushuEachEntryTemplateOfLevel[ 1 ],
			''
		)
	);
	document.getElementById( 'secondSelectionGystype' ).innerHTML = '';
	LetDisplayAsBlock( 'gyoushuSecondLevelWarning' );
	SetBGColor( 'columnOfSecondSelectionGystype', '#ddf5dd' );
	return( false );
//	var secondDivs = '';
	var secondDivs = document.getElementById( 'secondSelectionGystype' ).innerHTML;
	var arrayDivsData = gC[ '10000' ].split( ',,' );
	for( var i=0; i<arrayDivsData.length; i++ ) {
		var arrayEachDivsData = arrayDivsData[ i ].split( '::' );
		secondDivs = secondDivs +
			MkHtmlFromHash(
				gC,
				gN,
				arrayEachDivsData[ 0 ],
				gyoushuSecondLevelTemplate,
				gyoushuEachEntryTemplateOfLevel[ 2 ],
				''
			);
	}
	SetContent(
		'secondSelectionGystype',
		secondDivs
	);
}
