function mainmenu(){
$("ul#nav ul ").css({display: "none"}); // Opera Fix
$("ul#nav li").hover(function(){
$(this).addClass('active');
$(this).find('ul:first').css({visibility: "visible",display: "none"}).fadeIn(300);
},function(){
$(this).removeClass('active');
$(this).find('ul:first').css({visibility: "hidden"});
});
}



$(function() {
	mainmenu();
	
	
	 $('<li class="left"></li>').appendTo('ul.imageslider');
	 $('<li class="right"></li>').appendTo('ul.imageslider');
	 
	 
	
	
	$('#menu ul#nav ul li:last-child').addClass('bottom');
	
	var numberOfItems = $('ul#sliderposts li').size();
	var ssnumberOfItems = $('ul.imageslider:first li').size();
	var currentItem = 1;
	var sscurrentItem = 1;
	var newLocationTemp;
	var ssnewLocationTemp;
	var newLocation;
	var ssnewLocation;
	
	$('#banner li.arrowright, #banner li.arrowleft').css({"opacity":"0.5"});
	$('#banner li.arrowright, #banner li.arrowleft').hover(function() {
		$(this).animate({"opacity":"1"});
	}, function() {
		$(this).animate({"opacity":"0.5"});
	});
	
	$('#banner li.arrowright').click(function() {
		if(currentItem == numberOfItems - 0) {
			currentItem = 1;
			$('#sliderposts').animate({"left":"0px"});
		} else {
			newLocationTemp = currentItem * 460;
			newLocation = newLocationTemp - newLocationTemp - newLocationTemp;
			$('#sliderposts').animate({"left":newLocation});
			currentItem++;
		}
			return false;
	});
	
	$('#banner li.arrowleft').click(function() {
		if(currentItem == 1) {
			currentItem = 1;
			$('#sliderposts').animate({"left":"0px"});
		} else {
			newLocationTemp = currentItem * 460 - 460 - 460;
			newLocation = newLocationTemp - newLocationTemp - newLocationTemp;
			$('#sliderposts').animate({"left":newLocation});
			currentItem--;
		}
			return false;
	});
	
	
	
	$('#container.page .successstories .right .post .entry .imageslider li').addClass('image');
	$('#container.page .successstories .right .post .entry .imageslider li.left, #container.page .successstories .right .post .entry .imageslider li.right').removeClass('image');
	$('#container.page .successstories .right .post .entry .imageslider li.image').hide();
	$('#container.page .successstories .right .post .entry .imageslider li:first-child, #container.page .successstories .right .post .entry .imageslider li.left, #container.page .successstories .right .post .entry .imageslider li.right').show();
	
	$('.post .entry .imageslider li.right').click(function() {
		if(sscurrentItem == ssnumberOfItems - 2) {
		} else {
			$(this).parent('.imageslider').find('li.image').fadeOut();
			ssnewid = sscurrentItem;
			$(this).parent('.imageslider').find('li').eq(sscurrentItem).fadeIn();
			$(this).parent('.imageslider').find('li.left').show();
			$(this).parent('.imageslider').find('li.right').show();
			sscurrentItem++;
		}
			return false;
	});
	
	
	$('.post .entry .imageslider li.left').click(function() {
		if(sscurrentItem == 1) {
			sscurrentItem = 1;
			$(this).parent('.imageslider').find('li.image').fadeOut();
			$(this).parent('.imageslider').find('li:first').fadeIn();
			$(this).parent('.imageslider').find('li.left').show();
			$(this).parent('.imageslider').find('li.right').show();
		} else {
			sscurrentItem--;
			$(this).parent('.imageslider').find('li.image').fadeOut();
			ssnewid = sscurrentItem -1;
			$(this).parent('.imageslider').find('li').eq(ssnewid).fadeIn();
			$(this).parent('.imageslider').find('li.left').show();
			$(this).parent('.imageslider').find('li.right').show();
		}
			return false;
	});	
	
		
	
	$('.fname').focus(function() {
		if($(this).attr("value") == "FIRST NAME*") { $(this).attr("value",""); }
	});
	$('.fname').blur(function() {
		if($(this).attr("value") == "") { $(this).attr("value","FIRST NAME*"); }
	});
	
	$('.lname').focus(function() {
		if($(this).attr("value") == "LAST NAME*") { $(this).attr("value",""); }
	});
	$('.lname').blur(function() {
		if($(this).attr("value") == "") { $(this).attr("value","LAST NAME*"); }
	});
	
	$('.email').focus(function() {
		if($(this).attr("value") == "EMAIL ADDRESS*") { $(this).attr("value",""); }
	});
	$('.email').blur(function() {
		if($(this).attr("value") == "") { $(this).attr("value","EMAIL ADDRESS*"); }
	});
	
	$('.question').focus(function() {
		if($(this).attr("value") == "QUESTION?") { $(this).attr("value",""); }
	});
	$('.question').blur(function() {
		if($(this).attr("value") == "") { $(this).attr("value","QUESTION?"); }
	});


		
});