Event.observe(window,'load',indexInit);
//=================================== START: INIT FUNCTIONS =========================================//
	
	function indexInit(e){
		Event.stop(e);
		setImages();
		setNavBarOpacity();
		new Effect.Opacity('datesMainMsgContainer',{to:.90})
		new Effect.Opacity('itineraryMainMsgContainer',{to:.85})
		new Effect.Opacity('hotelMainMsgContainer',{to:.85})
		new Effect.Opacity('travelTipsMainMsgContainer',{to:.90})
		setTimeout(setInitialize,1000);
		new Insertion.Top('countDownMsg', getDaysRemaining());
		setNavListeners();	
		//setTimeout('getPhotoAlbums()',3000);
	};
	
//=================================== END: INIT FUNCTIONS =========================================//
//=================================== START: SET FUNCTIONS =========================================//
	function setInitialize(){
		Effect.toggle('contentContainer','appear',{duration: .5});		
	};
	
	function setNavListeners(){
		var navObjList = $$('.navObj');		
		navObjList.each(function(item,index){	
			Event.observe(item,'click',movePageObj,true);	
		});	

		var activityNavList = $$('.activityNav');		
		activityNavList.each(function(item,index){	
			Event.observe(item,'click',moveActivityObj,true);	
		});					
	};
	
	function setNavBarOpacity(){
		var navObjList = $$('.navBar');		
		navObjList.each(function(item,index){	
			new Effect.Opacity(item,{to:.80});	
		});			
	};
	
	function setImages(){	
		new Insertion.Top('oneImage','<img src="images/P1030687.JPG" alt="" />');
		new Insertion.Top('twoImage','<img src="images/P1020572.JPG" alt="" />');
		new Insertion.Top('threeImage','<img src="images/CIMG0338.JPG" alt="" />');
		new Insertion.Top('fourImage','<img src="images/P1040314.JPG" alt="" />');
		new Insertion.Top('fiveImage','<img src="images/P1040303Left.JPG" alt="" />');
		new Insertion.Top('sixImage','<img src="images/P1020774.JPG" alt="" />');		
	};
	
	function setPhotoAlbums(resp){
		var respObj = resp.responseText;
		new Insertion.Top('preLoadContainer',respObj);	
	};
	
	function getPhotoAlbums(){
/* 		new Insertion.Top('preLoadContainer',"<embed type='application/x-shockwave-flash' src='http://picasaweb.google.com/s/c/bin/slideshow.swf' width='600' height='400' flashvars='host=picasaweb.google.com&captions=1&RGB=0x000000&feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2Filuvsleep%2Falbumid%2F5220705355237245825%3Fkind%3Dphoto%26alt%3Drss%26authkey%3DNHKswjxPIX8' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed>");
		new Insertion.Top('preLoadContainer',"<embed type='application/x-shockwave-flash' src='http://picasaweb.google.com/s/c/bin/slideshow.swf' width='600' height='400' flashvars='host=picasaweb.google.com&captions=1&RGB=0x000000&feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2Filuvsleep%2Falbumid%2F5220706263083849153%3Fkind%3Dphoto%26alt%3Drss%26authkey%3DSD5xr6LSfZk' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed>");
		new Insertion.Top('preLoadContainer',"<embed type='application/x-shockwave-flash' src='http://picasaweb.google.com/s/c/bin/slideshow.swf' width='600' height='400' flashvars='host=picasaweb.google.com&captions=1&RGB=0x000000&feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2Filuvsleep%2Falbumid%2F5220705622592936865%3Fkind%3Dphoto%26alt%3Drss%26authkey%3DsdxG1C6Ye8c' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed>");
		new Insertion.Top('preLoadContainer',"<embed type='application/x-shockwave-flash' src='http://picasaweb.google.com/s/c/bin/slideshow.swf' width='600' height='400' flashvars='host=picasaweb.google.com&captions=1&RGB=0x000000&feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2Filuvsleep%2Falbumid%2F5220706890555278913%3Fkind%3Dphoto%26alt%3Drss%26authkey%3DbNq6d93ReH0' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed>");
		new Insertion.Top('preLoadContainer',"<embed type='application/x-shockwave-flash' src='http://picasaweb.google.com/s/c/bin/slideshow.swf' width='600' height='400' flashvars='host=picasaweb.google.com&captions=1&RGB=0x000000&feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2Filuvsleep%2Falbumid%2F5220706770551448321%3Fkind%3Dphoto%26alt%3Drss%26authkey%3DJf3427JUq20' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed>");
		new Insertion.Top('preLoadContainer',"<embed type='application/x-shockwave-flash' src='http://picasaweb.google.com/s/c/bin/slideshow.swf' width='600' height='400' flashvars='host=picasaweb.google.com&captions=1&RGB=0x000000&feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2Filuvsleep%2Falbumid%2F5220703592489661649%3Fkind%3Dphoto%26alt%3Drss%26authkey%3DiWHoL8UtuN0' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed>");
		new Insertion.Top('preLoadContainer',"<embed type='application/x-shockwave-flash' src='http://picasaweb.google.com/s/c/bin/slideshow.swf' width='600' height='400' flashvars='host=picasaweb.google.com&captions=1&RGB=0x000000&feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2Filuvsleep%2Falbumid%2F5220703741077736897%3Fkind%3Dphoto%26alt%3Drss%26authkey%3Do40N_Tyyewo' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed>"); */
		
		var photoBtn;
		var photoBtnList = $$('.lbOn'); 
		photoBtnList.each(function(item,index){	
			var url = item.readAttribute('href');
			var ajaxRequest = new Ajax.Request(
				url, 
				{
					method: 'GET', 
					asynchronous: true,
					onSuccess: setPhotoAlbums
				});				
		});				
	};	

//=================================== END: SET FUNCTIONS =========================================//
//=================================== START: GET FUNCTIONS =========================================//
	function getDaysRemaining(){
		d = new Date()   					  //today's date
		mill=new Date(2008, 10, 18)   		 //Next millennium start date
		diff = mill-d    					//difference in milliseconds
		mtg = new String(diff/86400000)    //calculate days and convert to string	
		point=mtg.indexOf(".")    		  //find the decimal point
		days=mtg.substring(0,point)      //get just the whole days
		return "<b>"+days+"</b>";
	};

//=================================== END: GET FUNCTIONS =========================================//
//================================= START: RESPONSE HANDLERS ====================================================================
	
	function movePageObj(e){
		Event.stop(e);
		var srcObj = Event.element(e)
		if(srcObj.className=='activeBtn'){
			return;
		}
		else{
			setMovePageObj(e);
		};		
	};
	
	function setMovePageObj(e){
		var moveInt;
		var activeObj;
		var srcObj = Event.element(e).id;
		var activeBtnList = $$('.activeBtn');
		activeBtnList.each(function(item,index){				
			Element.removeClassName(item,'activeBtn');		
		});	
		var activePageList = $$('.activePage');
		activePageList.each(function(item,index){	
			activeObj = item.id;		
			Element.removeClassName(item,'activePage');		
		});			
					
		targetObj = srcObj.split("NavBtn");		
			
		targetObj = targetObj[0]+"Main";
		targetObjClasses = new String($(targetObj).classNames());
		targetObjClasses = targetObjClasses.split(" ");
		targetInt = (targetObjClasses[0] * 801)
		
		if(targetInt>0){
			targetInt = -1*targetInt
		}
		else{
			targetInt = targetInt/-1
		};
		
		Element.addClassName(targetObj,'activePage');		

		new Effect.Morph('contentContainer',{
		  style:{
		   left:targetInt+'px'
		  }
		});		

		Element.addClassName(srcObj,'activeBtn');			
	};
	
	function moveActivityObj(e){
		Event.stop(e);
		var srcObj = Event.element(e)
		if(srcObj.className=='activeActivityBtn'){
			return;
		}
		else{
			setMoveActivityObj(e);
		};		
	};
	
	function setMoveActivityObj(e){
		var moveInt;
		var activeObj;
		var srcObj = Event.element(e).id;
		var activeBtnList = $$('.activeActivityBtn');
		activeBtnList.each(function(item,index){				
			Element.removeClassName(item,'activeActivityBtn');		
		});	
		var activePageList = $$('.activeActivityPage');
		activePageList.each(function(item,index){	
			activeObj = item.id;		
			Element.removeClassName(item,'activeActivityPage');		
		});			
					
		targetObj = srcObj.split("Nav");		
			
		targetObj = targetObj[0];
		targetObjClasses = new String($(targetObj).classNames());
		targetObjClasses = targetObjClasses.split(" ");
		targetInt = (targetObjClasses[0] * 538)

		if(targetInt>0){
			targetInt = -1*targetInt
		}
		else{
			targetInt = targetInt/-1
		};
		
		Element.addClassName(targetObj,'activeActivityPage');		

		new Effect.Morph('activityPageContainer',{
		  style:{
		   left:targetInt+'px'
		  }
		});		

		Element.addClassName(srcObj,'activeActivityBtn');					
	};
	
	function activityNavOn(e){
		var srcObj = Event.element(e);
		Element.setStyle(srcObj,{color:'#487076'});
	};	

	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	





