var UCTmoving=false;
var UCToolbar={
	lang:'en',
	openTool:function(e){
		if(!UCTmoving){
			if(!$('UCT-bg')){
				var tool_shadow1 = Builder.node('div',{className:'UCT-sh1'});
				var tool_shadow2 = Builder.node('div',{className:'UCT-sh2'});
				var tool_shadow3 = Builder.node('div',{className:'UCT-sh3'});
				var tool_shadow4 = Builder.node('div',{className:'UCT-sh4'});
				var tool_shadow5 = Builder.node('div',{className:'UCT-sh5'});
				var tool_contShad = Builder.node('div',{className:'contShad',id:'contShad'});
				var tool_cont = Builder.node('div',{id:'UCT-cont'});
				var tool_bg = Builder.node('div',{className:'UCT-bg',id:'UCT-bg'});		
				var tool_btnClose = Builder.node('div', {id:'btnClose'});
				var tool_btnCloseHref = Builder.node('a',{id:'btnCloseA',onclick:'UCToolbar.closeTool(this);',href:'javascript:void(0);'},'CLOSE');
				tool_contShad.appendChild(tool_shadow1);
				tool_contShad.appendChild(tool_shadow2);
				tool_contShad.appendChild(tool_shadow3);
				tool_contShad.appendChild(tool_shadow4);
				tool_contShad.appendChild(tool_shadow5);
				$('UCToolbar').appendChild(tool_contShad);
				tool_bg.appendChild(tool_cont);
				$('UCToolbar').appendChild(tool_bg);
				$$('div.UCTCont')[0].getElementsByTagName('UL')[0].className = "open";
				$('UCToolbar').style.background = 'url(/images/styles/bgTool.jpg) top center no-repeat #98000E';
				$('UCT-bg').style.display="none";
				$$('A.UCT-t').each(function(a){a.target="UCTFrame"});
				UCTmoving=true;
				new Effect.SlideDown('UCT-bg', {duration:.6,afterFinishInternal:function(){
					var tool_iframe = Builder.node('iframe',{
						src:e.href,
						id:'UCTFrame',
						name:'UCTFrame',
						height:'230',
						width:'990',
						frameborder:'0',
						marginwidth:'0',
						marginheight:'0',
						align:'middle',
						scrolling:'no',
						allowtransparency:'true'
					});
					$('UCT-cont').appendChild(tool_iframe);
					$('UCTLink').style.visibility="visible"
					UCTmoving=false;
				}});
				tool_btnClose.appendChild(tool_btnCloseHref);
				$('UCTClose').appendChild(tool_btnClose);
				$('btnClose').style.display = "none";
				new Effect.Appear($('btnClose'),{duration:.6});
				e.className = "t on";
				e.parentNode.className="on";
			}else{
				$$('A.t').each(
					function(b){
						b.className = "t";
						b.parentNode.className="";
					}
				);
				e.className = "t on";
				e.parentNode.className = "on";
				$('UCTFrame').style.height="232px";
				$('UCT-bg').style.height="232px";
				$('UCTFrame').src = e.href;
				$('UCTLink').style.visibility="visible"
			}
		}
	},
	closeTool:function(){
		UCTmoving=true;
		$('UCTLink').style.visibility="hidden"
		Element.remove('UCTFrame');
		new Effect.SlideUp('UCT-bg',{
			duration:.8,
			afterFinishInternal:function(){
				$$('div.UCTCont')[0].style.display = "block";
				Element.remove('UCT-bg');
				$('UCToolbar').style.background = 'url(/images/styles/tb_bg.gif) #E6E6E6 repeat-x bottom left';
				var li=$('menuTool').getElementsByTagName('LI');
				for (var i=0; i<li.length; i++) {
					li[i].className="";
					li[i].firstChild.className = "t";
				};
				Element.remove('contShad');
				$$('div.UCTCont')[0].getElementsByTagName('UL')[0].className = "";
				UCTmoving=false;
			}
		});
		new Effect.Fade($('btnClose'),{
			duration:.5,
			afterFinishInternal: function(){
				Element.remove($('btnClose'));
		}});
	},
	showWWL:function(){
		new Effect.Morph($('UCT-bg'),{style:'height:470px',duration:.5,afterFinishInternal:function(){
			$('UCTFrame').src="http://www.unicreditgroup.eu/ucg-content/en/inc/worldwide.htm"
			$('UCTLink').style.visibility="hidden"
		}});
		$('UCTFrame').style.height="470px"
		$('UCT-cont').style.height="470px"
	}
}

