


//var items1 = new Array();
var countryName = '';
var saCode = '' ; 
var OAGRegion = '' ; 
var currency = '' ; 

function items(){

	this.items1 = new Array();
}

items.prototype.setCurrency = function(i){
	this.currency = i;
}

items.prototype.getCurrency = function(){
	return this.currency;
}

items.prototype.setOAGRegion = function(i){
	this.OAGRegion = i ;
}

items.prototype.getOAGRegion = function(){
	return this.OAGRegion;
}

items.prototype.getPc = function(){
	return this.pc;
}

items.prototype.setPc = function(i){
	this.pc = i ;
}

items.prototype.setSaCode = function(i){
	this.saCode = i ;
}


items.prototype.getSaCode = function(i){
	return this.saCode;
}

items.prototype.setCountryName = function(i){
	this.countryName = i ;
}

items.prototype.getCountryName = function(){
	return this.countryName ; 
}

var tcount = 0; 

items.prototype.add = function(it){
	//document.write(it.toString());
	this.items1.push(it) ;
}

items.prototype.removeItem = function(id){
/*
	var l = new Array();

	for( i = 0 ; i < items1.length ; i++){
	
		if(items1[i].getId() != id){
			l.push(items1[i]);
		}
	
	}
	
	items1 = l ; 
*/
}


items.prototype.getItemsList = function(){
	return this.items1;
	
}



items.prototype.getItemsCount = function(){
	return this.items1.length;
	
}



items.prototype.findItem = function(id){

	var index = 0; 
	var rtn = null;
	var len = this.items1.length ; 

	while(index < len){
	
		if(this.items1[index].getId() == id) {
				rtn =  this.items1[index] ; 
				break;
		}

		index++;
	}
	
	return rtn ; 
}

items.prototype.clear = function(){
	
	this.items1.clear();
	
}

items.prototype.findEdition = function(edition,id){

	var index = 0; 
	var rtn = null;
	var len = this.items1.length ; 

	while(index < len){
	
		if((this.items1[index].getEdition() == edition) && (this.items1[index].getId() != id)) {
				rtn =  this.items1[index] ; 
				break;
		}

		index++;
	}
	
	return rtn ; 
}




items.prototype.findItemIndex =  function(id){
	
	var index = 0; 
	var rtn = null;
	var len = this.items1.length ; 

	while(index < len){
	
		if(this.items1[index].getId() == id) {
				rtn  =  index ; 
				break;
		}

		index++;
	}
	
	return rtn ; 
}



items.prototype.remove = function(index){
	this.items1.remove(index);
}
 
Array.prototype.remove = function(from, to) {
  var rest = this.slice((to || from) + 1 || this.length);
  this.length = from < 0 ? this.length + from : from;
  return this.push.apply(this, rest);
};



Array.prototype.clear=function()
  {
      this.length = 0;
  };