function switchcontentitem(id)
{
	var trs = document.getElementsByTagName('tr');
	var i=0;
	var d;
	while((d=trs[i++]))
	{
		if(d.id.match(/tblcontenthead_/))
		{
			if(d.id=='tblcontenthead_'+id)
			{
				
				d.setAttribute("class", "colorgray");
			}else
			{
				d.setAttribute("class", "colorgreen");
			}
		}
		if(d.id.match(/tblcontent_/))
		{
			if(d.id=='tblcontent_'+id)
			{
				if(d.style.display=='none')
				{
					d.style.display = '';
					//d.style.display='inline';
				}else
				{
					d.style.display='inline';
				}
			}else
			{
				d.style.display='none';
			}
		}
	}
}

function addtofavorites()
{
    var url=location.href;
    var title=document.title;
    if (window.sidebar) { // Mozilla Firefox Bookmark
        window.sidebar.addPanel(title, url,"");
    } else if( window.external ) { // IE Favorite
        window.external.AddFavorite( url, title); 
    }
    else if(window.opera && window.print) { // Opera Hotlist
        return true; }
}

function ZoomProduct(img)
{
    document.getElementById('zoomimg').src=img;
    document.getElementById('zoomdiv').style.display='inline';
}

/* variáveis de controlo do fluxo de imagens de produtos */
/*var gotimer=0;
var cimg=0;
var imglist=new Array();

function changeimg(){
    if(cimg==(imglist.length-1))
    {
        cimg=0;
    }
    else
    {
        cimg++;
    }
    document.getElementById('imgspec').src=imglist[cimg].src;
    if(gotimer==1)
    {
        if(cimg!=(imglist.length-1))
            setTimeout('changeimg()',2000);
    }
}*/

/* variáveis de controlo do fluxo de imagens de produtos */
var gotimer=0;
var cimg=0;
var imglist=new Array();

function changeimg(){
    if(cimg==(imglist.length-1))
    {
        cimg=0;
	    gotimer=1;
	
    }
    else
    {
        cimg++;
				
    }
    document.getElementById('imgspec').src=imglist[cimg].src;
    if(gotimer==1)
    {

        if(cimg!=(imglist.length-1))
            setTimeout('changeimg()',2000);
    }

	
}

function ShowProductDescription()
{
  //  document.getElementById('first').style.display='inline';document.getElementById('second').style.display='none';
    gotimer=0;
}

function ShowProductSpecification()
{
    //document.getElementById('first').style.display='none';document.getElementById('second').style.display='inline';
    cimg=-1;
    gotimer=1;
    if(imglist.length>0)
    {
        changeimg();
    }
}

function changeLanguage(lang)
{
    document.getElementById('langid').value=lang;
    if((lang==1)||(lang==2)||(lang==4))
        document.getElementById('langsel').submit();
}

