(function($, undefined)
{
    $(function()
	{
		
		//All JS functions to be included in here, not the template files!
		
		//Slideshow
		if ($('#featured').length)
        {
			$('#featured').orbit();
		}
		
		//Placeholder text
		if (!Modernizr.input.placeholder)
		{
			$('[placeholder]').focus(function()
			{
				var input = $(this);
				if (input.val() == input.attr('placeholder'))
				{
				  input.val('');
				  input.removeClass('placeholder');
				}
			}).blur(function()
			{
				var input = $(this);
				if (input.val() == '' || input.val() == input.attr('placeholder'))
				{
					input.addClass('placeholder');
					input.val(input.attr('placeholder'));
				}
			}).blur();
			
			$('[placeholder]').parents('form').submit(function()
			{
				$(this).find('[placeholder]').each(function()
				{
				  var input = $(this);
				  if (input.val() == input.attr('placeholder'))
				  {
					input.val('');
				  }	
				})
			});
		}
		
		//Google Map
		if ($('#map').length)
        {
			var myLatlng = new google.maps.LatLng(55.883914,-4.21205);
			var myOptions = 
			{
				zoom: 11,
				center: myLatlng,
				mapTypeId: google.maps.MapTypeId.ROADMAP
			}
			
			var map = new google.maps.Map(document.getElementById("map"), myOptions);
			
			var marker = new google.maps.Marker(
			{
				position: myLatlng, 
				map: map,
				title:"RAD IT Solutions"
			});
		}
		
	});
	
})(jQuery);
