// JavaScript Document

    $(document).ready(function(){
   
	$('#login').ajaxForm(function(data) {
            if (data==10){
                $('#loggedin').show();
                $('#login').hide();
				$('#wrong').hide();
            }
            else if (data==11){
                $('#wrong').fadeIn("slow");
            }
            
        });
	
	
	});
	
	
		$(function() {
	$('#headerpic').cycle({ 
		fx:     'fade',
		timeout: 8000, 
	    speed:   1000,
		containerResize: 0,
		random: 1
	});
	});
	
	
	// when the DOM is ready, convert the feed anchors into feed content 
    $(document).ready(function() { 
        $('a.feed').gFeed( { target: '#feeds', tabs: true } ); 
    }); 
	
	
	
	
	google.load("feeds", "1");
 
    function initialize() {
      var feed = new google.feeds.Feed("http://www.digg.com/rss/index.xml");
      feed.load(function(result) {
        if (!result.error) {
          var container = document.getElementById("feed");
          for (var i = 0; i < result.feed.entries.length; i++) {
            var entry = result.feed.entries[i];
            var div = document.createElement("div");
            div.appendChild(document.createTextNode(entry.title));
            container.appendChild(div);
          }
        }
      });
    }
    google.setOnLoadCallback(initialize);
	
	$(function() {
		$("#datepicker").datepicker();
	});
	
	
	
	