// JavaScript Document
//menu click xo xuong;
function test()
{
	alert("test");
}
var ii=0;
function Show_Hide(a)
{ 
    var answer = "answer"+a;
	var id="answer"+ii;
	if (null!=answer)
	{
		if(answer!=id)
    	{ 
			if(ii!=0)
			{
				Hide(id	);
			}
			Show(answer);
			ii=a;
		}
		else
		{
			Hide(answer);
			ii=0;
		}
	}
    
}
function Hide(answer)
{  
	if (null!=answer)
	{
	     document.getElementById(answer).style.display = "none";
	}
}
function Show(answer)
{
	if (null!=answer)
	{
	     document.getElementById(answer).style.display = "block" ;
		 
	}
}
//menu thay doi hinh nen
var vitritruoc=1;
function doihinhnen(vitri)
{
	if(vitri!=vitritruoc)
	{
		document.getElementById("tuan"+vitri).style.backgroundImage="url(images/hose2.jpg)";
		document.getElementById("chu"+vitri).style.color="#ff0000";
		document.getElementById("tuan"+vitritruoc).style.backgroundImage="url()";
		document.getElementById("chu"+vitritruoc).style.color="#00FF00";
		vitritruoc=vitri;
	}
}
function mousehover(vitri)
{alert("");
	if(vitri!=vitritruoc)
	{
		document.getElementById("tuan"+vitri).style.backgroundImage="url(images/hose1.jpg)";
		document.getElementById("chu"+vitri).style.color="#ff0000";
		document.getElementById("tuan"+vitritruoc).style.backgroundImage="url()";
		document.getElementById("chu"+vitritruoc).style.color="#00FF00";
		//vitritruoc=vitri;
	}
}
function mouseout(vitri)
{
	if(vitri!=vitritruoc)
	{
		document.getElementById("tuan"+vitritruoc).style.backgroundImage="url(images/hose2.jpg)";
		document.getElementById("chu"+vitritruoc).style.color="#ff0000";
		document.getElementById("tuan"+vitri).style.backgroundImage="url()";
		document.getElementById("chu"+vitri).style.color="#00FF00";
		//vitritruoc=vitri;
	}
}
//zoom anh
var zoomfactor=0.05 ;
function zoomhelper()
{
	if(parseInt(whatcache.style.width)>300 || parseInt(whatcache.style.height)>300)
	{
		clearzoom();
	}
	else
	{
		whatcache.style.width = parseInt(whatcache.style.width)	+  parseInt(whatcache.style.width)*zoomfactor*prefix;
		whatcache.style.height=parseInt(whatcache.style.height)	+ parseInt(whatcache.style.height)*zoomfactor*prefix;
	}
}
function Zoom(originalW, originalH, what, state)
{
	whatcache=eval("document.images."+what)
	if (whatcache.style.width==""||state=="restore")
	{
		clearzoom();
		whatcache.style.width=originalW;
		whatcache.style.height=originalH;
		document.getElementById("tuan").style.position="static" ;
		if (state=="restore")
			return
	}
	else
	{
		prefix=2;
		document.getElementById("tuan").style.position="absolute" ;
		zoomhelper();
		beginzoom=setInterval("zoomhelper()",1)
	}
}
function clearzoom()

{

	if (window.beginzoom)
		clearInterval(beginzoom)
}
