/********************************************************************

　JAPET「実践事例アイディア集」 HP
　　　（社）日本教育工学振興会（JAPET） / （財）才能開発教育研究財団
　　　製作：2008/2/20

　※JASONPとAjaxの切り替えはdb.php内コードの書き換えで対応
　改造ソース：(C) 2007 M.HONDA

********************************************************************/

//-------------------------------------------------------------------
// JSONP対応APIの呼び出し

function callJsonp(url) {
	readScriptFile(url);
}

//-------------------------------------------------------------------
// 外部スクリプトファイル(UTF-8)の読み込みタグを追加する

function readScriptFile(url) {
	var s = document.createElement("script");
	s.charset = "UTF-8";
	s.type = "text/javascript";
	s.src = url;
	document.body.appendChild(s);
}

//-------------------------------------------------------------------
// キャッシュ対策のユニーク文字列を作る

function getKillCacheCode(cSep) {
	var tDate = new Date();
	return cSep + tDate.getTime();
}

//-------------------------------------------------------------------
// 指定ブロックにhtmlコードを挿入

function _m(id, htmlText) {
	document.getElementById(id).innerHTML = htmlText;
}

function _d(id, htmlText) {
	document.getElementById(id).innerHTML = htmlText;
}

function _da(id, htmlText) {
	document.getElementById(id).innerHTML += htmlText;
}

//-------------------------------------------------------------------
// エレメントオブジェクト取得

function _e(id){
	return document.getElementById(id);
}

//-------------------------------------------------------------------
// divブロック挿入

function createDiv(id, left, top, width, height) {
	var outDiv;
	outDiv =document.createElement('div');
	outDiv.id = id;
	document.body.appendChild(outDiv);

	var tgdStyle = document.getElementById(id).style;
	tgdStyle.position = "absolute";
	tgdStyle.left = left + "px";
	tgdStyle.top = top + "px";
	tgdStyle.background = "white";
}
	
//-------------------------------------------------------------------
// divブロックの不可視化

function hideDiv(id) {
	document.getElementById(id).style.visibility ="hidden";
}

//-------------------------------------------------------------------
// div ブロックの削除

function removeDiv(id) {
	var outDiv = document.getElementById(id);
	document.body.removeChild(outDiv);
}

//-------------------------------------------------------------------
// 要素のタイプを確認する

function varChk(tgd,type) {
	return typeof(tgd) == type ? true : false;
}

// EOF
