//get string:"script"
var scriptStr = document.getElementsByTagName("script");
for(var i=0;i<scriptStr.length;i++){
	var checkSrc = scriptStr[i].src;
	if(checkSrc.match(/calendar10\.js/)){
		var scriptSrc = scriptStr[ i ].src;
	}
}

//get query
var calType = 1;
var calId = 1;
if(scriptSrc){
	var calendarTypeResult = scriptSrc.match(/calType=([0-9]+)/);
	var calendarIdResult = scriptSrc.match(/calId=([0-9]+)/);
	/*
	calType = calendarTypeResult[1];
	calId = calendarIdResult[1];
	*/
	calType = ((calendarTypeResult[1]) ? calendarTypeResult[1] : 1);
	calId = ((calendarIdResult[1]) ? calendarIdResult[1] : 1);
}
var urlPath = "http://www.365calendar.net/";
var imgSWF = urlPath+"lib_image/special/blogparts2010/calendar.swf";
var sWidth = "150";
var sHeight = "230";
var altImg = "";

/********************************************************************
   Detect Flash Movie  script by Seito Makino
   (C)pharcyde inc.
   
   ::: functions :::
   PH_detect_swf(MOVIE-PATH,WIDTH,HEIGHT,[ALT-PATH,INIT])
   	detect swf
   	MOVIE-PATH	:path of SWF file
   	WIDTH		:swf width
   	HEIGHT		:swf height
   	ALT-PATH	:alternative image not to have flash player. '' is detect default message
   	INIT		:the function name for configuration for swf status.
   
   PH_detect_swf_init_def()
   return configuration for default swf status.
 *******************************************************************/

function PH_detect_swf_init_def(imgSWF,sWidth,sHeight,altImg){
	//basic output (1:Flash  2:JPEG,GIF 3:HTML)
	gImgStats = 1;
	//flash movie path
	gImgSWF = imgSWF;
	//flash movie size
	gsWidth = sWidth;
	gsHeight = sHeight;
	//alternative image file path
	gAltImg = altImg;
	//html source for the non flash player user
	gHtmlsrc = 'GET FlashPlayer';
	//transaction for the plugin false (1: alternative image  2: alternative html)
	gPlginF = 2;
	
	if(gAltImg == "") gPluginF = 2;
};

var MM_contentVersion = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
		for (var i = 0; i < words.length; ++i)
		{
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i]; 
		}
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}

PH_detect_swf(imgSWF,sWidth,sHeight,altImg,'');

function PH_detect_swf(imgSWF,sWidth,sHeight,altImg,initFunc){
	//configure
	if(initFunc == ""){
		PH_detect_swf_init_def(imgSWF,sWidth,sHeight,altImg);
	}else{
		eval(initFunc);
	}

	if (gImgStats == 3){
		document.write(gHtmlsrc);
	}else if(gImgStats == 2){
		document.write('<img src="' + gAltImg + '" width="' + gsWidth + '" height="' + gsHeight + '" border="0">');
	}else{
		if ( MM_FlashCanPlay ) {
			document.write('<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="' + gsWidth + '" height="' + gsHeight + '" id="movie" align="">');
			document.write(' <param name="allowScriptAccess" value="sameDomain" />  '); 
			document.write(' <param name="movie" value="' + gImgSWF +"?calType="+calType+"&calId="+calId+ '">'); 
			document.write(' <param name="menu" value="false" />'); 
			document.write(' <param name="quality" value="best">'); 
			document.write(' <param name="scale" value="exactfit" />'); 
			document.write(' <param name="wmode" value="transparent" />'); 
			document.write(' <param name="bgcolor" value="#ffffff" />'); 

			document.write(' <embed src="' + gImgSWF +"?calType="+calType+"&calId="+calId+ '" menu="false" quality="best" scale="exactfit" wmode="transparent" bgcolor=#ffffff');
			document.write(' swLiveConnect="true" width="' + gsWidth + '" height="' + gsHeight + '" name="movie" align=""');
			document.write(' allowScriptAccess="sameDomain"');
			document.write(' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">');
			document.write(' </embed>');
			document.write(' </object>');
		} else{
			if(gPlginF == 2){
				document.write(gHtmlsrc);
			}else{
				document.write('<IMG SRC="' + gAltImg + '" WIDTH="' + gsWidth + '" HEIGHT="' + gsHeight + '" BORDER="0">');
			}
		}
	}
};

/* ------------------------------------------------------------
 * setMessage
 * ARG  : msg - Message Strings | place - Set Target ID
 * ------------------------------------------------------------ */
function PHsetResult(msg,place){
	if(document.all || document.getElementById){
		if(document.all)document.all(place).innerHTML = msg; 
		else document.getElementById(place).innerHTML = msg; 
	} else if(document.layers){
		with(document.layers[place]){ 
		document.open(); 
		document.write(msg); 
		document.close(); 
		} 
	} 
}
/* ------------------------------------------------------------
 * Debug
 * ARG  : msg - Message Strings
 * ------------------------------------------------------------ */
var debugWriteClass = "even";
function PHdebug(msg) {
	debugWriteClass = (debugWriteClass == "even")?"odd":"even";
	var c = document.getElementById('debugOut');

	if (c) {
		 PHsetResult("<li class=\""+debugWriteClass+"\">"+msg+"</li>"+c.innerHTML,"debugOut");
	}
}

