// JavaScript Document
$(
  function(){ 
	$('.leftNavGenre').hover(
		function(){ 
			$(this).addClass("leftNavHover");
		},
		function(){ 
			$(this).removeClass("leftNavHover");
		}
	);
	$('.subGenre').hover(
		function(){ 
			$(this).addClass("subGenreHover");
		},
		function(){ 
			$(this).removeClass("subGenreHover");
		}
	);
	$('#loginpanel').hide();
	$('#loginpanel').css('z-index',9000);
	$('#signInLink').click(
		function(event){ 
			event.stopPropagation();
			$('#loginpanel').css('visibility','visible');
			$('#loginpanel').show();
		}
	);
	$('#loginpanel').click(
		function(event){ 
			event.stopPropagation();
		}
	);				   
						   
	 $('body').click(function(event) {
	 	$('#loginpanel').hide();
        event.stopPropagation();
	 });


    $(".smallAd input").click(function (e) { e.preventDefault(); });
    $("#skyscraperContainer input").click(function (e) { e.preventDefault(); });
    $("#leaderboardContainer input").click(function (e) { e.preventDefault(); });
	
    $('#signupSubmit,.performanceThumb,.buyBtn,.previewBtn,div.leftArrow,div.rightArrow').hover(function() {
        $(this).animate({ opacity: 0.5 }, 100);
        $(this).css('cursor','pointer');
        },
        function() {
        $(this).animate({ opacity: 1.0 }, 100);
    });
	var tempArray=new Array();
	$.ajax({
			type: "GET",
			url: "xml/hot.xml",
			dataType: "xml",
			success: function(xml) {
	 			$(xml).find('entry').each(function(){
					tempArray.push($(this).text());
				});
				var str="";
				for(var i=0;i<tempArray.length;i++){
					if(i>0){
						str=str+" | ";
					}
					str=str+"<a href='contentCentral.aspx?sterm="+tempArray[i]+"'>"+tempArray[i]+"</a>";
				}
				$('#whatsHot').html("<span class='whatsHotText'>WHAT'S HOT</span>&nbsp;&nbsp;"+str);
			}
	});
	
	$('#inboxTableDashboard tr:even').addClass('zebra');
	$('.financialTable tr:odd').addClass('zebra');
	$('.settingsTable tr:even').addClass('zebra');
	
	//chat
	$('.imContainer').hide();
	$('#chatOverlay').hide();
	$('.imEntry').hover(
		function(){ 
			$(this).addClass('imEntryHover');
		},
		function(){ 
			$(this).removeClass('imEntryHover');
		}
	);

	$('.imLaunchButton').click(
		function(){ 
			$('.imContainer').show();
			$('.imContainer').css('visibility','visible');
			$('#chatOverlay').show();
			
		}
	);
	$('#chatOverlay').click(
		function(){ 
			$('.imContainer').hide();
			$('.imContainer').css('visibility','hidden');
			$('#chatOverlay').hide();
		}
	);
	
	
});
