Cufon.replace('h1,h2,h3,span.floorplan-result-title,span.cufon,a.news-register');
Cufon.replace('#sub-nav ul li a', {
	hover: true
});

$(document).ready(function() {
  
  /**
   * DROP DOWN
   */
  $("ul.sf-menu").supersubs({ 

                minWidth:    10,   // minimum width of sub-menus in em units 
                maxWidth:    24,   // 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();  // call supersubs first, then superfish, so that subs are 
                             // not display:none when measuring. Call before initialising 
                             // containing tabs for same reason.
	
/**
 * TOP BANNER
 */
	if($('#flash-banner').length>0){
		var details = $('#flash-banner').attr('class').split(' ');
		var swfSrc;
		var height;
		$.each(details, function(index, item){
			if(item.indexOf('src[')>-1){
				swfSrc = item.replace('src[','').replace(']','');
			}
			if(item.indexOf('height[')>-1){
				swfHeight = item.replace('height[','').replace(']','');
			}
		});
		$('#flash-banner').flash({
					swf: swfSrc,
					width: 932,
					height: swfHeight
		});

	}
	
/**
 * FACTOID
 */	
	
	if($('.factoid').length>0){
		$('.factoid a').mouseover(function() {
			$('.factoid img').stop(true,true).fadeIn('slow');
		});
		
		$('.factoid a').mouseout(function() {
			$('.factoid img').fadeOut('slow');
		});
	}
/**
 * NEWSLETTER LINK
 */	
	
	$('a.newsletter').click(function(){
		window.open('http://www.baywesthomes.com/utils/newsletter.html','newsletterWindow', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=650,height=550');
	});
	
	$('a.privacy').click(function(){
		window.open('http://www.baywesthomes.com/utils/privacy-policy.html','privacyWindow', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=650,height=550');
	});
	
	
});

