$(document).ready(function(){
	$('#home-news').html('');

	// Topics
	$.get('/ajax/city.php?type=topics',  function(o){
		$('#home-news').html(o);
	});
	
	// Events
	$.get('/ajax/city.php?type=events', function(o){
		$('#home-events').html(o);
	});	
	
	// Login Form
	var loginForm = '<img src=/images/city_logo.png />'+
					'<h4>Login to The City</h4>'+
					'<form action="https://faithbiblelincoln.onthecity.org/session" method="post">'+
					'<input id="login" name="login" type="text" placeholder="Username" value="Username" />'+
					'<input id="password" name="password" type="text" placeholder="Password" value="Password" />'+
					'<p><input type="submit" value="Login" /> <!--<a href="http://faithbiblelincoln.onthecity.org">Click here to signup</a>-->'+
					'</form>'+
					'<p><a class="city" href="http://faithbiblelincoln.onthecity.org/plaza">Check us Out on The City Plaza</a></p>'+
					'<p><a href="/what-is-the-city">What is The City? Click here to Learn About Our Online Community</a></p>';
					
	$('#welcome').html(loginForm);
	$('#login').focus(function(){
		if(this.value == 'Username') this.value = '';
	}, blur(function(){
		if(this.value == '') this.value = 'Username';
	}));
	
	$('#password').focus(function(){
		this.type = 'password';
		if(this.value == 'Password') this.value = '';
	}, blur(function(){
		if(this.value == '') this.value = 'Password';
		this.type = 'text';
	}))
});
