// Flash
	
$j(document).ready(function() {	
		
	$j(".accordion").accordion({
		autoHeight: false
		//collapsible: true,
		//active: false
	});

	// # IE Helpers
	$j('#nav>li:last-child').addClass('_last-child');
	$j('._featurebox:last-child').addClass('_last-child'); 
	$j('fieldset:last-child').addClass('_last-child'); 
	$j('p:last-child').addClass('_last-child'); 
	$j('#content table td:last-child, #content table th:last-child').addClass('_last-child'); 

	$j('a.submit').unbind();
	$j('a.submit').click(function(e){
		e.preventDefault();
		var href = $j(this).attr('href');
		var form = $j(this).parents('form');
		if (href != '' && href != '#') {
			form.attr('action',href);
		}
		form.submit();		
	});
	$j('a.infobox').click(function(e){
		e.preventDefault();
	});
	$j('a.infobox').mouseover(function(e){
		e.preventDefault();
		target = $j(this).attr('href');
		y = $j(this).position().top;
		x = $j(this).position().left;
		x = x + 35;
		$j(target).css({"top":y, "left":x, "position":"absolute"}).show('fast');
	}).mouseleave(function(e){
		$j(target).hide('fast');
	});
	
	$j('.p_residential #solar-calc select.sector').val('Residential');
	$j('.p_commercial #solar-calc select.sector').val('Commercial');
	$j('.p_non-profit #solar-calc select.sector').val('Non-Profit');
	
	$j('.landing-bottom').parent().parent().parent().find('.start-estimate').hide();
	
	getTwitters('twitters', { 
		  id: 'geoscapesolar', 
		  count: 3, 
		  enableLinks: true, 
		  ignoreReplies: true, 
		  clearContents: true,
		  template: '%text% <a href="http://twitter.com/%user_screen_name%/statuses/%id_str%/" class="date" rel="nofollow">%time%</a>'
	});
	
	$j("#twitters").delay(1000).queue(function() {
		$j("#twitters li").each(function(){
			$j(this).find("a").attr("rel","nofollow");
		});
	});
	
	if($j("#subnav li._nav_residential-solar-nj").hasClass("active") == true) {
		$j("#subnav li._nav_residential-solar-roi-investment").addClass("active");
	}
	
	var slideshow = $j("#photoGal");
	if(slideshow.length > 0) {
		var toggle = $j('#galToggle').click(function() {
			var paused = slideshow.is(':paused');
			slideshow.cycle(paused ? 'resume' : 'pause', true);
			if(paused == true) {
				toggle.html('<img src="_assets/images/pause-btn.png" border="0" />');
			} else {
				toggle.html('<img src="_assets/images/resume-btn.png" border="0" />');
			}
		});
		function onAfter(curr, next, opts) {
			var index = opts.currSlide;
			$j('#prev')[index == 0 ? 'hide' : 'show']();
			$j('#next')[index == opts.slideCount - 1 ? 'hide' : 'show']();
		}
		slideshow.cycle({ 
			fx:    'shuffle', 
			shuffle: { 
				left:  480 
			},
			easing: 'easeOutExpo',
			prev:   '#prev', 
			next:   '#next', 
			after:   onAfter,
			pause: true
			//timeout: 2000
		});
	}
});

if ($j.browser.msie && ($j.browser.version == "6.0")) {
}
else {
	//Cufon.replace('#nav.cms', { fontFamily: 'Rockwell', hover: true });
}
