/*
 * imagene.jp usage Javascripts
 * http://www.imagene.jp/
 *
 * Copyright (c) 2009 imagene.jp
 */

$(document).ready(function() {

	//blog slide down
	$('.blog li').hover(
		function() {
			$(this).animate({
				height:"15em"
			}, "normal"
			).queue([]);
		},
		function() {
			$(this).animate({height:"4.8em"},"normal");
		}
	);

	$('#ticker marquee').marquee('pointer').mouseover(function () {
		$(this).trigger('stop');
	}).mouseout(function () {
		$(this).trigger('start');
	}).mousemove(function (event) {
		if ($(this).data('drag') == true) {
			this.scrollLeft = $(this).data('scrollX') + ($(this).data('x') - event.clientX);
		}
	}).mousedown(function (event) {
		$(this).data('drag', true).data('x', event.clientX).data('scrollX', this.scrollLeft);
	}).mouseup(function () {
		$(this).data('drag', false);
	});

	if(FlashPlayerVer() != 0) {
		//sebira
		var flashvars = {};
		var params = {
			wmode: "transparent",
			scale: "noscale"
		};
		var attributes = {};
		swfobject.embedSWF("/swf/sebira_2012valentine.swf", "sebira", "525", "210", "10.0.0", "/swf/expressInstall.swf", flashvars, params, attributes);
	} else {
		$("#sebira").css('background', 'url(/image/sebira/sebira_2012valentine.jpg)');
	}
});


function FlashPlayerVer(){
	//初期設定
	var flashplayer_ver = 0;
	//IE以外の場合
	if(navigator.plugins && navigator.mimeTypes['application/x-shockwave-flash']){
		var plugin = navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin;
		//Flash Playerがインストールされている場合
		if(plugin){flashplayer_ver = parseInt(plugin.description.match(/\d+\.\d+/));}
	}
	//IEの場合、もしくはFlash Playerがインストールされていない場合
	else{
	//IEでFlash Playerがインストールされている場合
		try{
		var flashOCX = new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").match(/([0-9]+)/);
		if(flashOCX){flashplayer_ver = parseInt(flashOCX[0]);}
		}catch(e){}
	}

	//Flash Playerがインストールされていない、もしくはバージョンが6以下の場合
	if(flashplayer_ver <= 6){flashplayer_ver = 0;}
		return flashplayer_ver;
} 

