/* */

var arAbas = new Array();
arAbas[0] = new stAba('Ppost','prodPost');
arAbas[1] = new stAba('Pstats','prodStats');
arAbas[2] = new stAba('Pinfo','prodDescription');

var arAbas_02 = new Array();
arAbas_02[0] = new stAba_02('linkUpcoming','tabUpcoming');
arAbas_02[1] = new stAba_02('linkPastFlings','tabPastFlings');
arAbas_02[2] = new stAba_02('linkWidget','tabWidget');

function stAba(menu,conteudo)
	{
		this.menu = menu;
		this.conteudo = conteudo;
	}
	
function stAba_02(menu,conteudo)
	{
		this.menu = menu;
		this.conteudo = conteudo;
	}
	
function AlternarAbas(menu,conteudo)
	{
		for (i=0;i<arAbas.length;i++)
		{
			m = document.getElementById(arAbas[i].menu);
			m.className = '';
			c = document.getElementById(arAbas[i].conteudo)
			c.style.display = 'none';
		}
		m = document.getElementById(menu)
		m.className = 'prodActive';
		c = document.getElementById(conteudo)
		c.style.display = '';
	}
	

function AlternarAbas_02(menu,conteudo)
	{
		for (i=0;i<arAbas_02.length;i++)
		{
			y = document.getElementById(arAbas_02[i].menu);
			y.className = '';
			t = document.getElementById(arAbas_02[i].conteudo)
			t.style.display = 'none';
		}
		y = document.getElementById(menu)
		y.className = 'tabActive';
		t = document.getElementById(conteudo)
		t.style.display = '';
	}
	
function FlingMeHome(url)
{
    var quantity = document.getElementById('quantitySelected');
    document.location=url + 'quantity=' + quantity.value;
}

function OnChangeImage(link,path,url,title,windowProperties)
{
    var img1 = document.getElementById('Image1');
    var img2 = document.getElementById('Image2');
    var img3 = document.getElementById('Image3');
    
    if (img1 != null) { img1.className = ""; }
    if (img2 != null) { img2.className = ""; }
    if (img3 != null) { img3.className = ""; }
    
    link.className = "tabOn";
    
    var img = document.getElementById('ActualImage');
    img.src = path;
    img.parentNode.href = "javascript:WindowOpen('"+url+"','"+title+"','"+windowProperties+"');";
    
}

function WindowOpen(url,name,features)
{
            window.open(url,name,features);
}

function toggleLayer( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}

function changeLayerState( whichLayer, display )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  vis.display = (display == 0) ? 'none' : 'block';
}
