// JavaScript Document
$.fn.reverse = [].reverse;

$(document).ready(function() {

	var agent = navigator.userAgent.toLowerCase(); 

	if ($.browser.msie) {

		$('body').addClass('ie ie'+$.browser.version.substr(0,1));

	} else if (agent.match(/chrome/i)) {

		$('body').addClass('chrome');

	} else if (agent.match(/safari/i)) {

		$('body').addClass('safari');

	}

	if (agent.match(/iphone/i)) {

		$('body').addClass('iphone');

	}

	$('#topMenu ul li')
		.mouseover(function() { $(this).addClass('hover'); })
		.mouseout(function() { $(this).removeClass('hover'); });

	$('#content p').first().addClass('first');
	$('#content p').reverse().first().addClass('last');

	$('#sidebar-right img').first().addClass('first');
	$('#sidebar-right img').reverse().first().addClass('last');

	$('#content h3:not(.widget-area h3)')
		.before('<div class="contentdividersmall"></div>')
		.after('<div class="contentdividersmall"></div>');

	$('.contactForm p').first().addClass('first');
	$('.contactForm p').reverse().first().addClass('last');

	$('.brochureForm p').first().addClass('first');
	$('.brochureForm p').reverse().first().addClass('last');

	$(".testimonial .quote").prepend('&ldquo;').append("&rdquo;");

	$(".widget-container:not(.widget_search)")
		.prepend('<div class="top"></div>')
		.append('<div class="bottom"></div>');

});

