
//
//  CPLightBox Class (CPLightBox.css) ver 1.3.a
//
//  Created by Jun.S on 2009.04.01 modified 2010.02.07
//  CPLightBox Copyright 2009 Commons Plus and AltSwitch.
//  http://www.coplus.co.jp/
//  http://www.altswitch.com/
//  This script is licensed under the Creative Commons Attribution 3.0 License
//  http://creativecommons.org/licenses/by-sa/3.0/
//

// SETTING
/////////////////////////////////////////////////
var flashSetting = {
	//flvPlayer path
	playerPath: "../../common/images/flvPlayer.swf",
	controllerPath: "../../common/images/ClearOverPlaySeekMute.swf",
	//"Please install plug-in." images directory
	defaultImgDir: "../../common/images/",
	//Flash version request
	flashVersion: 9 
};

var wordsSetting = {
	next: "NEXT >>",
	prev: "<< PREV",
	close: "×"
};


// CPLightBox Class
/////////////////////////////////////////////////
var _cplightbox;
function CPLightBox() {
	this.initialize.apply(this, arguments);
}

CPLightBox.prototype = {
	initialize: function() {
		_cplightbox = this;
		
		this._Event = {
			addListener: function(element, type, callback) {
				var obj = new Object();
				type = type.toLowerCase();
				
				var eventFunc = this.getEventObject;
				
				//if (element.addEventListener) element.addEventListener(type, function(e) {callback(eventFunc(e));}, false);
				//else if (element.attachEvent) element.attachEvent('on' + type, function() {callback(eventFunc());});
				if (element.addEventListener) element.addEventListener(type, callback, false);
				else if (element.attachEvent) element.attachEvent('on' + type, callback);
			},
			
			removeListener: function(element, type, callback) {
				type = type.toLowerCase();
				if (element.removeEventListener) element.removeEventListener(type, callback, false);
				else if (element.detachEvent) element.detachEvent('on' + type, callback);
			},
			
			getEventObject: function(e) {
				if(e) {
					return {
						type: e.type,
						target: e.target,
						mouseX: e.pageX,
						mouseY: e.pageY,
						screenX: e.screenX,
						screenY: e.screenY
					};
				} else {
					return {
						type: window.event.type,
						target: window.event.srcElement,
						mouseX: window.event.x + document.body.scrollLeft,
						mouseY: window.event.y + document.body.scrollTop,
						screenX: window.event.screenX,
						screenY: window.event.screenY
					};
				}
			}
		};
		
		this.isSafari = (navigator.appVersion.indexOf("Safari") != -1) ? true : false;
		this.isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
		this.isIE8 = (navigator.appVersion.indexOf("MSIE 8") != -1) ? true : false;
		this.isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
		this.isWinIE = (this.isIE == true && this.isWin == true) ? true : false;
		this.isMacSafari = (this.isSafari == true && this.isWin == false) ? true : false;
		
		this.ieHeight = 0;
		this.lightBoxArray = new Object();
		
		this._Event.addListener(window, "load", this.init);
		this._Event.addListener(window, "resize", this._winResizeAction);
	},


	init: function() {
		_cplightbox._setLBEvent();
	},
	
	
	_setLBEvent: function() {
		if (!document.getElementsByTagName) return;
		
		var linkArray = document.getElementsByTagName("a");
		var obj = new Array();
		var group = new Array();
		var file = new Array();
		var value = new Array();
		var size = new Array();
		
		this.lightBoxArray.obj = new Array();
		this.lightBoxArray.group = new Array();
		this.lightBoxArray.file = new Array();
		this.lightBoxArray.value = new Array();
		this.lightBoxArray.size = new Array();
		
		for (var i = 0; i < linkArray.length; i++) {
			var rel = (linkArray[i].getAttribute("rel")) ? linkArray[i].getAttribute("rel") : "none";
			
			if (rel.indexOf("cplbox") != -1) {
				obj.push(linkArray[i]);
				if (rel == "cplbox") group.push("");
				if (rel != "cplbox") group.push(rel.split("[")[1].split("]")[0]);
				file.push(linkArray[i].href);
				value.push(linkArray[i].title);
				size.push(linkArray[i].getAttribute("cplbsize"));
			}
		}
		
		var grpName = group[0];
		var grpNameArray = new Array(grpName);
		var same;
		for (var i = 0; i < obj.length; i ++) {
			if (grpName != group[i]) {
				same = 0;
				for (var j = 0; j < grpNameArray.length; j++) {
					if (grpNameArray[j] != group[i]) same++;
				}
				
				if (same == grpNameArray.length) grpNameArray.push(group[i]);
			}
		}
		
		for (var i = 0; i < grpNameArray.length; i++) {
			for (var j = 0; j < obj.length; j++) {
				if (grpNameArray[i] == group[j]) {
					this.lightBoxArray.obj.push(obj[j]);
					this.lightBoxArray.group.push(group[j]);
					this.lightBoxArray.file.push(file[j]);
					this.lightBoxArray.value.push(value[j]);
					this.lightBoxArray.size.push(size[j]);
				}
			}
		}
		
		delete obj;
		delete group;
		delete file;
		delete value;
		delete size;
		
		for (var i = 0; i < this.lightBoxArray.obj.length; i++) {
			this.lightBoxArray.obj[i].setAttribute("href", "javascript:void(0);");
			var func = this._retrunFunc("_setupLightBox", i);
			this._Event.addListener(this.lightBoxArray.obj[i], "click", func);
		}
		this._imgPreloader();
	},
	
	
	_setupLightBox: function(num) {
		var objBody = document.getElementsByTagName("body");
		var targetObj = objBody[0];
		
		var objLightBox = document.createElement("div");
		objLightBox.setAttribute("id", "LB_DivBox");
		
		var objLightBoxOverray = document.createElement("div");
		objLightBoxOverray.setAttribute("id", "LB_Overray");
		this._Event.addListener(objLightBoxOverray, "click", this._closeLightBox);
		
		var objContentsContainer = document.createElement("div");
		objContentsContainer.setAttribute("id", "LB_ContentsContainer");
		
		var objContents = this._createContents(num);
		
		objContentsContainer.appendChild(objContents);
		objLightBox.appendChild(objLightBoxOverray);
		objLightBox.appendChild(objContentsContainer);
		targetObj.appendChild(objLightBox);
	
		this._setupLightBoxSize();
		this._showContents();
	},
	
	
	_setupLightBoxSize: function(){
		var arrayPageSize = this._getPageSize();
		var divLightBoxHeight = (arrayPageSize[1] > arrayPageSize[3]) ? arrayPageSize[1] : arrayPageSize[3];
		var divLightBoxWidth = (arrayPageSize[0] > arrayPageSize[2]) ? arrayPageSize[0] : arrayPageSize[2];
		
		if (this.isIE) {
			var newHeight;
			if (document.getElementById("LB_ContentsContainer").style.top != "") {
				newHeight = document.getElementById("LB_ContentsContainer").clientHeight + Number(document.getElementById("LB_ContentsContainer").style.top.split("px")[0]) + 30;
			} else {
				newHeight = divLightBoxHeight;
			}
			
			newHeight = (this.ieHeight > newHeight) ? this.ieHeight : newHeight;
			if (newHeight > divLightBoxHeight) {
				divLightBoxHeight = newHeight;
				this.ieHeight = divLightBoxHeight;
			}
		}
		
		document.getElementById("LB_Overray").style.height = divLightBoxHeight + "px";
		document.getElementById("LB_Overray").style.width = divLightBoxWidth + "px";
		
		if (!document.getElementById("LB_Overray").style.opacity) {
			this._fadeBackground(document.getElementById("LB_Overray"), "in");
		}
	},
	
	
	_showContents: function() {
		setPos = function() {
			var imageWidth = document.getElementById("LB_Contents").childNodes[0].clientWidth;
			if (imageWidth == 0) imageWidth = document.getElementById("LB_Contents").clientWidth;
			var imageHeight = document.getElementById("LB_ContentsContainer").childNodes[0].clientHeight;
			var scrollTop  = document.body.scrollTop || document.documentElement.scrollTop;
			var winHeight = _cplightbox._getPageSize()[3];
			var marginTop = (winHeight > imageHeight + 100) ? Math.round((winHeight - imageHeight) / 3) : 10;
			
			document.getElementById("LB_ContentsContainer").style.width = imageWidth + "px";
			if (_cplightbox.isIE) {
				document.getElementById("LB_ContentsContainer").style.position = "relative";
				document.getElementById("LB_ContentsContainer").style.top = marginTop + scrollTop + "px";
			} else {
				document.getElementById("LB_ContentsContainer").style.marginTop = marginTop + scrollTop + "px";
			}
			
			document.getElementById("LB_ContentsContainer").style.visibility = "visible";
			_cplightbox._setupLightBoxSize();
			
			if (document.getElementById("LB_Contents").childNodes[0].tagName == "IMG" || document.getElementById("LB_Contents").childNodes[0].tagName == "IFRAME") {
				document.getElementById("LB_Contents").childNodes[0].style.opacity = 0;
				document.getElementById("LB_Contents").childNodes[0].style.filter = "alpha(opacity=0)";
				document.getElementById("LB_Contents").style.visibility = "visible";
				_cplightbox._fadeinPhoto(document.getElementById("LB_Contents").childNodes[0]);
			} else {
				document.getElementById("LB_Contents").style.visibility = "visible";
			}
			document.getElementById("LB_ContentsClose").style.display = "block";
		}
		
		setTimeout(setPos, 700);	
	},
	
	
	_fadeBackground: function(eml, type) {
		var baseOpacity = (type == "in") ? 0 : 8;
		var targetOpacity = (type == "in") ? 8 : 0;
		
		setOpac = function() {
			if (type == "in") {
				if(baseOpacity < targetOpacity){
					baseOpacity += 1;
					eml.style.filter = 'alpha(opacity=' + (baseOpacity * 10) + ')';
					eml.style.opacity = baseOpacity / 10;
				} else {
					clearInterval(interval);
				}
			} else {
				if(baseOpacity > targetOpacity){
					baseOpacity -= 2;
					eml.style.filter = 'alpha(opacity=' + (baseOpacity * 10) + ')';
					eml.style.opacity = baseOpacity / 10;
				} else {
					_cplightbox._removeLightBox();
					clearInterval(interval);
				}
			}
		};
		
		var interval = setInterval(setOpac, 40);
	},
	
	
	_fadeinPhoto: function(eml) {
		var opacity = 0;
		
		setOpac = function() {
			if(opacity < 10){
				opacity += (11 - opacity) * 0.12;
				opacity = Math.round(opacity * 10) / 10;
				opacity = (opacity > 10) ? 10 : opacity
				eml.style.filter = 'alpha(opacity=' + (opacity * 10) + ')';
				eml.style.opacity = opacity / 10;
			} else {
				clearInterval(interval);
			}
		};
		
		var interval = setInterval(setOpac, 40);
	},
	
	
	_createContents: function(num) {
		var extension = this.lightBoxArray.file[num].split(".");
		extension = extension[extension.length - 1];
		var fileType = this._checkFileType(extension);
		var objContents = document.createElement("div");
		objContents.setAttribute("id", "LB_Contents");
		objContents.style.visibility = "hidden";
		
		switch (fileType) {
			case ("img") : {
				var objImg = document.createElement("img");
				objImg.setAttribute("src", this.lightBoxArray.file[num]);
				objImg.setAttribute("title", this.lightBoxArray.value[num]);
				objImg.setAttribute("alt", this.lightBoxArray.value[num]);
				objContents.appendChild(objImg);
			}
			break;
			
			case ("flv") : {
				var swfPath = flashSetting.playerPath;
				var flvPath = this.lightBoxArray.file[num];
				var sizeX = this.lightBoxArray.size[num].split("x")[0];
				var sizeY = this.lightBoxArray.size[num].split("x")[1];
				var vars = "";
				vars += "&flvPath=" + flvPath;
				vars += "&sizeX=" + sizeX;
				vars += "&sizeY=" + sizeY;
				vars += "&controllerPath=" + flashSetting.controllerPath;
				
				var contentsHTML = this._embedSwf(swfPath, sizeX, sizeY, "LB_SWF", vars);
				objContents.innerHTML = contentsHTML;
				objContents.style.width = sizeX + "px";
			}
			break;
			
			case ("swf") : {
				var swfPath = this.lightBoxArray.file[num];
				var sizeX = this.lightBoxArray.size[num].split("x")[0];
				var sizeY = this.lightBoxArray.size[num].split("x")[1];
				var vars = "";
				
				var contentsHTML = this._embedSwf(swfPath, sizeX, sizeY, "LB_SWF", vars);
				objContents.innerHTML = contentsHTML;
				objContents.style.width = sizeX + "px";
			}
			break;
			
			case ("html") : {
				var crossDomain = this._checkCrossDomein(this.lightBoxArray.file[num]);
				var objIFrame = document.createElement("iframe");
				if (!crossDomain) objIFrame.setAttribute("src", this.lightBoxArray.file[num]);
					else objIFrame.setAttribute("src", document.URL);
				objIFrame.setAttribute("width", this.lightBoxArray.size[num].split("x")[0]);
				objIFrame.setAttribute("height", this.lightBoxArray.size[num].split("x")[1]);
				objIFrame.setAttribute("id", "LB_IFRAME");
				if (this.isIE) objIFrame.frameBorder = 0;
				objContents.appendChild(objIFrame);
			}
			break;
		}
		
		var objPrev = document.createElement("p");
		objPrev.className = "LB_PrevBtn";
		if ((this.lightBoxArray.obj.length > 1 && num != 0) && (this.lightBoxArray.group[num] == this.lightBoxArray.group[num - 1])) {
			var objPrevA = document.createElement("a");
			objPrevA.setAttribute("href", "javascript:void(0);");
			objPrevA.innerHTML = wordsSetting.prev;
			
			var func = this._retrunFunc("_lbCtrlContents", "prev", num);
			this._Event.addListener(objPrevA, "click", func);
			objPrev.appendChild(objPrevA);
		}
		objContents.appendChild(objPrev);
		
		var objCaption = document.createElement("p");
		objCaption.className = "LB_Caption";
		objCaption.innerHTML = this.lightBoxArray.value[num];
		objContents.appendChild(objCaption);
		
		var objNext = document.createElement("p");
		objNext.className = "LB_NextBtn";
		if ((this.lightBoxArray.obj.length > 1 && num != this.lightBoxArray.obj.length - 1) && (this.lightBoxArray.group[num] == this.lightBoxArray.group[num + 1])) {
			var objNextA = document.createElement("a");
			objNextA.setAttribute("href", "javascript:void(0);");
			objNextA.innerHTML = wordsSetting.next;
			var func = this._retrunFunc("_lbCtrlContents", "next", num);
			this._Event.addListener(objNextA, "click", func);
			objNext.appendChild(objNextA);
		}
		objContents.appendChild(objNext);
		
		var objCloseBtn = this._createCloseBtn();
		objContents.appendChild(objCloseBtn);
		//this._Event.addListener(objContents, "mouseover", this._showCloseBtn);
		//this._Event.addListener(objContents, "mouseout", this._hideCloseBtn);
		
		return objContents;
	},
	
	
	_createCloseBtn: function() {
		var objCloseBtn = document.createElement("div");
		objCloseBtn.setAttribute("id", "LB_ContentsClose");
		
		var objClose = document.createElement("a");
		objClose.setAttribute("href", "javascript:void(0);");
		objClose.innerHTML = wordsSetting.close;
		this._Event.addListener(objCloseBtn, "click", this._closeLightBox);
		objCloseBtn.appendChild(objClose);
		
		return objCloseBtn;
	},
	
	
	_showCloseBtn: function() {document.getElementById("LB_ContentsClose").style.display = "block";},
	_hideCloseBtn: function() {document.getElementById("LB_ContentsClose").style.display = "none";},
	
	
	_checkFileType: function(extension) {
		var fileType;
		
		switch (extension) {
			case "jpg" : fileType = "img";
			break;
			
			case "png" : fileType = "img";
			break;
			
			case "gif" : fileType = "img";
			break;
			
			case "flv" : fileType = "flv";
			break;
			
			case "swf" : fileType = "swf";
			break;
			
			case "html" : fileType = "html";
			break;
			
			case "htm" : fileType = "html";
			break;
		}
		return fileType;
	},
	
	
	_imgPreloader: function() {
		var imgPath = new Array();
		var imgObj = new Array();
		
		for (var i = 0; i < this.lightBoxArray.file.length; i++) {
			var extension = this.lightBoxArray.file[i].split(".");
			extension = extension[extension.length - 1];
			var fileType = this._checkFileType(extension);
			if (fileType == "img") imgPath.push(this.lightBoxArray.file[i]);
		}
		
		for (var i = 0; i < imgPath.length; i++) {
			imgObj[i] = new Image();
			imgObj[i].src = imgPath[i];
		}
	},
	
	
	_winResizeAction: function() {
		if (document.getElementById("LB_DivBox")) {
			_cplightbox._setupLightBoxSize();
		}
	},
	
	
	_closeLightBox: function() {
		document.getElementById("LB_DivBox").removeChild(document.getElementById("LB_ContentsContainer"));
		_cplightbox._fadeBackground(document.getElementById("LB_Overray"), "out");
		_cplightbox.ieHeight = 0;
	},
	
	
	_removeLightBox: function() {
		var objBody = document.getElementsByTagName("body");
		var targetObj = objBody[0];
		var childCount = targetObj.childNodes.length;
		targetObj.removeChild(targetObj.childNodes[childCount-1]);
	},
	
	
	_lbCtrlContents: function(type, num) {
		var objTarget = document.getElementById("LB_ContentsContainer");
		objTarget.removeChild(objTarget.childNodes[0]);
		
		var nextNum = (type == "next") ? num + 1 : num - 1;
		
		var objNewContents = this._createContents(nextNum);
		objTarget.appendChild(objNewContents);
		this._showContents();
	},
	
	
	_retrunFunc: function(func, arg1, arg2) {
		var retFunc;
		
		switch (func) {
			case ("_setupLightBox") : {
				retFunc =  function() {_cplightbox._setupLightBox(arg1)};
			}
			break;
			
			case ("_lbCtrlContents") : {
				retFunc =  function() {_cplightbox._lbCtrlContents(arg1, arg2)};
			}
			break;
		}
		
		return retFunc;
	},
	
	
	_checkCrossDomein: function(uri) {
		var pageDomain = document.domain;
		var blCrossDomain = false;
		if (uri.match("http://")) blCrossDomain = (uri.match(pageDomain)) ? false : true;
		return blCrossDomain;
	},
	
	
	_getPageSize: function(){
		var xScroll, yScroll;
		if (window.innerHeight && window.scrollMaxY) {
			xScroll = window.innerWidth + window.scrollMaxX;
			yScroll = window.innerHeight + window.scrollMaxY;
		} else if (document.body.scrollHeight > document.body.offsetHeight){
			xScroll = document.body.scrollWidth;
			yScroll = document.body.scrollHeight;
		} else {
			xScroll = document.body.offsetWidth;
			yScroll = document.body.offsetHeight;
		}
		
		var windowWidth, windowHeight;
		if (self.innerHeight) {
			if(document.documentElement.clientWidth){
				windowWidth = document.documentElement.clientWidth;
			} else {
				windowWidth = self.innerWidth;
			}
			windowHeight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) {
			windowWidth = document.documentElement.clientWidth;
			windowHeight = document.documentElement.clientHeight;
		} else if (document.body) {
			windowWidth = document.body.clientWidth;
			windowHeight = document.body.clientHeight;
		}	
		
		if(yScroll < windowHeight){
			pageHeight = windowHeight;
		} else { 
			pageHeight = yScroll;
		}
		
		if(xScroll < windowWidth){	
			pageWidth = xScroll;		
		} else {
			pageWidth = windowWidth;
		}
		
		arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
		return arrayPageSize;
	},
	
	
	_hasFlashPlagin: function(reqflashVersion) {
		var chkResult;
		var flashPlagin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
		
		if (flashPlagin) {
			chkResult = parseInt(flashPlagin.description.match(/\d+/g)[0]) >= reqflashVersion;
		} else if (this.isWinIE) {
			try {
				flashPlagin = Math.floor(new ActiveXObject("ShockwaveFlash.ShockwaveFlash").FlashVersion() / 0x10000);
				chkResult = parseInt(flashPlagin) >= reqflashVersion;
			} catch (e) {
				chkResult = false;
			}
		}
		
		return chkResult;
	},
	
	
	_embedSwf: function(path, width, height, id, data, fver, imgDir) {
		var swfHtml ="";
		var fvs = data;
		var reqflashVersion = (fver) ? fver : flashSetting.flashVersion;
		var chkResult = this._hasFlashPlagin(reqflashVersion);
		
		var imgPath = flashSetting.defaultImgDir;
		if (imgDir) imgPath = imgDir;
		
		fvs += "&isMacSafari=" + this.isMacSafari;
		
		if (chkResult) {
			swfHtml += "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'";
			swfHtml += " codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab'";
			swfHtml += " id='" + id +"'";
			swfHtml += " width='" + width +"'";
			swfHtml += " height='" + height +"'>";
			swfHtml += "<param name='allowScriptAccess' value='sameDomain' />";
			swfHtml += "<param name='movie' value='" + path +"' />";
			swfHtml += "<param name='quality' value='high' />";
			swfHtml += "<param name='wmode' value='opaque' />";
			if(fvs) swfHtml += "<param name='FlashVars' value='" + fvs +"' />";
			swfHtml += "<embed src='" + path +"'";
			swfHtml += " allowscriptaccess='sameDomain'";
			swfHtml += " name='" + id +"'";
			swfHtml += " quality='high'";
			swfHtml += " width='" + width +"'";
			swfHtml += " height='" + height +"'";
			swfHtml += " wmode='opaque'";
			swfHtml += " type='application/x-shockwave-flash'";
			if(fvs) swfHtml += " FlashVars='" + fvs +"'";
			swfHtml += " pluginspage='http://www.macromedia.com/go/getflashplayer' />";
			swfHtml += "</object>";
		} else {
			swfHtml += "<div id='LB_getFlash' style=width:" + width + "px; height:" + (height - Math.round(height / 2 - 50)) + "px; padding-top:" + Math.round(height / 2 - 50) + "px;'>";
			swfHtml += "<a href='http://www.macromedia.com/go/getflashplayer'>";
			swfHtml += "<img src='" + imgPath + "flash_dl.png' width='158' height='39' alt='Get ADOBE Flash Player'><br /><br />";
			swfHtml += "最新のFlash Playerをインストールしてください。";
			swfHtml += "</a>";
			swfHtml += "</div>";
		}
		
		return swfHtml;
	},
	
	
	flvThumb: function(flvPath, width, height) {
		var chkResult = this._hasFlashPlagin(flashSetting.flashVersion);
		var swfHtml ="";
		var path = flashSetting.playerPath;
		var id = "flvThumb";
		var fvs = "";
		fvs += "flvPath=" + flvPath;
		fvs += "&sizeX=" + width;
		fvs += "&sizeY=" + height;
		fvs += "&isThumb=true";
		
		if (chkResult) {
			swfHtml += "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'";
			swfHtml += " codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab'";
			swfHtml += " id='" + id +"'";
			swfHtml += " width='" + width +"'";
			swfHtml += " height='" + height +"'>";
			swfHtml += "<param name='allowScriptAccess' value='sameDomain' />";
			swfHtml += "<param name='movie' value='" + path +"' />";
			swfHtml += "<param name='quality' value='high' />";
			swfHtml += "<param name='wmode' value='opaque' />";
			if(fvs) swfHtml += "<param name='FlashVars' value='" + fvs +"' />";
			swfHtml += "<embed src='" + path +"'";
			swfHtml += " allowscriptaccess='sameDomain'";
			swfHtml += " name='" + id +"'";
			swfHtml += " quality='high'";
			swfHtml += " width='" + width +"'";
			swfHtml += " height='" + height +"'";
			swfHtml += " wmode='transparent'";
			swfHtml += " type='application/x-shockwave-flash'";
			if(fvs) swfHtml += " FlashVars='" + fvs +"'";
			swfHtml += " pluginspage='http://www.macromedia.com/go/getflashplayer' />";
			swfHtml += "</object>";
		} else {
			swfHtml += "<a href='http://www.macromedia.com/go/getflashplayer'>";
			swfHtml += "Flash Playerがインストールされていません。";
			swfHtml += "</a>";
		}
		
		document.write(swfHtml);
	}
}

var cplightbox = new CPLightBox();
