/* GOOGLE MAPS */
function initialize() {
  if (GBrowserIsCompatible()) {
    var map = new GMap2(document.getElementById("map_canvas"));
    map.setCenter(new GLatLng(33.363512,-111.79339), 13);
    map.setUIToDefault();
    var latlng = new GLatLng(33.363512,-111.79339);
              map.addOverlay(new GMarker(latlng));
    
  }
}

function no_comments() {
	$(document).ready(function() {
		$('#reply').css('border','none');
	});
}



$(document).ready(function() {

	/* GOOGLE MAPS */
	if( $('#map_canvas').length !== 0 ) {
		initialize();
	}

	/* FEATURED ROTATOR */
	$(".featured").easySlider({
			auto: true,
			continuous: true,
			controlsShow: false,
			pause: 4000,
			duration: 1200,
			prevId: 'prevBtn',
			nextId: 'nextBtn'
		});
	$("#category1").easySlider({
			auto: false,
			continuous: false,
			controlsShow: false,
			pause: 4000,
			duration: 1200,
			prevId: 'prevBtn1',
			nextId: 'nextBtn1'
		});
	$("#category2").easySlider({
			auto: false,
			continuous: false,
			controlsShow: false,
			pause: 4000,
			duration: 1200,
			prevId: 'prevBtn2',
			nextId: 'nextBtn2'
		});
		
		
		if (!$.browser.msie) {
		  /* CORNERS */
		$('#main').corner('2px');
		$('input.email-field').corner('3px');
		$('#main .post #comments .comment').corner('4px');
		$('#header ul#nav li ul').corner('2px');
		$('#header ul#nav li .outside').corner('3px');
		$('#commentform').corner('4px');
		$('#main .post #reply #commentform p input').corner('3px');
		$('#main .post #reply #commentform p textarea').corner('3px');
		}
	
	
	/* QUESTION DROPDOWN STUFF*/
	$('#header .topbar .question ul li:first').addClass('first');
	$('#header .topbar .question ul li').hide();
	$('#header .topbar .question ul li.first').show();
	$('#header .topbar .question ul li:last').css('border-bottom','1px solid #533317')
											.css('padding-bottom','10px');
	$('#header .topbar .question ul li:eq(1)').css('padding-top','5px');
	$('#header .topbar .question ul').mouseenter(function() {
		$('#header .topbar .question ul li:not(:first)').slideDown();
	});
	$('#header .topbar .question ul').mouseleave(function() {
		$('#header .topbar .question ul li:not(:first)').slideUp();
	});
	
	
	/* TEXT FIELDS */
	$('input.search-field').focus(function() {
		if( $(this).attr('value') == 'Search...') {
			$(this).attr('value', '');
		}
	}).blur(function() {
		if( $(this).attr('value') == '') {
			$(this).attr('value', 'Search...');
		}
	});
	
	$('input.email-field').focus(function() {
		if( $(this).attr('value') == 'email address') {
			$(this).attr('value', '');
		}
	}).blur(function() {
		if( $(this).attr('value') == '') {
			$(this).attr('value', 'email address');
		}
	});
	
	/* NAVIGATION STUFF */	
	$('#header ul#nav li.dir').each(function() {
	
		$(this).children('ul').hide();
	
		$(this).css('width', $(this).width()); 
		
		$(this).children('ul').show();

	});
	

});


