// JavaScript 
function playSound()
{
	document.all.bgSound.src ="sound/mouseOver.mp3"; 
	
}
///////////////////////////////////////////////////////////////////////////////
//flv flash player
var flvFlashHelper =
{
	movieIsLoaded : function (theMovie)
	{
		if (typeof(theMovie) != "undefined") return theMovie.PercentLoaded() == 100;
		else return
		false;
  },

	getMovie : function (movieName)
	{
  	if (navigator.appName.indexOf ("Microsoft") !=-1) return window[movieName];
	  else return document[movieName];
	}
};

function sendToFlash(theValue)
{
	this.obj = flvFlashHelper.getMovie("flvPlayer");
	if (!flvFlashHelper.movieIsLoaded(this.obj)) return;
	this.obj.sendToFlash(theValue);

}
function sendToPlayNewFlv(theFlv)
{
	this.obj = flvFlashHelper.getMovie("flvPlayer");
	if (!flvFlashHelper.movieIsLoaded(this.obj)) return;
	this.obj.playNewFlv(theFlv);
}
///////////////////////////////////////////////////////////////////////////////
//music play ctrl
var musicStatus = 0;
//播放
function musicPlay(source,button)
{
	var playButton=document.getElementById(button);
	//var theMenu=document.all(name);
	if(musicStatus == 0)
	{
		/*
		player.url=source;
		player.settings.autoStart = false ;
		if (player.controls.isavailable('play'))
		{
			player.controls.play();
			//
		}
		*/
		//document.all.playimg1.src = "winxImages/signUp.jpg";
		musicStatus=1;
		playButton.innerHTML = "stop";
		
	}
	else if(musicStatus == 1)
	{
		/*if (player.controls.isavailable('stop'))
		{
			player.controls.stop();
			player.url="";
		}*/
		//document.all.playimg1.src = "winxImages/back.jpg";
		musicStatus=0;
		playButton.innerHTML = "play";
	}
	
}

//暂�?�
function musicPause()
{
	if (player.controls.isavailable('pause'))
	{
		player.controls.pause();
	}
}

//�?�止
function musicStop()
{
	if (player.controls.isavailable('stop'))
	{
		player.controls.stop();
		player.url="";
	}
}

///////////////////////////////////////////////////////////////////////////////////////////////////
//全局标记 0�?�?目标打开, 1 显示目标关闭
genGameGategoryMenuMark=0;
//目�?所处步数
genGameGategoryMenuStep=0;
function setGameGategoryMenu()
{
	//�?�得�?�柄
	var theMenuOld=document.all("gameGategoryMenu_old");
	var theMenuAll=document.all("gameGategoryMenu_all");
	var theMenuTop=document.all("gameGategoryMenu_top");
	var theMenu1=document.all("gameGategoryMenu_1");
	var theMenu2=document.all("gameGategoryMenu_2");
	var theMenu3=document.all("gameGategoryMenu_3");
	var theMenu4=document.all("gameGategoryMenu_4");
	var step = 90;
	if(genGameGategoryMenuMark==0)
	{
		genGameGategoryMenuStep++;
		//由于有些�?览器会对浮动窗�?�进行过滤,所以�?先设置�?置�?作一次显示
		//打开
		if(genGameGategoryMenuStep==1)
		{
			//1
			//�?�?底图
			theMenuOld.style.visibility="hidden";
			//显示第一张
			theMenu1.style.top = theMenuOld.offsetTop;
			theMenu1.style.visibility="visible";
			setTimeout("setGameGategoryMenu()",step);
		}
		else if (genGameGategoryMenuStep==2)
		{
			//2
			//显示顶图
			theMenuTop.style.top = theMenu1.offsetTop - theMenuTop.offsetHeight;
			theMenuTop.style.visibility="visible";
			setTimeout("setGameGategoryMenu()",step);
		}
		/*
		else if(genGameGategoryMenuStep==3)
		{
			//3
			//显示第二张
			theMenu2.style.top = theMenu1.offsetTop - theMenu2.offsetHeight;
			theMenuTop.style.top = theMenu2.offsetTop - theMenuTop.offsetHeight;
			theMenu2.style.visibility="visible";
			setTimeout("setGameGategoryMenu()",step);
		}
		*/
		else if(genGameGategoryMenuStep==3)
		{
			//5
			//�?�?顶图
			theMenuTop.style.visibility="hidden";
			//显示第四张
			theMenu4.style.top = theMenuTop.offsetTop;
			theMenu4.style.visibility="visible";
			//标记已�?完全打开
			genGameGategoryMenuMark=1;
			//setTimeout("setGameGategoryMenu()",step);
		}
		else
		{
			return;
		}
		
		
	}
	else
	{
		//关闭
		if(genGameGategoryMenuStep==3)
		{
			//5
			//�?�?第四张
			theMenu4.style.visibility="hidden";
			//显示顶图
			theMenuTop.style.visibility="visible";
			setTimeout("setGameGategoryMenu()",step);
		}
		/*
		else if(genGameGategoryMenuStep==3)
		{
			//3
			//�?�?第二张
			theMenu2.style.visibility="hidden";
			theMenuTop.style.top = theMenu1.offsetTop - theMenuTop.offsetHeight;
			theMenuTop.style.visibility="visible";
			setTimeout("setGameGategoryMenu()",step);
		}
		*/
		else if(genGameGategoryMenuStep==2)
		{
			//2
			//�?�?顶图
			theMenuTop.style.visibility="hidden";
			setTimeout("setGameGategoryMenu()",step);
		}
		else if(genGameGategoryMenuStep==1)
		{
			//1
			//�?�?第一张
			theMenu1.style.visibility="hidden";
			//显示底图
			theMenuOld.style.visibility="visible";
			//标记已�?完全关闭
			genGameGategoryMenuMark=0;
			//setTimeout("setGameGategoryMenu()",step);
		}
		else
		{
		}
		genGameGategoryMenuStep--;
		
	}
	
}
//ranking switch
function rankingSwitch(name)
{
	var ranking1=document.all("ranking-1");
	var ranking2=document.all("ranking-2");
	var ranking3=document.all("ranking-3");
	var rankingT1=document.all("rankingT1");
	var rankingT2=document.all("rankingT2");
	var rankingT3=document.all("rankingT3");
	ranking1.style.visibility="hidden";
	ranking2.style.visibility="hidden";
	ranking3.style.visibility="hidden";
	rankingT1.style.display="none";
	rankingT2.style.display="none";
	rankingT3.style.display="none";
	if(name=="1")
	{
		ranking1.style.visibility="visible";
		rankingT1.style.display="";
	}
	else if(name=="2")
	{
		ranking2.style.visibility="visible";
		rankingT2.style.display="";
	}
	else if(name=="3")
	{
		ranking3.style.visibility="visible";
		rankingT3.style.display="";
	}
	else
	{
		ranking1.style.display="";
	}
}

function displayTopUp(test)
{	
	var topMenu=document.all("top_menu");
	topMenu.style.left=document.body.scrollWidth/2- parseInt(topMenu.style.width)/2;
	topMenu.style.top=document.body.scrollTop + document.body.clientHeight/2 - parseInt(topMenu.style.height)/2;
	topMenu.style.display="";
	//alert(parseInt(topMenu.style.width));

}
