jQuery.noConflict();
jQuery(document).ready(function($){  

	/* IE6-8 Z-Index Fix */
	var zIndexNumber = 1000;
	$("div").each(function() {
		$(this).css('zIndex', zIndexNumber);
		zIndexNumber -= 10;
	});
	
	
		
	var patterns = {
		text: /^['"]?(.+?)["']?$/,
		url: /^url\(["']?(.+?)['"]?\)$/
	};
	
	$("#blue-bar #event-type").selectbox();
	$("#blue-bar #event-time").selectbox();
	
    $('.primary ul').superfish({ 
            delay:       1000,                            // one second delay on mouseout 
            speed:       0,                          // faster animation speed 
            autoArrows:  false,                           // disable generation of arrow mark-up 
            dropShadows: false                            // disable drop shadows 
        }); 
	$('.top ul').superfish({ 
            delay:       1000,                            // one second delay on mouseout 
            speed:       0,                          // faster animation speed 
            autoArrows:  false,                           // disable generation of arrow mark-up 
            dropShadows: false                            // disable drop shadows 
        }); 
	
	$(function() {
		var dates = $( "#from, #to" ).datepicker({
			defaultDate: "+1w",
			changeMonth: true,
			onSelect: function( selectedDate ) {
				var option = this.id == "from" ? "minDate" : "maxDate",
					instance = $( this ).data( "datepicker" ),
					date = $.datepicker.parseDate(
						instance.settings.dateFormat ||
						$.datepicker._defaults.dateFormat,
						selectedDate, instance.settings );
				dates.not( this ).datepicker( "option", option, date );
			}
		});
	});
	
	$(function inputClass() {
        $(':input').addClass("idleField");
        $('input[type="text"]').focus(function () {
            $(this).removeClass("idleField").addClass("focusField");
        });
        $(':input').blur(function () {
            $(this).removeClass("focusField").addClass("idleField");
        });
    })
	
	$("#searchevents")
    .val("Search Events")
    .focus(function(){
        if ($(this).val() == "Search Events") {
            $(this).val("");
        }
    })
    .blur(function(){
        if ($(this).val() == "") {
            $(this).val("Search Events");
        }
    });
});

