function injectScriptFile(name) {
	document.write("<script src='"+name+"'></script>");
	return;
	head = window.document.documentElement.firstChild;
	script = window.document.createElement("script");
	script.src = name;
	head.appendChild(script)	
}
function injectScript(code) {
	document.write("<script>"+code+"</script>");
	return;
	head = window.document.documentElement.firstChild;
	script = window.document.createElement("script");
	script.innerHTML = code;
	head.appendChild(script)	
}

function dynamicFeed( id, url){
	if (! window.google) {
		injectScriptFile('http://www.google.com/jsapi?key=ABQIAAAAVnyotm9l78XFNB3iY7Y6YRQTduFfQoKgb9k8MV_G9fGVh9gsmBRVWxGJ2jszVwulk662TUUnW9NTFA');
		injectScriptFile('http://www.google.com/uds/solutions/dynamicfeed/gfdynamicfeedcontrol.js');
		//document.write("<script>google.setOnLoadCallback(eval('function(){LoadDynamicFeedControl(\"" + id + "\",\"" + url + "\")}'));</script>");
		injectScript("google.load(\"feeds\", \"1\");");
		injectScript("LoadDynamicFeedControl(\"" + id + "\",\"" + url + "\");");
	} else if (window.Ext) {
		var context={url:url,id:id}
		Ext.onReady(function(){LoadDynamicFeedControl(this.id, this.url);},context);
	} else {
		LoadDynamicFeedControl(id,url);
	}
}

function LoadDynamicFeedControl( id, url) {
	if (! window.GFdynamicFeedControl) return;
	if (! window.google) window.google = {};
	if (! google.feeds) {
		google.feeds = {};
		google.feeds.LINK_TARGET_BLANK = "google.feeds";
	}
	new GFdynamicFeedControl(url, id, {
		stacked: false,
		horizontal: false,
		//title: '',
		numResults : 4,
		displayTime : 5000,
		fadeOutTime : 1000,
		scrollOnFadeOut : true,
		pauseOnHover : true,
		horizontal : false,
		stacked : false
	});
}
         