/**
 * @author keisuke
 */
/*
function hello(){
	alert("hello");
}
*/
// ------------------------------------------
// initialize index.html
ID_TOP_LOGO = "top_logo";
ID_TOP_BASEPATTERN = "top_basepattern";
ID_TOP_COPY = "top_copy_0";
//
function init_index(){
	//
	appearFromNoneHalf( "top_logo", 0.25, BASIC_DURATION );
	//
	appearFromNoneHalf_BP( "top_basepattern", 1.5, BASIC_DURATION );
	//
	appearFromNone( "top_copy_0", 2.5, BASIC_DURATION );	
}

// ------------------------------------------
// initialize ordinary pages.
// ** dummy for editing page **
/*
function init_common( tag_opening_title, tag_contents, tag_basepattern ){
	//
    //alert(tag_basepattern );
    //
	//appearAndHide( tag_opening_title, 0.1, 0.1 );
	//

// comment out this block for editing
//	if(tag_basepattern != ''){
//	    appearFromNone( tag_basepattern, 1.0, BASIC_DURATION );		
//	}

	//
	appearFromNone( tag_contents, 0.0, 0.0 );
	//appearFromNone( tag_contents, 1.0, BASIC_DURATION );	
}
*/
function init_common( tag_opening_title, tag_contents, tag_basepattern ){
	//
    //alert(tag_basepattern );
    //
	appearAndHide( tag_opening_title, 0.1, 0.1 );
	//
	if(tag_basepattern != ''){
	    appearFromNone( tag_basepattern, 1.0, BASIC_DURATION );		
	}
	//
	appearFromNone( tag_contents, 1.0, BASIC_DURATION );	
}


// ------------------------------------------
// initialize works.html
//
TAG_WORKS_DOOR_0 = "door_0";
TAG_WORKS_DOOR_2 = "door_2";
//
TAG_WORKS_DOOR_0_VALU_X = -215;
TAG_WORKS_DOOR_2_VALU_X =  220;
//
TAG_WORKS_MESSAGE = "works_mess";
//
function init_works( tag_opening_title, tag_contents ){
	
	// opelate opening title, page title only.
    init_common( tag_opening_title, tag_contents, '' );
	
	// prepare string "click the cathegory you want to see" to be appeared.
    appearFromNone( TAG_WORKS_MESSAGE, 1.75, BASIC_DURATION ); 
    
	// ----------------------------------
	// appear doors
	//
	// as layer
	appearFromNone( "layer_2_wor", 1.0, 1.0 );	
	// each doors individualy
	/*
	appearFromNone( "door_0", 1.0, 1.0 );
	appearFromNone( "door_1", 1.0, 1.0 );
	appearFromNone( "door_2", 1.0, 1.0 );
	*/
	
	// move doors
	move( TAG_WORKS_DOOR_0, 0, TAG_WORKS_DOOR_0_VALU_X, 1.0, 1.0);
	move( TAG_WORKS_DOOR_2, 0, TAG_WORKS_DOOR_2_VALU_X, 1.0, 1.0 );
}
// ------------------------------------------
// initialize staff.html
//
TAG_STAFF_0 = "staff_face_0";
TAG_STAFF_1 = "staff_face_1";
TAG_STAFF_2 = "staff_face_2";
//
TAG_STAFF_LAYER_FACES = "layer_2_sta";
TAG_STAFF_LAYER_TEXTS = "layer_3_sta";
//
TAG_STAFF_LAYER_FACE_0 = "staff_face_0";
TAG_STAFF_LAYER_FACE_1 = "staff_face_1";
TAG_STAFF_LAYER_FACE_2 = "staff_face_2";
//                 // width of column + adjust
TAG_STAFF_0_VALU_X = ( -280 - 60);
TAG_STAFF_0_VALU_Y = 0;
//
TAG_STAFF_1_VALU_X = ( -60 );
TAG_STAFF_1_VALU_Y = 0;
//
TAG_STAFF_2_VALU_X = ( 280 - 60 );
TAG_STAFF_2_VALU_Y = 0;
//
function init_staff( tag_opening_title, tag_contents ){
	//
	// opelate opening title, page title only.
    init_common( tag_opening_title, tag_contents, '' );
	//
	
    //---------------------------------------
	// set text layer to be hided and appeared.
	appearFromNone( TAG_STAFF_LAYER_TEXTS, 2.0, BASIC_DURATION ); 
	// for editing 
	//appearFromNone( TAG_STAFF_LAYER_TEXTS, 0.0, 0.0 );

    //---------------------------------------
	// appear each staffcases
	appearFromNone( TAG_STAFF_LAYER_FACE_0, 1.0, 2.0 );	
	appearFromNone( TAG_STAFF_LAYER_FACE_1, 1.0, 2.0 );		
	appearFromNone( TAG_STAFF_LAYER_FACE_2, 1.0, 2.0 );
				
    //---------------------------------------
	// move each staffcases
	//
    move( TAG_STAFF_0, TAG_STAFF_0_VALU_Y, TAG_STAFF_0_VALU_X, 1.0, 1.5 );
	//
	move( TAG_STAFF_1, TAG_STAFF_1_VALU_Y, TAG_STAFF_1_VALU_X, 1.0, 1.5 );
	//
	move( TAG_STAFF_2, TAG_STAFF_2_VALU_Y, TAG_STAFF_2_VALU_X, 1.0, 1.5 );
}
// // // // // // // // // // // // // // //
// effect

// ------------------------------------------
// appear and hide
//
// duration of appear and hide effect.
var BASIC_DURATION = 1.0;//0.5;
//
// delay_time:start to show  // duration_showing: duration the object can be seen.
function appearAndHide( tag_id, delay_time, duration_showing ){
	// appear from none.
	appearFromNone( tag_id, delay_time, BASIC_DURATION );
	// hide 
	hideToNone( tag_id, delay_time + BASIC_DURATION + duration_showing );
}
//
function appearFromNone( tag_id, delay_time, duration ){
	//$(tag_id).style.display = "none";
    new Effect.Appear(tag_id, {from: 0.0, to: 1.0, delay:delay_time, duration: duration });	
}
//
function appearFromNoneHalf( tag_id, delay_time, duration ){
	//$(tag_id).style.display = "none";
    new Effect.Appear(tag_id, {from: 0.0, to: 0.85, delay:delay_time, duration: duration });	
}
function appearFromNoneHalf_BP( tag_id, delay_time, duration ){
	//$(tag_id).style.display = "none";
    new Effect.Appear(tag_id, {from: 0.0, to: 0.70, delay:delay_time, duration: duration });	
}
//
function hideToNone( tag_id, delay_time ){
    new Effect.Fade(tag_id, {from: 1.0, to: 0.0, delay:delay_time, duration: BASIC_DURATION });	
}
// ------------------------------------------
// move
//
function move( tag_id,  value_y, value_x, duration_moving, delay_start  ){
    new Effect.MoveBy(tag_id, value_y, value_x, {duration: duration_moving, delay: delay_start});
}

