$().ready(function() {
	var so = new SWFObject("landing2.swf", "ssp", "100%", "100%", "8", "#000000");
	so.addParam("allowScriptAccess", "always");
	so.addParam("wmode", "transparent");
	so.write("bg");
	
	//$('div.event').hide();
	
	$('#events-button').toggle(function() {
		if ($.browser.msie && $.browser.version.substr(0,1)<8) { $('#eventslayer').height('187px'); }
		$('#events').animate({height:'187px'},100).animate({width:'805px'},300);
	}, function() {
		if ($.browser.msie && $.browser.version.substr(0,1)<8) { $('#eventslayer').height('28px'); }
		$('#events').animate({width:'205px'},300).animate({height:'28px'},100);
	});
	
	
	$('.three a').hover(function() {
		//$(this).children('span').animate({width:'73px'}, 250);
		$(this).children('.enter').animate({width:'73px'},250);
		ssploadImageNumber($('.three a').index(this));
	}, function() {
		//$(this).children('.enter').width('22px');
		$(this).children('.enter').animate({width:'22px'},250);
	});
});


// ******** Sliding Boxes ********

$(document).ready(function(){
	//To switch directions up/down and left/right just place a "-" in front of the top/left attribute
	//Vertical Sliding
	$('.boxgrid.slidedown').hover(function(){
		$(".cover", this).stop().animate({top:'-260px'},{queue:false,duration:300});
	}, function() {
		$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:300});
	});
	//Horizontal Sliding
	$('.boxgrid.slideright').hover(function(){
		$(".cover", this).stop().animate({left:'325px'},{queue:false,duration:300});
	}, function() {
		$(".cover", this).stop().animate({left:'0px'},{queue:false,duration:300});
	});
	//Diagnal Sliding
	$('.boxgrid.thecombo').hover(function(){
		$(".cover", this).stop().animate({top:'260px', left:'325px'},{queue:false,duration:300});
	}, function() {
		$(".cover", this).stop().animate({top:'0px', left:'0px'},{queue:false,duration:300});
	});
	//Partial Sliding (Only show some of background)
	$('.boxgrid.peek').hover(function(){
		$(".cover", this).stop().animate({top:'90px'},{queue:false,duration:160});
	}, function() {
		$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:160});
	});
	//Full Caption Sliding (Hidden to Visible)
	$('.boxgrid.captionfull').hover(function(){
		$(".cover", this).stop().animate({top:'160px'},{queue:false,duration:160});
	}, function() {
		$(".cover", this).stop().animate({top:'260px'},{queue:false,duration:160});
	});
	//Caption Sliding (Partially Hidden to Visible)
	$('.boxgrid.caption').hover(function(){
		$(".cover", this).stop().animate({top:'60px'},{queue:false,duration:160});
	}, function() {
		$(".cover", this).stop().animate({top:'114px'},{queue:false,duration:160});
	});
});



function sspToggleDisplayMode() {
	thisMovie("ssp").sspToggleDisplayMode();
}

function sspLoadAlbum(album) {
	thisMovie("ssp").sspLoadAlbum(album);
}

function ssploadImageNumber(image) {
	thisMovie("ssp").ssploadImageNumber(image);
}

function thisMovie(movieName) {
	if (navigator.appName.indexOf("Microsoft") != -1) {
		return window[movieName]
	} else {
		return document[movieName]
	}
}