
var _TT_ = {

	scriptCount: 0,
	loadJSLibrary: function (aUrl, aTag, aSId)
	{	
		var headObj = {};
		if (aTag == null || aTag == "")
		{
			headObj = document.getElementsByTagName("head")[0];
		} else
		{
			headObj = document.getElementById(aTag);
		}
	
		if (aUrl.indexOf(".css") >= 0)
		{
			var node = document.createElement("link");
			if (node.addEventListener)
				node.addEventListener("load", function() {  /**/ _TT_.removeJSLibrary(aSId); }, false);
			else
				node.onreadystatechange = function() {
				if (this.readyState == "complete" || this.readyState == "loaded") {
					/* */
					_TT_.removeJSLibrary(aSId);
				}
			}
			node.setAttribute("rel", "stylesheet");
			node.setAttribute("type", "text/css");
			node.setAttribute("href", aUrl);
			node.setAttribute("id", aSId);
		
		} else
		{
			var node = document.createElement("script");
			if (node.addEventListener)
				node.addEventListener("load", function() { /* */_TT_.removeJSLibrary(aSId); }, false);
			else
				node.onreadystatechange = function() {
				if (this.readyState == "complete" || this.readyState == "loaded") {
					/*  */
					_TT_.removeJSLibrary(aSId);
				}
			}
			node.src = aUrl;
			node.id = aSId;
		}
		
		headObj.appendChild(node);
	
	},
	
	removeJSLibrary: function (aSId){
		var node = document.getElementById(aSId);
		var pNode = node.parentNode;
		pNode.removeChild(node);
	},
	
	loadandremove: function(action){
		_TT_.scriptCount++;
		_TT_.loadJSLibrary('testjs02.js', null, 's'+_TT_.scriptCount);
		//setTimeout ('_TT_.removeJSLibrary(\'s'+_TT_.scriptCount+'\')', 1000);
	},
	
	init: function(){
	
	}
}