jQuery(document).ready(function() {	
	
    jQuery("#artists").cycle({
		fx:    	 "fade",
		speed:	 2000,
		timeout: 10000,
		before:  onBefore, 
		after:   onAfter, 
		pager:   "#featured ul",
		pagerAnchorBuilder: function(idx, slide){
			return '<li><a href="#">' + (slide.title) + '</a></li>';
		}
    });
	jQuery("#featured").hover(function(){
		jQuery('#artists').cycle("pause");
	},function(){
		jQuery('#artists').cycle("resume");		
	}); 
	
	function  onBefore() {
		//remove the artist link and 'on' class
	}
	function  onAfter() {
		//give the artist link and 'on' class
	}
	
	// .hover(over,out)
	// over uses slide down to slide up because of css positioning
	jQuery("#feature2 div.artist").hover(function(){
		jQuery(this).children("div").children("p").slideDown("fast");
	},function(){
		jQuery(this).children("div").children("p").slideUp("slow");
	});
	
	
	// search box text removal
	jQuery("input[@name='q']").click(function(){
		if(jQuery(this).val()=="Search for artist/event..."){
			jQuery(this).val("");
		}
	}).blur(function(){
		if(jQuery(this).val()==""){
			jQuery(this).val("Search for artist/event...");
		}
	});
	
	jQuery(".close").click(function(event){
		event.preventDefault();
		jQuery("#welcome").css("display","none");
	});
});   

jQuery(document).ready(function() {

jQuery('[class^=link]').click(function() {
var jQuerythis = jQuery(this);
var x = jQuerythis.attr("className");
jQuery('.toggle-item-' + x).toggle();
});
});



 $(document).ready( function(){       
            $("td[class^='click_']").click( showDialog );
				}
        );
   
   //function to show dialog   
    var showDialog = function() {
	var jQuerythis = jQuery(this);
	var click = jQuerythis.attr("className");
	
	//variable to reference window
    $myWindow = $('.info_' + click);
    
	$myWindow.dialog({ height: 700,
                        width: 770,
                        modal: true,
						resizable: false,
                        position: 'center',
                        autoOpen:false,
                        title:'Ticket Information:',
                        overlay: { opacity: 0.5, background: 'black'}
                        });
						
    //if the contents have been hidden with css, you need this
        $myWindow.show(); 
        //open the dialog
        $myWindow.dialog("open");
        }

    //function to close dialog, probably called by a button in the dialog
    var closeDialog = function() {
        $myWindow.dialog("close");
    }
			
