// Functions

function quickNav_change (val){
	if (val != '0'){
		location.href = val;	
	}
}


function getFlash (path, src, holder, w, h){
	var newFlash = new SWFObject(src, holder + '_flashObj', w, h, '8', '');
	newFlash.useExpressInstall(path+'flash/expressinstall.swf');
	newFlash.addParam('wmode', 'transparent');
	newFlash.addParam('showmenu', 'false');
	newFlash.addVariable('path', path);	
	newFlash.addVariable("pageName", document.title);
	if (arguments.length > 5){
		newFlash.addVariable('gallID', arguments[5]);	
	}
	newFlash.write(holder);
}

function showPhotoGallery (path, type){
	makeOverlay(path, type);
}

function makeOverlay (path, gallID){	
	 


	var elem = document.getElementById('overlay');
	var holder = document.getElementById('galleryHolder');
	
	elem.style.zIndex = '300';
	elem.style.position = 'absolute';
	elem.style.width = '100%'; 
	elem.style.height = '100%';
	elem.style.top = '0';
	elem.style.left = '0';
	elem.style.display = 'block';
	
	holder.style.height = '100%';
	holder.style.width = '100%';	
	
	document.getElementsByTagName('BODY')[0].style.overflow = 'hidden';
	location.hash = "#";
	
	getFlash(path, path+'flash/gallery.swf', 'galleryHolder', '100%', '100%', gallID);
}

function hideOverlay (){
	var elem = document.getElementById('overlay'); 
	elem.style.display= 'none';
	document.getElementsByTagName('BODY')[0].style.overflow = 'auto';
}

var nClicked = 0;
	$(document).ready(function(){
		
		$('#C4th_MoreDetail').click(function(){
		 
			
			if(nClicked){
				nClicked = 0;
				$('#Celebrathe4thJuly').stop();
				$('#Celebrathe4thJuly').animate({height:100});
			}else{
				nClicked = 1;
				$('#Celebrathe4thJuly').stop();
				$('#Celebrathe4thJuly').animate({height:500});
			}
			
		})
		
		$('#C4th_MoreDetail_Close').click(function(){
				nClicked = 0;	
				$('#Celebrathe4thJuly').animate({height:100});
		})
						   
	});