//データ
var new_stocks  = new Array(
'2010/09/05','Worship(Ger/Fra)|Dooom|20071103115340|digi-CD==Black Orchid(Aus)|Inertia|20100905151354|CD==Sungoddess(Jpn)|Akumu|20100905160625|CD',
'2010/09/04','Coffins(Jpn) / Hooded Menace(Fin)|Split|20100904172015|7"==Zombie Ritual(Jpn) / Swarming(Fin/Swe)|split|20100904173438|7"',
'2010/09/03','Patek XIII(Cze)|Videothrash|20100902224916|CD==V/A|Buried Terror #2|20100902231502|CD',
'2010/09/01','The NULLL Collective(Bel/USA)|De Monstris|20100901221000|CD',
'2010/08/26','Eibon(Fra)|Entering Darkness|20100826075208|digisleeve CD',
'2010/08/21','Autarcie(Fra)|S.I.D.A.|20100821082412|CD==Les Chants de Nihil(Fra)|La Liberte Guidant le Fer|20100821090505|CD==Les Chants de Nihil(Fra)|Ma Plus Douce Vermine|20100821103936|digi-CD==Altars(Aus) / Tzun Tzu(Aus)|Nepenthe...Sepulchure / Komuso|20100821135559|CD with gatefold paper booklet',
'2010/08/20','Grotesqueuphoria(USA)|Conquered By Corruption|20051224090518|CD',
'2010/08/19','Atra HOra(Rus)|Lost in the Depth|20100818215925|CD',
'2010/08/18','Sacratus(Rus)|The Doomed to Loneliness|20100817232318|CD',
'2010/08/16','Wolf\'s Sorce(Rus)|Remission of Spirit|20100816090649|CD==The True Nihilist(Rus)|The Ancient Forest... The Forest of the Forgotten Wisdom|20100816094058|CD==Mournful Congregation(Aus)|Suicide Choir(Girly S)|20100816095936|T-Shirts==Mournful Congregation(Aus)|Suicide Choir(Girly M)|20100816100220|T-Shirts'
);

//スクリプト
var max = 20;
function makeNewStocks(lang){
	var diSEMBOWELMENT = '';//more new stocks flag
	var langflag = '';
	var tables = '';
	var howmany = 1;
	if(lang == 'jp'){
		langflag = '_j';
	}
	for(var i=0; i<new_stocks.length; i+=2){
		tables += '<span class="newstock_date">: : ' + new_stocks[i] + ' : :</span><br />\n';
		tables += '<ul>\n';
		var this_stuffs = new_stocks[i+1].split("==");
		for(var j=0; j<this_stuffs.length; j++){
			var this_datas = this_stuffs[j].split("|");
			tables += '<li>' + this_datas[0] + '<br />\n';
			tables += '<a href="' + top_url + 'cgi-bin/webstore/store' + langflag + '.cgi?pmode=detail&selected_id=' + this_datas[2] + '">';
			tables += '"' + this_datas[1] + '" - ' + this_datas[3] + '</a></li>\n';
			howmany++;
			if(howmany > max){
				if(this_stuffs.length > (j+1)){
					diSEMBOWELMENT = 'on';
				}
				break;
			}
		}
		tables += '</ul>\n<br />\n';
		if(howmany > max){
			diSEMBOWELMENT = 'on';
			break;
		}
	}
	
	if(diSEMBOWELMENT){
			tables += '&gt;&gt;<a href="' + top_url + 'webstore_datas/newstock_' + lang + '.html" target="newstocks" onclick="var newstocks = window.open(\'' + top_url + 'webstore_datas/newstock_' + lang + '.html\',\'newstocks\',\'width=500, height=600,resizable, scrollbars\'); newstocks.focus(); return false;">more new stocks</a>\n';
	}
	document.write(tables);
}
