crossDomainCall = "/wp-content/themes/dahu/services/crossdomain_call.php";

function dahu_write_feed(id,src,limit,linkTarget)
{
	webfeed = new ArthurDent.service(crossDomainCall+"?uri="+src);
	webfeed.limit = limit;
	webfeed.linkTarget = linkTarget;
	webfeed.targetById = id;
	webfeed.target = function(thread){
		obj = document.getElementById(thread.targetById);
		txt = thread.XMLRequest.responseText;
		txt = txt.substr(txt.indexOf("<"),txt.length);//clean up any gunk
		txt = txt.substr(0,txt.lastIndexOf(">")+1);
		ret = ArthurDent.utilities.parseXML(txt);
		ret = ret.getElementsByTagName("item");
		for(var i=0;i<ret.length && (i<limit || limit<=0 || !limit);i++)
		{
			str = (ret[i].getElementsByTagName("title")[0]).textContent;
			theLink = ret[i].getElementsByTagName("link")[0].textContent;
			if (!str) 
			{
				str = (ret[i].getElementsByTagName("title")[0]).text;
				theLink = ret[i].getElementsByTagName("link")[0].text;
			}		
			conct = (thread.linkTarget.indexOf("?")!=-1 ? "&": "?");
			theLink = (thread.linkTarget.length>1? thread.linkTarget+conct+"ref="+theLink:theLink);
			theTarget = (thread.linkTarget.length>1?"":"_new");
			li = document.createElement("li");
			li.innerHTML = '<a class="link-button" href="'+theLink+'" target="'+theTarget+'">'+str+'</a>';
			obj.appendChild(li);
		}
	}
	webfeed.load();
}

function showlanguages(_id)
{
	var langOps = document.getElementById(_id);
	$(langOps).fadeIn("def");
	clearInterval(langInt);
}

langInt = false;

function hidelanguages(_id)
{
	//use a delay here so that it doesn't open/close very time the mouseout/over is called, causing a flicker
	
	langInt = setInterval(function()
	{
		var langOps = document.getElementById(_id);
		$(langOps).fadeOut("def");
		clearInterval(langInt);
	},500);	
}







