function mainmenu(){
$("#nav ul ul").css({display: "none"}); 
$("#nav ul ul ul").css({display: "block"}); 
$("#nav ul li").hover(function(){
	$(this).find('ul:first').parent('li').addClass("dropdown");
	if($(this).parent('ul').parent('li').hasClass('dropdown')) {
		$('#nav ul ul ul').show();
	} else {
		$(this).find('ul:first').fadeIn(300);
	}
},function(){
	$(this).find('ul:first').hide();
	$("#nav ul ul ul").css({display: "block"});
	$(this).find('ul:first').parent('li').removeClass("dropdown");
});
}


$(function() {

	
// Header Login
	var headerlogin = 0;
	$('#header .login .handle').click(function() {
		if(headerlogin == 0) {
			headerlogin = 1;
			$(this).find('.arrow').fadeOut(500);
			$(this).parent('.login').animate({"top":"0px"}, 500);
		} else {
			headerlogin = 0;
			$(this).find('.arrow').fadeIn(500);
			$(this).parent('.login').animate({"top":"-282px"}, 500);
		}
		return false;
	});
	

// Header Dropdown
	var headerdropdown = 0;
	$('#header .dropdown .handle').click(function() {
		if(headerdropdown == 0) {
			headerdropdown = 1;
			$(this).find('span.red').find('.arrow').fadeOut(500);
			$(this).find('span.red').find('.arrowup').fadeIn(500);
			$(this).parent('.dropdown').find('.hidden').slideDown(500);
		} else {
			headerdropdown = 0;
			$(this).find('span.red').find('.arrow').fadeOut(500);
			$(this).find('span.red').find('.arrowdown').fadeIn(500);
			$(this).parent('.dropdown').find('.hidden').slideUp(500);
		}
		return false;
	});
	

// Menu
	mainmenu();
	$('#nav li:last').addClass('last');	


// Subscribe Widget
	$('#sidebar .subscribewidget ul li').hover(function() {
		$('#sidebar .subscribewidget p span').text($(this).find('a').attr('title'));
	});


/* / Region Subpages
	$('.regionpost .regionsubpages li').each(function() {
		$(this).find('a').prepend('<span>Skip Hire </span>');
	});
	*/

// Contact Form
	$('form .name input').focus(function() {
		if($(this).attr("value") == "Name*") { $(this).attr("value",""); }
	});
	$('form .name input').blur(function() {
		if($(this).attr("value") == "") { $(this).attr("value","Name*"); }
	});
	
	$('form .email input').focus(function() {
		if($(this).attr("value") == "Email address*") { $(this).attr("value",""); }
	});
	$('form .email input').blur(function() {
		if($(this).attr("value") == "") { $(this).attr("value","Email address*"); }
	});
	
	$('form .company input').focus(function() {
		if($(this).attr("value") == "Company") { $(this).attr("value",""); }
	});
	$('form .company input').blur(function() {
		if($(this).attr("value") == "") { $(this).attr("value","Company"); }
	});
	
	$('form .phone input').focus(function() {
		if($(this).attr("value") == "Phone number") { $(this).attr("value",""); }
	});
	$('form .phone input').blur(function() {
		if($(this).attr("value") == "") { $(this).attr("value","Phone number"); }
	});
	
	$('form .comments textarea').focus(function() {
		if($(this).attr("value") == "Your comments...") { $(this).attr("value",""); }
	});
	$('form .comments textarea').blur(function() {
		if($(this).attr("value") == "") { $(this).attr("value","Your comments..."); }
	});
	


	
});
