﻿var EC_top_Message	='';


/*Stringクラスを拡張*/
String.prototype.replaceAll = function (org, dest){  
	return this.split(org).join(dest);  
}  
String.prototype.escapeJson = function (){  
	return this.replace(/®/g,'(R)').replace(/©/g,'(C)').replace(/™/g,'(TM)').replace(/～|〜/g,'&#x301c;').replace(/\n/ig,'<BR />').replace(/\r/g,'').replace(/"/g,'￥”');
}  
String.prototype.unescapeJson = function (){  
	return this.replace(/\(R\)/g,'®').replace(/\(C\)/g,'©').replace(/\(TM\)/g,'™').replace(/&#x301c;/g,'～').replace(/\|\|/g,'\n').replace(/<BR \/>/g,'\n').replace(/\\"/g,'"').replace(/￥”/g,'"');
}  
String.prototype.escapeXML = function (){  
	return this.replace(/®/g,'(R)').replace(/&amp;/ig,'&').replace(/©/g,'(C)').replace(/™/g,'(TM)').replace(/～|〜/g,'&#x301c;').replace(/\n/g,'|').replace(/\r/g,'').replace(/"/g,'\\"');
}  
String.prototype.unescapeXML = function (){  
	return this.replace(/\(R\)/g,'®').replace(/&/ig,'&amp;').replace(/\(C\)/g,'©').replace(/\(TM\)/g,'™').replace(/&#x301c;/g,'～').replace(/\|/g,'\n').replace(/\\"/g,'"');
}
String.prototype.convertHTML = function (){
	var	_str= this;
	_str	= _str.replace(/<</ig,'≪').replace(/>>/ig,'≫').replace(/</ig,'＜＜').replace(/>/ig,'＞＞');
	_str	= _str.replace(/>\n+?</i,'><');
	_str	= '▽△▽▽△▽'+_str.replace(/\r/g,'').replace(/\n+$/g,'').replace(/\n\n/g,'▽△▽▽△▽▽△▽▽△▽').replace(/\n/g,'▽△▽')+'▽△▽▽△▽';
	while(_str.match(/▽△▽▽△▽.*?▽△▽▽△▽/)){
		_str	= _str.replace(/▽△▽▽△▽(.*?)▽△▽▽△▽/i,'<p>$1</p>');
	}
	_str	= _str.replace(/\?/ig,'￥？').replace(/\//ig,'￥／').replace(/☆/ig,'■★■★');
	while(_str.match(/▽△▽/)){
		_str	= _str.replace(/▽△▽/i,'☆');
	}
	_str	= _str.replace(/<p>※(.*?)<\/p>/ig,'<p class="kome">※$1</p>');
	_str	= _str.replace(/<p>！！！(.*?)<\/p>/ig,'<p class="caution">$1</p>');
	_str	= _str.replace(/<p>！！(.*?)<\/p>/ig,'<p class="notice">$1</p>');
	_str	= _str.replace(/<p>・(.*?)<\/p>/ig,'<ul><li>$1</li></ul>');
	_match	= _str.match(/<ul><li>(.*?)<\/li><\/ul>/ig);
	if(_match){
		for(var _i=0; _match.length>_i; _i++){
			var	__str	= _match[_i].replace(/<br \/>・/ig,'</li><li>');
			var	__match	= _match[_i].replace(/\(/ig,'\\(').replace(/\)/ig,'\\)').replace(/\|/ig,'\\|');
			var	_regex	= new RegExp(__match,'g');
			_str	= _str.replace(_regex,__str);
		}
	}
	_str	= _str.replace(/<p>\d+?\.(.*?)<\/p>/ig,'<ol><li>$1</li></ol>');
	_match	= _str.match(/<ol><li>(.*?)<\/li><\/ol>/ig);
	if(_match){
		for(var _i=0; _match.length>_i; _i++){
			var	__str	= _match[_i].replace(/<br \/>\d+?\./ig,'</li><li>');
			var	__match	= _match[_i].replace(/\(/ig,'\\(').replace(/\)/ig,'\\)').replace(/\|/ig,'\\|');
			var	_regex	= new RegExp(__match,'g');
			_str	= _str.replace(_regex,__str);
		}
	}
	while(_str.match(/≪([^<]+?)☆([^>]+?)≫/)){
		_str	= _str.replace(/≪([^☆]+?)☆([^☆]+?)≫/i,'≪$1||$2≫');
	}

	_str	= _str.replace(/≪([^\|]+?\.swf)\|(中||右|左)\|([^\|]+?)\|([^\|]+?)≫/ig,makeSwfTag('$1','$3','$4'));
	_str	= _str.replace(/≪([^\|]+?)\|(中||右|左)\|([^\|]+?)\|([^\|]+?)\|([^\|]+?)\|([^\|]+?)≫/ig,'<img src="$1" align="$2" width="$3" height="$4" alt="$5" title="$5" border="$6">');
	_str	= _str.replace(/≪([^\|]+?)\|(中||右|左)\|([^\|]+?)\|([^\|]+?)\|([^\|]+?)≫/ig,'<img src="$1" align="$2" width="$3" height="$4" alt="$5" title="$5">');
	_str	= _str.replace(/≪([^\|]+?)\|(中||右|左)\|([^\|]+?)\|([^\|]+?)≫/ig,'<img src="$1" align="$2" width="$3" height="$4">');
	_str	= _str.replace(/≪([^\|]+?)\|(中||右|左)≫/ig,'<img src="$1" align="$2">');
	_str	= _str.replace(/≪([^\|]+?)≫/ig,'<img src="$1">');

	_str	= _str.replace(/\(\(([^\|]+?)\|([^\|]+?)\|拡大\)\)/ig,'<a href="javascript: void(popup(\'$2\'))">$1<img src="http://www.sourcenext.com/img/common/icon_zoom.gif" style="margin-left: -80px;" border="0"></a>');
	_str	= _str.replace(/\(\(([^\|]+?)\|([^\|]+?)\|新\)\)/ig,'<a href="$2" target="_blank">$1</a>');
	_str	= _str.replace(/\(\(([^\|]+?)\|([^\|]+?)\|上\)\)/ig,'<a href="$2" target="_top">$1</a>');
	_str	= _str.replace(/\(\(([^\|]+?)\|([^\|].+?)\|親\)\)/ig,'<a href="$2" target="_parent">$1</a>');

	_match	= _str.match(/\(\((.+?)\|(.+?)\)\)/ig);
	if(_match){
		for(var _i=0; _match.length>_i; _i++){
			var	__str	= _match[_i];
			var	__match	= _match[_i].replace(/\(/ig,'\\(').replace(/\)/ig,'\\)').replace(/\|/ig,'\\|');
			var	_regex	= new RegExp(__match,'g');
			__str	= __str.replace(/\(\((.+?)\|強調\)\)/ig,'<strong>$1</strong>');
			__str	= __str.replace(/\(\((.+?)\|(.+?)\)\)/ig,'<a href="$2">$1</a>');
			_str	= _str.replace(_regex,__str);
		}
	}
	_str	= _str.replace(/align=\"中\"/ig,'align="center"').replace(/align=\"右\"/ig,'align="right"').replace(/align=\"左\"/ig,'align="left"').replace(/align=\"\"/ig,'');
	return	_str.replace(/￥？/ig,'?').replace(/￥／/ig,'/').replace(/☆/ig,'<br />').replace(/■★■★/ig,'☆').replace(/＜＜/ig,'<').replace(/＞＞/ig,'>');
}  


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

if(!login){
	var login	={
		"loginStatas"		: false,
		"IsChowari"			: false,
		"IsSgm"				: false
	}
}

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

var	URLargument	= getURLargument();
function getURLargument(){
	var	_argument	= w.search.replace(/^\?/,'').split('&');
	var	_URLargument	= new Array();
	for	(var i in _argument){
		var	temp	= _argument[i].split('=');
		_URLargument[temp[0]]=temp[1]||false;
	}
	return _URLargument;
}

function getCookies(){
	var	myCookie	= document.cookie;
	arg			= new Array();
	var	_arg	= myCookie.split(';')
	for	(var i in _arg){
		var temp=_arg[i].split('=');
		arg[temp[0].replace(/ /,'')]=temp[1];
	}
}
getCookies();

/*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);}
}
function LoginStatasCallback(str){
	//mAlert('ok')
/*
	alert((str.LoginStatasResponse.ActivationResult==0)? '正常':'エラー')
	alert((str.LoginStatasResponse.loginStatas==1)? 'ログイン済み':'未ログイン')
	alert((str.LoginStatasResponse.superDiscount==1)? '超割サービズ適用':'超割サービズ非適用')
	alert((str.LoginStatasResponse.IsSgm==1)? 'SGM会員':'通常会員')
*/
	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)

}
ImportJS('https://www.sourcenext.com/users/action/login_check_exe');

/*フォントサイズ*/
var FONT_SIZE	= new function(){
	var	_size	= 'M';
	var	_CSS	= new String();
	if(arg){
		_size 	= (arg.fontSize>=4)?'L':(arg.fontSize>=3)?'M':(arg.fontSize>=1)?'S':'M';
		_sizeNum= (arg.fontSize>=4)?'5':(arg.fontSize>=3)?'3':(arg.fontSize>=1)?'2':'3';
	}
	_CSS = '<style>\n<!--\n#font_size_icon_S,\n#font_size_icon_M,\n#font_size_icon_L{display:none}\n#font_size_icon_'+_size+'{display:block}\n-->\n</style>';

	var	_URL	= '/css/css-size'+_sizeNum+'.css';
	document.write("<link rel='stylesheet' href='"+_URL+"' type='text/css'>"); 
	document.write(_CSS);

	this.setFont=function(_size){
		var _size	= (_size=='L')? 4:(_size=='M')? 3:(_size=='S')? 1:(isNaN(_size))? 3:_size;
		setCookie('fontSize',_size,365);
		document.location.reload();
	}
}

/*Cookie書き込み*/
function setCookie(_key, _value, _period) {
	var	_period		= (_period)? _period:90;
	var	_nowtime	= new Date().getTime();
	var	_limit		= new Date(_nowtime + (60 * 60 * 24 * 1000 * _period));
	var	_expires 	= _limit.toGMTString();
	// クッキーの発行（書き込み）
	document.cookie = _key + "=" + escape(_value) + "; expires=" + _expires +";path=/";
}

/*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);
}

function removeChild(_element){
	if (_element.hasChildNodes()) {
		while (_element.childNodes.length > 0) {
			_element.removeChild(_element.firstChild)
		}
	}
}

//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');
	}
*/
}

function func_lineUp(){
}

/********************************************/
/*	iPhoneCHECK(method,string1[,string2])	*/
/*	method:return or inline	or objectID		*/
/*	string1:iPhonだった場合					*/
/*	string2:iPhonでなかった場合				*/
/********************************************/
function iPhoneCHECK(_method,_string1,_string2){
	var	_string1	= (_string1)? _string1 :'';
	var	_string2	= (_string2)? _string2 :'';
	var	_UA	= window.navigator.userAgent;
	var	_isIphone	= (_UA.match(/iPhone|iPod/i))? true:false;
	var	_returnText	=(_isIphone)? _string1:_string2;
	if(_method.match(/return/i)){
		return 	_returnText
	}else if(_method.match(/^inline$/i)){
		document.write(_returnText)
	}else{
		$(_method).innerHTML = _returnText;
	}
}


/********************************************/
/*	getElementPosition( _element)			*/
/*	_element:DOMエレメント					*/
/********************************************/
function getElementPosition( _element){ 
	var _target = _element; 
	var _pos = new function(){ this.x = 0; this.y = 0; } 
	while(_target){ 
		_pos.x += _target.offsetLeft; 
		_pos.y += _target.offsetTop; 
		_target = _target.offsetParent; 
	} 
	_element._x = _pos.x;
	_element._y = _pos.y;
	return _element;
}

function getScrollPosition() {
	var _obj = new Object();
	_obj._x = document.documentElement.scrollLeft || document.body.scrollLeft;
	_obj._y = document.documentElement.scrollTop || document.body.scrollTop;
	return _obj;
}


/********************************************/
/*	tk_setCookie(key, value, period)		*/
/*	key		:キー							*/
/*	value	:値								*/
/*	period	:有効期限（日）					*/
/********************************************/

function tk_setCookie(key, value, period) {
	var	nowtime	= new Date().getTime();
	var	limit	= new Date(nowtime + (60 * 60 * 24 * 1000 * period));
	var	expires = limit.toGMTString();
	// クッキーの発行（書き込み）
	document.cookie = key + "=" + escape(value) + "; expires=" + expires +";path=/";
}

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

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

/*****************************************************
オブジェクトをマージする
merge(source,destination)

source：マージ元
destination：マージ先
*****************************************************/
/*オブジェクトのマージ*/
function objectMerge(){
	this.construct	= function(obj){
		for(var i in obj){
			this[i]=merge(obj[i],this[i])
		}
	}
}
function merge(source,destination){
	if(destination){
		for(var i in source){
			destination[i]=source[i];
		}
	}else{
		destination= source;
	}
	return destination;
}

/*****************************************************
/日付オブジェクトを/区切りの日付フォーマットに変換
slDobj(date)

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

date		：スラッシュ区切りの日にち
*****************************************************/
function slDobj(dObj){
	if(dObj){
	var	yy = dObj.getYear();
	var	mm = dObj.getMonth() + 1;
	var	dd = dObj.getDate();
	mm	= (mm < 10)? "0" + mm:mm;
	dd	= (dd < 10)? "0" + dd:dd;
	yy	= (yy < 2000)? yy+ 1900: yy;
	yy	= (yy > 3000)? yy- 1900: yy;

	return (yy + "/" + mm + "/" + dd);
	}else{
	return false;
	}
}


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

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

date		：スラッシュ区切りの日にち
*****************************************************/
function SNdObj(date,_tgl){
	if(date){
	var	d0	= date.split('/');
	var	d 	= new Date(date+' 0:0:0');
		if(_tgl){
			return (d0[0]*1)+'年'+(d0[1]*1)+'月'+(d0[2]*1)+'日（'+youbi[d.getDay()]+'）';
		}else{
			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){
	document.write(makeSwfTag(swf,w,h))
}

function makeSwfTag(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>';
	return HTML;
}

function makeImageTag(img,w,h,align,alt,border){
	var	HTML = new String();
	HTML+='<img src="'+img+'" style="';
	HTML+=(w)? 'width:'+w+'px; ':'';
	HTML+=(h)? 'height:'+h+'px; ':'';
	HTML+=(border)? 'border:'+border+'px; ':'';
	HTML+=(align)? 'float:'+align.replace(/右/,'right').replace(/左/,'left').replace(/中/,'center')+'; ':'';
	HTML+='" '
	HTML+=(alt)? 'alt="'+alt+'" ':'';
	HTML+='>'

	return 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(arguments[1]){
		js_effets.setAttribute("charset", arguments[1]);
	}

	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){
	if(isNaN(num)){
		return num;
	}else{
		var temp = num.toString().split('.');
			temp[0]=temp[0].toString().replace( /([0-9]+?)(?=(?:[0-9]{3})+$)/g , '$1,')
		return temp.join('.');
	}
}

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

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


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

function testCB(){
	alert('CB')	
}

/*****************************************************
ファイルのインポート（ぺろんぺろん）
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;
	}
}


function xml2obj(xmlObj,tag){
	var	t		= false;
	var _array	= false;
	try{
		t	= xmlObj.getElementsByTagName(tag);
	}catch( e ){}
	if(t){
		_array	= new Array();
		for(var _i=0; t.length>_i; _i++){
			var	temp	= t[_i];
			_array[_i]	= new Object();
			try{
				_array[_i].value	= temp.firstChild.nodeValue.toString().replace(/\n/ig,'<br />');
				_array[_i]._value	= temp.firstChild.nodeValue;
			}catch( e ){
				_array[_i].value	= false;
				_array[_i]._value	= false;
			}
			for(var _j=0; temp.attributes.length>_j; _j++){
				var	_name	= temp.attributes.item(_j).name;
				var	_value	= temp.getAttributeNode(_name).value;
				try{
					_array[_i][_name]	=_value.toString().replace(/\n/ig,'<br />');
					_array[_i]['_'+_name]	=_value;
				}catch( e ){
				}
			}
		}
	}else{}
	return _array;
}


/*****************************************************
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;
}



/*****************************************************
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'+xmlObj.status+'\n'+alertMsg[xmlObj.status]);
				}
			}
		}
		var	rndHead	= (fileName.match(/\?/))? '&rnd=':'?rnd=';
		var	file	= fileName+rndHead+Math.ceil(Math.random()*10000);
		xmlObj.open('GET', file ,true);
		xmlObj.send(null);
	}else{
		mAlert("XMLHttpRequest非対応のブラウザです。");
	}
}

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

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();
}

/*****************************************************
注意書き
makeAtP(attention)
attention = ((yyyy/mm/dd))文字列|文字列
複数行は「 | 」で区切る。
掲載期間は頭に((yyyy/mm/dd))をつける。
******************************************************/
function makeAtP(attention){
	var HTML = new String();
	if(attention){
		if(attention!='false'){
		try{
			var	atText	= new Array();
			var nowTime=slashDobj(time.toString().replace(/(\d{4})(\d{2})(\d{2})\d{2}/,'$1/$2/$3'));
				var tempAttention	= attention.replace(/\|\|/ig,'|').replace(/\n|｜/ig,'|');
				var tempAttention	= tempAttention.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>'
		
		}catch( e ){}
		}
	}
	return HTML.replace(/※※/ig,'※');
}


/*CSS関連*/
function reSizeWin(){
	document.FORM.fontSize.selectedIndex=myFontSize-1;
}
function initFontSize(){
	try{
		var	obj	= $('footer');
		var	HTML= new String();
		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>';
		obj.innerHTML = HTML;
	}catch( e ){}
//	reSizeWin();
}

function makeInnerHTML(){
	try{
		var	mes1	= '<img src="/eshop/img/gt/sn_logo_black.gif" alt="SOURCENEXT eSHOP" name="eSHOP_logo" border="0" height="28" width="200">';

		$('ecLogo2').innerHTML=mes1;
		$('ecLogo2').style.display='block';
	}catch( e ){
	//エラー時の処理
	}


	try{
		var	_HTML	= $('ecNavi').innerHTML;
		var	mes2	= '<div style="width:200px; padding: 10px; background: #f4f2ea none repeat scroll 0 0; margin: 10px 0;">';
			mes2	+='<div align="center" style="margin-bottom:5px;"><img src="/img/common/icon_ch_login.gif"></div>';
			mes2	+='<p style="text-align:left">「超割ダウンロード」サービスをご利用いただき、ありがとうございます。</p>';
			mes2	+='</div>';
			mes2	=(_HTML.match(/「超割ダウンロード」サービスをご利用いただき/))?'':mes2;			
			_HTML	+=	(EC_top_Message)? EC_top_Message:'';
			_HTML	=	(login.IsChowari)? '<div>'+_HTML+'</div>'+mes2:_HTML;
		$('ecNavi').innerHTML=_HTML;

	}catch( e ){
	//エラー時の処理
	}
		

	try{
		makeInnerHTML_GT()
	}catch( e ){
		
		var tk	= (w.search.match(/tk=/))? URLargument.tk:false; 
		(tk)?	tk_setCookie('tk',tk,1):void(0);
		
		/*
		if(myLocation.port > 0){
			var hostName	= myLocation.hostname.split('.');
			var jsName		= hostName[0]+'-'+myLocation.port+'.js';
			var js = new ImportJS('/js/'+jsName,'utf-8');
		}
		*/

		/*特殊処理*/
		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');
				}
			}
		}
	

		try{
			var obj	= $('footer');
			/*文字サイズ変更*/
			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>';
		
			obj.innerHTML = HTML;
			obj.style.backgroundColor = document.bgColor;
			reSizeWin();
		}catch( e ){}
	
	
		/*期間限定処理*/
		try{
		//Script
		}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/?code=i'+array[0]:'/titles/'+array[1]+'/'+array[0]+'/';
	this._price			= (('i'+array[9]).replace(/[^\d]/ig,''))*1;
	this.price			= array[9];
	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 style="margin: 0 auto 0.5em; text-align: left; width: 190px; cursor: pointer;"><a href="'+_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"></a></p>'
		}
	}
	return(_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'))
};