$(document).ready(function() { 


		//PDX ECO ROOF PAGE
		$('#company').focus(function() {
			if ($(this).attr('value') == 'Company') {
				$(this).attr('value', '');
			};
		});

			$('#company').blur(function() {
				if ($(this).attr('value') == '') {
					$(this).attr('value', 'Company');
				};
			});


		$('#name').focus(function() {
			if ($(this).attr('value') == 'Name') {
				$(this).attr('value', '');
			};
		});

			$('#name').blur(function() {
				if ($(this).attr('value') == '') {
					$(this).attr('value', 'Name');
				};
			});


		$('#email').focus(function() {
			if ($(this).attr('value') == 'E-Mail Address') {
				$(this).attr('value', '');
			};
		});

			$('#email').blur(function() {
				if ($(this).attr('value') == '') {
					$(this).attr('value', 'E-Mail Address');
				};
			});


		$('#phone').focus(function() {
			if ($(this).attr('value') == 'Phone') {
				$(this).attr('value', '');
			};
		});

			$('#phone').blur(function() {
				if ($(this).attr('value') == '') {
					$(this).attr('value', 'Phone');
				};
			});


		//PORTFOLIO COUNT IMAGES
		$('.folio_images').children('img').each(function(index)
		{
			index = index+1;
			var alt = $(this).attr('alt');

			if (index == 1) 
			{
				hover = "hover";
			} 
			else 
			{
				hover = "";
			};

			$(this).attr('id', index).css('z-index', 100-index);
			$('.folio_thumbs').append(
				"<a alt='"+alt+"' class='thumb "+
				hover
				+"' href='#' id='"+
				index
				+"'>"+
				index
				+"</a>"
			);
		});




		//PORTFOLIO CLICK
		$('a.thumb').click(function()
		{

			id = $(this).attr('id');
			img = '.folio_images #'+id;


			$('.folio_images').children('img').each(function(index)
			{
				index = index+1;
				
				if ($(this).is('.active')) 
					{
						$(this).attr('id', index).css('z-index', 100).removeClass('active').removeClass('hover');
					} 
				else 
					{
						$(this).attr('id', index).css('z-index', 100-index).removeClass('active').removeClass('hover');
					};
			});


			$('a.thumb').each(function(index) {
				$(this).removeClass('hover');
			});

			$(this).addClass('hover');

			$(img).addClass('active').css('z-index', '101').css('left', '450px').animate({left: 0}, 'fast');

			return false;

		});




	$('ul.sf-menu').superfish({
		hoverClass: 'sfHover'
		});

	$('#nav li').hover(function() {
		$(this).addClass('hover');
	}, function() {
		$(this).removeClass('hover');
		});

	$('.oHover').hover(function() {
		$(this).animate({
			opacity: 0.75
			}, 500);
	}, function() {
		$(this).animate({
			opacity: 1
			}, 0);
	});

});
