
/* menu top animations*/

function buttAct(nr) {	
  if ( document.getElementById("b_f" + nr) ) {
    document.getElementById("b_f" + nr).style.backgroundColor = '#FFFFFF';
    document.getElementById("b_f" + nr).style.paddingTop = '0px';
  }
  if ( document.getElementById("fb_f" + nr) ) {
    document.getElementById("fb_f" + nr).style.color = '#35591C';
  }
  if ( document.getElementById("tr_f" + nr) ) {
    document.getElementById("tr_f" + nr).style.backgroundImage = 'url(img/menu/navMenuArrow.png)';
    document.getElementById("tr_f" + nr).style.backgroundRepeat = 'no-repeat';
    document.getElementById("tr_f" + nr).style.backgroundPosition = 'center top';

    document.getElementById("tr_f" + nr).style.height = '8px';
    document.getElementById("tr_f" + nr).style.marginBottom = '2px';
	document.getElementById("tr_f" + nr).style.paddingTop = '10px';
  }
}
function buttInac(nr) {
	if ( document.getElementById("b_f" + nr) ) {
		document.getElementById("b_f" + nr).style.backgroundColor = 'transparent';
    document.getElementById("b_f" + nr).style.paddingTop = '10px';
	}
	if ( document.getElementById("fb_f" + nr)) {
		document.getElementById("fb_f" + nr).style.color = '#000000';
	}
  if ( document.getElementById("tr_f" + nr) ) {
    document.getElementById("tr_f" + nr).style.backgroundImage = 'none';

    document.getElementById("tr_f" + nr).style.height = '0px';
    document.getElementById("tr_f" + nr).style.marginBottom = '0px';
	document.getElementById("tr_f" + nr).style.paddingTop = '0px';
  }
}	


/*--------------------*/


/* animations */
YAHOO.namespace('animCoachbet');
YAHOO.animCoachbet.init = function() {
	/*var maxWidth = screen.availWidth-20;*/
    /* Right Menu */
	var expandMenuContent = new YAHOO.util.Anim('menu_right_content', { width: {to: 200}}, 0.2 );
	var collapseMenuContent = new YAHOO.util.Anim('menu_right_content', { width: {to: 0}}, 0.2 );

	var expandMenu = new YAHOO.util.Anim('right_menu', { width: {to: 230}}, 0.2 );
	var collapseMenu = new YAHOO.util.Anim('right_menu', { width: {to: 30}}, 0.2 );
	
	var moveLeftMenu = new YAHOO.util.Anim('right_menu', {left: {to: -220}},0.2);
	var moveRightMenu = new YAHOO.util.Anim('right_menu', {left: {to: 0}},0.2);
	/* Login */
	var moveLeftLogin = new YAHOO.util.Anim('div_login', { left: {to: 485}}, 0.2 );
	var moveRightLogin = new YAHOO.util.Anim('div_login', { left: {to: 765}}, 0.2 );
    /* Body */
	var expandBody = new YAHOO.util.Anim('yahoo-com', { width: {to: 1000}}, 0.2 );
	var collapseBody = new YAHOO.util.Anim('yahoo-com', { width: {to: 780}}, 0.2 );
	/* doc Div */
	var expandDocDiv = new YAHOO.util.Anim('doc', { width: {to: 960}}, 0.2 );
	var collapseDocDiv = new YAHOO.util.Anim('doc', { width: {to: 760}}, 0.2 );
	/* Footer */
	var expandFooter = new YAHOO.util.Anim('ft', { width: {to: 980}}, 0.2 );
	var collapseFooter = new YAHOO.util.Anim('ft', { width: {to: 780}}, 0.2 );
	/* Header */
	var expandHeader = new YAHOO.util.Anim('hd', { width: {to: 960}}, 0.2 );
	var collapseHeader = new YAHOO.util.Anim('hd', { width: {to: 760}}, 0.2 );

	if(navigator.appName == 'Microsoft Internet Explorer') {
	    /* Right Menu */
    	var moveLeftMenu = new YAHOO.util.Anim('right_menu', {left: {to: -220}},0.2);
  	    var moveRightMenu = new YAHOO.util.Anim('right_menu', {left: {to: 0}},0.2);
		/* doc Div */
		var expandDocDiv = new YAHOO.util.Anim('doc', { width: {to: 980}}, 0.2 );
		var collapseDocDiv = new YAHOO.util.Anim('doc', { width: {to: 780}}, 0.2 );
		/* Footer */
		var expandFooter = new YAHOO.util.Anim('ft', { width: {to: 990}}, 0.2 );
		var collapseFooter = new YAHOO.util.Anim('ft', { width: {to: 790}}, 0.2 );
	}

	
	var isOpen = false;
	var isOpenRMenu = false;
	var AnimateMenu = function(e) {
		if ((isOpen)&&(!isOpenRMenu)) {
				moveLeftMenu.animate();
				expandMenu.animate();
				expandMenuContent.animate();
				document.getElementById("menu_right_content").style.cssFloat = 'right';
				document.getElementById("left_bar_arrow").style.backgroundImage = 'url(./img/menu/leftbar_arrowRight.gif)';
				isOpenRMenu = true;
			} else if ((isOpen)&&(isOpenRMenu)) {
				moveRightMenu.animate();
				//collapseMenu.animate();
				collapseMenuContent.animate();
				document.getElementById("menu_right_content").style.cssFloat = 'left';
				document.getElementById("left_bar_arrow").style.backgroundImage = 'url(./img/menu/leftbar_arrowLeft.gif)';
				isOpenRMenu = false;
			}
	}
	var AnimateBody = function(e) {
			if (isOpen) {
				expandMenu.animate();
				expandMenuContent.animate();
				expandBody.animate();
				expandDocDiv.animate();
				expandFooter.animate();
				expandHeader.animate();
				moveRightMenu.animate();
				document.icon.src = "./img/common/icon_open.gif";
				document.getElementById("menu_right_content").style.cssFloat = 'right';
				document.getElementById("left_bar_arrow").style.backgroundImage = 'url(./img/menu/leftbar_arrowRight.gif)';
				isOpen = false;
	
			} else {
				//collapseMenu.animate();
				collapseMenuContent.animate();
				collapseBody.animate();
				collapseDocDiv.animate();
				collapseFooter.animate();
				collapseHeader.animate();
				document.icon.src = "./img/common/icon_close.gif";
				document.getElementById("menu_right_content").style.cssFloat = 'left';
				document.getElementById("left_bar_arrow").style.backgroundImage = 'url(./img/menu/leftbar_arrowLeft.gif)';
				isOpen = true;
			}

		}
	YAHOO.util.Event.addListener('left_bar', 'click', AnimateMenu);
	if(screen.availWidth > 1000){
	YAHOO.util.Event.addListener('resizeIcon', 'click', AnimateBody);
	} else {
				collapseMenu.animate();
				collapseMenuContent.animate();
				collapseBody.animate();
				collapseDocDiv.animate();
				collapseFooter.animate();
				document.icon.src = "./img/common/icon_close.gif";
				document.getElementById("menu_right_content").style.cssFloat = 'left';
				document.getElementById("left_bar_arrow").style.backgroundImage = 'url(./img/menu/leftbar_arrowLeft.gif)';
				isOpen = true;
	}
}
/* // dissabled
YAHOO.util.Event.addListener(window, 'load', YAHOO.animCoachbet.init);
*/