﻿/*ロケーション情報*/
var	myLocation	= window.location;
var	w		= myLocation;

/*曜日配列*/
var	youbi	= new Array('日','月','火','水','木','金','土')

/*Cookie情報*/
var	myCookie	= document.cookie;
var	myFontSize	= (myCookie.match(/fontSize/ig))? myCookie.replace(/.*fontSize=(\d.?).*/ig,'$1').replace(/\;/ig,''):3;

function mAlert(str){
	if(myLocation.host.match(/origin/ig)){alert(str+'\nこのメッセージはテストURLでのみ表示されます')};
}
function tAlert(STR){
	if(w.search .match(/chk/)){	alert(STR);}
}

if(!login){
	var login	={
		"loginStatas"		: false,
		"IsChowari"			: false,
		"IsSgm"				: false
	}
}
function LoginStatasCallback(str){
	var ActivationResult	= (str.LoginStatasResponse.ActivationResult==0)? true:false;

	if(ActivationResult){
		login	={
			"loginStatas"		: (str.LoginStatasResponse.loginStatas==1)?		true:false,
			"IsChowari"			: (str.LoginStatasResponse.superDiscount==1)?	true:false,
			"IsSgm"				: (str.LoginStatasResponse.IsSgm==1)?			true:false
		}
	}else{
		login	={
			"loginStatas"		: false,
			"IsChowari"			: false,
			"IsSgm"				: false
		}
	}
//	mAlert(login.ActivationResult)
}

/*HTTPアラート*/
var	alertMsg=new Array();
	alertMsg[401]='認証が必要です';
	alertMsg[403]='アクセスできませんでした';
	alertMsg[404]='ファイルが見つかりませんでした';
	alertMsg[500]='内部サーバー・エラー';
	alertMsg[503]='サーバーが利用不可';

/*DOM操作用*/
function $(ID){
	return document.getElementById(ID);
}
function $$(tagName){
	return document.getElementsByTagName(tagName);
}

//Safati対策
//	(c) http://kawa.at.webry.info/	//
//	thanks!							//
function get_response_text ( HTML ) {
	var	text	= HTML;
	if ( navigator.appVersion.indexOf( "KHTML" ) > -1 ) {
		var	esc	= escape( text );
		if ( esc.indexOf("%u") < 0 && esc.indexOf("%") > -1 ) {
			text	= decodeURIComponent( esc );
		}
	}
	return text;
}

/*onLoad処理*/
/*
window.onload=function(){
	onLoadFunc();
	searchBoxChk();
	makeInnerHTML();
	if(myLocation.pathname.match(/\/titles\/\D{3,}/)){
		var	sn	= setNavi();
		getSystemText('squ',sn);
		/*requestFile('/titles/titlelist.txt','lineUp');
	}
}
*/

// ユーザーエージェント
var userAgent = navigator.userAgent.toLowerCase();

// ページの構築が完了したらloadを呼び出す
(function(){
	if(document.addEventListener){ // opera,safari,mozilla向け
		document.addEventListener("DOMContentLoaded", onLoadFunc, false);
	} else if(/msie/.test(userAgent)){ // IE向け
		try {
			document.documentElement.doScroll("left");
		} catch(error){
			setTimeout(arguments.callee, 0);
			return;
		}
		onLoadFunc();
	} else { // その他
		window.onload = onLoadFunc;
	}
})();


function func_lineUp(){
}

/*****************************************************
/連想配列の添字をカウント
hash_len(hash)

入力された連想配列の添字をカウント
hash		：連想配列
*****************************************************/
function hash_len(hash){
	var	num	=new Number();
	for (var i in hash) {
		 num++
	}
	return num;
}

/*****************************************************
/区切りの日付をSOURCENEXTフォーマットに変換
SNdObj(date)

区切りの日付をSOURCENEXTフォーマットに変換

date		：スラッシュ区切りの日にち
*****************************************************/
function SNdObj(date){
	if(date){
	var	d0	= date.split('/');
	var	d 	= new Date(date+' 0:0:0');
	
	return (d0[1]*1)+'月'+(d0[2]*1)+'日（'+youbi[d.getDay()]+'）';
	}
	return false;
}
/*****************************************************
/区切りの日付を日付オブジェクトに変換
slashDobj(date)

区切りの日付をSOURCENEXTフォーマットに変換

date		：スラッシュ区切りの日にち
*****************************************************/
function slashDobj(date){
	if(date){
		var	d 	= new Date(date+' 0:0:0');
		return d;
	}
	return false;
}

/*****************************************************
任意のIDに差込
reWrite(ID,str)

指定IDのタグ内にstrの値を書き込む。

ID		：書き込むタグのID※必須
str		：書き込む内容
*****************************************************/
function reWrite(ID,str){
	try{
		$(ID).innerHTML=str;
	}catch( e ){
		mAlert(ID+'が存在しないか書き込めません。')
	}
}


/*****************************************************
エクセルから出力された数列を日付に変換
getDateEX(num)

num	：数列
*****************************************************/
function getDateEX(num){
	if(isNaN(num)){
		retDate=false
	}else{
	var	date	= new Date(1899,11,30);
	var	dObj	= new Date();
		dObj.setTime(date.getTime() + (num * 24 * 3600 * 1000));
	var retDate	= dObj;
	}

	return retDate;
}


/*****************************************************
テーブル縞々
tblColor(ID,color1,color2[,color3,color4])

指定IDのテーブルに対して、色をつける。

ID		：色をつけるTABLEのID※必須
color1	：第一色※必須
color2	：第二色※必須
color3	：TH第一色※任意
color4	：TH第二色※任意

*****************************************************/
function tblColor(ID,color1,color2,color3,color4){
	var	TRcolor	= new Array(color1,color2)
	if(color3){
		var	THcolor	= new Array(color3,color4)
	}
	var	tblObj=document.getElementById(ID);
	var	tr	=	tblObj.getElementsByTagName('tr');
	var	th	=	tblObj.getElementsByTagName('th');
	for(i=0;tr.length>i;i++){
		tr[i].style.backgroundColor=TRcolor[i%2];
		if(color3){
		th[i].style.backgroundColor=THcolor[i%2];
		}
	}
}


/*****************************************************
トグル切り替え
fncTgl(ID)

指定IDで呼び出すごとに、trueとfalseを交互で返す。

ID		：一意のID
*****************************************************/

function fncTgl(ID){
	try{
		this[ID]	= !eval(ID)
	}catch( e ){
		this[ID]	= true;
	}
	return(this[ID])
}


/*****************************************************
配列追加
pushArray(arrayObj,str)

配列に要素をPush。
新規の場合は、作成。既存の場合はPush
arrayObj	：配列
str			：追加要素
*****************************************************/

function pushArray(arrayObj,str,rnd){
	try{
		if(rnd){
			var rndNum=Math.round(Math.random()*arrayObj.length);
			arrayObj.splice(rndNum,0,str);
		}else{
			arrayObj.push(str);
		}
	}catch( e ){arrayObj=new Array(str);}
	return(arrayObj)
}


/*****************************************************
wiki構文もどき処理
wiki(str)

******************************************************/
function wiki(str){
	var	HTML	= new String();
		HTML	= ('∴∵'+str).replace(/∴∵''([^'])/ig,'∴∵\'\'\'$1');
		HTML	= HTML.replace(/\(R\)/ig,'&reg;').replace(/\(C\)/ig,'<span class="thin">&copy;</span>').replace(/\(TM\)/ig,'<span class="thin">&#8482;</span>');
		HTML	= HTML.replace(/\（R）/ig,'&reg;').replace(/（C）/ig,'<span class="thin">&copy;</span>').replace(/（TM）/ig,'<span class="thin">&#8482;</span>');
		HTML	= HTML.replace(/'''(.*?)'''/ig,'<strong>$1</strong>').replace(/\(\((.*?)\)\)/ig,'<span style="font-size:80%;">$1</span>').replace(/<<(.*?)>>/ig,'<span style="font-size:80%;">$1</span>').replace(/\((.*?)\|(.*?)\)/ig,'<a href="$2" target="_blank">$1</a>').replace(/∴∵/,'');
	return HTML
}

/*****************************************************
Flash読み込み
swf(swfPath,width,height)

FlashをJavascript経由で読み込みScriptの位置に表示する。
「1クリック」対策。

swfPath	：swfファイルのPath※必須
width		：表示幅※必須
height	：表示高さ※必須
******************************************************/
function swf(swf,w,h){
	var	HTML = new String();
	HTML+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+w+'" height="'+h+'" class="js_swf">';
	HTML+='<param name="movie" value="'+swf+'">';
	HTML+='<param name="quality" value="high">';
	HTML+='<embed src="'+swf+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+w+'" height="'+h+'">';
	HTML+='</embed>';
	HTML+='</object>';
	document.write(HTML)
}

/*****************************************************
分割払い
calc(price)

分割払いを出力する

price	：価格（コンマなし）
******************************************************/
/* 分割回数 */
times		= new Array(3,5,6,10,12,15,18,20,24);

/* 分割手数料（100円あたり） VISAの場合 */
commission	= new Array(1.71,2.85,3.45,5.70,6.84,8.55,10.26,11.40,13.68);

/* 計算 */
function wcalc(price) {
	document.write(calc(price));
}

function calc(price) {
	var	total		= price*1;							// ご利用金額
	var	tid			= getTimesID(total);					// 分割回数ID
	var	payAmount	= total + getCommission(total, tid);	// お支払い合計金額
	monthly			= Math.round(payAmount / times[tid]);	// １回あたりの金額
	myTimes			= times[tid];							// 分割回数
	var	HTML	= (total >= 10000)?	'<p style="font-size:80%;margin-top:5px;"><a href="javascript:open_window(\'/cp/bunkatsu/simulation.html\',600,530)">分割払いシミュレーション</a><br>'+myTimes+'回払い'+ketatori(monthly)+'円/1回</p>':'';
	return(HTML);
}

function getTimesID(total) {
	if(total>175000){
	return(8);
	}else if(total>160000){
	return(7);
	}else if(total>110000){
	return(6);
	}else if(total>81000){
	return(5);
	}else if(total>94000){
	return(4);
	}else if(total>58000){
	return(3);
	}else if(total>48000){
	return(2);
	}else if(total>28000){
	return(1);
	}else{
	return(0);
	}
}

function getCommission(total, tid) {
  val		= commission[tid];
  return( Math.round(total * (val / 100)) );
}


/*外部スクリプト読み込み*/
/*****************************************************
#Objet d'import de javascript .js
******************************************************/
function ImportJS() {
	var nbr_att = arguments.length;
	var js_effets=document.createElement("script");
	js_effets.setAttribute("type", "text/javascript");
	js_effets.setAttribute("src", arguments[0]);
	if(nbr_att>1){
		for (var i = 1; i<nbr_att; i++){
			js_effets.setAttribute(arguments[i][0], arguments[i][1]);
		}
	}
	$$("head")[0].appendChild(js_effets);
}


/*****************************************************
折りたたみ
exMenu(ID)

入力されたID属性の表示非表示を変更する。
該当するIDが存在しない場合は「IDが存在しません」とアラートをたてる。

ID		: CSS ID属性値（必須）
******************************************************/
function exMenu(ID) {
	if($(ID)){
		var	tMenu = $(ID).style;
		tMenu.display = (tMenu.display == 'block') ? 'none' : 'block' ;
	}else{
		mAlert('「'+ID+'」が存在しません。');
	}
}

/*****************************************************
桁とり
ketatori(num)

入力された値を桁とり（3桁ごとに「,」を挿入）して返す
該当する値が存在しない場合は「false」を返す。

num		: 数値（必須）
******************************************************/
function ketatori(num){
	return num.toString().replace( /([0-9]+?)(?=(?:[0-9]{3})+$)/g , '$1,');
}

/*****************************************************
ファイルのインポート
importFile(PATH)

与えられたパスに存在するファイルを読み込んで表示する。


PATH		: 呼び出すファイルのパス
******************************************************/
function importFile(URI,ID){
	if(ID){
	}else{
	var ID	= 'ID'+(Math.ceil(Math.random()*1000000+10000000))
	document.write('<ins style=" text-decoration:none;" ID="'+ID+'"></ins>');
	}
	requestFile(URI,'import',ID);
}

/*****************************************************
ファイルのインポート（ぺろんぺろん）
importFile(PATH)

与えられたパスに存在するファイルを読み込んで表示する。


PATH		: 呼び出すファイルのパス
******************************************************/
function importFilePero(URI,ID){
	if(ID){
	}else{
	var ID	= 'ID'+(Math.ceil(Math.random()*1000000+10000000))
	document.write('<ins style=" text-decoration:none;" ID="'+ID+'"></ins>');
	}
	requestFile(URI,'importPero',ID);
}




/*****************************************************
マイル解説
mileWindow()

マイルの解説をポップアップする。
******************************************************/
function mileWindow() {
	open_window("/common_img/mileage/",500,350);
}
function open_window1(URI) {
	open_window(URI,600,400);
}

/*****************************************************
ダウンロード時間シミュレータ
mileWindow(num)

num		: ファイルのダウンロードサイズ
******************************************************/
function sizeWindow(num) {
	open_window("/dl/simulation.html?"+num,465,360);
}

function resSearch(){
	var	myArgs	= w.search.replace(/\?/,'').split('&');
	var	args	= new Array();
	for(var i=0; i<myArgs.length; i++){
		var argTemp	=myArgs[i].split('=');
		var arg		=argTemp[0];
		var value	=argTemp[1];
		args[arg]	= value;
	}
	return	args;
}

/*XML操作系*/
/*****************************************************
XMLから任意の情報を抽出する
xmlTag(XMLObject,tagName[,nodeNumber,Attribute])

指定されたXMLオブジェクトの指定されたタグの内容を返す
該当する値が存在しない場合は「false」を返す。

XMLObject		: XMLオブジェクトを指定※必須
tagName			: タグを指定※必須
nodeNumber		: ノードを数値で指定※省略可（省略時は一番先頭のノードが読み込まれる）
Attribute		: アトリビュート※省略可（省略時は指定ノードの情報が出力される）
******************************************************/

function xmlTag(xmlObj,tag,num,Attribute){
	var	num		= (num>0)? num:0;
	try{
		var	t	= xmlObj.getElementsByTagName(tag);
	}catch( e ){
		var	t	= false;
	}
	if(t){
		var	temp	= t[num]
		if(!Attribute){
			try{
				return	temp.firstChild.nodeValue.replace(/\n/ig,'<br />');
			}catch( e ){
				return	false;
			}
		}else{
			try{
				var	t= temp.getAttribute(Attribute);
				return (t!=null)? t: false;
			}catch( e ){
				return	false;
			}
		}
	}else{
		return	false;
	}
}


/*****************************************************
XMLオブジェクト作成
createXMLHttp()

XMLオブジェクトを作成する
XMLオブジェクトが作成できない場合は「false」を返す。
******************************************************/
function createXMLHttp(){
	if (window.XMLHttpRequest) {
		return(new XMLHttpRequest());
	} else if (window.ActiveXObject) {
		try {
			return(new ActiveXObject("Msxml2.XMLHTTP"));
		} catch(e) {
			return(new ActiveXObject("Microsoft.XMLHTTP"));
		}
	} else {
		return(false);
	}
}

/*****************************************************
同期確認
confirmation(obj)

足並みを確認する。
足並み確認用Objectを入力し、全てのプロパティを確認し
全て真だった場合、真を返す。
******************************************************/
function confirmation(obj){
	var n	= new Number()
	for (var i in obj) {
		n+=(obj[i])?0:1;
	}
	return (n==0)? true:false;
}

/*****************************************************
注意書き
makeAtP(attention)
attention = ((yyyy/mm/dd))文字列|文字列
複数行は「 | 」で区切る。
掲載期間は頭に((yyyy/mm/dd))をつける。
******************************************************/
function makeAtP(attention){
	var HTML = new String();
	if(attention){
	var	atText	= new Array();
	var nowTime=slashDobj(time.toString().replace(/(\d{4})(\d{2})(\d{2})\d{2}/,'$1/$2/$3'));
		var tempAttention	= attention.split('|');
		for (var h=0; tempAttention.length>h; h++){
			var	_tObj	= tempAttention[h].match(/\(\(\d{4}\/\d{2}\/\d{2}\)\)/);
			if(_tObj){
			var	tObj	= slashDobj(_tObj.toString().match(/\d{4}\/\d{2}\/\d{2}/));
			var	sabun	= (tObj.getTime() -nowTime.getTime())/(24*60*60*1000);
				if(sabun>0){
					var	naiyou	= tempAttention[h].replace(/\(\(\d{4}\/\d{2}\/\d{2}\)\)/ig,'');
					atText.push(naiyou);
				}
			}else{
				var	naiyou	= tempAttention[h];
				atText.push(naiyou);
			}
		}
		HTML ='<p class="kome">※'+atText.join('</p><p class="kome">※')+'</p>'
	}
	return HTML.replace(/※※/ig,'※');
}

/*****************************************************
XML取得
requestFile(fileName,ID,[myID,obj,callbackFaunction])
******************************************************/
/*XML読み込み*/
function requestFile(fileName,ID,myID,obj,callbackFaunction) {
	var	xmlObj = createXMLHttp();
	if (xmlObj){
		xmlObj.onreadystatechange = function (){
			if (xmlObj.readyState == 4){
				if(xmlObj.status == 200){
					eval('func_'+ID)(xmlObj,myID,obj,callbackFaunction);
				}else if(xmlObj.status != 200){
					mAlert('「'+fileName+'」\n'+alertMsg[xmlObj.status]);
				}
			}
		}
		xmlObj.open('GET', fileName+'?rnd='+Math.ceil(Math.random()*10000) ,true);
		xmlObj.send(null);
	}else{
		mAlert("XMLHttpRequest非対応のブラウザです。");
	}
}

function func_import(xml,ID){
	var	txt		= xml.responseText;
	reWrite(ID,txt)
	if(ID=='js_sysPage'){
		var	_myName	=txt.match(/<!--：.+?：.+?：.+?：.+?：-->/);
		var	myName	=_myName.toString().split('：')
		reWrite('js_pName',myName[4])
	}
}

function func_importPero(xml,ID){
	var	txt		= xml.responseText;
	var	chk	= txt.match(/<!--：次回確認日：\d{8}：.*?：.*?：-->/);
	if(chk){
		var	cArray	= chk.toString().split('：');
	}
	var mongon=(chk)?cArray[4]:'詳細'
	txt		=  '<p ID="'+ID+'_c1" onClick="exMenu(\''+ID+'_o\');exMenu(\''+ID+'_c1\');exMenu(\''+ID+'_c2\');exMenu(\''+ID+'_body\');" style="font-size:80%; display:none; cursor:pointer; display:none"><span style=" color:#f90">▲</span>閉じる</p>\n<p ID="'+ID+'_o" onClick="exMenu(\''+ID+'_o\');exMenu(\''+ID+'_c1\');exMenu(\''+ID+'_c2\');exMenu(\''+ID+'_body\');" style="font-size:80%; cursor:pointer; display:block"><span style=" color:#f90">▼</span>'+mongon+'を見る</p>\n<div ID="'+ID+'_body" style="display:none;">'+txt+'</div>\n';
	txt		+= '<p ID="'+ID+'_c2" onClick="exMenu(\''+ID+'_o\');exMenu(\''+ID+'_c1\');exMenu(\''+ID+'_c2\');exMenu(\''+ID+'_body\');" style="font-size:80%; display:none; cursor:pointer; display:none"><span style=" color:#f90">▲</span>閉じる</p>\n';
	reWrite(ID,txt)
}

/****/
function func_t(xml){
	var	xmlObj	= xml.responseXML.getElementsByTagName('items');
		titlesObj	= new Array();
		itmAry		= new Array()
		var	j		= new Number()

	var	tXmlobj		= xmlObj[0].getElementsByTagName('product')
	for(var i=0; tXmlobj.length>i;	i++){
		var	name	=xmlTag(tXmlobj[i],'productName');
		var	yomi	=xmlTag(tXmlobj[i],'productName',0,'yomi');
		var	genre	=xmlTag(tXmlobj[i],'irokubun');
		var	note	=xmlTag(tXmlobj[i],'text');
		var	ss		=xmlTag(tXmlobj[i],'irokubun',0,'bunrui');
		var	JAN		=xmlTag(tXmlobj[i],'JAN');
		var	ISBN	=xmlTag(tXmlobj[i],'ISBN');
		var	series	=xmlTag(tXmlobj[i],'series');
		var	lineUp	=xmlTag(tXmlobj[i],'lineup');
		var	mile	=xmlTag(tXmlobj[i],'mile');

		var	ePack	=xmlTag(tXmlobj[i],'p_package');
		var	eDL		=xmlTag(tXmlobj[i],'p_download');
		var	eDS		=xmlTag(tXmlobj[i],'p_downstall');

		var	os		=xmlTag(tXmlobj[i],'OS');
		var	pack	=xmlTag(tXmlobj[i],'dokon');

		var	license	=xmlTag(tXmlobj[i],'dokon');
		var	start	=xmlTag(tXmlobj[i],'start');
		var	end		=xmlTag(tXmlobj[i],'end');

		var	pageID	=xmlTag(tXmlobj[i],'pageID');
		var	sCode	=(JAN)?JAN.toString().substr(7,5):false;

		if(JAN){
			itmAry[j++]			= new Array(yomi,sCode)
			titlesObj[sCode]	= new titles(name,yomi,mile,genre,ss,sCode,note,series,lineUp,JAN,ISBN,ePack,eDL,eDS,os,pack,license,start,end,pageID);
		}
	}
/*
	alert(sCode);
*/
	itmAry.sort();
//	reWrite('sample',titlesObj[61340].w50HTML(true)+'<br />'+titlesObj[61340].hatsubaibi.getFullYear()+'年'+(titlesObj[61340].hatsubaibi.getMonth()*1+1)+'月'+titlesObj[61340].hatsubaibi.getDate()+'日')
	reWrite('sample','<a href="javascript:reWrite(\'sample\',create_50List())">作成</a>');
}

/**ここから製品ページ用**/
/*色定義*/
var	bgCol	= new Array();
	bgCol['kid'] = '#ff9ace'
	bgCol['sel'] = '#84bade'
	bgCol['sys'] = '#b59ece'
	bgCol['use'] = '#ff7552'
	bgCol['hob'] = '#9cd342'
	bgCol['ent'] = '#ffb200'
	bgCol['pack'] = '#c6ebf7'

/*製品情報オブジェクト*/
function titles(name,yomi,mile,genre,sentences,code,note,series,lineUp,JAN,ISBN,ePack,eDL,eDS,os,pack,license,hatsubaibi,end,pageID) {
	this.name		= name.replace(/(ソースネクストセレクションコミックス)/,'$1&reg;');			//製品名
	this.yomi		= yomi;			//製品名読み
	this.genre		= genre;		//色分類
	this.sentences	= sentences;	//中文類
	this.code		= code;			//製品コード
	this.note		= note;			//1行キャッチ
	this.series		= series;		//シリーズ名
	this.lineUp		= lineUp;		//ラインアップ名
	this.ePack		= ePack;		//価格
	this.eDL		= eDL;			//価格
	this.eDS		= eDS;			//価格
	this.os			= os;			//対応OS
	this.pack		= pack;			//パッケージ内容
	this.license	= license		//ライセンス
	this.end		= end;			//販売終了日
	this.pageID		= pageID;		//ページID

	var	dObj	= new Date(1900,1,1);
		dObj.setDate(hatsubaibi-32);
		
	this.hatsubaibi	= dObj;	//発売日

	var	priceNc		= (Math.floor((ISBN.toString().replace(/.*\\/ig,'').replace(/E/ig,'')*1.05)/10))*10;
	this.priceNc	= priceNc;		//桁とりなし素の価格
	this.price		= ketatori(priceNc);	//桁とりした価格

	this.mile		=(mile)? mile:Math.floor(priceNc/10);

	//製品ページURL
    this.uri		= function() {
        return ('/titles/'+this.genre+'/'+this.code+'/');
    }

	//パッケージページ用、パッケージ詳細HTML出力
    this.toPacklist	= function() {
        return ('<a href="/titles/'+this.genre+'/'+this.code+'/">'+this.name+'<img src="/img/common_img/next.gif" width="15" height="15" align="absmiddle" border="0"></a>');
    }
	//価格
	this.toPackName	= function() {
		return ('<h4>'+this.name+'</h4><p class="caption">標準価格　'+this.price+'円</p>');
	}
	//新規製品チェック
	this.newTitles	= function() {
		var HTML	=	new String();
			HTML	+=	'<div class="nBox">';
			HTML	+=	'<div class="nImg">'+('<img src="/img/product_img/'+this.code+'_m.gif" width="60" height="80"  border="0">').link('/titles/'+this.genre+'/'+this.code+'/')+'</div>';
			HTML	+=	'<p class="nHatsubaibi">'+this.hatsubaibi.getFullYear()+'年'+(this.hatsubaibi.getMonth()+1)+'月'+this.hatsubaibi.getDate()+'日</p>';
			if(this.series.length>0){
				HTML	+=	'<h2>'+this.series.link('/titles/'+this.genre+'/'+this.code+'/')+'</h2>';
				var p	='\uFF5E'
			}else{
				HTML	+=	'<h2>'+this.name.link('/titles/'+this.genre+'/'+this.code+'/')+'</h2>';
				var p	=''
			}
			HTML	+=	'<p>標準価格'+this.price+'円(税込)'+p+'</p>';
			HTML	+=	'<p class="nNote">'+this.note+'</p>';
			HTML	+=	'</div>';
		return(HTML);
	}
	//製品名出力（シリーズ名考慮）
	this.seriesname	= (series)?	series:name;
	//
	this.w50HTML	=function(bln){
		var	HTML	= new String();
		var	myName	= new String();
		myName	= (series.length>1)? series	: name ;
		if(bln){
			HTML += '<tr valign="top" nowrap class="';
			HTML +=	(fncTgl('w50'))?'ca':'cb';
			HTML += '">';
			HTML += '<th>'+myName+'</th>';
			HTML += '<td>'+sentences+'</td>';
			HTML += '<td>'+note+'</td>';
			HTML += '<td class="ssi" nowrap>'+'<img src="/img/common_img/next.gif" width="15" height="15" align="absmiddle" border="0">詳細'.link('/titles/'+genre+'/'+code+'/')+'</td></tr>';
			return(HTML);
		}else{
			return('');
		}
	}
}

/*50音INDEX作成*/
function make50INDEX(){
	var	w		= new Array();
		w[0]	=  new Array('<table border="0" cellspacing="0" cellpadding="0" class="tbl50"><tr><td colspan="4"><a name="a"></a><h2>あ</h2></td></tr>\n',true);
		w[1]	=  new Array('<tr><td colspan="4" nowrap valign="bottom"><a name="k"></a><h2>か<a href="#top">▲上に戻る</a></h2></td></tr>\n',true);
		w[2]	=  new Array('<tr><td colspan="4" nowrap valign="bottom"><a name="s"></a><h2>さ<a href="#top">▲上に戻る</a></h2></td></tr>\n',true);
		w[3]	=  new Array('<tr><td colspan="4" nowrap valign="bottom"><a name="t"></a><h2>た<a href="#top">▲上に戻る</a></h2></td></tr>\n',true);
		w[4]	=  new Array('<tr><td colspan="4" nowrap valign="bottom"><a name="n"></a><h2>な<a href="#top">▲上に戻る</a></h2></td></tr>\n',true);
		w[5]	=  new Array('<tr><td colspan="4" nowrap valign="bottom"><a name="h"></a><h2>は<a href="#top">▲上に戻る</a></h2></td></tr>\n',true);
		w[6]	=  new Array('<tr><td colspan="4" nowrap valign="bottom"><a name="m"></a><h2>ま<a href="#top">▲上に戻る</a></h2></td></tr>\n',true);
		w[7]	=  new Array('<tr><td colspan="4" nowrap valign="bottom"><a name="y"></a><h2>や<a href="#top">▲上に戻る</a></h2></td></tr>\n',true);
		w[8]	=  new Array('<tr><td colspan="4" nowrap valign="bottom"><a name="r"></a><h2>ら<a href="#top">▲上に戻る</a></h2></td></tr>\n',true);
		w[9]	=  new Array('<tr><td colspan="4" nowrap valign="bottom"><a name="w"></a><h2>わ<a href="#top">▲上に戻る</a></h2></td></tr>\n',true);
	return(w)
}

/*50音順リスト出力*/
function create_50List(){
//	ranking('name.html');//ページ右部ランキング表示
	var	index	= make50INDEX();	//50音INDEX作成
	var HTML	= new Array();
	var	j		= new Number();

	for(var i=0; i<itmAry.length; i++){
		if(!titlesObj[itmAry[i][1]].pageID){
			HTML[j++]	= titlesObj[itmAry[i][1]].w50HTML(true);
		}
	}
	return('<div id="w50"><table border="0" cellspacing="0" cellpadding="0" class="tbl50">'+HTML.join('\n')+'</table>\n</div>');


/*
	HTMLarray.sort();

	for(var i=0; i<array.length; i++){
		var j		= chkLine(objArray[array[i]].yomi);
		if(w[j][1]){
			HTML	+=	w[j][0];
			w[j][1]	=	false;
			c		=	true;
		}
		array[i]	=	HTML;
		document.getElementById('loading').innerHTML	= '処理中：'+i+'件/'+array.length+'件';
	}
	document.getElementById('loading').style.display='none';
*/
}

/*****************************************************
「動作環境」「FAQ」「ユー声」読み込み
getSystemText(str)
strに「s：動作環境」「q or f：Q&A」「u：ユー声」を指定することで、
特定のIDへ情報が読み込まれる
******************************************************/
/*「動作環境」「FAQ」「ユー声」読み込み*/
function getSystemText(str,sn){
	(str.match(/s/))?	requestFile('/produce/system/'	+sn+'.txt','system'	)	:void(0);
	(str.match(/q|f/))?	requestFile('/produce/qa/'		+sn+'.txt','qa'		)	:void(0);
	(str.match(/u/))?	requestFile('/produce/user/'	+sn+'.txt','user'	)	:void(0);
}

/*****************************************************
「画像」ポップアップ
popup(URL)
URLに画像を指定することで、画像表示用のポップアップWindowが
開く。Windowのサイズは画像に最適化される。
******************************************************/
/*「動作環境」「FAQ」「ユー声」読み込み*/
function popup(url) {
	if(window.nwin){
		window.nwin.close();
	}
	nwin	= window.open('/img/popup.html?URL='+url,"nwin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,WIDTH=100,HEIGHT=100");
	window.nwin.focus();
}

/*****************************************************
ポップアップ
open_window(URL,width,height)
URLに画像を指定することで、画像表示用のポップアップWindowが
開く。Windowのサイズは画像に最適化される。
******************************************************/
/*「動作環境」「FAQ」「ユー声」読み込み*/
function open_window(url,w,h) {
	if(window.nwin){
		window.nwin.close();
	}
	nwin = window.open(url,'nwin','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,WIDTH='+w+',HEIGHT='+h);
	window.nwin.focus();
}


/*CSS関連*/
function reSizeWin(){
	document.FORM.fontSize.selectedIndex=myFontSize-1;
}
function makeInnerHTML(){
	try{
		makeInnerHTML_GT()
	}catch( e ){
		/*テストURLでの校正機能提供*/
		if(myLocation.port > 0){
			var hostName	= myLocation.hostname.split('.');
			var jsName		= hostName[0]+'-'+myLocation.port+'.js';
			var js = new ImportJS('/js/'+jsName);
		}
	
		/*特殊処理*/
		var	HTML	= new String();
		if(window['key']){
			if(key=='com')	{
				HTML	+=	'<div style="text-align:right;"><a href="/rule/index.html">規約一覧</a>　　</div>'
			}else if(key=='rec')	{
				HTML	+=	'<div style="text-align:right;"><a href="http://www.sourcenext.com/privacy/jinji.html">採用に関する個人情報の取り扱いについて</a>　　</div>'
			}else if(key=='par')	{
				HTML	+=	'<div style="text-align:right;"><a href="http://www.sourcenext.com/privacy/partner.html">個人情報の取り扱いについて</a>　　</div>'
			}else if(key=='sup')	{
				HTML	+=	'<div style="text-align:right;"><img src="/test/img/support/powerdby.gif">　　</div>'
			}
		}
	
		/*使用許諾系*/
		var anc=document.getElementsByTagName('A');
		for(var i=0; i<anc.length; i++){
			if(anc[i].getAttribute('href')){
				if(anc[i].getAttribute('href').match(/\/agree\?/)){
					var temp=anc[i].getAttribute('href').split('?');
					anc[i].setAttribute('href','/titles/agree/?'+temp[1]);
					anc[i].setAttribute('target','_blank');
				}
			}
		}
	
		/*文字サイズ変更*/
		HTML	+=	'当サイトでは　■文字の大きさを調節できます　';
		HTML	+=	'<form name="FORM" style="display:inline;">';
		HTML	+=	'<select name="fontSize" onChange="setCookie()">';
		HTML	+=	'<option>極小</option>';
		HTML	+=	'<option>小</option>';
		HTML	+=	'<option>中</option>';
		HTML	+=	'<option>大</option>';
		HTML	+=	'<option>特大</option>';
		HTML	+=	'</select>';
		HTML	+=	'</form>';
		HTML	+=	'　　■ロゴマークをクリックするといつでもトップページに戻れます';
		
		HTML	+=	'<div style="text-align:right">Copyright (C) SOURCENEXT CORPORATION All Rights Reserved.<a href="http://www.sourcenext.com/privacy/"><img src="http://www.sourcenext.com/img/common_img/trustejp.gif" align="absmiddle" border="0" height="34" width="116" style="margin-left:1em"></a></div>';
	
		var obj	= $('footer');
		obj.innerHTML = HTML;
		obj.style.backgroundColor = document.bgColor;
		reSizeWin();
	
	
		/*期間限定処理*/
		try{
		//Script
			setZERONOTE();
		}catch( e ){
		//エラー時の処理
		}
		}

}
/*削除してもいいやつ*/
function maijanStart(){
	if((myLocation.pathname.match(/\/cp\/|\/pt\//ig))&&(myLocation.port == 9001)){
		try{
			hObj=$('head');
			aArray	= hObj.getElementsByTagName('A');
			for (var i=0; i<aArray.length; i++){
				aArray[i].innerHTML=aArray[i].innerHTML.toString().replace(/会員だけの格安キャンペーン/,'キャンペーン一覧').replace(/マイページ/,'マイページ（NEW 春の毎ジャン）');
			}
		}catch( e ){}
	}
}

/*製品ページ系*/
function searchBoxChk(){
	var oE	= $$('form');
	try{
		if(oE[0].getAttribute("ACTION")=='http://search-asp.fresheye.com/'){
			oE[0].getAttributeNode("ACTION").value='http://search-asp.fresheye.com/cgi-bin/SEARCH-ASP/utf8/go.cgi';
			oE[0].innerHTML='<INPUT TYPE="HIDDEN" VALUE="s" NAME="ord"><INPUT TYPE="HIDDEN" VALUE="10538" NAME="id"><INPUT TYPE="TEXT" NAME="kw"  size="10" style="width:120px" onMouseOver="setTgl(false)" onMouseOut="setTgl(true)"><INPUT TYPE="SUBMIT" VALUE="検索" onMouseOver="setTgl(false)" onMouseOut="setTgl(true)">';
		}
	}catch( e ){}
}
function setColorNavi(path){
	var	obj		= $('head_'+path);
	var	head	= $('siteNavi');
		obj.style.display			= "block";
		head.style.backgroundColor	= bgCol[path];
}
function setNavi(){
var H1				= $$("H1");
	var path	= myLocation.pathname.split('/');
	var	gen		= path[2];
	var	sn		= path[3];

	var	productsName	= H1[0].innerHTML.replace(/\&reg\;/ig,'');
		setColorNavi(path[2]);
	var	navLst	= $('nav_'+path[2]);
	var	headBas	= $('head_bas');

	var	HTML	=	new String();
		HTML	=	'<div><a href="/img/product_img/'+sn+'_ll.jpg" onclick="popup(\'/img/product_img/'+sn+'_ll.jpg\'); return false"><img src="/img/product_img/'+sn+'_l.gif" border="0" height="140" width="100" title="'+productsName+'"></a></div>';
		HTML	+=	'<div id="packZoom"><a href="/img/product_img/'+sn+'_ll.jpg" onclick="popup(\'/img/product_img/'+sn+'_ll.jpg\'); return false">[拡大する]</a></div>'

	reWrite('package',HTML);
	reWrite('nav_THIS',productsName);
	reWrite('productCode','製品コード：'+sn);
	
	navLst.style.display		= "inline";
	headBas.style.display		= "none";

	return	sn;
}

/*プロデュース系*/
function po(str){
	var HTML= str;
	HTML	= HTML.replace(/\n/g,'∴∴');
	HTML	= HTML.replace(/\r/g,'∴∴');
	HTML	= HTML.replace(/∴∴∴∴/g,'∴∴');
	HTML	+= '∴';
	return(HTML);
}

function func_user(txt){
	var	HTML	= get_response_text(txt.responseText);
	if(HTML.length > 5){
		HTML	= po(HTML);
		HTML	= '∴'+HTML;
		HTML	= HTML.replace(/∴●(.*?)∴/g,'<li>●$1</li>\n');
		HTML	= HTML.replace(/【(.*?)】∴/g,'<p class="caption">$1</p>\n');
		HTML	= HTML.replace(/<p class="caption"><\/p>/ig,'');
		HTML	= HTML.replace(/∴/g,'');
		HTML	= HTML.replace(/\(/g,'（').replace(/\)/g,'）');
		try{
			reWrite('userHTML','<h4>お客様アンケートより</h4>\n<div><img src="/img/common_img/clear.gif" width="180" height="1" border="0"></div>\n<ul>'+HTML+'</UL>\n');
			$('userHTML').style.display='block';
		}catch( e ){}
	}
}
function func_qa(txt){
			var	URI	= myLocation.pathname.split('/');
			var	myPath	= URI[1];
			var	HTML	= po('∴'+get_response_text(txt.responseText));
			HTML	= HTML.replace(/∴Q\.(.*?)∴/g,'<dt class="faq-q">Q.$1</dt>\n');
			HTML	= HTML.replace(/∴A\.(.*?)∴/g,'<dd class="faq-a">A.$1</dd>\n');
			HTML	= HTML.replace(/∴(.*?)∴/g,'<dd>$1</dd>\n');
			HTML	= HTML.replace(/\(R\)/ig,'&reg;');
			HTML	= HTML.replace(/\(TM\)/ig,'&#8482;');
			HTML	= HTML.replace(/∴/g,'');
			HTML	= HTML.replace(/\/\/\//ig,'<br />');
			HTML	= HTML.replace(/\(\((.*?)\|(.*?)\)\)/g,'<a href="$2">$1</a>');
			HTML	= HTML.replace(/∴/g,'');
			if(myPath=='cp'||myPath=='pt'||myPath=='produce'){
				HTML	= HTML.replace(/<dd.*?動画チュートリアル.*?dd>/ig,'');
			}
		try{
			reWrite('qaHTML',HTML);
			$('qaHTML').style.display='block';
		}catch( e ){}
}
function createList(str){
	var	HTML	= str.replace(/安心サービス/,'<a href="/support/free/">安心サービス</a>');
		HTML	= HTML.replace(/([^∴])※/g,'$1<span class="caption">※</span>');
		HTML	= HTML.replace(/∴※(.*?)∴/g,'<li class="note">※$1</li>\n');
		HTML	= HTML.replace(/∴\[(.*?)\]∴/g,'<li class="b">$1</li>\n');
		HTML	= HTML.replace(/∴●(.*?)∴/g,'<li>$1</li>\n');
		HTML	= HTML.replace(/∴/g,'');
	return(HTML);
}
function func_system(txt){
		var tgl	= false;
		var myport	= myLocation.port;
		var	sysDoc	= po(get_response_text(txt.responseText));
			sysDoc	= sysDoc.replace(/\(C\)/ig,'&copy;').replace(/\(R\)/ig,'&reg;').replace(/\(TM\)/ig,'&#8482;');
			sysDoc	= sysDoc.replace(/\(\(([^\|]*?)\|(http.*?:\/\/[^\|]*?)\)\)/g,'<a href="$2" target="_blank">$1</a>（別ウィンドウで開きます）');
			sysDoc	= sysDoc.replace(/\(\((.*?)\|(http.*?:\/\/.*?)\|(.*?)\)\)/g,'<a href="$2" target="_blank">$1</a>（$3のページが別ウィンドウで開きます）');
			sysDoc	= sysDoc.replace(/\/\/\//ig,'<br />');
			sysDoc.match(/【製.*?】∴(.*?)∴【こ.*?】∴(.*?)∴【ご.*?】∴(.*?)∴【著.*?】∴(.*?)∴【サ.*?】∴(.*?)∴【(.*?)】∴(.*?)∴【マイル】∴∴(.*?)∴$/);

		var	productName		= new String(RegExp.$1);
		var	systemHTML		= new String(RegExp.$2);
		var	warningHTML		= new String(RegExp.$3);
		var	copyrightHTML	= new String(RegExp.$4);
		var	supportHTML		= new String(RegExp.$5);
		var	supportSUB		= new String(RegExp.$6);
		var	conditionHTML	= new String(RegExp.$7);
		var	mileHTML		= new String(RegExp.$8);
			mileHTML		= (tgl) ? mileHTML.replace(/各/g,''):mileHTML;
		if(tgl) document.getElementById('pName').innerHTML		= productName.replace(/∴/g,'')+'の動作環境';


			systemHTML		= createList(systemHTML);
			warningHTML		= createList(warningHTML);
			copyrightHTML	= createList(copyrightHTML);
			supportHTML		= createList(supportHTML);
			conditionHTML	= createList(conditionHTML);


		if(warningHTML.length>15)	document.getElementById('warning').style.display='block';
		if(supportHTML.length<15){
			supportHTML	=	'<div style="width:30px; float:left;"><img src="/img/common_img/free.gif" width="25" height="25"></div>\n'
			supportHTML	+=	'<h4 class="sn">安心サービス対象製品</h4>'
			supportHTML	+=	'<h5>万一正常に動作しない場合、ソースネクストに返品できる安心サービス対象製品です。</h5>\n'
			supportHTML	+=	'<ul class="sn">\n'
			supportHTML	+=	'<li>ご購入30日以内</li>\n'
			supportHTML	+=	'<li>レシートなどが必要</li>\n'
			supportHTML	+=	'<li>ユーザー登録が必要</li>\n'
			supportHTML	+=	'</ul>'
		}else{
			supportHTML	=	'<h4>サポート情報</h4>\n<ul>'+supportHTML+'</ul>\n';
		}

		if(conditionHTML.length<15){
			conditionHTML =		'<div style="width:30px; float:left;"><img src="/img/common_img/support_b.gif" width="30" height="18"></div>\n'
			conditionHTML +=	'<h4 class="sn">webとeメールによるサポートです</h4>'
			conditionHTML +=	'<h5>サポート対象条件</h5>\n'
			conditionHTML +=	'<ul class="sn">\n'
			conditionHTML +=	'<li>メーカーサポートのパソコンであること</li>\n'
			conditionHTML +=	'<li>OSが推奨する条件と上記を満たすこと</li>\n'
			conditionHTML +=	'<li>ユーザー登録されていること</li>\n'
			conditionHTML +=	'</ul>'
		}else{
			conditionHTML =		'<h4>'+supportSUB+'</h4>\n<ul>'+conditionHTML+'</ul>\n';
		}
		reWrite('systemHTML',systemHTML.replace(/∴/g,''));
		reWrite('warningHTML',warningHTML.replace(/∴/g,''));
		reWrite('copyrightHTML',copyrightHTML.replace(/∴/g,''));
		reWrite('supportHTML',supportHTML.replace(/∴/g,''));
		reWrite('conditionHTML',conditionHTML.replace(/∴/g,''));
		reWrite('mileNum',mileHTML.replace(/∴/g,''));
/*
		try{$('system').style.display='block';}catch( e ){}
		try{$('supportHTML').style.display='block';	}catch( e ){}
		try{$('conditionHTML').style.display='block';}catch( e ){}
		try{$('mile').style.display='block';}catch( e ){}
*/
}

function tryCatch(str1,str2){
	try{
		eval(str1.replace(/\n/ig,''))
	}catch( e ){
		try{
			eval(str2)
		}catch( e ){}
	}
}

function openUSB(){
	open_window('http://www.sourcenext.com/eshop/usb/',800,480);
}
function openDS(){
	open_window('http://www.sourcenext.com/downstall/ds.html',600,400);
}
function openAgree(num){
	open_window('/downstall/agrement.html?'+num,600,400);
}

/*製品マスター操作*/
function ec_makeTitles(array){
	this.ID				= array[0];
	this.name			= array[6];
	this.kana			= array[7];
	this.yomi			= array[7];
	this.gen			= array[1];
	this.dsURL			= '/downstall/product/agr/'+array[0]+'.xml';
	this.URL			= (this.gen=='cho')? 'http://www.chou-jimaku.com/titles/products/?temp=index_temp&code=i'+array[0]:'/titles/'+array[1]+'/'+array[0]+'/';
	this._price			= (('i'+array[9]).replace(/[^\d]/ig,''))*1;
	this.price			= array[9];
	this.gen			= array[1];
	this.subgen			= array[2];
	this.text			= array[8];
	this.hatsubaibi		= array[3];
	this.hatsubaiNum	= ('/'+array[3]).replace(/[^\d]/ig,'');
	this._hatsubaibi	= SNdObj(array[3]);
	this.chkSubgen		= function (str){
		var	re = new RegExp(str, "i");
		return 	(array[2].match(re))? true:false;
	}
}

function sizeChk(){};

function specialCP(){

	var	_HTML= new String();
	var _cp	= {
		"20091225":{"URL":"/cp/s/0912/25_ikip_pla_7.html","bunner":"/cp/img/09_saimatsu/20091225.jpg"},
		"20091226":{"URL":"/cp/s/0912/26_narundesu.html","bunner":"/cp/img/09_saimatsu/20091226.jpg"},
		"20091227":{"URL":"/cp/s/0912/27_sns_drivecleaner.html","bunner":"/cp/img/09_saimatsu/20091227.jpg"},
		"20091228":{"URL":"/cp/s/0912/28_pita.html","bunner":"/cp/img/09_saimatsu/20091228.jpg"},
		"20091229":{"URL":"/cp/s/0912/29_degi_came.html","bunner":"/cp/img/09_saimatsu/20091229.jpg"},
		"20091230":{"URL":"/cp/s/0912/30_bs10.html","bunner":"/cp/img/09_saimatsu/20091230.jpg"},
		"20091231":{"URL":"/cp/s/0912/31_bs.html","bunner":"/cp/img/09_saimatsu/20091231.jpg"}
	}
	if(time){
		if(_cp[''+Math.floor(time/100)]){
			_HTML='<p class="com_091231" style="margin: 0 auto 0.5em; text-align: left; width: 190px; cursor: pointer;" onclick="loginCHK(\''+_cp[''+Math.floor(time/100)].URL+'\')"><img src="'+_cp[''+Math.floor(time/100)].bunner+'" style="border: 1px solid rgb(255, 0, 0);" height="110" width="190"></p>'
		}
	}
	document.write(_HTML);
}

new function(){
	var	_style	= new Object();
	_style = {
		"chj_091231":true,
		"com_091231":true,
		"chj_100101":true,
		"com_100101":true,
		"chj_10010114":true,
		"com_10010114":true
	}
	try{
	/*↓年末年始特別*/
		var _time	=time*1;
		if(_time >= 2010010112){
			_style.chj_100101	=false;
			_style.com_100101	=false;
			_style.chj_10010114	=false;
			_style.com_10010114	=false;
		}else if(_time >= 2010010100){
			_style.chj_100101	=false;
			_style.com_100101	=false;
		}else{
			_style.chj_091231	=false;
			_style.com_091231	=false;
		}
	/*↑年末年始特別*/
	}catch( e ){
		mAlert('「time.js」が読み込まれていません\n年末年始のタイマー公開を行うには、「time.js」を組み込んでください。');
	}
	var _style_HTML = new Array();
	var _num = new Number();
	_style_HTML[_num++]	= '\n\n<style type="text/css">\n<!--';
	for(var i in _style){
		if(_style[i]){
			var _style_HTML_	= new String();
			_style_HTML_	='.'+i+'{display:none;}';
			_style_HTML[_num++]	= _style_HTML_;
		}
	}
	_style_HTML[_num++]	= '-->\n</style>\n\n';
	document.write(_style_HTML.join('\n'))
};
