function spcAccess()
{
	this.currentSheet = 0;
	this.accessNumber = 0;
	this.firstAccessSheet = 0;
	this.lastAccessSheet = 0;	
}
		
//<!--
		
spcAccess.prototype.changeSheets = function(whichSheet){
		var doAlerts=true;
		
		  whichSheet=whichSheet-1;
		  if(document.styleSheets){
			var c = document.styleSheets.length;
			
			for(var i=0;i<c;i++){
			  if(i!=whichSheet){
				document.styleSheets[i].disabled=true;
			  }else{
				document.styleSheets[i].disabled=false;
			  }
			}
		  }
		}
		
spcAccess.prototype.sheetList = function(){
var returnList='';

	if(document.styleSheets){
	var c = document.styleSheets.length;

		for(var i=0;i<c;i++) {
			var sep = '';
			if (returnList.length==0) sep = '';
			if (document.styleSheets[i].href) {
				var last = document.styleSheets[i].href.split('/').length - 1;
				returnList += sep + '[' + (i+1.0) + ']' + document.styleSheets[i].href.split('/')[last] + '<br>';	
			}	
			
		}
	}
	return returnList;
}		


spcAccess.prototype.getAccessSheet = function(sheetId){

	if(document.styleSheets){
	var c = document.styleSheets.length;

		for(var i=0;i<c;i++) {
			
			if ( document.styleSheets[i].href) {
				var last = document.styleSheets[i].href.split('/').length - 1;
				if (document.styleSheets[i].href.split('/')[last] == sheetId) return (i+1.0);
			}
		}
	}
	return 0;
}

spcAccess.prototype.getLastAccessSheet = function(sheetId){
var retVal = 0;

	if(document.styleSheets){
	var c = document.styleSheets.length;

		for(var i=0;i<c;i++) {
			
			if ( document.styleSheets[i].href) {
				var last = document.styleSheets[i].href.split('/').length - 1;
				if (document.styleSheets[i].href.split('/')[last] == sheetId) retVal = (i+1.0);
			}
		}
	}
	return retVal;
}
		
spcAccess.prototype.setSheets = function (whichSheet){
		  whichSheet=whichSheet-1;
		  if(document.styleSheets){
			var c = document.styleSheets.length;
			
			for(var i=0;i<c;i++){
			  if(i==whichSheet){
				document.styleSheets[i].disabled=false;
				}
			}
		  }
		}
		
spcAccess.prototype.resetSheets = function(whichSheet){
		  whichSheet=whichSheet-1;
		  if(document.styleSheets){
			var c = document.styleSheets.length;
			
			for(var i=0;i<c;i++){
			  if(i==whichSheet){
				document.styleSheets[i].disabled=true;
				}
			}
		  }
		}
		
		
		
spcAccess.prototype.countSheets = function(){
		  
		  if(document.styleSheets){
			var c = document.styleSheets.length;
			return c;
		  }
		  return -1;
		}
		
spcAccess.prototype.setFirstAccessSheet = function()
{
	this.firstAccessSheet = this.countSheets() + 1;
}

spcAccess.prototype.setLastAccessSheet = function()
{
	this.lastAccessSheet = this.countSheets();
}

spcAccess.prototype.getFirstAccessSheet = function()
{
	return this.firstAccessSheet;
}

spcAccess.prototype.getLastAccessSheet = function()
{
	return this.lastAccessSheet;
}
		
var objAccess = new spcAccess();
objAccess.setFirstAccessSheet();		
		
//-->

