function Store() {
	this.Items = new Array(arguments.length);
	for(i=0;i<arguments.length;i++) {
		this.Items[i] = arguments[i]; 
	}
	this.addItem = new Function("Item", "this.Items.push(Item)");
	
	//new position and Id
	this.updatePositions = function(newPos, oldPos, id) {
		
		//create "new" item to be inserted
		newItem = new Item(id, newPos);
		
		//subtract 1 for 0 base
		//remove "old" item
		this.Items.splice(oldPos, 1);
		
		//insert the "new" item at it's new index
		this.Items.splice(newPos, 0 ,newItem);
		
		//add it to the form
		for(i=0; i<this.Items.length; i++) {
			sElement =  "el" + i;
			eval("document.layout." + sElement + ".value=" + this.Items[i].nId);
		}
		document.layout.count.value = this.Items.length;
		document.layout.submit();
	}
}


function Item(nId, nPosition) {
	this.nId = nId;
	this.nPosition = nPosition;
}

function initFade(testObj) {
	for (var i=0;i<6;i++)
		setTimeout('setOpacity("'+testObj+'", '+i+')',100*i);
	return false;
}

function setOpacity(testObj, value) {
	testObj = (testObj.style) ? testObj : document.getElementById(testObj);
	//alert(testObj)
	testObj.style.opacity = value/10;
	testObj.style.filter = 'alpha(opacity=' + value*10 + ')';
}

function fade(elItem, value) {
	//if(elItem.id != ("item_" + activeItem1)) {
		setOpacity(elItem, value);
	//}
}

function showTitle(elTitle, state) {
	elTitle = document.getElementById(elTitle);
	elTitle.style.display = state;
}