jQuery(document).ready(function($)
{
	/*if(document.location != 'http://' + document.location.hostname + '/')
	{
		setTimeout(function()
		{
			if($('body').scrollTop() == 0)
			{
				$('body').animate({'scrollTop': 250}, 500);
			}
		}, 100);
	}*/
	
	// iPad & iPhone hover fix
	/*if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i)))
	{
    	$(".thumb a").click(function(){
    	    //we just need to attach a click event listener to provoke iPhone/iPod/iPad's hover event
    	    //strange
    	});
	}*/
	
	$('#menu a[href$="dev/contact/"]').click(function()
	{
		if(!$('.my_email').html())
		{
			$('.my_email').html(
				'&#105;&#110;&#102;&#111;&#064;&#103;&#117;&#105;&#100;&#111;&#098;&#111;&#117;&#109;&#097;&#110;&#046;&#099;&#111;&#109;'
			);
		}
		if($('#contact').css('top') == '-300px')
		{
			$('#contact').animate({'top': '75px'}, 300);
		}
		else
		{
			$('#contact').animate({'top': '-300px'}, 300);
		}
		return false;
	});
	
	$('#container').click(function()
	{
		hide_contact();
	});
	
	$('#contact_close').click(function()
	{
		hide_contact();
	});
	
	$(window).keydown(function(e)
	{
		if(e.which == 27)
		{
			hide_contact();
		}
	});
});

function hide_contact()
{
	if($('#contact').css('top') == '75px')
	{
		$('#contact').animate({'top': '-300px'}, 300);
	}
}
