var TOP_URL = "http://www.neo-miracle.com";

////////////////////// TO TOP ////////////////////////////////

function toTop(){
	document.write('<p class="totop"><a href="#top">>> このページのＴＯＰへ戻る</a></p>');
	}


////////////////// VIP LIST ///////////////////////
function viplist(sflag,page){
	document.write('<p style="padding:6px;border:1px solid #fff;background-color:#000;"><img src="'+TOP_URL+'/img/vip/sub04.jpg" /></p>');
	//document.write('<p style="padding:6px;border:1px solid #fff;background-color:#000;"><img src="'+TOP_URL+'/campaign/img/sub05.jpg" /></p>');

	tNum = page * 5 - 5;
	
	for(i=tNum;i<(tNum+5);i++){
		if(memList[i]){
			boxVipList(i,sflag);
			}
		}
	
	document.write('<div style="margin:20px;">');
		document.write('<p><img src="'+ TOP_URL +'/zzz/bar_vip_list.gif" /></p>');
		boxListTbl(page);
		toTop();
	document.write('</div>');
	
}

function boxVipList(i,sflag){
	
	var num = memList[i]['num'].substr(1,4);
	
	//sample
	numEnd = num.substr(3,1);
	trType = new Array("i","j","a","p","a","n","e","s","e","g");
	spType = new Array("r","r","l","r","o","p","e","d","j","g");
	trUrl = "http://croz-videos.com/neo/tr/e" + num + "_720" + trType[numEnd] + ".wmv";
	spUrl = "http://croz-videos.com/neo/tr/e" + num + "_320" + trType[numEnd] + ".wmv";
	
	
	document.write('<div style="margin:10px 15px 40px;">');
		document.write('<div style="padding:8px;border:1px solid #B0AEAE;background-color:#000;position:relative;">');
			document.write('<p style="width:570px;padding:8px 0 8px 30px;border:1px dashed #fff;color:#fff;background-image:url('+TOP_URL+'/img/bg_title.gif);background-repeat:no-repeat; font-weight:bold;">'+memList[i]["title"]+'</p>');
			document.write('<p style="position:absolute;top:20px;right:25px;color:#fff;font-size:12px;font-weight:bold;">moive '+ mData[num]["minute"] +'min</p>');
		document.write('</div>');
		document.write('<div style="position:relative;">');
			
			//media
			document.write('<div style="position:relative;width:325px;height:280px;margin:5px 5px;background-image:url('+ TOP_URL +'/movie/img/bg_m3bp.gif);background-repeat:no-repeat;">');
				document.write('<p style="position:absolute;top:24px;left:9px;"><a href="',trUrl,'" target="_blank"><img src="'+ TOP_URL +'/movie/'+ num +'/m3bp.jpg" /></a></p>');
				
				document.write('<p style="position:absolute;top:236px;left:15px;">');
				document.write('<a href="',trUrl,'" target="_blank"><img src="',TOP_URL,'/movie/img/btn_m3bp_720_480.gif" id="btn_m3bp_tr_'+ num +'" ');
				document.write('onmouseover="MM_swapImage(\'btn_m3bp_tr_'+ num +'\',\'\',\'',TOP_URL,'/movie/img/btn_m3bp_720_480_on.gif\',1)" ');
				document.write('onmouseout="MM_swapImgRestore()" /></a>');
				document.write('</p>');
				document.write('<p style="position:absolute;top:236px;left:167px;">');
				document.write('<a href="',spUrl,'" class="btn_sample" target="_blank"><img src="',TOP_URL,'/movie/img/btn_m3bp_320_280.gif" id="btn_m3bp_sample_'+ num +'" ');
				document.write('onmouseover="MM_swapImage(\'btn_m3bp_sample_'+ num +'\',\'\',\'',TOP_URL,'/movie/img/btn_m3bp_320_280_on.gif\',1)" ');
				document.write('onmouseout="MM_swapImgRestore()" /></a></p>');
			document.write('</div>');
			
			//description
			document.write('<div style="position:absolute; top:0; left:340px; width:420px;">');
				document.write('<p style="padding:7px 5px 5px; background-color:#1E1E1E; color:#fff;">■作品紹介</p>');
				document.write('<p class="vip txt_m2desc" style="margin:10px; line-height:16px;">'+ mData[num]['description'] +'</p>');
				document.write('<p style="margin:10px 10px;">・種類:動画　　・MEMBERS:720*480/1500kbps<br />　<a href="http://www.microsoft.com/downloads/Browse.aspx?displaylang=en&categoryid=4" target="_blank">Windows Media Player9以上でご覧ください。</a></p>');
				document.write('<div style="position:relative;">');
					//document.write('<p><img src="'+ TOP_URL +'/movie/'+ num +'/2list.jpg" /></a></p>');
					

				document.write('</div>');
			document.write('</div>');
			
		document.write('</div>');
	document.write('</div>');
}

////////////////// LIST TABLE ////////////////////////////

function boxListTbl(page){
	listPage = memList.length / 5;
	Math.round(listPage);
		
	document.write('<div class="box_listtbl">');
		
		document.write('<table style="margin:0;">');
		document.write('<tr>');
		
		for(i=1;i<listPage+1;i++){
			n = i / 7;
			if(i == page){
				document.write('<td><span>Page ',i,'</span></td>');
			}else{
				document.write('<td><a href="index.php?page=',i,'">Page ',i,'</a></td>');
				}
			if ((""+n).indexOf(".") > -1){
				void(0);
			}else{
				document.write('</tr><tr>');
				}
			}
		document.write('</tr></table>');
	document.write('</div>');
	}
