var flVa2 = "test"
var swf_url_cl = "http://www.cocacola.co.jp/blogparts/meguricha/calendar/blogs.swf"
var swf_url_cl2 = "http://www.cocacola.co.jp/blogparts/meguricha/calendar/blogs_m.swf"

var openF=false;

function writeTagEffect_cl(){
	
	openF=true;
		var html = "";
		html += "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='100%' height='100%' id='bPatM' align='middle'>";
		html += "<param name='allowScriptAccess' value='always' />";
		html += "<param name='movie' value='" + swf_url_cl + "' />";
		html += "<param name='scale' value='noscale' />";
		html += "<param name='salign' value='lt' />";
		html += "<param name='quality' value='high' />";
		html += "<param name='wmode' value='transparent' />";
		html += "<param name='FlashVars' value='" + flVa2 + "' />";
		html += "<embed src='" + swf_url_cl + "' quality='high' scale='noscale' salign='lt' wmode='transparent' width='100%' height='100%' name='bPatM' id='bPatM' swLiveConnect=true align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' wmode='transparent' FlashVars='" + flVa2 + "'/>";
		html += "</object>";
		var oLayer = document.createElement('div');
		oLayer.setAttribute('id','flVCBParts');
		oLayer.innerHTML = html;
		oLayer.style.position = 'absolute';
		oLayer.style.top = 0;
		oLayer.style.left = 0;
		oLayer.style.zIndex = 100;
		document.body.appendChild(oLayer);
		showFullWindowSize_cl()
}

function del_cl(){
	openF=false;
document.body.removeChild(document.getElementById("flVCBParts"))
}

var body = document['CSS1Compat' == document.compatMode ? 'documentElement' : 'body'];

function writeTag_cl(){
		var html = "";
		html += '<div align="center">';
		html += "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='160' height='190' id='bPat' align='middle'>";
		html += "<param name='allowScriptAccess' value='always' />";
		html += "<param name='movie' value='" + swf_url_cl2 + "' />";
		html += "<param name='scale' value='noscale' />";
		html += "<param name='salign' value='lt' />";
		html += "<param name='quality' value='high' />";
		html += "<param name='wmode' value='transparent' />";
		html += "<param name='FlashVars' value='" + flVa2 + "' />";
		html += "<embed src='" + swf_url_cl2 + "' quality='high' scale='noscale' salign='lt' wmode='transparent' width='160' height='190' name='bPat' id='bPat' swLiveConnect=true align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' wmode='transparent' FlashVars='" + flVa2 + "'/>";
		html += "</object>";
		html += '</div>';
		document.write(html);
}


//browserCheck
function checkBrowser(){
	var uName = navigator.userAgent;
	if (uName.indexOf("Safari") > -1) return "Safari";
	if (uName.indexOf("MSIE") > -1) return "MSIE";
	if (uName.indexOf("Firefox") > -1) return "FIREFOX";
	if (uName.indexOf("Opera") > -1) return "OPERA";
	return "Netscape";
}
//OSCheck
function checkOSystem(){
	str = navigator.userAgent.toUpperCase();
	if (str.indexOf("MAC") >= 0) return "MacOS";
	if (str.indexOf("WIN") >= 0) return "Windows";
	if (str.indexOf("X11") >= 0) return "UNIX";
	return "OTHER";
}


//fullView
function showFullWindowSize_cl(){
		if(openF){
	setValignTop();
	setAlignLeft();
	setFullWindow();
		}
	window.onresize = function(){
		if(openF){
		setValignTop();
		setAlignLeft();
		setFullWindow();
		}
	}
	window.onscroll = window.onresize;
}

function clearDivSpace(){
	document.getElementById("flVCBParts").style.background = 'transparent';
}

function showCustomSize(WW,HH){
	setValignTop();
	setAlignRight(WW);
	setLayerWidth(WW);
	setLayerHeight(HH);
	window.onresize = function(){
		setValignTop();
		setAlignLeft(WW);
		setLayerWidth(WW);
		setLayerHeight(HH);
	}
	window.onscroll = window.onresize;
}

//Layer FullWindow
function setFullWindow(){
	var browser =checkBrowser();
	var WW;
	var HH;
	if(browser == "MSIE"){
		HH = body.clientHeight;
		WW = body.clientWidth;
	}else {
		HH = window.innerHeight;
		WW = window.innerWidth;
	}
	setLayerHeight(HH);
	setLayerWidth(WW);
}

//Layer Set TopPosittion
function setValignTop(){
	var browser =checkBrowser();
	var YY;
	if(browser == "MSIE"){
		YY = body.scrollTop;
	}else {
		YY = pageYOffset;
	}
	document.getElementById("flVCBParts").style.top = YY + 'px';
}

//Layer Set Left Posittion
function setAlignLeft(){
	var XX;
	XX = 0;
	document.getElementById("flVCBParts").style.left =XX + 'px';
}

//Layer Set Right Position(layer_WW:Layer_Width)
function setAlignRight(layer_WW){
	var browser =checkBrowser() ;
	var XX;
	var WW;
	if(browser == "MSIE"){
		XX = body.scrollLeft;
		WW = body.clientWidth;
	}else {
		XX = pageXOffset;
		WW = window.innerWidth;
	}
	var dX = 0;
	if(browser != "MSIE"){
		dX = -15;
	}
	document.getElementById("flVCBParts").style.left =(WW - layer_WW + XX + dX) + 'px';
}

//Layer Width Change
function setLayerWidth(WW){
	var browser =checkBrowser() ;
	var dX = 0
	if(browser == "FIREFOX"){
		dX = -20;
	}
	document.getElementById("flVCBParts").style.width = WW+dX + 'px';
}

//Layer Height Change
function setLayerHeight(HH){
	document.getElementById("flVCBParts").style.height = HH + 'px';
}

writeTag_cl()

