_dom = document.all?(document.getElementById?2:1):
                    (document.getElementById?4:
                    (document.layers?3:0));
                    
var mode = document.compatMode=="CSS1Compat";

function getWindowWidth(){
  if(_dom==4 || _dom==3) return window.innerWidth;
		if(_dom==2 || _dom==1){
			if(mode){ return document.documentElement.clientWidth; }
			else{ return document.body.clientWidth; }
		}
  return 0;
}

function getWindowHeight(){
  if(_dom==4 || _dom==3) return window.innerHeight;
		if(_dom==2 || _dom==1){
			if(mode){ return document.documentElement.clientHeight; }
			else{ return document.body.clientHeight; }
		}
  return 0;
}

function getScrollTop(){
  if(_dom==4 || _dom==3) return window.pageYOffset;
		if(_dom==2 || _dom==1){
			if(mode){ return document.documentElement.scrollTop; }
			else{ return document.body.scrollTop; }
		}
  return 0;
}

function getScrollLeft(){
  if(_dom==4 || _dom==3) return window.pageXOffset;
		if(_dom==2 || _dom==1){
			if(mode){ return document.documentElement.scrollLeft; }
			else{ return document.body.scrollLeft; }
		}
  return 0;
}


var IE = document.all?true:false;
// If NS -- that is, !IE -- then set up for mouse capture
if (!IE) document.captureEvents(Event.MOUSEMOVE)





function showSWF(swfurl,width,height){
	var 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="'+width+'" height="'+height+'" id="mj_float" align="middle">'+
				'<param name="wmode" value="transparent">'+
				'<param name="allowScriptAccess" value="always" />'+
				'<param name="movie" value="'+swfurl+'" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />'+
				'<embed src="'+swfurl+'" quality="high" bgcolor="#ffffff" width="'+width+'" height="'+height+'" wmode="transparent" name="mj_float" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'+
				'</object>';
	var divObj = document.getElementById("flashcontent1");
	if(divObj){
		divObj.style.display = "block";
	}
	else{
		divObj  = document.createElement("div");
		divObj.id     		= "flashcontent1";
	}
	
	divObj.style.position = "absolute";
	divObj.style.left    = getScrollLeft() + "px";
	divObj.style.top     = getScrollTop()+ "px";
	divObj.style.width   = width;
	divObj.style.height  = height;
	divObj.style.zIndex  = 100;
	divObj.width  		= width;
	divObj.height 		= height;
	
	divObj.innerHTML    = html;
	window.document.body.appendChild(divObj);
}

var wordplayText;
var colorNo;

function showMainSWF(wt,cn){
	wordplayText = wt;
	colorNo = cn;
	var swfurl = "http://www.shiseido.co.jp/mj/chapter24/blogparts/blogparts1.swf?colorNo="+colorNo;
	var width  = "165";
	var height = "240";
	var 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="'+width+'" height="'+height+'" id="mj_bp" align="middle">'+
				'<param name="wmode" value="transparent">'+
				'<param name="allowScriptAccess" value="always" />'+
				'<param name="movie" value="'+swfurl+'" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" />'+
				'<embed src="'+swfurl+'" quality="high" bgcolor="#000000" width="'+width+'" height="'+height+'" wmode="transparent" name="mj_bp" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'+
				'</object>';
	document.write(html);
}

function showSubSWF(){
	var swfurl = "http://www.shiseido.co.jp/mj/chapter24/blogparts/blogparts2.swf?wordplayText="+wordplayText+"&colorNo="+colorNo;
	var width  = "100%";
	var height = "100%";
	showSWF(swfurl,width,height);
}
function hiddenSubSWF(){
	var divObj = document.getElementById("flashcontent1");
	if(divObj){
		divObj.style.display = "none";
	}
	callMJShowLogo();
}
function callMJShowLogo() {
	thisMJMovie("mj_bp").goHome();
}

function thisMJMovie(movieName) {
	if (navigator.appName.indexOf("Microsoft") != -1) {
		return window[movieName]
	} else {
		return document[movieName]
	}
}



