$(document).ready(function() {
	// Put default text in search fields.
	$('input#keywords').attr('value','Events, Orgs, Venues, etc.').css({'color':'#aaa','font-size':'12px','font-family':'Verdana'}).click(function(){$(this).attr('value','')});
	$('input#when').attr('value','mm/dd/yyyy').css({'color':'#aaa','font-size':'12px','font-family':'Verdana'}).click(function(){$(this).attr('value','')});

	if ($('#submit_event_preview_h1_placeholder').length > 0) {
	   $('#submit_event_preview_h1_placeholder').html('<h1>submit an event</h1>');
   } 
	if ($('#category_spotlight').length > 0) {
	   $('#content_main > h1').prependTo('#category_spotlight').css('display','block');
   } 
	if ($('#description').length > 0) {
	   $('#content_main > h1').prependTo('#description').css('display','block');
   } 
   
	if ($('#static_tabs').length > 0) {
	   $('#content_main > h1').prependTo('#content_main_inner').css('display','block');
   } 
   
	if ($('#content_page').length > 0) {
	   $('#content_main > h1').prependTo('#content_page').css('display','block');
   } 
   
	if ($('#content_main_inner').length > 0) {
	   $('#content_main > h1').prependTo('#content_main_inner').css('display','block');
   } 
   
	if ($('#top_10_outer').length > 0) {
	   $('#content_main > h1').prependTo('#content_main_inner').css('display','block');
   } 
   
	if ($('.csscat14 #intro_paragraph').length > 0) {
		$('#intro_paragraph h1').remove();
	   $('#content_main > h1').prependTo('#intro_paragraph').css('display','block');
   } 
   
	if ($('#esavers').length > 0) {
	   $('#content_main > h1').prependTo('#esavers').css('display','block');
   } 
   
	if ($('#bostix').length > 0) {
	   $('#content_main > h1').prependTo('#bostix').css('display','block');
   } 
   
	if ($('.funsavers').length > 0) {
	   $('#content_main > h1').prependTo('#content_main_inner').css('display','block');
   } 
   
	if ($('#review_form').length > 0) {
	   $('#description > h1').prependTo('#content_main_inner').css('display','block');
   } 

if ($('#rants_list_container').length > 0) {
	   $('body').addClass('rants_raves');
   } 
   
	if ($('.member_login_form').length > 0) {
	   $('body').addClass('members');
   } 
   
	if ($('#top_10_outer').length > 0) {
	   $('body').addClass('top_10_events');
	   $('h3').css('display','none');
   } 
   
	if ($('#form_events_with_videos').length > 0) {
	   $('body').addClass('video_central');
   } 
   
  
   $('div#intro_paragraph:has(p)').css('display','block');
   var group_header = $('#category_spotlight h1').text();
   $('#intro_paragraph').prepend('<h1><span>' + group_header + '</span></h1>');
	   
   
   
   $('.cssvenue img.event_image').wrap('<div id="event_image"></div>');
   $('.cssorg img.event_image').wrap('<div id="event_image"></div>');
   var imgHeight = $('div#event_image img').height();
   var imgTopMargin = (251 - imgHeight)/2;
   $('#category_spotlight div#event_image img').css('margin-top',imgTopMargin);
   $('#description div#event_image img').css('margin-top',imgTopMargin);
						   
	// If the rounded.js file has been included, then round all the corners.
	if(typeof(rounded) != 'undefined' && rounded == true) {
        obj = $('#content_sub > ul > li');
        if( obj && obj !== undefined )
        {
            obj = obj.not('.advertisement');
            if( obj && obj !== undefined ) 
			{
				obj = obj.not('#calendarsearch-container');
				if( obj && obj !== undefined ) 
				{
					obj.corner('15px');
				}
			}
        }
        obj = $('#main_nav');
        if( obj && obj !== undefined ) obj.corner('destroy');
        obj = $('#static_tabs .semtabs');
        if( obj && obj !== undefined ) obj.corner('destroy');
        obj = $('#main_nav > li > ul');
        if( obj && obj !== undefined ) obj.corner('10px');
        obj = $('#content_main_inner #info');
        if( obj && obj !== undefined ) obj.corner('10px');
        obj = $('#home_featured_events > ul > li');
        if( obj && obj !== undefined ) obj.corner('destroy');
		obj = $('#content #maincolumnlistA > li');
        if( obj && obj !== undefined ) obj.corner('15px');
        obj = $('#content #maincolumnlistB > li');
        if( obj && obj !== undefined ) obj.corner('15px');
		obj = $('#site_info > ul > li');
        if( obj && obj !== undefined ) obj.corner('15px');
		obj = $('.content #content_main');
        if( obj && obj !== undefined ) obj.corner('destroy');
		obj = $('#meta_links');
        if( obj && obj !== undefined )
        {
            obj.corner('destroy');
        }
		obj = $('#category_spotlight');
        if( obj && obj !== undefined ) obj.corner('15px');
		obj = $('#info .semtabs');
        if( obj && obj !== undefined ) obj.corner('destroy');
		obj = $('#category_spotlight .inner');
        if( obj && obj !== undefined ) obj.corner('destroy');
		obj = $('.content #content_main h3 span');
        if( obj && obj !== undefined ) obj.corner('5px TR TL');
		obj = $('#bostix h4 span');
        if( obj && obj !== undefined ) obj.corner('5px TR TL');
		obj = $('.semtabs li');
        if( obj && obj !== undefined ) obj.corner('15px TR TL');
		obj = $('#featured_events');
        if( obj && obj !== undefined ) obj.corner('10px');
		obj = $('#intro_paragraph');
        if( obj && obj !== undefined ) obj.corner('10px');
		obj = $('#static_tabs');
        if( obj && obj !== undefined ) obj.corner('10px');
		obj = $('.content #content_main_inner');
        if( obj && obj !== undefined ) obj.corner('10px');
		obj = $('#featured_organizations');
        if( obj && obj !== undefined ) obj.corner('10px');
		obj = $('#featured_venues');
        if( obj && obj !== undefined ) obj.corner('10px');
		obj = $('.content #top_10_outer');
        if( obj && obj !== undefined ) {
			obj.corner('10px');
		}
		obj = $('#more_events');
        if( obj && obj !== undefined ) obj.corner('10px');
		obj = $('#info');
        if( obj && obj !== undefined ) obj.corner('10px');
		obj = $('#static_tabs #info');
        if( obj && obj !== undefined ) obj.corner('destroy');
		obj = $('#info > li');
        if( obj && obj !== undefined ) obj.corner('destroy');
		obj = $('#main_nav li.selected > a');
        if( obj && obj !== undefined ) obj.corner('10px TR TL');
		obj = $('#main_nav > li > a');
        if( obj && obj !== undefined ) obj.corner('10px TR TL');
		obj = $('#home_spotlight');
        if( obj && obj !== undefined ) obj.corner('8px');
	}
});

