var swfPathCalgotSea="http://calgot.net/fla/beach.swf";
var swfPathCalgotSeaPPC="http://calgot.net/fla/beach.swf";
var bannerPathCalgotSea="http://calgot.net/fla/cdr4.swf";
var browser =checkBrowser();
var bodyy = document['CSS1Compat' == document.compatMode ? 'documentElement' : 'body'];
var insertBlock;

//////////////////////////////////////
if(navigator.platform == "MacPPC") var macppcCH=true;
if(navigator.userAgent.indexOf('Opera') != -1) var operaCH=true;
var swfVersion="6";
if(macppcCH){
	swfVersion="8";
	swfPathCalgotSea = swfPathCalgotSeaPPC;
}
var bannerWidthCalgotSea="170";
var bannerHeightCalgotSea="210";
//////////////////////////////////////
var VBflash="ShockwaveFlash.ShockwaveFlash."+swfVersion;
var plugin=(navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if(plugin){
	plugin=parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= swfVersion;
}else{
	document.write('<script language=VBScript>\non error resume next\nplugin=(IsObject(CreateObject(VBflash)))\n</script\>');
}
if(plugin){
	document.write('<div id="blogparts_CalgotSea"><object id="blogparts_object_CalgotSea" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+bannerWidthCalgotSea+'" height="'+bannerHeightCalgotSea+'" VIEWASTEXT><param name="movie" value="'+ bannerPathCalgotSea +'" /><param name="loop" value="true" /><param name="quality" value="high" /><param name="base"><param name="allowScriptAccess" value="always" /><param name="wmode" value="transparent" /><embed src="'+ bannerPathCalgotSea +'" loop="true" quality="high" wmode="transparent" swLiveConnect="false" width="'+bannerWidthCalgotSea+'" height="'+bannerHeightCalgotSea+'" allowScriptAccess="always" type="application/x-shockwave-flash"></embed></object></div>');
	document.getElementById("blogparts_CalgotSea").style.width = '170px';
	document.getElementById("blogparts_CalgotSea").style.height = '210px';

}
//////////////////////////////////////
var flag=true;
//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";
}

function delCalgotSea(){
	flag=!flag;
	if(macppcCH || operaCH) document.getElementById("blogparts_object_CalgotSea").style.display = 'block';
//	document.body.removeChild(document.body.firstChild);
	if(document.getElementById("blogparts_effect_CalgotSea")){
		document.body.removeChild(document.getElementById("blogparts_effect_CalgotSea"));
	}
	if(macppcCH){
		document.body.removeChild(document.body.firstChild);
		document.body.removeChild(document.body.firstChild);
	}
}

function showExtSWFCalgotSea(){
	if(flag){
		flag=!flag;
		if(macppcCH || operaCH) document.getElementById("blogparts_object_CalgotSea").style.display = 'none';
		//For MacPPC Write
		if(macppcCH){
			var insertImgLeft=document.createElement("div");
			insertImgLeft.style.width='100%';
			insertImgLeft.style.height=(windowSizeCalgotSea()+'px');
			insertImgLeft.style.display = 'block';
			insertImgLeft.style.position='absolute';
			insertImgLeft.style.zIndex='1201';
			insertImgLeft.style.top='0';
			insertImgLeft.style.left='0';
			insertImgLeft.onclick=new Function('swfClose()');
			insertImgLeft.innerHTML='&nbsp;';
			document.body.insertBefore(insertImgLeft,document.body.firstChild);
			var insertImgRight=document.createElement("div");
			insertImgRight.style.width='100%';
			insertImgRight.style.height=(windowSizeCalgotSea()+'px');
			insertImgRight.style.display = 'block';
			insertImgRight.style.position='absolute';
			insertImgRight.style.zIndex='1202';
			insertImgRight.style.top='0';
			insertImgRight.style.left='0';
			insertImgRight.onclick=new Function('swfClose()');
			insertImgRight.innerHTML='&nbsp;';
			document.body.insertBefore(insertImgRight,document.body.firstChild);
		}
		//Flash Object Write
		insertBlock=document.createElement("div");
		insertBlock.setAttribute('id','blogparts_effect_CalgotSea');
		insertBlock.style.width='100%';
		insertBlock.style.height=(windowSizeCalgotSea()+'px');
		insertBlock.style.display = 'block';
		insertBlock.style.position='absolute';
		insertBlock.style.zIndex='1200';
		setValignTopCalgotSea();
		//insertBlock.style.top='0';
		insertBlock.style.left='0';
		
		window.onresize = function(){
			setValignTopCalgotSea();
			insertBlock.style.height=(windowSizeCalgotSea()+'px');
		}
		window.onscroll = window.onresize;

		
		if(macppcCH) 1;
		insertBlock.innerHTML='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="100%" height="100%" id="overlayFlash" align="middle"><param name="movie" value="' + swfPathCalgotSea + '" /><param name="loop" value="true" /><param name="quality" value="high" /><param name="allowScriptAccess" value="always" /><param name="wmode" value="transparent" /><embed src="'+swfPathCalgotSea+'" loop="true" quality="high" wmode="transparent" swLiveConnect="false" width="100%" height="100%" allowScriptAccess="always" type="application/x-shockwave-flash" /></embed></object>';
		document.body.insertBefore(insertBlock,document.body.firstChild);
	}
}

function setValignTopCalgotSea(){
	var browser =checkBrowser();
	var YY;
	if(browser == "MSIE"){
		YY = bodyy.scrollTop;
	}else {
		YY = pageYOffset;
	}
	insertBlock.style.top = YY + 'px';
}



function windowSizeCalgotSea(){
	var windowHeight;
	var bodyHeight;
	if(window.scrollMaxY && window.innerHeight){
		bodyHeight=window.innerHeight+window.scrollMaxY;
	}else if(document.body.scrollHeight>document.body.offsetHeight){
		bodyHeight=document.body.scrollHeight;
	}else{
		bodyHeight=document.body.offsetHeight;
	}
	if(self.innerHeight){
		windowHeight=self.innerHeight;
	}else if(document.documentElement && document.documentElement.clientHeight){
		windowHeight=document.documentElement.clientHeight;
	}else if(document.body){
		windowHeight=document.body.clientHeight;
	}
	if(bodyHeight<windowHeight) bodyHeight=windowHeight;
	if(4100<bodyHeight) bodyHeight=4100;
	
	return windowHeight;
}