	$(document).ready(function() {
		$('#community-search>div').click(function() {
			$('#communities-search').slideToggle('fast');
		});
		$('#contentTop-homepage h1 a, #contentTop h1 a').click(function(event) {
			event.preventDefault();
		});
		$('.homepage div.editor p:first-child').remove();
		$('.homepage div.editor style').remove();
		$('.homepage div.editor').prepend($('.homepage .welcome-statement h2:first-child'));
		$('<div id="footerAbove"></div>').insertBefore('#footer-homepage');
		/*
		$('#community-search>div').mouseout(function() {
			$('#communities-search').slideUp('fast');
		});*/
		
		//print stylesheet fix
		$('link[href="/themes/globalcss/print.css"]').attr('href','/sitecss/print.css');
		
		//ie7 fix to make menu on top pf other items
		$('#box-1-homepage').css('z-index', '1');
		
		//nav menu
		$('#nav2 li:nth-child(3) li').css('width', '23em');

		//index page
		$('#container-homepage').prepend($('#propertyslideshow, #agentPic, #community-search, #social-icons'));
		$('#propertyslideshow, #agentPic, #community-search, #social-icons').show();
		$('#content-homepage').prepend($('#tiles'));
		$('#box-1-homepage').prepend('<div id="logo"></div>');
		
		$('.homepage div#buy, .homepage div#sell').css('cursor','pointer').click(function(){
			window.location = $(this).find('a').attr('href');
		});
		
		$('#slide').css('cursor','pointer').click(function(){window.location = $('#viewproperty a').attr('href')});
		
		//internal pages
		$('#container #logo').prepend($('<img src="/siteimages/header-text.png" id="headerText" />'));
		$('#box-1').prepend($('#social-icons'));
		$('#box-2 #widget-blog li:last-child, #widgetbar div, #post-topics li:last-child').addClass('bottomRound');
		$('#box-2 #profileImage img').attr('src', '/siteimages/sam-contact.png').show();
		$('.sellersuggestedreadingarticle .editor iframe, .Detail.page .editor iframe').css('width', '688px');
		$('#contentTop-homepage p span').css('color', '#fff');
		$('#map_canvas').css('width', '688px');
		$('iframe#blockrandom').css('width', '925px').parents('#content').css('width', '925px');
		$('body.sellertips #content div.box:nth-child(3), body.buyertips #content div.box:nth-child(3)').css('margin-top', '75px');
			//contact page
			$('<div><label>Your Phone:</label><input name="contactform_phone" id="contactform_fromphone" type="text"></div>').insertAfter($('body.contact #contact-us-form-container #contactform_fromemail').parent('div'));
			$('#contact-us-form-content .action input').click(function () {
				SendContactFormCustom();
			});
		
		//wmode flash fix - only works in webkit currently
		$('embed').attr('wmode', 'transparent');
		$('object').prepend('<param name="wmode" value="transparent">');
		
		//for checking the site-map
		//$('ul.sitemap a').attr('target', '_blank').click(function(){$(this).parent().css('background', 'red')});
		
		//png image replacements
		$('.morningcoffee #mmc-content > div > div > img, img[src="http://www.realprosystems.com/mmc/coffee.jpg"]').attr('src', '/siteimages/Coffee-Button.png');
		$('img[src="http://www.toniavickery.com/agent_files/bank-button-blank.jpg"]').attr('src', '/siteimages/bank-button-blank.png');
		
		$('.buyerreportsarticle .editor .report_text + div > img').attr('src', '/siteimages/b1.png');		
		$('.sellerreportsarticle .report_text + div > img').attr('src', '/siteimages/s2.png');
		//$('.sellerreportsarticle .editor > div > img').attr('src', '/siteimages/s1.png');
		
		$('.buyertipsarticle #resourcedownload > div > img').attr('src', '/siteimages/buyer_8tips.png');
		$('.sellertipsarticle #resourcedownload > div > img').attr('src', '/siteimages/seller_10.png');
	});
