/*
	File Name:		tm.js
	Description:	Traffic Online top menu
	Version:		1
	Author:		Dmitry Korsunov
	E-mail:		dmitry.korsunov@gmail.com
	
	No Rights Reserved.
	But some credit would be appreciated.
*/

function toggleTm(id) {

	var unHide = 'subMenu' + id;
	var unHideHeight = $(unHide).getHeight();
	
	$(unHide).setStyle({
	  height: '199px'
	});
	
	if (unHideHeight != 209) {
		return;
	}	
	
	//Effect.toggle(document.getElementById(unHide).id, 'Slide');
	
	var tm = 'tm' + id;
	
	if (document.getElementById(tm).className == 'none') {	
	
		Effect.BlindDown(document.getElementById(unHide).id, { scaleMode: {originalHeight: 199, originalWidth: 980 } });
		document.getElementById(tm).className = 'act';
		
	} else {	
	
		Effect.BlindUp(document.getElementById(unHide).id, { scaleMode: {originalHeight: 199, originalWidth: 980 }, duration: 0.7 });
		document.getElementById(tm).className = 'none';	
		
	}
		
	for(i=1;i<=2;i++){
	
		toHide = 'subMenu' + i;
		toHideVis = $(toHide).visible();
		toHideHeight = $(toHide).getStyle('height');
		
		if ( (i != id) && toHideVis && (toHideHeight != 209) ) {
						
			Effect.BlindUp(document.getElementById(toHide).id, { duration: 0.7 });
			//Effect.SlideUp(document.getElementById(toHide).id, 'slide'); 				
			document.getElementById('tm'+i).className = 'none';			
			
		}		
	}	
}

function delayJump(href) {
	for(i=1;i<=2;i++){
		toHide = 'subMenu' + i;
		
		if (document.getElementById(toHide).style.display != "none") {
			Effect.SlideUp(document.getElementById(toHide).id, 'slide');
			document.getElementById('tm'+i).className = 'none';
		}	
	}
	setTimeout ( 'window.location="'+href+'";', 650 );
}

