//データ
var new_stocks  = new Array(
'2010/07/09','Chaos Magazine|issue 14|20100708231313|A4 pro zine==Chaos Magazine|Issue 15|20100708232634|A4 pro zine',
'2010/07/08','Legacy(Col) |Metallic Assault|20100707230353|CD==Ecuador Cadaver(Ecu)|Dark Path of Blood and Fire|20100707234158|CD',
'2010/07/07','Wretched(USA)|Black Ambience|20091112004600|MCD==Magma Rise(Hun)|Lazy Stream of Steel|20100706224154|CD==Verzivatar(Hun)|Transcendent Infection|20100706233259|CD',
'2010/07/06','Planet Gemini(USA)|Wicked|20100328172138|digi-CD==Stereochrist(Hun)|III|20100705225723|CD',
'2010/07/05','Wormphlegm(Fin)|In an Excruciating Way...|20100704214751|12"==Necrodeath(Ita)|The Shining Pentagram|20100704222246|10" MLP==Rigor Sardonicous(USA) / Persistence in Mourning(USA)|I / Neo-pessimism|20100704230035|7"',
'2010/06/29','Grave(Swe)|Extremely Rotten Demos|20100629001904|2x 12"==0Xist(Fin)|Unveiling the Shadow World|20100629002702|MCD',
'2010/06/26','Esoteric(UK)|The Maniacal Vale|20100626100918|2CD',
'2010/06/25','Esoteric(UK)|Subconscious Dissolusion Into The Continuum|20051210181715|CD',
'2010/06/19','Misasmal(Swe)|S/T|20100619110713|7"==King Diamond|Black Rose: 20 Years Ago A Night Of Rehearsal|20100619114753|pic 12"',
'2010/06/15','Hirax(USA)|Noise Chaos War|20100614233651|CD==Krypts(Swe)|Open The Crypt|20100614234717|12"'
);

//スクリプト
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);
}
