/*
====================================
========== GET MEMBERS IN ==========
====================================
*/

window.onload = function() {
	
	// set variables
	var numToShow = 9;
	var imgNum = Math.round(Math.random()*numToShow+1);
	var memberlist = document.getElementById('members-list');
	var photo = new Array('','3','2','5','2','6','3','4','7','2');
	
	// generate images
	for (i=0; i<=numToShow-1; i++) {
	
		// create the LI
		var listItem = document.createElement('li');
		if (i == 2 || i == 5 || i == 8) listItem.setAttribute('class','rh');
		
		// set image
		var theimg = document.createElement('img');
		if (imgNum == 10) imgNum = 1;
		theimg.setAttribute('src','_img/member0'+imgNum+'.jpg');
		imgNum++;
		if (imgNum>numToShow) imgNum = imgNum-numToShow;
		
		// set on/offline status
		var status = document.createElement('div');
		var rn = Math.round(Math.random()*numToShow);
		if (rn == 1 || rn == 9) status.setAttribute('class','offline');
		else status.setAttribute('class','online');
		
		// set number of uploaded photos
		var photoNum = document.createElement('div');
		photoNum.setAttribute('class','photoNum');
		photoNum.innerHTML = photo[imgNum]+' photos';
		
		// slap it all together
		memberlist.appendChild(listItem);
		listItem.appendChild(theimg);
		listItem.appendChild(status);
		listItem.appendChild(photoNum);
	
	}
	
	// launch lightbox
	$.openDOMWindow();
}

/*
====================================
========== SHOW/HIDE FORM ==========
====================================
*/
$(document).ready(function() {
	$('#form-continue').click( function() {
	      $('#form-part2').show('blind', { direction:'vertical' }, 500);
	      $('#form-continue').hide('blind', { direction:'vertical' }, 500);
	});
});
