/********************************************************************
* Designed / Programmed by Xian @ Cytekstudios.com
*	Standard use pagesystem
*
*	Use with pagesys.inc.php 
*	
*	For main page pagesystems (does not use iframe).  Use pagesystem.js/prototype.lite.js for iframe / animations	
*/


/***********************************************************
*	1. Set the index of the next record.  Loaded to iframe upon shiwHide.hide complettion
*	2. Create/Edit navigational + gui environment 
*	Takes place separate from the iframe animate+load
*/
function loadControl(i,id,pages) {
	
	/*********************************** MAIN PAGE MODE (Reloads full page) */
	alert(id);
	//setPageNavigation(i,id,pages); // reflect user action in the page-nav
	
}



/***********************************************************
*	1. 'Prev' button needs updating
*	2. 'Next' button needs updating
*	3. Pageing menu needs to reflect any user action
*	4. Include any extra animations or guis for "loading content"
*/
function setPageNavigation(i,id,pages) {
	prev = getEl('prev[\''+id+'\']');
	next = getEl('next[\''+id+'\']');

	if((i+1) >= pages) { // dim NEXT
		next.className = 'pageDim';
		next.onclick = function(){
			return false;
		}
	}else { // set new index target for NEXT button
		next.className = 'pageSys';
		next.onclick = function(){
			loadControl(i+1,id,pages);
			return false;
		}
	}
	
	if(i == 0) { // dim PREV
		prev.className = 'pageDim';
		prev.onclick = function(){
			return false;
		}
	}else { // set new index target for PREV button
		prev.className = 'pageSys';
		prev.onclick = function(){
			loadControl(i-1,id,pages);
			return false;
		}
	}
	
	for(var x = 0; x<pages; x++) {
		curpage = getEl('page' + x + '[\''+id+'\']');
		if(x == i) {
			curpage.className = 'pageOn';
		}else {
			curpage.className = 'pageSys';
		}
	} 
	
	
	
}

