$(document).ready(function(){
	
	//Homepage Buttons...
	
	$('#hp-blog').mouseover(function()
	{
		$('#hp-blog-hover').fadeIn(500);
	});
	
	$('#hp-blog-hover').mouseout(function()
	{
		$('#hp-blog-hover').fadeOut(500);
	});
	
	
	$('#hp-who').mouseover(function()
	{
		$('#hp-who-hover').fadeIn(500);
	});
	
	$('#hp-who-hover').mouseout(function()
	{
		$('#hp-who-hover').fadeOut(500);
	});


	$('#hp-what').mouseover(function()
	{
		$('#hp-what-hover').fadeIn(500);
	});
	
	$('#hp-what-hover').mouseout(function()
	{
		$('#hp-what-hover').fadeOut(500);
	});


	$('#hp-why').mouseover(function()
	{
		$('#hp-why-hover').fadeIn(500);
	});
	
	$('#hp-why-hover').mouseout(function()
	{
		$('#hp-why-hover').fadeOut(500);
	});


	$('#hp-contact').mouseover(function()
	{
		$('#hp-contact-hover').fadeIn(500);
	});
	
	$('#hp-contact-hover').mouseout(function()
	{
		$('#hp-contact-hover').fadeOut(500);
	});
	
	
	$('#page-thumbnail-color').fadeIn(2000);



});

// bodge for google + button

$(document).ready(function(){
//$("[id^=\_]").css('position','absolute');

});


$(document).ready(function(){

init_messages();
	
});
			
function init_messages()
{
	messages=$('#header-center').children();
	

	$.each(messages,function(index,elm){
		$(elm).css('display','none');
	});
	
	//$(messages[0]).fadeIn(1000);
	
	slideshow(0);	
	
}

function slideshow(current_slide)
{
	messages=$('#header-center').children();
	msg_count=messages.length;
	
	if(current_slide == msg_count)
	{
		new_slide=1;		
	}
	else
	{
		new_slide=current_slide + 1; 
	}
	
	$(messages[current_slide - 1]).fadeOut(1000);
	$(messages[new_slide-1]).fadeIn(1000);	
	
	t=setTimeout("slideshow(" + new_slide  +")",4000);	
	
}

//Twatter




$(document).ready(function() {
   	
	
	if($('.tweet-text').length == 0)
	{
		$('#last-tweets').css('display','block');
	}
	
	
	var username='regismedia'; // set user name
	var format='json'; // set format, you really don't have an option on this one
	var url='http://api.twitter.com/1/statuses/user_timeline/'+username+'.'+format+'?callback=?'; // make the url

	$.getJSON(url,function(tweet){ // get the tweets
		
		cnt=1; // No of tweets to show
		
		for(i=0;i< cnt ;i++)
		{
			
			d=new Date(tweet[i].created_at);
			theDay= d.getDate();
			theMonth= d.getMonth();
			theYear=d.getFullYear();
			monthNames = [ "January", "February", "March", "April", "May", "June","July", "August", "September", "October", "November", "December" ];
			theDate=theDay + " " + monthNames[theMonth] + ", " + theYear;

			$("#last-tweets ul").append('<li><em>' + theDate + '</em><br />' + tweet[i].text +'</li>');
		}
		
		//$("#last-tweet").html('<em>'+ tweet[0].text + '</em><br />'+tweet[0].created_at); // get the first tweet in the response and place it inside the div
		//$("#last-tweet").html('<li>'+ tweet[0].text + '</li>'); // get the first tweet in the response and place it inside the div
	
	});

 });



