var obj = null;

function checkHover() {
	if (obj) {
		obj.find('ul').fadeOut('fast');
	}
} 

/* learn/share/achieve navigation functions and data */
var imgset = {
	"learn-img":   [ "112px", "30px", "213px", "60px" ],
	"share-img":   [ "108px", "30px", "217px", "60px" ],
	"achieve-img": [ "147px", "30px", "299px", "60px" ]
}
var img = -1;

function resize(image, time, off) {
	$("#" + image).animate({ width: imgset[image][off], height: imgset[image][off+1] }, time);
}

function spin(time) {
	img++; if (img == 3) img = 0;
	resize("learn-img", time, (img==0)? 2 : 0);
	resize("share-img", time, (img==1)? 2 : 0);
	resize("achieve-img", time, (img==2)? 2 : 0);
	setTimeout('spin(1000);', 3000); 
}

/* various bits to make the page actually work */

$(document).ready(function() {
	/* bits for drop-down menus */
	jQuery("#dropmenu ul").css({display: "none"}); // this is for Opera
	jQuery("#dropmenu li").hover(
		function() {
			jQuery(this).find('ul:first').css({visibility: "visible", display: "none"}).show(0);
		},
		function() {
			jQuery(this).find('ul:first').css({visibility: "hidden"});
		}
	);
	
	/* turn on learn/share/achieve navigation if it's on the page */
	if ($("#lsa-nav")) spin(0);
});

