	embedPlayer = function (id, width, height, vid, ap, share) {
		flashvars = {
			MediaLink: escape(vid),
			playOnStart: ap,
			autoHideOther: false,
			fullVideoScale: false,
			allowFullScreen: true,
			autoHideVideoControls: false,
			htmlpath: location.href,
			share: false,
			script_path: vidShareUrl,
			bufferSize: 5,
			logo: logoUrlsm,
			logoLink: baseUrl,
			logoTarget: '_new',
			fitToPlayer: false,
			logoX: 2,
			logoY: 2
		};
		params = {
			bgcolor: "#333333",
			allowfullscreen: "true",
			wmode: 'transparent'
		};
		attributes = {};
		so = new swfobject.embedSWF(vidPlayer, id, width, height, "9.0.0", "expressInstall.swf", flashvars, params, attributes);
	};
jQuery(document).ready(function ($) {
								 
	$i = 0;
	$vcontainer = $('#videoArea');
	$videoPlayId = "videoPlayHome";
	$('#videoScroll').empty().append('<ul></ul>');
	$('#videoList li').each(function () {
		$(this).attr('rel', $i);
		$('.videoSelect ul').append('<li><img src="' + $('.thumb img', $(this)).attr('src') + '" width="94" height="78" rel="' + $i + '" vid="' + $('.videoId', $(this)).attr('rel') + '" alt="' + $('h2', $(this)).text() + '" /></li>');
		$i++;
	});
	$('.videoSelect').append('<div class="clr"></div>');
	embedPlayer($videoPlayId, 398, 268, $('#videoList li:eq(0) .videoId').text(), true, false);
	$('.videoSelect ul li:eq(0) img').addClass('active');
	$('.controls span').text($('.videoSelect ul li:eq(0) img').attr('alt'));
	$('.videoSelect img', $vcontainer).click(function () {
		$('.videoSelect img').removeClass('active');
		$vid = $('#videoList li:eq(' + $(this).attr('rel') + ') .videoId').text();
		embedPlayer($videoPlayId, 398, 268, $vid, true, false);
		$('.controls span').empty().hide().text($(this).attr('alt')).fadeIn();
		$(this).addClass('active');
	});
	$container = $('#featured');
	$i = 0;
	$('.featuredBanner li').each(function () {
		$(this).attr('rel', $i);
		$('.thumbs .inner').append('<img src="' + $('img', $(this)).attr('src') + '" width="70" height="43" alt="" rel="' + $i + '" />')
		$i++;
	});
	$curr = 0;
	$totalSlide = $i;
	var setSlide = function ($i) {
		$slide = $('.featuredBanner li:eq(' + $i + ')');
		$('.thumbs img', $container).removeClass('active');
		$('.imageBox', $container).empty().append('<img src="" width="470" height="268" alt="" style="display:none" />');
		$('.imageBox img', $container).attr('src', $('img', $slide).attr('src'));
		$('.feature h3', $container).text($('h2', $slide).text());
		$('.feature p:first', $container).text($('p:first', $slide).text());
		$('.imageBox img', $container).ready(function ($) {
			$('.imageBox img', $container).fadeIn();
		});
		$('.thumbs img[rel=' + $i + ']', $container).addClass('active');
	};
	var makeSlide = function () {
		$curr = $curr + 1;
		if ($curr > $totalSlide - 1) {
			$curr = 0;
		}
		setSlide($curr);
	};
	setSlide($curr);
	var slideInterval = 0;
	slideInterval = setInterval(function () {
		makeSlide();
	}, 3000);
	$('.thumbs img', $container).click(function () {
		slideInterval = clearInterval(slideInterval);
		$curr = (Number)($(this).attr('rel'));
		setSlide($curr);
		slideInterval = setInterval(function () {
			makeSlide();
		}, 3000);
	});
	$("#videoScroll").jCarouselLite({
		btnNext: ".next",
		btnPrev: ".prev",
		visible: 4,
		circular: false
	});
	$('.page-item-222>a,.page-item-241>a,.page-item-3>a').click(function () {
		return false;
	}).attr('href', '#');


// For Live Radio in header
	$radioHeaderTimeout = 0;
	$liveHeader = $('#radioHeader');
	$('.leftCol',$liveHeader).empty().append('<img />');

	function radioHeaders() {
		$.getJSON("http://dgtizer.com/radio/playlistjson.php",
		//$.getJSON("http://localhost/playlistjson.txt",
				function(data){
						$p=data.playlist[0];
						$pC=data.count;
						//$('.leftCol img', $liveHeader).attr('src', thumbUrl+'?w=94&h=78&zc=1&src='+escape($p.albumart)).attr('width', '94').attr('height', 78);
						$('.leftCol img', $liveHeader).attr('src', $p.albumart).attr('width', 94).attr('height', 78);
						$('.rightCol h3', $liveHeader).empty().append($p.title);
						$('.rightCol .album', $liveHeader).empty().append($p.album);
						$pL=$('#playlistOnline');
						if($pL.html()){
								$pL.empty();
							for(i=1;i<$pC;i++){
							$p=data.playlist[i];
								$pL.append('<div class="row" id="r'+i+'"><div class="c1"><img /></div><div class="c2"><h2></h2><div class="album"></div></div><div class="clr"></div></div>');
								$r=$('#r'+i);
								$('.c1 img', $r).attr('src', $p.albumart).attr('width', 120).attr('height', 120);
								$('.c2 h2', $r).empty().append($p.title);
								$('.c2 .album', $r).empty().append($p.album);
								
								}
							
							
							}
				});


/*$.ajax({
			url: 'http://dgtizer.com/radio/playjs.php?callback=?',
			dateType: 'jsonp',
			success: function (data, textStatus) {
				$p = eval(data) || {
					pics: null,
					artist: null,
					album: null
				};
				$('.leftCol img', $liveHeader).attr('src', $p.pics).attr('width', '94').attr('height', 78);
				$('.rightCol h3', $liveHeader).empty().append($p.artist);
				$('.rightCol .album', $liveHeader).empty().append($p.album);
			}
		});
*/	};
	$radioHeaderTimeout = setInterval(function () {
		radioHeaders();
	}, 50000);
	radioHeaders();
	
	
	
});