﻿// 共通script UTF-8版

var navi_url = "http://www.drx-web.com";
var rohto_url = "http://www.rohto.co.jp";

var prod_cont = 1;
var comp_cont = 0;
var ir_cont = 0;
var csr_cont = 0;

// ブラウザ名取得
// Netscape Navigator -> Netscape
// Internet Explorer  -> Explorer
function getBrowserName() {
	var aName = navigator.appName.toUpperCase();
	var uName = navigator.userAgent.toUpperCase();
	if (aName.indexOf("NETSCAPE") >= 0) return "Netscape";
	if (uName.indexOf("OPERA") >= 0) return "Netscape";
	if (aName.indexOf("MICROSOFT") >= 0) return "Explorer";
	return "";
	}
//　ブラウザバージョン取得
function getBrowserVer() {
	var browser = getBrowserName();
	var version = 0;
	var s = 0;
	var e = 0;
	var appVer = navigator.appVersion;
	if (browser == "Explorer") {
		appVer = navigator.userAgent;
		s = appVer.indexOf("MSIE ",0) + 5;
		e = appVer.indexOf(";",s);
		version = eval(appVer.substring(s,e));
		}
	else {
		s = appVer.indexOf(" ",0);
		version = eval(appVer.substring(0,s));
		if (version >= 5) version++;
		}
	return version;
	}
// OS名取得
// Macintosh -> MacOS
// Windows   -> Windows
function getOS() {
	var uAgent = navigator.userAgent.toUpperCase();
	if (uAgent.indexOf("MAC") >= 0) return "MacOS";
	if (uAgent.indexOf("WIN") >= 0) return "Windows";
	return "";
	}
	

// ヘッダ・グローバルナビ

function r_header(){
	document.write('<div id="rh_header_right">');
	document.write('<div id="rh_header_search">');
	document.write('<ul id="rh_headmenu">');
	document.write('<li><a href="'+rohto_url+'/support/index.htm">お問合せ（サポートデスク）</a></li>');
	document.write('<li><a href="'+rohto_url+'/guide/sitemap.htm">サイトマップ</a></li>');
	document.write('<li><a href="'+rohto_url+'/global/index.htm">GLOBAL</a></li>');
	document.write('</ul>');
	document.write('<form action="http://search-asp.fresheye.com/cgi-bin/SEARCH-ASP/dougigo/go.cgi" name="search" id="search">');
	document.write('<h3>サイト内検索</h3>');
	document.write('<input size="20" type="text" name="kw" id="search_box" onfocus="searchfocus();" onblur="searchblur();" />');
	document.write('<input type="submit" name="s_submit" value="検索" id="s_submit" />');
	document.write('<input type="hidden" name="ord" value="s" /><input type="hidden" name="id" value="11607" /><input type="hidden" name="cs" value="utf8" />');
	document.write('</form></div><hr class="clr hide" />');
	document.write('<div id="rh_header_contents">');
	document.write('<ul>');
	if(prod_cont == 1){
		var navi_prod = "_on";
		}
	else{
		var navi_prod = "";
		}
	document.write('<li id="header_prod'+navi_prod+'" title="製品情報"><a href="'+rohto_url+'/prod/">製品情報</a></li>');
	if(comp_cont == 1){
		var navi_comp = "_on";
		}
	else{
		var navi_comp = "";
		}
	document.write('<li id="header_comp'+navi_comp+'" title="企業情報"><a href="'+rohto_url+'/comp/">企業情報</a></li>');
	if(ir_cont == 1){
		var navi_ir = "_on";
		}
	else{
		var navi_ir = "";
		}
	document.write('<li id="header_ir'+navi_ir+'" title="IR情報"><a href="'+rohto_url+'/ir/">IR情報</a></li>');
	if(csr_cont == 1){
		var navi_csr = "_on";
		}
	else{
		var navi_csr = "";
		}
	document.write('<li id="header_csr'+navi_csr+'" title="CSR活動"><a href="'+rohto_url+'/csr/">CSR活動</a></li>');
	document.write('<li id="header_rclub" title="ロートくらぶ"><a href="http://www.rclub2.rohto.co.jp/">ロートくらぶ</a></li>');
	document.write('<li id="header_shop" title="ロート通販"><a href="http://www.shop.rohto.co.jp/">ロート通販</a></li>');
	document.write('</ul>');
	document.write('</div></div>');
	}

//　フッタ マイページボタン
function r_footer() {
	document.write('<ul id="my_page"><li><a href="javascript:popUp(\''+rohto_url+'/guide/mypage.htm\');">マイページ設定</a></li></ul>');
	var search_length = document.getElementById("search_box").value;
	if(search_length.length > 0){
		document.getElementById("search_box").style.background = '#fff';
		}
	else{
		document.getElementById("search_box").style.backgroundImage = 'url('+rohto_url+'/un_common/top_images/bg_searchbox.gif)';
		}
	}

//　サブウィンドウ
function popUp(url) {
	sealWin=window.open(url,'win','toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=500,height=450');
	self.name = "mainWin";
	sealWin.focus();
	}

//　マイページ設定情報取得
function setCookie(name,value,days) {
	if(days >= 1000){
		var expires = "; expires=Thu, 1-Jan-2030 00:00:00 GMT";
		}
	else if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
		}
	else expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
	}

function getCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}
	return null;
	}

var size    = getCookie("size");
var bright  = getCookie("bright");
var c_blind = getCookie("c_blind");
var print   = getCookie("print");

//　マイページ設定（CSS）
if(size == 1){
	document.write('<LINK rel=stylesheet href='+navi_url+'/un_common/rh_sl.css type=text/css>');
	}
else if(size == -1){
	document.write('<LINK rel=stylesheet href='+navi_url+'/un_common/rh_ss.css type=text/css>');
	}

if(bright == 1){
	document.write('<LINK rel=stylesheet href='+navi_url+'/un_common/rh_cb.css type=text/css>');
	}
else if(bright == -1){
	document.write('<LINK rel=stylesheet href='+navi_url+'/un_common/rh_cd.css type=text/css>');
	}
	
	document.write('<LINK rel=stylesheet href='+navi_url+'/un_common/rh_cb.css type=text/css>');

if(c_blind == 1){
	document.write('<LINK rel=stylesheet href='+navi_url+'/un_common/rh_mono.css type=text/css>');
	}

if(print == 1){
	document.write('<LINK rel=stylesheet href='+navi_url+'/un_common/print.css type=text/css>');
	}

//検索窓画像オンオフ





function searchfocus() {
	document.getElementById("search_box").style.background = '#fff';
	}
function searchblur() {
	var search_length = document.getElementById("search_box").value;
	if(search_length.length > 0){
		document.getElementById("search_box").style.background = '#fff';
		}
	else{
		document.getElementById("search_box").style.backgroundImage = 'url('+navi_url+'/un_common/top_images/bg_searchbox.gif)';
		}
	}
	

