/*
	Author: Arky
	
	Description: NewsList traitment 

	Date: 19.10.2009
*/


	var newsList = new Class({
	//initialization
	initialize: function() {
		//set options
		this.top = $('selectnavi_top');
		this.bottom = $('selectnavi_bottom');
		this.selected = $('current');
		this.contentNavi = $$('.bgnavi');
		this.listedNavi = $$('.pagelink');
		this.processToggle = 1;
		this.processList = 0;
		
		//TOP TOGGLE REPLACEMENT
		this._getElementName(this.processToggle, this.top, this.selected);
		
		//BOTTOM TOGGLE REPLACEMENT
		this._getElementName(this.processToggle, this.bottom, this.selected);
		
		
		// TOP / BOTTOM LIST REPLACEMENT
		/*this._countNaviList(this.processList, this.contentNavi, this.listedNavi);*/
	},
	
	
	/*
	Function: _getElementName
		Internal method
		
		Parameters:
		checkDiv, divSelected
		
		Return:
		value
			
	*/
	_getElementName : function(status, checkDiv, divSelected){
		if(checkDiv && divSelected){
			if(status == 1){
				this.value = divSelected.get('name');
				this._switchReplacement(status, checkDiv, this.value);
			}
			else if(status == 0){
			return false;
			}
		}
		
	},
	
	
	_switchReplacement: function(status, checkDiv, valueItem) {
		switch(valueItem){
			case "1":
				this.value = "1 - 10";
				break;
			case "2":
				this.value = "11 - 20";
				break;	
			case "3":
				this.value = "21 - 30";
				break;
			case "4":
				this.value = "31 - 40";
				break;
			case "5":
				this.value = "41 - 50";
				break;
			case "6":
				this.value = "51 - 60";
				break;
			case "7":
				this.value = "61 - 70";
				break;
			case "8":
				this.value = "71 - 80";
				break;
			case "9":
				this.value = "81 - 90";
				break;
			case "10":
				this.value = "91 - 100";
				break;
			case "11":
				this.value = "101 - 110";
				break;	
			case "12":
				this.value = "111 - 120";
				break;
			case "13":
				this.value = "121 - 130";
				break;
			case "14":
				this.value = "131 - 140";
				break;
			case "15":
				this.value = "141 - 150";
				break;
			default :
				this.value = 0;	
		}
		if(status == 1){
			this._setElementName(checkDiv, this.value);
		}
		else if(status == 0){
			return this.value;
		}
	},
	
		/*
	Function: _setElementName
		Internal method
		
		Parameters:
		checkDiv, elementName
		
		Return:
		True or False
			
	*/
	_setElementName : function(checkDiv, elementName){
		if(checkDiv){
			checkDiv.set({html: elementName});
			return true;
		}
		else{
			return false;	
		}
	},
	

	_countNaviList : function(status, divList, listNavi){
		if(divList){
			i = 0;
			listNavi.each(function(){
				i++;
				
			});
			for(i2 = 0; i2 <= i; i2++){
				this._switchReplacement(status, divList, listNavi[i2].name);
				listNavi[i2].set({html: this.value});
			}
		}
	},
	
	_Debug : function(valeur){
		return console.log("Debug ->",	valeur);
	}
	

});
