// Common JavaScript Document
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function PH_printWindow(features){
	window.open('/printout.php?site=' + window.location.href,'print',features);
}

function PH_disableSubmit(form){
	var elements = form.elements;
	for (var i = 0; i < elements.length; i++) {
		if (elements[i].type == 'submit') {
			elements[i].blur();
			elements[i].disabled = 'true';
		}
	}
}

function ctrlWind(url) {
 opener.location.href = url; window.close();
}

function MM_jumpMenu(targ,selObj,restore){
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_jumpMenuGo(selName,targ,restore){ //v3.0
  var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}
function PH_page_load(){
	return true;
}

/* ------------------------------------------------------------
	* setStyleById
	* CALL : ALL
 * ARG  : elm - ElementId | pro - Property | val - Value
 * ------------------------------------------------------------ */
function setStyleById(elm,pro,val) {
	if (document.layers) {	// NN
		document.layers[elm].pro = val;
	}
	if (document.getElementById) {	//IE、NC6
		document.getElementById(elm).style[pro] = val;
	}
}
/********************************************************************
   Detect Flash Movie  script by Seito Makino
   (C)pharcyde inc.
   
   ::: functions :::
   PH_detect_swf(MOVIE-PATH,WIDTH,HEIGHT,[ALT-PATH,INIT])
   	output "swf" html
   	MOVIE-PATH	: the path to SWF
   	WIDTH		: width
   	HEIGHT		: height
   	ALT-PATH	: the paht to alternative image. 
	   ( if this argument was "",  output default mesage )
   	INIT		: the function name that configure status such as
	    alternative html, plugin version, etc.
   
   PH_detect_swf_init_def()
   - set default configuration
 *******************************************************************/

function PH_detect_swf_init_def(imgSWF,sWidth,sHeight,altImg){
	//basic output type (1:Flash 2:JPEG,GIF 3:HTML)
	gImgStats = 1;
	//the path to flash file
	gImgSWF = imgSWF;
	//the flash movie size
	gsWidth = sWidth;
	gsHeight = sHeight;
	//the path to alternative image
	gAltImg = altImg;
	//html source
	gHtmlsrc = 'このコンテンツの閲覧には、<br>最新のFlashPlayerが必要です。';
	//the prosess setting for non-plungin brawser (1: output alternative image 2: output 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" type="text/vbscript"\>\n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('// <![CDATA[ \n');
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('// ]]> \n');
	document.write('</scr' + 'ipt\> \n');
}

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"');
			document.write('  codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
			document.write(' id="movie" width="' + gsWidth + '" height="' + gsHeight + '" align=""\>');
			document.write(' <param name="allowScriptAccess" value="sameDomain" /\>  '); 
			document.write(' <param name="movie" value="' + gImgSWF + '" /\> <param name="quality" value="best" /\> <param name="bgcolor" value="#FFFFFF" /\>  '); 
			document.write(' <embed src="' + gImgSWF + '" quality="best" 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="https://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"\>');
			}
		}
	}
};
function PH_detect_swf_init_recruit(){
	//basic output type (1:Flash 2:JPEG,GIF 3:HTML)
	gImgStats = 1;
	//the path to flash file
	gImgSWF = "/lib_image/recruit/recruit_movie.swf";
	//the flash movie size
	gsWidth = 800;
	gsHeight = 350;
	//the path to alternative image
	gAltImg = "/lib_image/top/top-movie-fix.jpg";
	//html source
	gHtmlsrc = '';
	//the prosess setting for non-plungin brawser (1: output alternative image 2: output alternative html)
	gPlginF = 2;
};
function themeChange(keyword, intern) {
	document.linkForm.KEYWORD.value = keyword;
	document.linkForm.is_intern.value = intern;
	document.linkForm.submit();
}

/* ------------------------------------------------------------
 * setStyleById
 * CALL : ALL
 * ARG  : elm - ElementId | pro - Property | val - Value
 * ------------------------------------------------------------ */
function setStyleById(elm,pro,val) {
	if (document.layers) {	// NN
		document.layers[elm].pro = val;
	}
	if (document.getElementById) {
		document.getElementById(elm).style[pro] = val;
	}
}

window.onload = getCookie;
var cookieName = "MEMBER_ID";
//var cookieName = "ASP.NET_SessionId";
/* ------------------------------------------------------------
 * getCookie
 * CALL : ALL
 * ------------------------------------------------------------ */
function getCookie(){
	var cookieSt = document.cookie.indexOf(cookieName + "=");
	if (cookieSt == -1) return null;
	var valueSt = document.cookie.indexOf('=', cookieSt) + 1;
	var valueEd = document.cookie.indexOf(';', valueSt);
	if (valueEd == -1) valueEd = document.cookie.length;
	var val = document.cookie.substring(valueSt, valueEd);
	val == null ? null : unescape(document.cookie.substring(valueSt, valueEd));
	if(val){
		setStyleById('memberMenu','display','block');
		setStyleById('preLoginMenu','display','none');
	}else{
		setStyleById('preLoginMenu','display','block');
	}
}

/* ------------------------------------------------------------
 * setSideBanner
 * CALL : ALL
 * ------------------------------------------------------------ */
function setSideBanner(){
	var endView = new Date("2010/06/01").getTime();//バナー表示終了
	var changeView = new Date("2010/06/01").getTime();//バナー入れ替え
	var endFlg = (new Date().getTime() >= endView)?true:false;
	var changeFlg = (new Date().getTime() >= changeView)?true:false;
	
	var sitePath = "";
	if((location.href).indexOf("test01") != -1){
		sitePath = "/rlive";
	}
	document.write('<div id="sideBanner">');
/*
	if(!changeFlg){
	document.write('<a href="'+sitePath+'/campaign/2010spring.html"><img src="'+sitePath+'/lib_image/banner/bn_side_spring2010.gif" alt="2010 春の「24時間スキンケア」コレクション　詳細はこちら" width="170" height="85" border="0" /></a><br />');
	}else{
	document.write('<a href="'+sitePath+'/campaign/2010spring.html"><img src="'+sitePath+'/lib_image/banner/bn_side_spring2010_2.gif" alt="2010 春の「24時間スキンケア」コレクション　詳細はこちら" width="170" height="85" border="0" /></a><br />');
	}
	*/
	//表示終了
	if(!endFlg){
	document.write('<a href="'+sitePath+'/campaign/2010spring.html"><img src="'+sitePath+'/lib_image/banner/bn_side_spring2010_2.gif" alt="2010 春の「24時間スキンケア」コレクション　詳細はこちら" width="170" height="85" border="0" /></a><br />');
//	document.write('<a href="'+sitePath+'/campaign/2009winter.html"><img src="'+sitePath+'/lib_image/banner/bn_side_winter2.gif" alt="2009 冬のスペシャル・コレクション　詳細はこちら" width="170" height="85" border="0" /></a><br />');
	}
	document.write('<a href="'+sitePath+'/review/"><img src="'+sitePath+'/lib_image/banner/bn_side_review.gif" alt="トゥール・ザン・レールってほんとにいいの?　お客様の感想をご紹介しています。" width="170" height="85" border="0" /></a><br />');
	document.write('<a href="'+sitePath+'/special/mcf.html"><img src="'+sitePath+'/lib_image/banner/bn_side_cfd.gif" alt="ビューティ・ディレクター＆読者も出るも代絶賛！次世代スキンケアファンデーション　詳細はこちら" width="170" height="85" border="0" /></a>');
	document.write('<a href="'+sitePath+'/products/pfd.html"><img src="'+sitePath+'/lib_image/banner/bn_side_pfd.gif" alt="その肌は、ずるいほど美しい。モイストパウダリーファンデーション　詳細はこちら" width="170" height="85" border="0" /><br /></a>');
	document.write('<a href="http://www.taya-blog.jp/" target="_blank"><img src="'+sitePath+'/lib_image/banner/bn_side_tayablog.gif" alt="TAYA Blog" width="170" height="85" border="0" /><br /></a>');
	document.write('</div>');
}

//-->