	


$(document).ready(function() {
	
	$("#newsBox div.boxlink").hover(function() {
  	 	$(this).addClass("hiliteboxlink"); 
			$(this).removeClass("boxlink");
			}, function() {
			$(this).addClass("boxlink");
			$(this).removeClass("hiliteboxlink");
		});
 	// doAjax('ajax.cfm?show=currentstatus','currentstatusbox');
	
   $('div.accordeon> div').hide(); 
   $('div.accordeon> #dashboardBox').slideToggle('fast');
   $('div.accordeon> #mediaContainer').slideToggle('fast'); 
  $('div.accordeon> h2').click(function() {
     $(this).next('div').slideToggle('fast')
     .siblings('div:visible').slideUp('fast');
   });
	
	
	 $('h2.top_head').click(function ()	{$('div.accordeon> div.bottom_set').hide();}); 
   $('h2.bottom_head').click(function ()	{$('div.accordeon> div.top_set').hide();}); 
   $('h2.headerlink').click(function ()	{frames[this.getAttribute('target')].location.href=this.getAttribute('href'); });
   $('h2.headerajaxlink').click(function ()	{doAjax(this.getAttribute('href'),this.getAttribute('target')); }); 
	 
	 $('div.accordeon> #currentstatusbox').slideToggle('fast');
	  
		
	 $('#subnav a').click(function ()	{
	 		if (this.rel) {
	 			doAjax(this.rel,this.getAttribute('ajaxtarget'));
				return false;
			}	
		}); 
 		
	
	
	 $("#ss_desc").animate({top: ($("#ss_desc").height() - ($("#ss_desc").parent().height() * 2))}, 10000);

	 $("table").tablesorter(); 
	 
	 
	  $("#ajax-dj-set-episodes").click(function() { 
	 	  	if ( jQuery.trim($("#tbody-dj-set-episodes").html()) == '' ) { 
			     $.get("modules/medialist.cfm?cat=dj set episodes", function(html) { 
           $("#tbody-dj-set-episodes").html(html); 
            $("#table-dj-set-episodes").trigger("update"); 
            var sorting = [[0,1]]; 
            $("#table-dj-set-episodes").trigger("sorton",[sorting]); 
						
						$("#table-dj-set-episodes tr").click(function() {
								doAjax('./ajax.cfm?' + this.getAttribute('rel'),'mediaInfoBox');
								return false;
							});
						
						$("#table-dj-set-episodes tr .playnow").click(function() {
								location.href = this.getAttribute('href');
								return false;
							});
						
						
						$("#table-dj-set-episodes tr").dblclick(function() {
								// alert(this.getAttribute('link'));
								if (this.getAttribute('link') != null) {
									location.href = this.getAttribute('link');
								}
								return false;
							});
						
						
						$("#tbody-dj-set-episodes tr").hover(function() {
								$(this).addClass("hilite");
							}, function() {
								$(this).removeClass("hilite");
						});
        }); 
        return false; 
			}	
    }); 
	 
	  $("#ajax-other-videos").click(function() { 
	 	  	if ( jQuery.trim($("#tbody-other-videos").html()) == '' ) { 
			     $.get("modules/medialist.cfm?cat=other videos", function(html) { 
           $("#tbody-other-videos").html(html); 
            $("#table-other-videos").trigger("update"); 
            var sorting = [[0,1]]; 
            $("#table-other-videos").trigger("sorton",[sorting]); 
						
						$("#table-other-videos tr").click(function() {
								doAjax('./ajax.cfm?' + this.getAttribute('rel'),'mediaInfoBox');
								return false;
							});
						
						$("#table-other-videos tr .playnow").click(function() {
								location.href = this.getAttribute('href');
								return false;
							});
						
						
						$("#table-other-videos tr").dblclick(function() {
								// alert(this.getAttribute('link'));
								if (this.getAttribute('link') != null) {
									location.href = this.getAttribute('link');
								}
								return false;
							});
						
						
						$("#tbody-other-videos tr").hover(function() {
								$(this).addClass("hilite");
							}, function() {
								$(this).removeClass("hilite");
						});
        }); 
        return false; 
			}	
    }); 
	 
	  $("#ajax-dj-mixes").click(function() { 
	 	  	if ( jQuery.trim($("#tbody-dj-mixes").html()) == '' ) { 
			     $.get("modules/medialist.cfm?cat=dj mixes", function(html) { 
           $("#tbody-dj-mixes").html(html); 
            $("#table-dj-mixes").trigger("update"); 
            var sorting = [[0,1]]; 
            $("#table-dj-mixes").trigger("sorton",[sorting]); 
						
						$("#table-dj-mixes tr").click(function() {
								doAjax('./ajax.cfm?' + this.getAttribute('rel'),'mediaInfoBox');
								return false;
							});
						
						$("#table-dj-mixes tr .playnow").click(function() {
								location.href = this.getAttribute('href');
								return false;
							});
						
						
						$("#table-dj-mixes tr").dblclick(function() {
								// alert(this.getAttribute('link'));
								if (this.getAttribute('link') != null) {
									location.href = this.getAttribute('link');
								}
								return false;
							});
						
						
						$("#tbody-dj-mixes tr").hover(function() {
								$(this).addClass("hilite");
							}, function() {
								$(this).removeClass("hilite");
						});
        }); 
        return false; 
			}	
    }); 
	 
	 
	  $("#ajax-backgroundinfobox").click(function() { 
	 	  	if ( jQuery.trim($("#backgroundinfobox").html()) == '' ) { 
						var openLink = "modules/_mediaticketlinks.cfm?SearchForStringList=" + this.getAttribute('rel');
			     $.get(openLink, function(html) { 
           $("#backgroundinfobox").html(html); 
						});
        return false; 
			}	
    }); 
		
		
});	

	var cookieoptions = { path: '/', expires: 'never' };
	function changeVidSrc(newsrc)	{
	 $.cookie('DTvidspeed', newsrc, cookieoptions);
	 setTimeout("window.location.reload(true);",500);
	}


	