function writeGadget(gdType,fromId, gdWidth, gdHeight){

	var waitTime=5000;
	var ipath="http://www.nhk.or.jp/e-tele/";

	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="'+gdWidth+'" height="'+gdHeight+'" codebase="http://active.macromedia.com/flash7/cabs/ swflash.cab#version=9,0,0,0" id="gd'+gdType+'">');

	document.write('<param name="movie" value="'+ipath +'gadget/gadget.swf" />');
	document.write('<param name="FlashVars" value="thePath='+ipath+'&gdType='+gdType+'&from='+fromId+ '&waitTime="'+waitTime+'&" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="menu" value="false" />');
	document.write('<param name="scale" value="noscale" />');
	document.write('<param name="wmode" value="transparent" />');
	document.write('<param name="bgcolor" value="#ffffff" />');
	document.write('<param name="allowScriptAccess" value="always" />');
	document.write('<param name="allowFullScreen" value="false" />');


	document.write('<embed src="'+ipath + 'gadget/gadget.swf" name="gd' + gdType + '" width="'+ gdWidth +'" height="' + gdHeight + '" FlashVars="thePath='+ipath+'&gdType='+gdType+'&from='+fromId+'&waitTime='+waitTime+'&" quality="high" menu="false" scale="noscale" wmode="transparent" bgcolor="#ffffff" allowScriptAccess="always" allowFullScreen="false" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer_jp" />');
	document.write('</object>');
}

function callbackURL(){
	return location.href;
}

