// stylesheet
if(navigator.platform.charAt(0)=="M"){
	if(navigator.appName=="Netscape"){  // Mac Netscape
		ver = parseInt(navigator.appVersion);
		if(ver < 5){  //Version 6 以下
			document.write('<link rel=stylesheet href="/css/mac.css" type="text/css">');
			document.close();
		}else{  //Version 6
			document.write('<link rel=stylesheet href="/css/mac_ie.css" type="text/css">');
			document.close();
		}
	}else{  // Mac IE
		document.write('<link rel=stylesheet href="/css/mac_ie.css" type="text/css">');
		document.close();
	}
}else{
		if(navigator.appName=="Microsoft Internet Explorer"){
		document.write('<link rel=stylesheet href="/css/win.css" type="text/css">');
		document.close();
}
		else{
		document.write('<link rel=stylesheet href="/css/win2.css" type="text/css">');
		document.close();
		}
}


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) { //v3.0
  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); 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];}
}


// check_char
function check_char(str){
	var chars = "%'_";

	for (i = 0 ; i < chars.length ; i++){
		if (str.indexOf(chars.charAt(i)) >= 0)  return false;
	}
	return true;
}


// check_empty
function check_empty(){
	with(document.top_find){
		if (find.value == ""){
			alert('検索キーワードを入力して下さい。');
			find.focus();
			return false;
		}else if(!check_char(find.value)){
			alert("検索キーワードとして %, \', _ は使用できません。");
			find.focus();
			return false;
		}else{
			submit();
		}
	}
}


// call
function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}


// NN4_reload
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
	if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
		document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
	else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


// omikuji
function pre(){
number = Math.floor(Math.random() * 30) + 10;
url = "/contents/omikuji/kuji_" + number + ".html";
win = window.open('','lucky','scrollbars=1,status=0,resizable=0,width=280,height=440');
win.location.href = url;
win.focus();
}

function mapa(){
number = Math.floor(Math.random() * 30) + 40;
url = "/contents/omikuji/kuji_" + number + ".html";
win = window.open('','lucky','scrollbars=1,status=0,resizable=0,width=280,height=440');
win.location.href = url;
win.focus();
}

//present（ハンドタオル）
function present_hand(){
	var aaa = window.open('','presenthand','scrollbars=0,status=1,resizable=0,width=420,height=375');
	with (aaa.document){
		write('<html>\n<head>\n<title>PRESENT</title>\n</head>\n');
		write('<body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">\n');
		write('<img src="images/prez_hand_towel.jpg">\n');
//		write('<img src="http://www.55192.com/images/prez_hand_towel.jpg">\n');
		write('</body>\n</html>');
		close();
	}
	aaa.focus();
}

//present（ガーゼタオル）
function present_gauze(){
	var aaa = window.open('','presentgauze','scrollbars=0,status=1,resizable=0,width=436,height=415');
	with (aaa.document){
		write('<html>\n<head>\n<title>PRESENT</title>\n</head>\n');
		write('<body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">\n');
		write('<img src="images/prez_gauzetowel_set.jpg">\n');
//		write('<img src="http://www.55192.com/images/prez_gauzetowel_set.jpg">\n');
		write('</body>\n</html>');
		close();
	}
	aaa.focus();
}


//present（ダンプトラック）
function present_dump(){
	var aaa = window.open('','presentdump','scrollbars=0,status=1,resizable=0,width=530,height=415');
	with (aaa.document){
		write('<html>\n<head>\n<title>PRESENT</title>\n</head>\n');
		write('<body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">\n');
		write('<img src="images/prez_dump_truck.jpg">\n');
//		write('<img src="http://www.55192.com/images/prez_dump_truck.jpg">\n');
		write('</body>\n</html>');
		close();
	}
	aaa.focus();
}

//present（お弁当箱）
function present_lbox(){
	var aaa = window.open('','presentlbox','scrollbars=0,status=1,resizable=0,width=445,height=445');
	with (aaa.document){
		write('<html>\n<head>\n<title>PRESENT</title>\n</head>\n');
		write('<body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">\n');
		write('<img src="images/prez_lunchbox.jpg">\n');
//		write('<img src="http://www.55192.com/images/prez_lunchbox.jpg">\n');
		write('</body>\n</html>');
		close();
	}
	aaa.focus();
}

//present1
function present1(){
	var aaa = window.open('','present1','scrollbars=0,status=1,resizable=0,width=430,height=445');
	with (aaa.document){
		write('<html>\n<head>\n<title>PRESENT</title>\n</head>\n');
		write('<body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">\n');
		write('<img src="images/prez_mini_towel1.jpg">\n');
		write('</body>\n</html>');
		close();
	}
	aaa.focus();
}

//topicswin
function topicswin(file_name,win_name,wtitle,wsize,hsize){
	var features = 'scrollbars=0,status=1,resizable=0,width=' + wsize + ',height=' + hsize;
	var aaa = window.open('',win_name,features);
	with (aaa.document){
		write('<html>\n<head>\n<title>');
		write(wtitle);
		write('</title>\n</head>\n');
		write('<body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">\n');
		write('<img src="images/');
		write(file_name);
		write('">\n');
		write('</body>\n</html>');
		close();
	}
	aaa.focus();
}

//topicswin2
function topicswin2(file_name,win_name,wtitle,wsize,hsize){
	var features = 'scrollbars=1,status=1,resizable=0,width=' + wsize + ',height=' + hsize;
	var aaa = window.open('',win_name,features);
	with (aaa.document){
		write('<html>\n<head>\n<title>');
		write(wtitle);
		write('</title>\n</head>\n');
		write('<body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">\n');
		write('<img src="images/');
		write(file_name);
		write('">\n');
		write('</body>\n</html>');
		close();
	}
	aaa.focus();
}


//マナー辞典用
function openDic(theURL) {
  DicWin = window.open(theURL,'dictionary','status=yes,scrollbars=yes,width=370,height=400');

  DicWin.focus();
}
