user.deny(html);

window.onload = function(){
	operation.rollovers();
	rotationNavi(document.getElementById('rotation'));
	operation.sliders();
    setupNavi();
    user.allow(html);
}

function rotationNavi(rotationContainer){
	if(!rotationContainer) return false;
	if( get.attribute(rotationContainer,'class') == 'off' ) return false;
	
	that = rotationContainer;
	
	var seconds = 5;
	var startdelay = 6;
	
	var counter = 0;
	var complete;
	var current;
	var coming;
	
	var images = new Array();
	images = that.getElementsByTagName('img');
	complete = images.length - 1;

	that.rotate = function(){	
		current = images[counter];
		if(counter == complete) counter = 0;
		else counter += 1;
		coming = images[counter];
		
		current.style.zIndex = 3;
		set.opacity(current,1);
		coming.style.zIndex = 2;
		set.opacity(coming,1);
		
		that.fading = setInterval(that.fade,150);
	}
	that.fade = function(){
		var op = get.opacity(current);
		if (op <= 0.1){
			set.opacity(current,0);
			current.style.zIndex = 1;
			clearInterval(that.fading);
			setTimeout("that.rotate()",seconds*1000)
		}
		else {
			set.opacity(current,op - 0.1);
		}
	}
	setTimeout("that.rotate()",startdelay*1000)
}


function setupNavi(){
    var lists = new Array();
    lists = document.getElementsByTagName('ul');
    for(var i=0; lists.length>i; i++){
        var list = lists[i];
        dropDown(list);
    }
}
function dropDown(somelist){
    var that = somelist;
    that.drop = function(){
        set.attribute(that,'class','dropped');
    }
    that.pick = function(){
        set.attribute(that,'class','');
    }
    set.listener(that,'mouseover',that.drop);
    set.listener(that,'mouseout',that.pick);
    return that;
}
