function avatar(id, _height, _width, no_link)
{
	now = new Date()
	y	= now.getYear()
	m	= "0"+now.getMonth();	m= m.substring(m.length-2,m.length)
	d	= "0"+now.getDay();		d= d.substring(d.length-2,d.length)
	h	= "0"+now.getHours();	h= h.substring(h.length-2,h.length)
	i	= "0"+now.getMinutes();	i= i.substring(i.length-2,i.length)
	s	= "0"+now.getSeconds();	s= s.substring(s.length-2,s.length)

	//now	= year+'/'+month+'/'+day+' '+h+':'+i+':'+s
	now	= y+m+d+h+i+s
        //var start = id.substring(0,1);
	//var end   = id.substring(id.length-1,id.length);
	var swfurl	= "http://img.avatar.livedoor.com/swf/"+id+".swf?"+now
	var codebase= "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"

	var	plugins	= "http://www.macromedia.com/go/getflashplayer"
	var clsid	= "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"

  //size
  var width  = (_width  ? _width  : 135);
  var height = (_height ? _height : 175); 

	document.write("<OBJECT classid='"+clsid+"' codebase='" + codebase + "' WIDTH='"+width+"' HEIGHT='"+height+"' id='demo' ALIGN=''>")
	document.write("<PARAM NAME=movie VALUE='"+swfurl+"'>")
	document.write("<PARAM NAME=Menu value='FALSE'> <PARAM NAME=quality VALUE=low> <PARAM NAME=loop VALUE=true>")
	document.write("<PARAM NAME=bgcolor VALUE=#EFEBDE>")
	document.write("<EMBED src='"+swfurl+"' quality=low loop=true bgcolor=#EFEBDE WIDTH='"+width+"' HEIGHT='"+height+"' ")
	document.write("NAME='demo' ALIGN='' TYPE='application/x-shockwave-flash' PLUGINSPAGE=''></EMBED> </OBJECT>")

  if(!no_link){
        document.write("<br /><a target='_blank' class='avatar_link' " +
                       "href='http://avatar.livedoor.com/rd.php?key=avt/api/present&url=http%3A%2F%2Favatar.livedoor.com%2F%3Fp%3DLDA_PROC_REPLY_PRESENT%26send_to%3D" + id + 
                       "'>プレゼントを贈る</a>")
        document.write("<br /><a target='_blank' class='avatar_link' href='http://avatar.livedoor.com/rd.php?key=avt/api/avatar&url=http%3A%2F%2Favatar.livedoor.com%2F'>livedoor アバター</a>")
	}
}

