/*
	title:			
	author:		T.Nagayama (WITHWIND)
	description:	
	history:		
	required:		jquery.js(jQuery core)
*/

/*jQueryのおまじない*/
//var wwjq=jQuery.noConflict();
/*コアクラスの設定*/
//var wwcore;
//if(!wwcore)wwcore={};

/*
	「人類の進むべき道」Flashタグ挿入
	wwcore.PresiFlash
*/
wwcore.PresiFlash; if(!wwcore.PresiFlash)wwcore.PresiFlash={};

wwcore.PresiFlash.init = function(){
	this.swf_file = "top.swf";
//	this.swf_path = "http://www.kunidukuri-hitodukuri.jp/web/president/flash/";
	this.swf_path = "flash/";
	this.swf_xs = 400;
	this.swf_ys = 400;
	this.TB = " />\n";	//for XHTML
	this.obj_id ="div#cmf_presi_flash";

	//for private value
	this.swf_fullpath= this.swf_path + this.swf_file;
}

wwcore.PresiFlash.css = function(){
	wwjq(this.obj_id).width(this.swf_xs);
	wwjq(this.obj_id).height(this.swf_ys);
}

wwcore.PresiFlash.set_ObjctTag = function(){
	var html = ""
	html  ='<object class="Flash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+ this.swf_xs +'" height="'+ this.swf_ys +'" >';
	html +='<param name="movie" value="'+ this.swf_fullpath +'"'+ this.TB;
	html +='<param name="quality" value="high"'+ this.TB;
	html +='<embed src="'+ this.swf_fullpath +'"  width="'+ this.swf_xs +'" height="'+ this.swf_ys +'" name="quality" value="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" '+ this.TB;
	html +='</object>';
	
	return html;
}

wwcore.PresiFlash.set = function(){
	//初期設定
	this.init();
	//CSS設定
	this.css();
	//タグ挿入
	wwjq(this.obj_id).append( this.set_ObjctTag() );
}


/*
	写真ライブラリ用
	wwcore.PresiPhoto
*/
wwcore.PresiPhoto; if(!wwcore.PresiPhoto)wwcore.PresiPhoto={};

function PresiPhoto_onBefore(){
	wwjq("div#presi_photo_msg").html(" " + "" + "<br />");
	wwjq("div#presi_photo_img").height(this.height);
	wwjq("div#presi_photo").height(this.height);
}
function PresiPhoto_onAfter(){
	wwjq("div#presi_photo_msg").html(" " +this.alt + "<br />");
	wwjq("div#presi_photo_img").height(this.height);
}
wwcore.PresiPhoto.set=function(){
	wwjq("div#presi_photo_img").css("display","block");
	wwjq("div#presi_photo_img").cycle({
		fx: 'fade',
		speed: 'fast', 
		timeout: 0, 
		pager:'#presi_photo_navi',
		before:PresiPhoto_onBefore,
		after:PresiPhoto_onAfter,
		pagerAnchorBuilder: function(idx,slide){
			return '#presi_photo_navi li:eq(' + (idx) + ') a';
		}
	});
}



/*処理実行*/
wwjq(function (){
	wwcore.PresiFlash.set();
	wwcore.PresiPhoto.set();
});





