var g_radio = window.g_radio || {};

g_radio.widget1 = {
    domain: "http://www.capitalfm.com",
    widget_el_id: 'g_radio_widget_1',
    news_el_id: 'g_radio_news_1',
	items: [
    
        {
		    h: "Rihanna And Coldplay Perform \u0027Princess Of China\u0027 At Grammys 2012 \u002D Video",
            p: "The two acts took to the stage for their much anticipated duet at the Staples Center in LA.",
		    u: "/artists/rihanna/news/coldplay-grammys-princess-of-china-performance/",
		    d: "11:05 Mon 13th Feb."
        }, 
    
        {
		    h: "Chris Brown Performs \u0027Turn Up The Music\u0027 And \u0027Beautiful People\u0027 At Grammys 2012 \u002D Video",
            p: "The singer returned to the ceremony to offer an impressive and energetic dance filled rendition of his hit songs.",
		    u: "/artists/chris-brown/news/grammy-awards-2012-performance-turn-up-the-music/",
		    d: "06:10 Mon 13th Feb."
        }, 
    
        {
		    h: "Katy Perry Performs New Song \u0027Part Of Me\u0027 At Grammy Awards 2012 \u002D Video",
            p: "The newly single star kicked into her latest track after a shortened rendition of \u0027E.T.\u0027",
		    u: "/artists/katy-perry/news/new-song-part-of-me-grammys-2012-live-performance/",
		    d: "06:03 Mon 13th Feb."
        }, 
    
        {
		    h: "Ed Sheeran Performs New Song \u0027Drunk\u0027 On The Graham Norton Show – Video",
            p: "The \u0027Lego House\u0027 star gives an impressive rendition of his latest single on the comedians\u0027 chat show.",
		    u: "/artists/ed-sheeran/news/graham-norton-show-drunk/",
		    d: "11:38 Sat 28th Jan."
        }, 
    
        {
		    h: "LMFAO \u002D Summertime Ball Backstage Interview",
            p: "LMFAO chatted with Roberto and you can watch the full video here...",
		    u: "/artists/lmfao/videos/summertime-ball-backstage-interview/",
		    d: "14:15 Thu 04th Aug."
        }, 
    
        {
		    h: "The Wanted \u002D Glad You Came",
            p: "Watch the boys partying in Ibiza.",
		    u: "/artists/the-wanted/videos/glad-you-came/",
		    d: "14:25 Sun 10th July"
        }, 
    
        {
		    h: "JLS \u002D She Makes Me Wanna",
            p: "The boys are back with their first single from their forthcoming third studio album.",
		    u: "/artists/jls/videos/she-makes-me-wanna/",
		    d: "11:26 Fri 08th July"
        }, 
    
        {
		    h: "Spot yourself in the crowd at Wembley",
            p: "Were you at the Summertime Ball? Have a nosey through our lovely panorama shot of the crowds arriving for the show and see if you can find yourself. Pic: Danny North",
		    u: "/summertime-ball/photos/spot-yourself-crowd-wembley/",
		    d: "09:39 Wed 22nd June"
        }, 
    
        {
		    h: "Jennifer Lopez takes a break",
            p: "\u0027On The Floor\u0027 star heads to Paris with her family after performing at Wembley Stadium",
		    u: "/artists/jennifer-lopez/news/takes-break-after-summertime-ball/",
		    d: "18:02 Fri 17th June"
        }, 
    
        {
		    h: "Example gets into Twitter row with Cher Lloyd fans",
            p: "Summertime Ball star dubs the leaking of her debut single \u0027the biggest crime since she got a record deal\u0027",
		    u: "/artists/example/news/twitter-row-cher-lloyd-fans/",
		    d: "17:59 Fri 17th June"
        }
    
	],
    styles: "#g_radio_widget_1 *{margin:0 !important\u003Bpadding:0 !important\u003Bfont\u002Dsize:12px !important\u003Bfont\u002Dstyle:normal !important\u003Bfont\u002Dweight:normal !important\u003Bline\u002Dheight:1 !important\u003Bfont\u002Dfamily:Helvetica,Arial,Verdana,helvetica,sans\u002Dserif !important\u003Bcolor:#000 !important\u003Bbackground:transparent !important\u003Btext\u002Dalign:left !important\u003Bborder:none !important}#g_radio_widget_1{border:1px solid #999 !important\u003Bbackground:#fff url(\u0027http://assets7.gcstatic.com/u/apps/asset_manager/uploaded/2011/18/header\u002Dfor\u002Dsummertime\u002Dball\u002D2011\u002Dwidget\u002D1304587894.jpg\u0027) no\u002Drepeat top right !important}#g_radio_widget_1 h2{text\u002Dindent:\u002D9999em !important\u003Bdisplay:block !important\u003Bheight:73px !important\u003Bwidth:auto !important\u003Bbackground:transparent url(\u0027http://capital.gcstatic.com/d/capitalfm.com/img/stb_widget_logo.png\u0027) no\u002Drepeat 12px 3px !important\u003B_background\u002Dimage:url(\u0027http://capital.gcstatic.com/d/capitalfm.com/img/stb_widget_logo.gif\u0027) !important}#g_radio_widget_1 p,#g_radio_widget_1 p a{text\u002Dindent:\u002D9999em !important\u003Bdisplay:block !important\u003Bwidth:auto !important\u003Bheight:42px !important}#g_radio_widget_1 p a{border:1px solid #fff !important\u003Bbackground:#57bfe3 url(\u0027http://capital.gcstatic.com/d/capitalfm.com/img/stb_widget_footer.gif\u0027) no\u002Drepeat top left !important\u003Bheight:40px !important}#g_radio_widget_1 ul{padding:6px 10px 0 !important\u003Blist\u002Dstyle:none !important}#g_radio_widget_1 ul li{list\u002Dstyle:none !important\u003Bborder\u002Dtop:1px solid #fff !important\u003Bborder\u002Dbottom:1px solid #c6dbdd !important\u003Bpadding:6px 0 !important\u003Bfloat:none !important}#g_radio_widget_1 li:first\u002Dchild{border\u002Dtop:none !important\u003Bpadding\u002Dtop:0 !important}#g_radio_widget_1 li:last\u002Dchild{border\u002Dbottom:none !important}#g_radio_widget_1 li p{text\u002Dindent:0 !important\u003Bline\u002Dheight:1.4em !important\u003Bheight:auto !important\u003Bbackground\u002Dcolor:transparent !important\u003Bbackground\u002Dimage:none !important\u003Bfont\u002Dsize:12px !important\u003Bcolor:#111 !important\u003Bmargin\u002Dtop:4px !important\u003Bborder:none !important}#g_radio_widget_1 li h3 a{font\u002Dsize:14px !important\u003Bfont\u002Dweight:bold !important}#g_radio_widget_1 li h3 a:link,#g_radio_widget_1 li h3 a:visited,#g_radio_widget_1 li h3 a:hover,#g_radio_widget_1 li h3 a:active{color:#2b397f !important\u003Btext\u002Ddecoration:none !important}#g_radio_widget_1 li h3 a:hover,#g_radio_widget_1 li h3 a:active{text\u002Ddecoration:underline !important}#g_radio_widget_1 li p.g_radio_date{font\u002Dsize:10px !important\u003Bfont\u002Dweight:bold !important}#g_radio_widget_1 li p.g_radio_error{font\u002Dsize:12px !important\u003Bfont\u002Dweight:bold !important\u003Bfont\u002Dcolor:red !important}#g_radio_news_1{padding:0 !important\u003Boverflow:auto !important\u003Bbackground\u002Dcolor:#efefef !important\u003Bwidth:auto !important\u003Bheight:254px !important\u003Bborder:1px solid #fff !important\u003Bborder\u002Dwidth:0 1px !important}",
	link : function (obj) {
		var li = document.createElement('li');
		var h = document.createElement('h3');
		var a = document.createElement('a');
		var p = document.createElement('p');
		var d = document.createElement('p');
		a.href = g_radio.widget1.domain + obj.u;
		a.innerHTML = obj.h;
		d.innerHTML = obj.d;
		p.innerHTML = obj.p;
		d.className = "g_radio_date";
		h.appendChild(a);
		li.appendChild(h);
		li.appendChild(p);
		li.appendChild(d);
        return li;
	},
	css: function () {
        var e = document.createElement('div');
        e.innerHTML = '<div>x</div><style text="text/css">' + g_radio.widget1.styles + '</style>';
        document.getElementById(g_radio.widget1.widget_el_id).appendChild(e.childNodes[1]);
	},
	init: function () {
	    var g_radio_container = document.getElementById(g_radio.widget1.widget_el_id);
	    var g_radio_news = document.getElementById(g_radio.widget1.news_el_id);
        if (g_radio_container) {
    		g_radio.widget1.css();
            if (g_radio_news) {
        		var limit = g_radio.widget1.items.length;
                var ul = document.createElement('ul');
        		for (var i=0; i < limit; i++) {
                    ul.appendChild(g_radio.widget1.link(g_radio.widget1.items[i]));
        		}
        	    document.getElementById(g_radio.widget1.news_el_id).appendChild(ul);
        	}
        	else {
    	        var p = document.createElement('p');
    	        p.className = 'g_radio_error';
    	        p.innerHTML = "ERROR! Document is missing an element with the id '" + g_radio.widget1.widget_el_id + "'";
    	        g_radio_container.appendChild(p);
        	}
        }
        else {
            alert("Widget code supplied by " + g_radio.widget1.domain.replace('http://', '') + " has been incorrectly installed.");
        }
	}
};
g_radio.widget1.init();

