/*
DEPENDS
	ipod_subscribe_link class
*/
if (typeof GR == "undefined") {
	GR ={};
}
if (typeof GR.feed == "undefined") {
	GR.feed = {};
}

/*
GR.feed.playITunesPcast = function()
{
	window.location='pcast://'+window.location.host+'/citigroup/graduaterecruitment/feed/vid_rss.xml';
}
*/

//Enable logging on resource
/* ----------------------------------------------------------- 
	Loader
   ----------------------------------------------------------- */
GR.feed.pageLoader = function(){
	GR.feed.decoratePodcast();	
};

GR.feed.decoratePodcast = function(){
	var podcastLinks=HRGR.util.Dom.getElementsByClassName("ipod_subscribe_link", "a");
	for(var i=0; i<podcastLinks.length; i++){
		HRGR.util.Event.addListener(podcastLinks, "click", 
			GR.feed.clickPodcast,null);
	}
};

GR.feed.clickPodcast = function(e,data){
	var callbackXmlReqObj = {
		success: function(o) { return; }, //do nothing
  		failure: function(o) { return; } //do nothing
  	};
	var ajaxCall = HRGR.util.Connect.asyncRequest('GET', 
		"/citigroup/graduaterecruitment/feed/vid_rss_cnt.htm", callbackXmlReqObj, null); 
	return true;	
};

HRGR.util.Event.addListener(window, "load", GR.feed.pageLoader);