// put jquery into no-conflict mode in case other library is also using $
var $j = jQuery.noConflict();
$j(document).ready(function() {
	// apply class to first item in the list to remove seperator
	$j("div#event > div:last").addClass('event-list-last');	
	// apply default value on input field
	$j('input.text').click(function() {
		if (this.value == this.defaultValue) {
			this.value = '';}
		}
	);
	$j('input.text').blur(function() {
	if (this.value == '') {
		this.value = this.defaultValue;}
		}
	);
	// initialize colorbox
	$j('ul.sf-menu').supersubs({ 
            minWidth:    9,   // minimum width of sub-menus in em units 
            maxWidth:    27,   // maximum width of sub-menus in em units 
            extraWidth:  1     // extra width can ensure lines don't sometimes turn over 
                               // due to slight rounding differences and font-family 
        		}).superfish({           
				autoArrows:  false,                           // disable generation of arrow mark-up 
				dropShadows: false                            // disable drop shadows 
	});
	// form validation
	// if form passed validation	
	$j(".newsletter").RSV({
          onCompleteHandler: validated,
                rules: [
						"valid_email,cm-xtuurj-xtuurj,Please enter a valid email address."
                ]
    });
	function validated()
	{		
		return true;
	}	
});
