/*
JSONデーター表示処理
LAST UPDATE WF IWASAKI 2008/03/04
 - '(シングルコーテーション)をエスケープした、&apos;文字列をreplaceにて'(シングルコーテーション)へ置き換え
*/

function avator_area(item){

  document.write('<div class="pickupColumn">');
  document.write('<h3><img src="images/top/txt_avatar.gif" alt="会員 Pick UP!" width="110" height="15" /></h3>');
  document.write('<p><iframe src="'+item.avator+'" alt="会員 Pick UP!" width="110" height="145" scrolling="no" frameborder="0"></iframe></p>');
  document.write('<p class="profile"><a href="'+item.nickname_link+'">'+item.nickname.replace(/&quote;/g,'\"').replace(/&apos;/g,'\'')+'<img src="'+item.gender_image+'" alt="'+item.gender+'" width="11" height="12" style="border:0;"/>（'+item.age+'）</a></p>');
  document.write('</div>');
  document.write('<div class="othersColumn">');
  document.write('<div class="mainTxt">');
  document.write('<p>'+item.description.replace(/&lt;/g,'<').replace(/&gt;/,'>').replace(/&quote;/g,'\"').replace(/&apos;/g,'\'')+'...</p>');
  document.write('<p class="moreLink"><span><img src="images/cmn/arw_orange.gif" alt="" width="8" height="9" /><a href="'+item.nickname_link+'">続きを見る</a></span></p>');
  document.write('</div>');
  document.write('<h3>みんなの新着日記</h3>');


  document.write('<div style="overflow:auto;width:97%;height:120px">')
  document.write('<ul>');
  for (i = 0; i < item.diary_text.length; i = i + 1) {
	 document.write('<li><a href="'+item.diary_text[i][1]+'">'+item.diary_text[i][0].replace(/&lt;/g,'<').replace(/&gt;/,'>').replace(/&quote;/g,'\"').replace(/&apos;/g,'\'')+'...</a></li>');
  }
  document.write('</ul>');
  document.write('</div>');
  document.write('</div>');

}

function drill_area(item){
    document.write('<div class="board">');
    document.write('<ul class="container">');
    document.write('<li class="pictColumn">');
    document.write('<a href="'+item.drill_url+'"><img src="'+item.drill_img+'" alt="'+item.drill_img_alt+'" width="174" height="130" /></a>');
    document.write('</li>');
    document.write('<li class="txtColumn">');
    document.write('<div class="number"><em>'+item.drill_title_no+'</em></div>');
	document.write('<h3><img src="'+item.drill_img_subtitle+'" alt="'+item.drill_img_subtitle_alt+'" width="435" height="25" /></h3>');
	document.write('<p class="txt">'+item.drill_body+'</p>');
	document.write('<p class="moreLink"><span><img src="images/top/arw_drill_red.gif" alt="" width="8" height="9" /><a href="'+item.drill_url+'">続きを見る</a></span></p>');
	document.write('</li>');
	document.write('</ul>');
	document.write('</div>');
}

function image_area(image,title,link,author){
	document.getElementById('video_img').setAttribute('src',image);
	document.getElementById('video_img').setAttribute('alt',title);
	document.getElementById('video_link1').setAttribute('onclick','javascript:V_OpenWindow(\''+link+'\');');
	document.getElementById('video_link2').setAttribute('onclick','javascript:V_OpenWindow(\''+link+'\');');
	document.getElementById('video_link2').innerHTML=title+'<br />'+author.replace(/&quote;/g,'\"').replace(/&apos;/g,'\'');
}

function video_area(item){

    document.write('<div class="pickupColumn">');
    document.write('<p><a id="video_link1" href="javascript:void(0);" onclick="javascript:V_OpenWindow(\''+item[0].vid_link+'\');"><img id="video_img" src="'+item[0].vimg_la+'" alt="'+item[0].vid_title.replace(/&quote;/g,'\"').replace(/&apos;/g,'\'')+'" /></a></p>');
	document.write('<p><a id="video_link2" href="javascript:void(0);" onclick="javascript:V_OpenWindow(\''+item[0].vid_link+'\');">'+item[0].vid_title.replace(/&quote;/g,'\"').replace(/&apos;/g,'\'')+'<br />'+item[0].vid_author.replace(/&quote;/g,'\"').replace(/&apos;/g,'\'')+'</a></p>');
	document.write('</div>');
	document.write('<div class="thumbnailColumn container">');
    for (i = 0; i < item.length; i = i + 1) {
		/* javascriptのパラメーターとしての置き換え部分に関して、&quote; => \" 、&apos; => \' としてエスケープ文字を不可するよう修正。エスケープしないとJavaScritpエラーが発生するため。by WF IWASAKI 2008/03/06　 */
		document.write('<p><a href="javascript:void(0);"><img src="'+item[i].vimg_sm+'" onclick="javascript:V_OpenWindow(\''+item[i].vid_link+'\');" alt="'+item[i].vid_title.replace(/&quote;/g,'\"').replace(/&apos;/g,'\'')+'" onmouseover="image_area(\''+item[i].vimg_la+'\',\''+item[i].vid_title.replace(/&quote;/g,'\\\"').replace(/&apos;/g,'\\\'')+'\',\''+item[i].vid_link+'\',\''+item[i].vid_author.replace(/&quote;/g,'\\\"').replace(/&apos;/g,'\\\'')+'\');" /></a></p>');
	}
    document.write('</div>');


}

function pet_area(item){
    document.write('<div class="pictColumn">');
	document.write('<p><a href="'+item.pet_url+'"><img src="'+item.pet_img+'" alt="'+item.pet_title.replace(/&quote;/g,'\"').replace(/&apos;/g,'\'')+'" width="202" height="152" /></a></p>');
    document.write('</div>');
	document.write('<div class="txtColumn">');
	document.write('<div class="number"><em>'+item.pet_main.replace(/&quote;/g,'\"').replace(/&apos;/g,'\'')+'</em></div>');
	document.write('<h3>'+item.pet_title.replace(/&quote;/g,'\"').replace(/&apos;/g,'\'')+'</h3>')
    document.write('<h4>'+item.pet_st_title.replace(/&quote;/g,'\"').replace(/&apos;/g,'\'')+'</h4>')
	document.write('<p class="txt">')
	document.write(item.pet_body.replace(/&quote;/g,'\"').replace(/&apos;/g,'\''));
	document.write('</p>')
    document.write('<p class="moreLink"><span><img src="images/cmn/arw_pink.gif" alt="" width="8" height="9" /><a href="'+item.pet_url+'">続きを見る</a></span></p>');
	document.write('</div>');
}


function stage_area(item){

	var stage=item;
   for (i = 0; i < stage.length; i = i + 1) {
   	    var img_id='image_'+(i+1);
   	    var img_href_id='image_href_'+(i+1);
//		document.getElementById(img_href_id).setAttribute('href','javascript:void(0);');
		document.getElementById(img_href_id).setAttribute('href','javascript:S_OpenWindow(\''+stage[i].stg_link+'\');');

//		document.getElementById(img_href_id).setAttribute('href',stage[i].stg_link);
    	document.getElementById(img_id).setAttribute('longdesc',stage[i].stg_link);

    	document.getElementById(img_id).setAttribute('alt',stage[i].stg_title.replace(/&quote;/g,'\"').replace(/&apos;/g,'\'')+'/'+stage[i].stg_author.replace(/&quote;/g,'\"').replace(/&apos;/g,'\''));
/*		document.write('<a href="'+stage[i][0].stg_link+'"><img src="'+stage[i][0].stg_img+'" alt="'+stage[i][0].stg_title+'/'+stage[i][0].stg_author+'" title="'+stage[i][0].stg_title+'/'+stage[i][0].stg_author+'" /></a>');
 */
	}


}

