// function myrgb2hex(rgbString) {
//     //Function to get hex format a rgb colour
//     // var rgbString = "rgb(0, 70, 255)"; // get this in whatever way.
//     var parts = rgbString.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
//     // parts now should be ["rgb(0, 70, 255", "0", "70", "255"]
//     delete(parts[0]);
//     for (var i = 1; i <= 3; ++i) {
//         parts[i] = parseInt(parts[i]).toString(16);
//         if (parts[i].length == 1) parts[i] = '0' + parts[i];
//     };
//     var hexString = parts.join(''); // "0070ff"
//     return hexString;
// }


// LOAD BANDCAMP MUSIC PLAYER
function loadMusicPlayer(bgcol) {
	// var bgbg = myrgb2hex($("body").css('background-color'));
    var bgbg = '000000';
	if(bgcol) {
		bgbg = bgcol;
		// alert("bgbg = "+bgbg);
	} else {
	    bgbg = '000000';		
	}
	
    var flashvars = {
        bgcol: bgbg,
        linkcol: '888888',
        album: '468503817',
        size: 'grande'
    };
    var params = {};
    var attributes = {};
    attributes.id = "bandcampPlayer";
    swfobject.embedSWF("http://bandcamp.com/EmbeddedPlayer.swf", "bandcampPlayer", "300", "100", "8", false, flashvars, params, attributes);
};



// LOAD YOUTUBE VIDEOS
// function loadVideos() {	
// 		
// 	// var params = {allowfullscreen: 'true', allowscriptaccess:'always', allownetworking:'false'};
// 	var params = {allowfullscreen: 'true'};
// 	var attributes = {};
// 	var flashvars = {rel:'0', fs:'1'};
// 
// 	swfobject.embedSWF('http://www.youtube.com/v/Y3Vcoq-QRo4', 'YouTubeMovie_1', '332', '275', '8', null, flashvars, params,{id: 'YouTubeMovie_1'});
// 	swfobject.embedSWF('http://www.youtube.com/v/zD_4mjV5b2U', 'YouTubeMovie_2', '332', '275', '8', null, flashvars, params,{id: 'YouTubeMovie_2'});
// 	swfobject.embedSWF('http://www.youtube.com/v/yoJyu5OGEOw', 'YouTubeMovie_3', '332', '275', '8', null, flashvars, params,{id: 'YouTubeMovie_3'});
// 	
// 	swfobject.embedSWF('http://www.youtube.com/v/zQpiHzTqBHA', 'YouTubeMovie_4', '332', '275', '8', null, flashvars, params,{id: 'YouTubeMovie_4'});
// 	swfobject.embedSWF('http://www.youtube.com/v/-AkJ_qeE9cs', 'YouTubeMovie_5', '332', '275', '8', null, flashvars, params,{id: 'YouTubeMovie_5'});
// 	swfobject.embedSWF('http://www.youtube.com/v/0Kh0XtokDVo', 'YouTubeMovie_6', '332', '275', '8', null, flashvars, params,{id: 'YouTubeMovie_6'});
// };


// load RSS feeds into page
function loadNewsFeeds() {
    // add a feed for twitter
    $('#tweetfeed').gFeed({
        url: 'http://twitter.com/statuses/user_timeline/42813218.rss',
        max: 1,
        // title: '<h3>status</h3>'
        title: ' '
    }).prepend('<h3>follow us on <a href="http://twitter.com/redfangband/">twitter</a></h3>');
;//.append('<div class="feed">you can follow <a type="application/rss+xml" rel="alternate" href="http://twitter.com/statuses/user_timeline/42813218.rss">RSS feed of Red Fang&#x27;s tweets. <img src="images/feed-icon-14x14.png" alt="twitter rss feed"></a></div>');
//	$('#newsfeed').gFeed({url: 'http://feeds.artistdata.com/rss.newfeeds/artist/AR-H192Y38L80PU4P50/rss',max:15,title: 'artistdata news feed'});

    // add a feed for blogspot
    $('#blogfeed').gFeed({
        // url: 'http://redfangband.blogspot.com/feeds/posts/default',
        url: 'http://feeds.feedburner.com/RedFang',
        max: 5,
        // title: 'from the blog'
        title: ' '
    }).prepend('<h3>from our <a href="http://redfangband.blogspot.com/">blog</a></h3>');
	
};

function loadShowFeeds () {
	// create a tabbed feed for show listings
    $('a.feed').gFeed({
        target: '#showfeed',
        tabs: true,
        max: 50
    });
};

//random colored background

// function spectrum(){
// 	var hue = 'rgb(' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ')';
// 	var hue2 = 'rgb(' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 86)) + ',' + (Math.floor(Math.random() * 56)) + ')';
// 	$('#header').animate( { backgroundColor: hue2 }, 2000, null, spectrum);



	// $('#title').animate( { color:hue2 }, 1000);
	// $('a').animate( { color: hue2 }, 1000);
	// spectrum(); 
// }






