var agent = navigator.userAgent ;
var appve = navigator.appVersion ;
var appna = navigator.appName ;
var userOs	= null ;
var browser = null ;
var version = null ;
if ( agent.indexOf('Win') != -1 ){ userOs = "Win";}
else if ( agent.indexOf('Mac') != -1 ){ userOs = "Mac" ;}
else{ userOs = "other" ;}
if ( appna == "Microsoft Internet Explorer" ){ browser = "MSIE"; version = agent.substring((agent.indexOf('MSIE') + 5),(agent.indexOf('MSIE') + 8)) ;}
else if ( appna == "Netscape" ){ browser = "NN"; version = appve.substring( 0,3 ) ;}	

function preloadImages(p) {
	if (document.images) {
		if (p == "lineup") {
		} else if (p == "lineup_step") {
		} else if (p == "present") {
		}
	}
}
function newImage(arg) {
	if (document.images) { rslt = new Image(); rslt.src = arg; return rslt;}
}
function imgChange(n){
	var imgsrc = document.images[n].src;
	if(imgsrc.indexOf('-on') < 0){ document.images[n].src=imgsrc.substring(0,imgsrc.length-4) +'-on.gif'; }
	else { document.images[n].src=imgsrc.substring(0,imgsrc.length-7) +'.gif'; }
}
function popUse(t){
	var w = "440";
	var h = '510';
	var wf = "";
	wf += "width=" + w;
	wf += ",height=" + h;
	wf += ",resizable=no,scrollbars=no,menubar=no,toolbar=no,directories=no,location=no,status=no";
	var sW = window.open("lineup_use_"+t+".html", 'HowToUse', wf);
	sW.focus();
}

function openDetailWin(targEt){
	var headUrl = '/suisai/';
	var tailURL='.html';
	switch(targEt)
	{
		case 'le_ap01': alurl = 'pre_le01'; alWidth=470; alHight=600; optScroll='no'; break;
		case 'le_ap02': alurl = 'pre_le02'; alWidth=470; alHight=600; optScroll='no'; break;
		case 'porescare': alurl = 'howto/pores_care'; alWidth=700; alHight=630; optScroll='no'; break;
		case 'brand_cp': alurl = 'pop_noumitsu_cp'; alWidth=473; alHight=600; optScroll='no'; break;
		case 'premiolity': alurl =  'premiolity/item'; alWidth=800; alHight=566; optScroll='no'; break;
	}
	var optLine = 'width=' + alWidth + ', height=' + alHight + ',toolbar=no,resizable=no,menubar=no,directories=no,status=no,location=no,scrollbars=' + optScroll;
	subal=window.open(headUrl+alurl+tailURL,targEt,optLine);
	subal.focus();
}


function popSecret(t){
	var w = "440";
	var h = '510';
	var wf2 = "";
	wf2 += "width=" + w;
	wf2 += ",height=" + h;
	wf2 += ",resizable=no,scrollbars=no,menubar=no,toolbar=no,directories=no,location=no,status=no";
	var sW2 = window.open(t, 'secret', wf2);
	sW2.focus();
}
function popHyaluronicDetail () {
	var wf3 = "width=460,height=600,resizable=no,scrollbars=no,menubar=no,toolbar=no,directories=no,location=no,status=no";
	var sW3 = window.open("secret_hyaluronic_detail.html", 'secret2', wf3);
	sW3.focus();
}
function popOCdetail () {
	var wf4 = "width=680,height=610,resizable=no,scrollbars=no,menubar=no,toolbar=no,directories=no,location=no,status=no";
	var sW4 = window.open("/suisai/pre_oil.html", 'oc_detail', wf4);
	sW4.focus();
}
function popHKL () {
	var wf5 = "width=460,height=600,resizable=no,scrollbars=no,menubar=no,toolbar=no,directories=no,location=no,status=no";
	var sW5 = window.open("/suisai/lineup_hic_hkl.html", 'HKL', wf5);
	sW5.focus();
}

//beautypauda
function popBcP () {
	var wf6 = "width=460,height=500,resizable=no,scrollbars=no,menubar=no,toolbar=no,directories=no,location=no,status=no";
	var sW6 = window.open("pop_beauty_cp.html", 'HKL', wf6);
	sW6.focus();
}

// Flash control
var flag_Fplay;
function load_Flash(tArSrc,wId,hEi){
	Check_Fplay();
	if ( flag_Fplay ) {
		document.write('<tr height="430">');
		document.write('<td width="570" height="430">');
		document.write('<div align="center">');
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="');
		document.write('http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" height="' + hEi + '" width="' + wId + '">\n');
		document.write('<param name="movie" value="' + tArSrc + '.swf">\n');
		document.write('<param name="quality" value="best">\n');
		document.write('<param name="play" value="true">\n');
		document.write('<param name="menu" value="false">\n');
		document.write('<embed height="' + hEi + '" pluginspage="http://www.macromedia.com/go/getflashplayer" src="');
		document.write(tArSrc + '.swf" menu="false" type="application/x-shockwave-flash" width="' + wId +'" quality="best" play="true">\n');
		document.write('</object>');
		document.write('</div>');
		document.write('</td>');
		document.write('</tr>');
		document.write('<tr height="46">');
		document.write('<td align="center" valign="bottom" width="570" height="46"><a href="top.html"><img src="images/index_skip.gif" alt="Skip" width="70" height="46" border="0"></a></td>');
		document.write('</tr>');
	} else{
		document.write('<tr height="430">');
		document.write('<td width="570" height="430">');
		document.write('<div align="center">');
		document.write('当サイトをお楽しみ頂くためには、Macromedia Flash最新版が必要になります。<br><br><br><br><a href="http://www.macromedia.com/shockwave/download/download.cgi?P5_Language=Japanese&Lang=Japanese&P1_Prod_Version=ShockwaveFlash&Lang=Japanese" target="_blank"><img src="images/get_flash.gif" alt="Skip" width="88" height="31" border="0"></a>');
		document.write('</div>');
		document.write('</td>');
		document.write('</tr>');
	}
}

function Check_Fplay(){
	chk_contentVersion = 6;
	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; chk_PluginVersion = words[i]; }
		flag_Fplay = chk_PluginVersion >= chk_contentVersion;
	}
	else if (navigator.appName && navigator.appName.indexOf("Microsoft")!=-1 && navigator.userAgent.indexOf("Windows")!=-1 && navigator.userAgent.indexOf("Windows 3.1")==-1) {
		flag_Fplay = true;
	}
}


// Flash control-test
var flag_Fplay;
function load_site_Flash(tArSrc,wId,hEi){
	Check_Fplay();
	if ( flag_Fplay ) {
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="');
		document.write('http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" height="' + hEi + '" width="' + wId + '">');
		document.write('<param name="movie" value="' + tArSrc + '.swf">');
		document.write('<param name="quality" value="best">');
		document.write('<param name="play" value="true">');
		document.write('<param name="menu" value="false">');
		document.write('<embed height="' + hEi + '" pluginspage="http://www.macromedia.com/go/getflashplayer" src="');
		document.write(tArSrc + '.swf" menu="false" type="application/x-shockwave-flash" width="' + wId +'" quality="best" play="true">');
		document.write('</object>');
	} else{
		document.write('<span class="px_12"><br><br><br><br><br><br><br><br><br><br>当サイトをお楽しみ頂くためには、Macromedia Flash Player 最新版が必要になります。<br><br><br><br><a href="http://www.macromedia.com/shockwave/download/download.cgi?P5_Language=Japanese&Lang=Japanese&P1_Prod_Version=ShockwaveFlash&Lang=Japanese" target="_blank"><img src="image/get_flash_player.gif" alt="Skip" width="88" height="31" border="0"></a></span>');
	}
}


//css
document.writeln('<style type="text/css" media="screen"><!--');
var Win = navigator.appVersion.indexOf('Win',0) != -1;
var Mac = navigator.appVersion.indexOf('Mac',0) != -1;
if(Win){
	document.writeln('.bp12px { color:#000000; font-size: 12px; line-height: 22px; margin-left:2px; }');
	document.writeln('.bp10px  { color: #000000; font-size: 10px; line-height: 16px; padding: 8px 0 0 2px }');
	}
	else{
	document.writeln('.bp12px { color:#000000; font-size: 12px; line-height: 20px; }');
	document.writeln('.bp10px  { color: #000000; font-size: 10px; line-height: 16px; padding: 18px 0 0 2px }');

}
document.writeln('--></style>');



//popupwin
function oPenCommodity(targEt){
	var headUrl = '/suisai/commodity/';
	var tailURL='.html';
	var alWidth='640';
	var alHight ='565';
	switch(targEt)
	{
		case 'lotion_c': alurl = 'lotion_c'; optScroll='no'; break;
		case 'oc': alurl = 'oilcle_c'; optScroll='no'; break;
		case 'cc': alurl = 'creamc_c'; optScroll='no'; break;
		case 'cs': alurl = 'creams_s'; optScroll='no'; break;
		case 'bc': alurl = 'beauty_p'; optScroll='no'; break;
		case 'alm': alurl = 'moisture-lotion'; optScroll='no'; break;
		case 'all': alurl = 'moisture-lotion'; optScroll='no'; break;
		case 'alap': alurl = 'moisture-lotion'; optScroll='no'; break;
		case 'he': alurl = 'hiaroi_e'; optScroll='no'; break;
		case 're': alurl = 'repair_e'; optScroll='no'; break;
		case 'amm': alurl = 'moisture-emulsion'; optScroll='no'; break;
		case 'aml': alurl = 'moisture-emulsion'; optScroll='no'; break;
		case 'uve': alurl = 'uvprot_e'; optScroll='no'; break;
		case 'hic': alurl = 'hiaroi_c'; optScroll='no'; break;
		case 'his': alurl = 'hiaros_m'; optScroll='no'; break;
		case 'him': alurl = 'hiaroi_m'; optScroll='no'; break;
		case 'serum': alurl = 'serum_ap'; optScroll='no'; break;
	}
	var optLine = 'width=' + alWidth + ', height=' + alHight + ',toolbar=no,resizable=no,menubar=no,directories=no,status=no,location=no,scrollbars=' + optScroll;
	subal=window.open(headUrl+alurl+tailURL,targEt,optLine);
	subal.focus();
}

function oPenhowTo(targEt){
	var headUrl = '/suisai/howto/';
	var tailURL='.html';
	var alWidth='440';
	var alHight ='510';
	switch(targEt)
	{
		case 'howlotionc': alurl = 'lotion_c'; optScroll='no'; break;
		case 'howoc': alurl = 'oilcle_c'; optScroll='no'; break;
		case 'howcc': alurl = 'creamc_c'; optScroll='no'; break;
		case 'howcs': alurl = 'creams_s'; optScroll='no'; break;
		case 'howbc': alurl = 'beauty_p'; optScroll='no'; break;
		case 'howalm': alurl = 'aquasl_m'; optScroll='no'; break;
		case 'howall': alurl = 'aquasl_l'; optScroll='no'; break;
		case 'howalap': alurl = 'aquasl_ap'; optScroll='no'; break;
		case 'howhe': alurl = 'hiaroi_e'; optScroll='no'; break;
		case 'howre': alurl = 'repair_e'; optScroll='no'; break;
		case 'howamm': alurl = 'aquasm_m'; optScroll='no'; break;
		case 'howaml': alurl = 'aquasm_l'; optScroll='no'; break;
		case 'howuve': alurl = 'uvprot_e'; optScroll='no'; break;
		case 'howhic': alurl = 'hiaroi_c'; optScroll='no'; break;
		case 'howhis': alurl = 'hiaros_m'; optScroll='no'; break;
		case 'howhim': alurl = 'hiaroi_m'; optScroll='no'; break;
		case 'howseram': alurl = 'seram_ap'; optScroll='no'; break;
		case 'moisturelotion': alurl = 'moisture-lotion'; optScroll='no'; break;
		case 'moistureemulsion': alurl = 'moisture-emulsion'; optScroll='no'; break;
	}
	var optLine = 'width=' + alWidth + ', height=' + alHight + ',toolbar=no,resizable=no,menubar=no,directories=no,status=no,location=no,scrollbars=' + optScroll;
	subal=window.open(headUrl+alurl+tailURL,targEt,optLine);
	subal.focus();
}
