﻿/*
	title:			トップページに関する各種処理
	author:		T.Nagayama (WITHWIND)
	description:	トップページで必要な各種処理をおこなう
	history:		
	required:		jquery.js(jQuery core)
*/

/*jQueryのおまじない*/
//var wwjq=jQuery.noConflict();
/*コアクラスの設定*/
//var wwcore;
//if(!wwcore)wwcore={};

/*
	動画プレイヤー表示
	wwcore.Movie
*/

/*wwcore.MoviePlayer; if(!wwcore.MoviePlayer)wwcore.MoviePlayer={};

wwcore.MoviePlayer.init = function(){
	this.movie_file = "playlist.asx";
//	this.movie_path = "http://www.kunidukuri-hitodukuri.jp/web/videos/asx/";
	this.movie_path = "web/videos/asx/";
	this.movie_xs = 320;
	this.movie_ys = 240;
	this.TB = " />\n";	//for XHTML
	this.obj_id ="div#cmf_movie";

	//for private value
	this.movie_fullpath= this.movie_path + this.movie_file;
	this.movie_ys +=55;//wmp制御パネルエリア
}

wwcore.MoviePlayer.css = function(){
	wwjq(this.obj_id).width(this.movie_xs);
	wwjq(this.obj_id).height(this.movie_ys);
}

wwcore.MoviePlayer.object_tag = function(){
	var html = ""
	html  ='<object class="Player" data="'+ this.movie_fullpath +'" width="'+ this.movie_xs +'" height="'+ this.movie_ys +'" standby="Loading...">';
	html +='<param name="fileName" value="'+ this.movie_fullpath +'"'+ this.TB;
	html +='<param name="autoStart" value="true"'+ this.TB;
	html +='<param name="PlayCount" value="0"'+ this.TB;
	html +='<param name="ShowStatusBar" value="true"'+ this.TB;
	html +='<param name="showControls" value="true"'+ this.TB;
	html +='<param name="bgcolor" value="#000000"'+ this.TB;
	html +='</object>';
	
	return html;
}

wwcore.MoviePlayer.set = function(){
	//初期設定
	this.init();
	//CSS設定
	this.css();
	//タグ挿入
	wwjq(this.obj_id).append( this.object_tag() );
}
*/


/*
	新着情報スナップ画像
	wwcore.Snap
*/
if(!wwcore.Snap)wwcore.Snap={};

function onBefore(){
	wwjq("div#snap_msg").html(" " + "" + "<br />");
}
function onAfter(){
	wwjq("div#snap_msg").html(" " +this.title + "<br />");
}
wwcore.Snap.set=function(){
	wwjq("div#snap_images").css("display","block");
	wwjq("div#snap_images").cycle({
		fx: 'curtainX',
		before:onBefore,
		after:onAfter
	});
}


/*
	トップページＣＭ部分表示
	wwcore.cm
*/
if(!wwcore.cm)wwcore.cm={};
wwcore.cm.set = function(load_no){
	var openOnLoad_no = (load_no!=undefined)?(load_no):(1);
	wwjq("#cm_menu").hrzAccordion({
//			containerClass			: "hrzContainer",
//			listItemClass				: "listItem",
//			contentStartClass		: "contentStart",
//			contentEndClass			: "contentEnd",
//			contentWrapper			: "contentWrapper",
//			contentInnerWrapper		: "contentInnerWrapper",
//			handleClass				: "handle",
//			handleClassOver			: "handleOver",
//			handleClassSelected		: "handleSelected",
//			handlePosition			: "left",
//			closeEaseAction			: "backin",
//			closeEaseSpeed			: 500,
//			openEaseAction			: "easein",
//			openEaseSpeed			: 500,
			openOnLoad				: openOnLoad_no
			});
	wwjq("#cm_menu").css("visibility","visible");
	
	this.setlink();
}
wwcore.cm.setlink = function(){
	wwjq("a.cm_menu_img_link")
			.bind('mouseover', this.setlinkenter)
			.bind('mouseout', this.setlinkexit);
}
wwcore.cm.setlinkenter = function(){
	wwjq(this).addClass("cm_menu_img_link_ON");
}
wwcore.cm.setlinkexit = function(){
	wwjq(this).removeClass("cm_menu_img_link_ON");
}



/*処理実行*/
wwjq(function (){
	/*wwcore.MoviePlayer.set();*/
	wwcore.Snap.set();
	/*wwcore.cm.set(7);*/
});

/*文字点滅*/
var mode=0;
function disp(){
	mode=1-mode;
	setTimeout("disp()",800);
	if(navigator.appName.charAt(0)=="M"){
		if (mode == 1){ 
			document.all.blink.style.visibility='hidden'; 
		} else { 
			document.all.blink.style.visibility='visible'; 
		}
	}
}


