﻿// Properties.
var f;
var v;
var isGecko = (navigator.userAgent.indexOf("Gecko") != -1) ? true : false;

// Wheel Event.
if(window.addEventListener) window.addEventListener('DOMMouseScroll', wheelHandler, false);
window.onmousewheel = document.onmousewheel = wheelHandler;
function wheelHandler(e){
	if (!e) e = window.event;
	if(v){
		if (e.preventDefault) e.preventDefault();
		e.returnValue = false;
	}
}

// Global Functions.
function createFlash(){
	// getting flashvars value.
	var _ls = location.search;
	if( 0 < _ls.length ) f = _ls.substr(1,_ls.length);
	// create object.
	if (AC_FL_RunContent == 0) {
		alert("このページでは \"AC_RunActiveContent.js\" が必要です。");
	} else {
		var ver = DetectFlashVer(9,0,115);
		if(ver){
			AC_FL_RunContent(
				'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
				'width', '1000px',
				'height', '100%',
				'src', 'http://player.dai2ntv.jp/dai2ntv/player/CoDai2NtvB',
				'quality', 'high',
				'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
				'align', 'middle',
				'play', 'true',
				'loop', 'true',
				'scale', 'showall',
				'wmode', (isGecko?'transparent':"window"),
				'devicefont', 'false',
				'id', 'CoDai2Ntv',
				'bgcolor', '#ffffff',
				'name', 'CoDai2NtvB',
				'menu', 'true',
				'allowFullScreen', 'true',
				'allowScriptAccess','always',
				'movie', 'http://player.dai2ntv.jp/dai2ntv/player/CoDai2NtvB',
				'flashvars',(f||''),
				'salign', ''
			);
			if( -1 < f.indexOf("item_id") ){
				var _id = f.match(/item_id=(.+)&*/)[1];
				if(_id) document.write("<img src='http://www.teamlab-recommend.jp/dai2ntv/beacon.gif?item="+_id+"'width='1'height='1'>");
			}
		}else{
			flashUpgrade();
		}
	}
}
function cH(h){
	document.getElementById("contents").style.height=h+"px";
	if(isIE)document.getElementById("CoDai2NtvB").style.height=h+"px";
}
function vv(b){v=b}