$(document).ready(function() {
	'use strict';
	
	$("#nSlider").easySlider({
		auto: true, 
		continuous: true,
		numeric: true,
		pause: 5000
	});
	
	// it's cool
	var contentHeight = $('.ccon').height();
	$('.confix').attr('style', 'height: ' + contentHeight + 'px');
});

function Login()
{
	'use strict';
	
	var u = $('#user_name').val();	
	var p = $('#password').val();
	
	if (u == '' || p == '')
	{
		alert ('Please fill out all fields');
		return false;	
	}
	
	var dataString = 'User='+ u + '&Pass='+ p;
	
	$.ajax({
	  type: "POST",
	  url: '/StormyCP/login/',
	  data: dataString,
	  success: function(data){ 
            ParseLogin(data);
         }
	});	
}

function ParseLogin(r)
{
	'use strict';
	
	if (r == 'OK')
	{
		window.location.reload();	
		return;
	}
	
	alert(r);
}