if( hq == undefined ) {
	var hq = {};
}

jQuery(document).ready(toolbox.delegate(hq.lightbox2.init, hq.lightbox2));

jQuery(function(){
    jQuery(".page_item a:contains('Contact')").click(function() {
	hq.lightbox2.update(jQuery('#contact7Form').html());
	hq.lightbox2.show();
	hq.lightbox2.$domObj.find( '#closeLB' ).click( toolbox.delegate( hq.lightbox2.hide, hq.lightbox2 ) );
	jQuery( '#contentWrapper' ).bind( 'closeLB', toolbox.delegate( hq.lightbox.hide2, hq.lightbox2 ) );
	return false;
    });

    jQuery(".blue_button").each(function(){
	createShadow(this);
    });

    jQuery(".widget_ThumbnailRecentPosts").append('<h2 class="view_more_listings"><a href="/category/featured-listings/">Click Here For More Listings</a></h2>');
});

function createShadow(elem){
	var marginTop = jQuery(elem).css('margin-top');
	var marginRight = jQuery(elem).css('margin-right');
	var marginBottom = jQuery(elem).css('margin-bottom');
	var marginLeft = jQuery(elem).css('margin-left');
	var cssfloat = jQuery(elem).css('float');
	var width = jQuery(elem).outerWidth() - 3;
	var height = jQuery(elem).outerHeight() - 3;

	marginTop = (marginTop) ? (parseInt(marginTop) + 3) + "px" : "0px";
	marginRight = (marginRight) ? marginRight : "0px";
	marginBottom = (marginBottom) ? marginBottom : "0px";
	marginLeft = (marginLeft) ? (parseInt(marginLeft) + 3) + "px" : "0px";

	jQuery(elem).wrap("<div class='blue_button_shadow_1 shadow_elem'><div class='blue_button_shadow_2 shadow_elem'><div class='blue_button_shadow_3 shadow_elem'></div></div></div>");
	jQuery(elem).parents(".shadow_elem").width(width).height(height);

	jQuery(elem).css({ 'margin': '0' }).parents(".blue_button_shadow_1").css({
	    'margin': marginTop + " " + marginRight + " " + marginBottom + " " + marginLeft,
	    'float': cssfloat
	});
}