///////////////////////////////////////////
///	『 JAVASCRIPTライブラリ 』	///
///		第一電子株式会社	///
///	Copyright (C) 2001		///
///	DaiichiDenshi Corporation.	///
///	All Rights Reserved.		///
///////////////////////////////////////////

//////////////
// 月日取得 //
//////////////
atDate = new Date();
atMonth = atDate.getMonth()+1;
atDate = atDate.getDate();

///////////////////////
// 直前のURLチェック //
///////////////////////
function checkURL(){
	nxtURL = 'http://www.ddk.ne.jp/';	//ジャンプ先のURL指定
	myURL = document.URL;			//現在のURL取得
	myHOST = location.hostname;		//ホスト名の取得
	oldURL = document.referrer;		//ジャンプ元のURL取得
	oldHOST = oldURL.substring(7,19);	//substring(http://の文字数,ドメインまでの文字数)
	if(oldHOST != myHOST || oldHOST == 0){location.href(nxtURL);}
}

//////////////////////
// ファイル名の取得 //
//////////////////////
function GetFileName(file_url){
	file_url = file_url.substring(file_url.lastIndexOf("/")+1,file_url.length)
	//拡張子も取り除く場合は次の行のコメントアウトをはずしてください
	//file_url = file_url.substring(0,file_url.indexOf("."));
	return file_url;
}

////////////////////////
// メニューセレクター //
////////////////////////
function LinkSelect(form, sel){
	url = sel.options[sel.selectedIndex].value;
	if(url=='http://www.hyobanten.com/'||url=='http://hosti.ddk.ne.jp/servlet/webddk.Idcheck'||url=='http://www.toshomaru.com/'){
		window.open(url) }	
	else {
		location.href = url; }
}

////////////////////////
// スクロールテキスト //
////////////////////////
var msg;
msg="・・・・・・・・・・・・・・★☆★  オンラインショッピングコーナーに新商品を追加しました！ ぜひご覧下さい！  ★☆★";
msg=msg+msg;
function disp(){
	setTimeout("disp()",250);
	msg=msg.substring(2,msg.length)+msg.substring(0,2);
	document.TopInformation.box.value=msg;
}

////////////////////
// タイプライター //
////////////////////
function typewriter() {
	i += 1;
	document.showmsg.conts.value = sample.substring(0, i);
	if (i <= sample.length) setTimeout("typewriter()", 50);
}
i = 0;
sample = "";

function link_info(m) {
  if(m==null)  m = "";
	i=0
	sample=m
	typewriter()
}

////////////////////////
// ウインドウオープン //
////////////////////////
function openwin(url) {
 /* 横幅650px、縦幅450pxのウインドウを開く */
 w = window.open(url, 'win','width=650,height=450,status=no,scrollbars=yes,directories=no,menubar=no,resizable=yes,toolbar=no');
}

//////////////////////////
// ウインドウオープン２ //
//////////////////////////
function OpenSubWindow(n) {
	popupWin = window.open('./open_' + n + '.html', 'popup', 'width=510,height=510,OpenSpace')
}

////////////////////////////
// ポップアップウインドウ //
////////////////////////////
//【HTML記述例】
//popWin('表示させるアドレス',ウィンドウの幅,ウインドウの高さ,スクロールバーON/OFF);
function popWin(url,w,h,s){
	window.open(url, 'win','width='+ w +',height='+ h +',scrollbars=' + s + ',status=0,directories=0,menubar=0,resizable=1,toolbar=0,fullscreen=0,dependent=1');
}

////////////////////////
// クローズウインドウ //
////////////////////////
function CloseThisWindow () {
	close()		
}

/////////////////////////////////
// 通販商品一覧TABLEレイアウト //
/////////////////////////////////
function Table(){
	document.write('<TABLE BORDER="1" WIDTH="500" CELLPADDING="0" CELLSPACING="1" BORDERCOLOR="#737373" RULES="none">');
	document.write('<TR><TD ALIGN="center" VALIGN="top" WIDTH="170" HEIGHT="170" ROWSPAN="3"><IMG SRC="images/'+ Img +'" WIDTH="170" HEIGHT="170" ALT="'+ Model +'"></TD>');
	document.write('    <TD ALIGN="center" WIDTH="330">');
	document.write('	<TABLE BORDER="0" CELLPADDING="3" CELLSPACING="0">');
	document.write('	<TR><TD ALIGN="center"><FONT SIZE="3"><B>'+ Model +'</B></FONT></TD></TR>');
	document.write('	</TABLE>');
	document.write('    </TD>');
	document.write('</TR>');
	document.write('<TR><TD ALIGN="center" BGCOLOR="#FFEBE3"><FONT SIZE="2" color="#D90013">販売価格 </FONT><FONT SIZE="4" color="#D90013"><U><I><B>￥'+ Price +' - </B></I></U></FONT><FONT SIZE="2" color="#D90013">（税別）</FONT></TD></TR>');
	document.write('<TR><TD VALIGN="top">');
	document.write('	<TABLE BORDER="0" WIDTH="100%" ALIGN="center" CELLPADDING="3" CELLSPACING="0">');
	document.write('	<TR><TD STYLE="line-height:103%;"><FONT SIZE="2">'+ Spec +'</FONT><FONT SIZE="2" COLOR="#0A979B"><U>'+ Feature +'</u></FONT><FONT SIZE="2" COLOR="#FF7700">'+ Comment  +'</FONT></TD></TR>');
	document.write('	<TR><TD ALIGN="right">');
	document.write('		<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">');
	document.write('		<TR>');
	if(Url != 0){ document.write('		    <TD><A HREF="'+ Url +'" target="_blank"><FONT SIZE="2"> 製品仕様 </FONT></A></TD>'); }
	document.write('		    <TD width="10">　</TD>');
	if(Price != 0){document.write('		    <TD><A HREF="before.html"><FONT SIZE="2">注文フォーム</FONT></A></TD>'); }
	document.write('		</TR>');
	document.write('		</TABLE>');
	document.write('	    </TD>');
	document.write('	</TR>');
	document.write('	</TABLE>');
	document.write('    </TD>');
	document.write('</TR>');
	document.write('</TABLE>');
	document.write('<BR>');
}

