// JavaScript Document
	var ODFeature = Class.create();
	ODFeature.prototype = {
		initialize:function(con, featured_obj){
			this.container = con;
			this.featured_artist = featured_obj;
			switch(this.featured_artist.program_id){
				case '10':
					this.program_name ='Stripped';
					this.tagline_text = ' - In Studio Performances';
					this.container.up().style.background = 'url(images/stripped_feature.jpg) top left no-repeat';
				break;
				case '3':
					this.program_name = 'In-Concert';
					this.tagline_text = ' - Live Performances On Demand';
					this.container.up().style.background = 'url(images/inconcert_feature.jpg) top left no-repeat';
				break;
				case '4':
					this.program_name = 'Sneak Peek';
					this.tagline_text = ' - Hear Full Albums Here First';
					this.container.up().style.background = 'url(images/sneakpeek_feature.jpg) top left no-repeat';
				break;
				case '9':
					this.program_name = 'Music On Demand';
					this.tagline_text = ' - Singles and Full Albums On Demand'; 
					this.container.up().style.background = 'url(images/mod_feature.jpg) top left no-repeat';
				break;
				case '54':
					this.programe_name = 'Video 6 Pack';
					this.tagline_text = ' - Artist Hosted Video Show';
					this.container.up().style.background = 'url(images/v6p_feature.jpg) top left no-repeat';
				break;
			}
			this.build_feature_container();
		},
		build_feature_container:function(){
			this.container.style.background = 'url('+this.featured_artist.location+'/images/596x368.jpg) top left no-repeat #000000';
			this.topLeftLinks = JTools._createDOMElement('div', 'topLeftLinks', [{name:'id',value:'featured_content_playlist'}]);
			this.container.appendChild(this.topLeftLinks);
			for(var i = 0; i<this.featured_artist.song_list.length; i++){
				this.build_song(i);
			}
			if(this.featured_artist.buy_link != ''){
				if(this.featured_artist.album_title != ''){
					this.buy_link = this.featured_artist.buy_link;
					this.buy_text = 'Buy CD - '+ this.featured_artist.album_title;
				}else{
					this.buy_link = this.featured_artist.buy_link;
					this.buy_text = 'Buy CD';
				}
				this.buy_div = JTools._createDOMElement('div', 'topLeftLinkContainers', [{name:'id',value:'buy_div'}]);
				
				this.buy_table = JTools._createDOMElement('table', false, [{name:'width',value:'175px'},{name:'cellspacing',value:0},{name:'cellpadding',value:0}]);
				
				this.buy_tbody = JTools._createDOMElement('tbody', false, []);
				
				this.buy_tr = JTools._createDOMElement('tr', false, []);
				
				this.buy_td1 = JTools._createDOMElement('td', false, [{name:'width',value:'14px'}]);

				this.buy_td1link = JTools._createDOMElement('a', false, [{name:'href',value:this.buy_link}, {name:'target',value:'_blank'}]);
				
				this.buy_tdimage = JTools._createDOMElement('img', false, [{name:'src',value:'/cc-common/ondemand/images/cdbuybutton.jpg'}, {name:'border', value:0}]);
				
				this.buy_td1link.appendChild(this.buy_tdimage);
				this.buy_td1.appendChild(this.buy_td1link);
				
				this.buy_tr.appendChild(this.buy_td1);
				
				this.buy_td2 = JTools._createDOMElement('td', 'blue', [{name:'width',value:'40px'}]);
				
				this.buy_td2link = JTools._createDOMElement('a', false, [{name:'href',value:this.buy_link}, {name:'target',value:'_blank'}], 'Buy CD');
				
				this.buy_td2.appendChild(this.buy_td2link);
				
				this.buy_tr.appendChild(this.buy_td2);
				
				this.buy_td3 = JTools._createDOMElement('td', 'blue', [{name:'width',value:'111px'}]);
				
				if(this.featured_artist.album_title != ''){
					this.buy_td3link = JTools._createDOMElement('a', false, [{name:'href',value:this.buy_link}, {name:'target',value:'_blank'}], this.featured_artist.album_title);
				
					this.buy_td3.appendChild(this.buy_td3link);
				}
				this.buy_tr.appendChild(this.buy_td3);
				
				
				this.buy_tbody.appendChild(this.buy_tr);
				this.buy_table.appendChild(this.buy_tbody);
				this.buy_div.appendChild(this.buy_table);
				this.topLeftLinks.appendChild(this.buy_div);
			}
			if(this.featured_artist.itunes_link!=""){
				this.iTunes_div = JTools._createDOMElement('div', 'topLeftLinkContainers', [{name:'id',value:'iTunes_div'}]);
				this.topLeftLinks.appendChild(this.iTunes_div);
				this.iTunes_table = JTools._createDOMElement('table', false, [{name:'width',value:'175px'},{name:'cellspacing',value:0},{name:'cellpadding',value:0}]);
				this.iTunes_tbody = JTools._createDOMElement('tbody', false, []);
				this.iTunes_tr = JTools._createDOMElement('tr', false, []);
				this.iTunes_td1 = JTools._createDOMElement('td', false, [{name:'width',value:'14px'}]);
				this.iTunes_td1link = JTools._createDOMElement('a', false, [{name:'href',value:this.featured_artist.itunes_link}, {name:'target',value:'_blank'}]);
				this.iTunes_tdimage = JTools._createDOMElement('img', false, [{name:'src',value:'/cc-common/ondemand/images/itunesbutton.jpg'}, {name:'border', value:0}]);
				this.iTunes_td1link.appendChild(this.iTunes_tdimage);
				this.iTunes_td1.appendChild(this.iTunes_td1link);

				this.iTunes_td2 = JTools._createDOMElement('td', 'blue', [{name:'width',value:'151px'}]);
				this.iTunes_td2link = JTools._createDOMElement('a', false, [{name:'href',value:this.featured_artist.itunes_link}, {name:'target',value:'_blank'}], 'Buy on iTunes');

				this.iTunes_td2.appendChild(this.iTunes_td2link);
				this.iTunes_tr.appendChild(this.iTunes_td1);
				this.iTunes_tr.appendChild(this.iTunes_td2);
				this.iTunes_tbody.appendChild(this.iTunes_tr);
				this.iTunes_table.appendChild(this.iTunes_tbody);
				this.iTunes_div.appendChild(this.iTunes_table);
			}else if(this.featured_artist.album_title != ''){
				this.iTunes_div = JTools._createDOMElement('div', 'topLeftLinkContainers', [{name:'id',value:'iTunes_div'}]);
				this.topLeftLinks.appendChild(this.iTunes_div);
				new Ajax.Request(
					'/cc-common/js/ajax_services/od_landing_page_itunes.php',
					{
						method:'get',
						parameters:{album_title:this.featured_artist.album_title, artistName:this.featured_artist.artist_name},
						on200:function(transport){
							eval (transport.responseText);
							if(Object.keys(o).length != 0){
								this.iTunes_table = JTools._createDOMElement('table', false, [{name:'width',value:'175px'},{name:'cellspacing',value:0},{name:'cellpadding',value:0}]);
								this.iTunes_tbody = JTools._createDOMElement('tbody', false, []);
								this.iTunes_tr = JTools._createDOMElement('tr', false, []);
								this.iTunes_td1 = JTools._createDOMElement('td', false, [{name:'width',value:'14px'}]);
								this.iTunes_td1link = JTools._createDOMElement('a', false, [{name:'href',value:o.album_link}, {name:'target',value:'_blank'}]);
								this.iTunes_tdimage = JTools._createDOMElement('img', false, [{name:'src',value:'/cc-common/ondemand/images/itunesbutton.jpg'}, {name:'border', value:0}]);
								this.iTunes_td1link.appendChild(this.iTunes_tdimage);
								this.iTunes_td1.appendChild(this.iTunes_td1link);

								this.iTunes_td2 = JTools._createDOMElement('td', 'blue', [{name:'width',value:'151px'}]);
								this.iTunes_td2link = JTools._createDOMElement('a', false, [{name:'href',value:o.album_link}, {name:'target',value:'_blank'}], 'Buy on iTunes');

								this.iTunes_td2.appendChild(this.iTunes_td2link);
								this.iTunes_tr.appendChild(this.iTunes_td1);
								this.iTunes_tr.appendChild(this.iTunes_td2);
								this.iTunes_tbody.appendChild(this.iTunes_tr);
								this.iTunes_table.appendChild(this.iTunes_tbody);
								this.iTunes_div.appendChild(this.iTunes_table);
							}else{
								this.iTunes_div.remove();
							}
						}.bind(this)
					}
				);
			}
			if(this.featured_artist.gallery_id != 0){
				if(this.featured_artist.program_name == 'stripped'){
					var options_popup = 'width=510,height=527,top=30,left=30,resize=1,screenY=30,screenX=30'
					var url = 'http://www.strippedmusic.com/jacor-common/cc_photopopStripped.html?eventID='+this.featured_artist.gallery_id;
				}else{
					var options_popup = 'width=728,height=600,toolbar=0,menubar=0,status=0,scrollbars=0'
					var url = '/cc-common/gallery/display.html?album_id='+this.featured_artist.gallery_id;
				}
				this.photo_div = JTools._createDOMElement('div', 'topLeftLinkContainers', [{name:'id',value:'photo_div'}]);
				this.photo_table = JTools._createDOMElement('table', false, [{name:'width',value:'175px'},{name:'cellspacing',value:0},{name:'cellpadding',value:0}]);
				this.photo_tbody = JTools._createDOMElement('tbody', false, []);
				this.photo_tr = JTools._createDOMElement('tr', false, []);
				this.photo_td1 = JTools._createDOMElement('td', 'blue', [{name:'width',value:'151px'}]);
				this.photo_td1link = JTools._createDOMElement('a', false, [{name:'href',value:'javascript:void(window.open("'+url+'", "gallery", "'+options_popup+'"));'} ], 'Photo Gallery');
				this.photo_td1.appendChild(this.photo_td1link);
				this.photo_tr.appendChild(this.photo_td1);
				this.photo_tbody.appendChild(this.photo_tr);
				this.photo_table.appendChild(this.photo_tbody);
				this.photo_div.appendChild(this.photo_table);
				this.topLeftLinks.appendChild(this.photo_div);
			}
			if(this.featured_artist.link_labels['Wallpaper'] != ''){
				if(this.featured_artist.program_name == 'stripped'){
					var options_popup = 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=675,height=400'
					var url = 'http://www.strippedmusic.com/media/'+this.featured_artist.location.replace(/\/cc-common/,"").replace(/\/stripped\//, "")+'_wallpaper/pop.html?wallpaper='+this.featured_artist.location.replace(/\/cc-common/,"").replace(/\/stripped\//, "")+'_wallpaper'
				}else{
					var options_popup = 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=660,height=500'
					var url = this.featured_artist.location+'/pop_wall.html';
				}
				this.wallpaper_div = JTools._createDOMElement('div', 'topLeftLinkContainers', [{name:'id',value:'wallpaper_div'}]);
				this.wallpaper_table = JTools._createDOMElement('table', false, [{name:'width',value:'175px'},{name:'cellspacing',value:0},{name:'cellpadding',value:0}]);
				this.wallpaper_tbody = JTools._createDOMElement('tbody', false, []);
				this.wallpaper_tr = JTools._createDOMElement('tr', false, []);
				this.wallpaper_td1 = JTools._createDOMElement('td', 'blue', [{name:'width',value:'151px'}]);
				this.wallpaper_td1link = JTools._createDOMElement('a', false, [{name:'href',value:'javascript:void(window.open("'+url+'", "_blank", "'+options_popup+'"));'}], this.featured_artist.link_labels['Wallpaper']);
				this.wallpaper_td1.appendChild(this.wallpaper_td1link);
				this.wallpaper_tr.appendChild(this.wallpaper_td1);
				this.wallpaper_tbody.appendChild(this.wallpaper_tr);
				this.wallpaper_table.appendChild(this.wallpaper_tbody);
				this.wallpaper_div.appendChild(this.wallpaper_table);
				this.topLeftLinks.appendChild(this.wallpaper_div);
			}
			if(this.featured_artist.link_labels['Icon'] != ''){
				if(this.featured_artist.program_name == 'stripped'){
					var options_popup = 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=675,height=400'
					var url = 'http://www.strippedmusic.com/media/'+this.featured_artist.location.replace(/\/cc-common/,"").replace(/\/stripped\//, "")+'_icons/pop.html?icons='+this.featured_artist.location.replace(/\/cc-common/,"").replace(/\/stripped\//, "")+'_icons'
				}else{
					var options_popup = 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=660,height=500'
					var url = this.featured_artist.location+'/pop_icons.html';
				}
				this.icons_div = JTools._createDOMElement('div', 'topLeftLinkContainers', [{name:'id',value:'icons_div'}]);
				this.icons_table = JTools._createDOMElement('table', false, [{name:'width',value:'175px'},{name:'cellspacing',value:0},{name:'cellpadding',value:0}]);
				this.icons_tbody = JTools._createDOMElement('tbody', false, []);
				this.icons_tr = JTools._createDOMElement('tr', false, []);
				this.icons_td1 = JTools._createDOMElement('td', 'blue', [{name:'width',value:'151px'}]);
				this.icons_td1link = JTools._createDOMElement('a', false, [{name:'href',value:'javascript:void(window.open("'+url+'", "_blank", "'+options_popup+'"));'}], this.featured_artist.link_labels['Icon']);
				this.icons_td1.appendChild(this.icons_td1link);
				this.icons_tr.appendChild(this.icons_td1);
				this.icons_tbody.appendChild(this.icons_tr);
				this.icons_table.appendChild(this.icons_tbody);
				this.icons_div.appendChild(this.icons_table);
				this.topLeftLinks.appendChild(this.icons_div);
			}
			if(this.featured_artist.bio_link != ''){
				this.artist_infodiv = JTools._createDOMElement('div', 'topLeftLinkContainers', [{name:'id',value:'artist_infodiv'}]);
				this.artist_infotable = JTools._createDOMElement('table', false, [{name:'width',value:'175px'},{name:'cellspacing',value:0},{name:'cellpadding',value:0}]);
				this.artist_infotbody = JTools._createDOMElement('tbody', false, []);
				this.artist_infotr = JTools._createDOMElement('tr', false, []);
				this.artist_infotd1 = JTools._createDOMElement('td', 'blue', [{name:'width',value:'151px'}]);
				this.artist_infotd1link = JTools._createDOMElement('a', false, [{name:'href',value:this.featured_artist.bio_link}, {name:'target', value:'_blank'}], 'Artist Information');
				this.artist_infotd1.appendChild(this.artist_infotd1link);
				this.artist_infotr.appendChild(this.artist_infotd1);
				this.artist_infotbody.appendChild(this.artist_infotr);
				this.artist_infotable.appendChild(this.artist_infotbody);
				this.artist_infodiv.appendChild(this.artist_infotable);
				this.topLeftLinks.appendChild(this.artist_infodiv);
			}
			if(this.featured_artist.artist_website != ''){
				this.artist_websitediv = JTools._createDOMElement('div', 'topLeftLinkContainers', [{name:'id',value:'artist_websitediv'}]);
				this.artist_websitetable = JTools._createDOMElement('table', false, [{name:'width',value:'175px'},{name:'cellspacing',value:0},{name:'cellpadding',value:0}]);
				this.artist_websitetbody = JTools._createDOMElement('tbody', false, []);
				this.artist_websitetr = JTools._createDOMElement('tr', false, []);
				this.artist_websitetd1 = JTools._createDOMElement('td', 'blue', [{name:'width',value:'151px'}]);
				this.artist_websitetd1link = JTools._createDOMElement('a', false, [{name:'href',value:this.featured_artist.artist_website}, {name:'target', value:'_blank'}], 'Visit Artist Site');
				this.artist_websitetd1.appendChild(this.artist_websitetd1link);
				this.artist_websitetr.appendChild(this.artist_websitetd1);
				this.artist_websitetbody.appendChild(this.artist_websitetr);
				this.artist_websitetable.appendChild(this.artist_websitetbody);
				this.artist_websitediv.appendChild(this.artist_websitetable);
				this.topLeftLinks.appendChild(this.artist_websitediv);
			}
			if(this.topLeftLinks.getHeight()>325){
//				this.topLeftLinks.style.height = '325px';
//				this.topLeftLinks.style.overflow = 'auto';
				this.topLeftLinks.up().setStyle(
					{
						height : this.topLeftLinks.getHeight()+'px'
					}
				);
				var height = 0;
				this.topLeftLinks.up().up().immediateDescendants().each(function(obj){height += obj.getHeight();});
				this.topLeftLinks.up().up().setStyle(
					{
						height : height+60+'px',
						backgroundColor:'#000000'
					}
				);
			}
		},
		build_song:function(num){
			if(this.featured_artist.song_list[num].playall != 1){
				if(this.program_name == 'Stripped' || this.program_name == 'Video 6 Pack' || this.program_name == 'In-Concert'){
					for(var i = 0; i<this.featured_artist.song_list[num].media.length; i++){
						if(this.featured_artist.song_list[num].media[i].media_type == 'video'){
							var mid = this.featured_artist.song_list[num].media[i].song_media_id;
							break;
						}else{
							var mid = this.featured_artist.song_list[num].media[i].song_media_id;
						}
					}
				}else{
					for(var i = 0; i<this.featured_artist.song_list[num].media.length; i++){
						if(this.featured_artist.song_list[num].media[i].media_type == 'audio'){
							var mid = this.featured_artist.song_list[num].media[i].song_media_id;
							break;
						}else{
							var mid = this.featured_artist.song_list[num].media[i].song_media_id;
						}
					}
				}
				var topLeftLinkContainers = JTools._createDOMElement('div', 'topLeftLinkContainers', [{name:'id',value:'topLeftLinkContainers_'+num}]);
				var table = JTools._createDOMElement('table', false, [{name:'width',value:'175px'},{name:'cellspacing',value:0},{name:'cellpadding',value:0}]);
				
				var tbody = JTools._createDOMElement('tbody', false, []);
				
				var tr = JTools._createDOMElement('tr', false, []);
				
				var td1 = JTools._createDOMElement('td', false, [{name:'width',value:'14px'}]);
				
				var td1link = JTools._createDOMElement('a', false, [{name:'href',value:'javascript:void(PlayerPopups.openPlayer("/cc-common/ondemand/player.html?apid='+this.featured_artist.artist_program_id+'&mid='+mid+'"));'}]);
				
				var td1image = JTools._createDOMElement('img', false, [{name:'src',value:'/cc-common/ondemand/images/playbuttonblack.jpg'}, {name:'border', value:0}]);
				td1link.appendChild(td1image);
				td1.appendChild(td1link);
				tr.appendChild(td1);
				
				var td2 = JTools._createDOMElement('td', 'smallwhite', [{name:'width',value:'151px'}]);
				
				var td2link = JTools._createDOMElement('a', false, [{name:'href',value:'javascript:void(PlayerPopups.openPlayer("/cc-common/ondemand/player.html?apid='+this.featured_artist.artist_program_id+'&mid='+mid+'"));'}], this.featured_artist.song_list[num].song_title);

				td2.appendChild(td2link);
				tr.appendChild(td2);
				tbody.appendChild(tr);
				table.appendChild(tbody);
				topLeftLinkContainers.appendChild(table);
				this.topLeftLinks.appendChild(topLeftLinkContainers);
			}
		}
	};
