// JavaScript Document
function show(this_id,container_id)
{
	hide('all',0);
	var curleft = curtop = 0;obj=this_id;
         if (obj.offsetParent) 
		 {
			curleft = obj.offsetLeft
			curtop = obj.offsetTop
			while (obj = obj.offsetParent) 
			{
				curleft += obj.offsetLeft
				curtop += obj.offsetTop
			}
		 }
 
 	if (container_id=='menu_container1')
 	{ extraleft=155; }
 	
 	if (container_id=='menu_container2')
 	{ extraleft=319; }
 	
 	if (container_id=='menu_container3')
 	{ extraleft=167; }
 	
 	if (container_id=='menu_container4')
 	{ extraleft=107; }
 	
 	if (container_id=='menu_container5')
 	{ extraleft=177; }
 
    document.getElementById(container_id).style.position="absolute";
	document.getElementById(container_id).style.left=curleft-extraleft+"px";
	document.getElementById(container_id).style.top=curtop+45+"px";
	document.getElementById(container_id).style.display="block";
}

function hide(container_id, exception)
{
	if (container_id=='all')
	{
		if (exception!=1 && exception!='menu_container1')
		{document.getElementById('menu_container1').style.display="none";}
		
		if (exception!=2 && exception!='menu_container2')
		{document.getElementById('menu_container2').style.display="none";}
		
		if (exception!=3 && exception!='menu_container3')
		{document.getElementById('menu_container3').style.display="none";}
		
		if (exception!=4 && exception!='menu_container4')
		{document.getElementById('menu_container4').style.display="none";}
		
		if (exception!=5 && exception!='menu_container5')
		{document.getElementById('menu_container5').style.display="none";}
	}
	else
	{ document.getElementById(container_id).style.display="none"; }
}

function show_image(this_id,produtos)
{
	hide_image('all',produtos);
	
	if (document.getElementById(this_id))
	{
		if (this_id=='menu-1')
	 	{document.getElementById(this_id).style.background="url(/static-media/images/tab1.png) no-repeat";}
	 	
	 	if (this_id=='menu-2')
	 	{document.getElementById(this_id).style.background="url(/static-media/images/tab.png) no-repeat";}
	 	
	 	if (this_id=='menu-3')
	 	{document.getElementById(this_id).style.background="url(/static-media/images/tab3.png) no-repeat";}
	 	
	 	if (this_id=='menu-4')
	 	{document.getElementById(this_id).style.background="url(/static-media/images/tab4.png) no-repeat";}
	 	
	 	if (this_id=='menu-5')
	 	{document.getElementById(this_id).style.background="url(/static-media/images/tab5.png) no-repeat";}
	}	
	
	document.getElementById(this_id).style.color="#CC0000"
}

function hide_image(this_id,produtos)
{

	if (this_id=='all')
	{
		if (produtos!=1 && produtos!='menu-1')
		{
			document.getElementById('menu-1').style.background="";
			document.getElementById('menu-1').style.color="";
		}
		
		if (produtos!=2 && produtos!='menu-2')
		{
			document.getElementById('menu-2').style.background="";
			document.getElementById('menu-2').style.color="";
		}
		
		if (produtos!=3 && produtos!='menu-3')
		{
			document.getElementById('menu-3').style.background="";
			document.getElementById('menu-3').style.color="";
		}
		
		if (produtos!=4 && produtos!='menu-4')
		{
			document.getElementById('menu-4').style.background="";
			document.getElementById('menu-4').style.color="";
		}
		
		if (produtos!=5 && produtos!='menu-5')
		{
			document.getElementById('menu-5').style.background="";
			document.getElementById('menu-5').style.color="";
		}
	}
	else
	{ 
		if (document.getElementById(this_id))
			document.getElementById(this_id).style.background="";
		document.getElementById(produtos).style.color="";
	}
}

function roll_over(img_name, img_src)
{
   document[img_name].src = img_src;
}

function onfocus_onblur(this_id,value)
{ 
	if(this_id.value==value)
	{
	  this_id.value="";
	}
	else if(this_id.value=="")
	{
		this_id.value=value;
	}
}
