var isFirst = true;

// Below is the code that picks an item at random to display
jQuery.jQueryRandom = 0;  
jQuery.extend(jQuery.expr[":"],  
{  
    random: function(a, i, m, r) {  
        if (i == 0) {  
            jQuery.jQueryRandom = Math.floor(Math.random() * r.length);  
        };  
        return i == jQuery.jQueryRandom;  
    }  
}); 

// The below function repeatedly gets called, to do the rotating
function show_next_rotating_item(t){
	jQuery(t).hide();//fadeOut('fast');
 
	var next_rotating_item = jQuery(t).siblings('.rotating_item:random');
	if(!next_rotating_item.attr('class')){
		next_rotating_item = jQuery('#rotating_items div.rotating_item:first');
	}
	next_rotating_item.fadeIn('slow');
 
	showing = next_rotating_item;	
}
	
$(function() {
    swapValues = [];
    $(".swap_value").each(function(i){
        swapValues[i] = $(this).val();
        $(this).focus(function(){
            if ($(this).val() == swapValues[i]) {
                $(this).val("");
            }
        }).blur(function(){
            if ($.trim($(this).val()) == "") {
                $(this).val(swapValues[i]);
            }
        });
    });
});

	
document.write("<style type='text/css'>div.navigation{width:300px;float: left;}div.content{display:block;}</style>");

			
$(document).ready(function(){
	$('li.headlink').hover(
		function() { $('ul', this).css('display', 'block'); },
		function() { $('ul', this).css('display', 'none'); });
});

function nav()
{
	Obj = document.getElementById("artistSelect");
	if(Obj.selectedIndex != 0)
	{
		document.getElementById("artistName").value = Obj[Obj.selectedIndex].value;
		document.getElementById("search_form").action = baseURL + "/" + Obj[Obj.selectedIndex].value;
		document.getElementById("search_form").submit();
		
		
	}
}

function doSearch()
{
	    document.getElementById("search_form").action = baseURL + "/" + document.getElementById("artistName").value;
		document.getElementById("search_form").submit();
}


