theElement = 0;

var doBanner = function() {
	counter = 10;
	$('main3').getChildren('li').each(function(el){
		el.addEvent('mouseover', doFocus);
		el.setStyle('top',counter);
		el.setStyle('position', 'absolute');
		counter=counter+125;
	});
	
	$('main3').addEvent('mouseleave', doReset);
	
}

var doReset = function() {
	
	counter = 10;
	theElement = 0;
	$('main3').getChildren('li').each(function(el){
		
		if (el.getStyle('height')  != 108) {
			el.get('morph').start({'height': 108, 'top':counter});	
			el.getFirst('a').getFirst('img').get('tween').start('opacity',1);		
		}
		counter = counter+125;													  
	});
}


var doFocus = function() {
	if (theElement != this) {
		
		theElement = this;
		
		counter = 10;
		
		$('main3').getChildren('li').each(function(el){
			if (el != theElement) {
				if (el.getStyle('height')  != 30) {
					el.get('morph').start({'height': 30, 'top':counter});
					el.getFirst('a').getFirst('img').get('tween').start('opacity',0);
				}
				counter = counter+50;
				
				
			} else {
				el.get('morph').start({'height': 255, 'top':counter});
				el.getFirst('a').getFirst('img').get('tween').start('opacity',1);
				
				counter = counter+275;
			}

		});
		

	}
}

var createFlashVideoBox = function(option) {
	
	var flashVideoBox = new Swiff('/flash/indexflash.swf', {
    	id: 'indexFlash',
		name: 'indexFlash',
    	width: 230,
    	height: 220,
   		params: {
        	wmode: 'transparent',
        	bgcolor: '#FFFFFF',
      		loop: 'false',
			menu: 'false',
       		quality: 'high',
   			scale: 'noscale',
			allowScriptAccess: 'always',
    		allowFullScreen: 'true',
			play: 'true'
    	},
		vars: {
        	linkvideo: linkvideo
    	}
	});

	(function() {flashVideoBox.inject($('flashcontent'));}).delay(1000);

}

window.addEvent('domready', createFlashVideoBox);
window.addEvent('domready', doBanner);