/*
 * ILC Ltd - JS Effects
 * © Creative Smile Media Ltd 2010
 */


function clearInput(varInput) {
     if (varInput.value == varInput.defaultValue) {
         varInput.value = "";
     }
 }

function resetInput(varInput) {
     if (varInput.value == "") {
         varInput.value = varInput.defaultValue;
     }
 }


$(document).ready(function(){
						
	var curcol = $('#nav ul li a').css("color");
						
	$('#nav ul li a').hover(function () {
		$(this).stop(false,false).animate({ color: '#ffffff' },"fast");
	}, function () {
		$(this).stop(false,false).animate({ color: curcol },"fast");
	});
						
	$('.breadcrumb ul li a').hover(function () {
		$(this).stop(false,true).animate({ paddingLeft: '+=8px', paddingRight: '+=8px' });
	}, function () {
		$(this).stop(false,true).animate({ paddingLeft: '-=8px', paddingRight: '-=8px' },"fast");
	});
	
	$('.contact_button').hover(function () {
		$(this).stop(false,false).animate({ left: '0px' },"fast");
	}, function () {
		$(this).stop(false,false).animate({ left: '-10px' },"fast");
	});


	
	$('.focus').focus(function(){
		clearInput(this);
	});
	
	$('.focus').blur(function(){
		resetInput(this);
	});



	$('.contact_button').click(function() {
		$('.overlay').show();
		$('.popup_contact').show();
	});

	$('.popup_close').click(function() {
		closeOverlays();
	});

	$('.overlay').click(function() {
		closeOverlays();
	});
	

});

	
$(document).keyup(function(e) { 
	if (e.which == 27) {
		closeOverlays();
	}
});

function closeOverlays() {
	$('.overlay').hide();
	$('.popup_contact').hide();	
}

