$(document).ready(function() {


//Partner logo fade
	$(".partner-tpg, .partner-jp, .partner-jot").fadeTo(1, 0.5);

	$(".partner-tpg, .partner-jp, .partner-jot").hover(
		function() {
			$(this).fadeTo("fast", 1);
		},
		function() {
			$(this).fadeTo("fast", 0.5);
		}
	);

			

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

//Concertina

	$(".sub-jobs").hover(
		function() {
			$(this).addClass("hover");
		},
		function() {
			$(this).removeClass("hover");
		}
	);

	$(".wsub-jobs").hover(
		function() {
			//$(this).find(".wsub-jobs-title").animate({  marginLeft: "5px" }, 1200 );
			$( '.wsub-jobs' ).not( this ).css( { opacity: 0.6 } , 2 ); 

		},
		function() {
			//$(this).find(".wsub-jobs-title").animate({  marginLeft: "0px" }, 100 );
			$( '.wsub-jobs' ).not( this ).css( { opacity: 1 } , 2 ); 
		}
	);
	
	$(".supersub li").hover(
		function() {
			$(this).find("a").animate({ textIndent: "4px" }, 100 );			 
		},
		function() {
			$(this).find("a").animate({ textIndent: "0px" }, 100 );
		}
	);
	
	/*

	$(".sub-job-but-1").click(function(e) {
		e.preventDefault();
		//$(this).hide();
		$(this).parent().parent().find(".some_details").fadeIn("medium");
	});

	$(".close_details a").click(function(e) {
		e.preventDefault();
		$(this).parent().parent().fadeOut("fast", function() {
			$(this).prev().show();
		});
	});

	*/

//Animated Scroll

	$(".scroll-to").click(function(e) {
		e.preventDefault();
		where = $(this).attr("href");
		$.scrollTo(where, 400, {offset: -20});
	});

});

(function($) {
	
	$.fn.defaultvalue = function() {
		
		// Scope
		var elements = this;
		var args = arguments;
		var c = 0;
		
		return(
			elements.each(function() {				
				
				// Default values within scope
				var el = $(this);
				var def = args[c++];

				el.val(def).focus(function() {
					if(el.val() == def) {
						el.val("");
					}
					el.blur(function() {
						if(el.val() == "") {
							el.val(def);
						}
					});
				});
				
			})
		);
	}
})(jQuery)

