// JavaScript Docuent
jQuery(function($){
				
				var $limit=0;
//get show about	
				
		$.ajax({
				type: "GET",
				dataType:"json",
				processData:false,
				url:  www_root+'shows/getshowabout/showid:'+$('#showid').val(),
				success: function(data) {
					
				    $('#show_about_name').parent().append(data.showAbout[0].Show.name);
					$('#show_about_name').remove();
					
				    $('#show_about_season_count').parent().append(data.showAbout[0].Show.totalSeason);
					$('#show_about_season_count').remove();					
					
					$('#show_about_description').parent().append(data.showAbout[0].Show.description);
					$('#show_about_description').remove();
					
					if(data.showAbout[0].Celebrity!=undefined)
						$('#show_about_VJ').parent().append(
									data.showAbout[0].Celebrity.last_name+' '+data.showAbout[0].Celebrity.first_name);
					$('#show_about_VJ').remove();
					
					if(data.showAbout[0].Photo!=undefined)
					$('#show_about_image').attr('src',server_content+'?f='+ data.showAbout[0].Photo.filename+'&w=300&h=224&s=false');
					
					if(data.showAbout[0].Photo!=undefined)
						$('#show_about_airdate').parent().append(data.showAbout[0].Schedule.time_start);					
					$('#show_about_airdate').remove();
					
				}
			});
		
			if($('#show_hot_videos_number').val()!=undefined)
				 limit=$('#show_hot_videos_number').val();
			else	
				 limit=4;

			$.ajax({
				type: "GET",
				url:  www_root+'shows/getHotVideosByShowid/showid:'+$('#showid').val()+'/limit:'+limit,
				success: function(msg) {
					$('#show_videos_hot').parent().append(msg);
					$('#show_videos_hot').remove();
				}
			});
			
		if($('#show_currentseason_number').val()!=undefined)
			 limit=$('#show_currentseasons_number').val();
		else	
			 limit=4;
		$.ajax({
				type: "GET",
				url:  www_root+'episodes/getCurrentSeasonEpisodes/showid:'+$('#showid').val()+'/limit:'+limit,
				success: function(msg) {
					$('#show_currentseason').parent().append(msg);
					$('#show_currentseason').remove();
				}
			});	
//get photos of show
		if($('#show_photo_number').val()!=undefined)
			 limit=$('#show_photo_number').val();
		else	
			 limit=6;
			
		$.ajax({
				type: "GET",
				url:  www_root+'shows/getshowphotos/showid:'+$('#showid').val()+'/limit:'+limit,
				success: function(msg) {
					$('#show_photos').parent().append(msg);
					$('#show_photos').remove();
				}
			});
		

		
			
//replace image for paging
		var inactive = '<img src="'+www_root+ 'img/inactive.png '+'" />';
		var active = '<img src="'+www_root+ 'img/active.png'+'" />';
		var pre = '<img src="'+www_root+ 'img/pre.png'+'" />';
		var next = '<img src="'+www_root+ 'img/next.png'+'" />';

		function setImgPage(object){
					jQuery(object).find('a[href*=/page:]').each(function(){
						jQuery(this).empty();
						jQuery(this).html(inactive);
						
					});
		
					jQuery(object).find('div.current').empty();
					jQuery(object).find('div.current').html(active);
					if(jQuery(object).find('div.pre >a').is('a'))
						jQuery(object).find('div.pre > a').html(pre);	
					else
						jQuery(object).find('div.pre').html(pre);	
						
					if(jQuery(object).find('div.next >a').is('a'))
						jQuery(object).find('div.next > a').html(next);	
					else{
						jQuery(object).find('div.next').html(next);	
					}
						
					jQuery(object).find('div.paging > a').html(active);
					
					return false;
	
	}
			
});