/*****************************************************************************
* global variables
*****************************************************************************/
var curTab = 0;
var numTabs = 0;
var tabName = "";
var promoNum = 0;
var promoPage = "";

/*****************************************************************************
* showTab - function for switching between tabs (i.e. on the product pages)
*****************************************************************************/
function showTab( tabNum )
{
    curTab = tabNum;
    for( i=0; i<numTabs; i++ ){
        page = document.getElementById( 'tabPage' + i );
        tab = document.getElementById( tabName + '_tab' + i );
        tabOn = document.getElementById( tabName + '_tab' + i + '_on' );
        tabOver = document.getElementById( tabName + '_tab' + i + '_over' );
        if( i == tabNum ){
	        page.className = tabName + '_tabPageTable';
	        tab.className = 'hidden';
	        tabOver.className = 'hidden';
	        tabOn.className = 'tab';
        }
        else{
	        page.className = 'hidden';
	        tab.className = 'tab';
	        tabOn.className = 'hidden';
        }
    }
}

/*****************************************************************************
* highlightTab - function for highlighting tabs (i.e. on the product pages)
*****************************************************************************/
function highlightTab( tabNum, bHighlight )
{
    if( tabNum != curTab ){
        tab = document.getElementById( tabName + '_tab' + tabNum );
        tabOver = document.getElementById( tabName + '_tab' + tabNum + '_over' );
        if( bHighlight ){
            tab.className = 'hidden';
            tabOver.className = 'tab';
        }
        else{
            tab.className = 'tab';
            tabOver.className = 'hidden';
        }
    }
}

/*****************************************************************************
* promoRollover - function for showing promo rollovers (i.e. on the home page)
*****************************************************************************/
function promoRollover( promoNum, bShow )
{
    promo = document.getElementById( promoPage + 'Promo' + promoNum );
    promoOver = document.getElementById( promoPage + 'Promo' + promoNum + '_over' );
    if( bShow ){
        promo.className = 'hidden';
        promoOver.className = promoPage + 'Promo_over';
    }
    else{
        promo.className = promoPage + 'Promo';
        promoOver.className = 'hidden';
    }
}

/*****************************************************************************
* showHeadline - function for rotating news headlines on the home page)
*****************************************************************************/
function showHeadline()
{
    headline = document.getElementById( 'a1NewsLink' );
    alert('teste');
    headline.innerHTML = "<a href = '" + links[ curHeadline ] + "'/>" + headlines[ curHeadline ] + "</a>"

    curHeadline++;
    if( curHeadline >= headlines.length ) curHeadline = 0;
}


/*****************************************************************************
* Gallery popup - function for showing popup window in the gallery
*****************************************************************************/

	function popitup(url, pathImg) {
	url = url + "?pathImg=" + pathImg;
	newwindow=window.open(url,'name','height=575, width=780, scrollbars=YES');
	if (window.focus) {newwindow.focus()}
	return false;
}

$(function(){
$("h1").each(function() {
	if($(this).html() == "AWARE")
		$(this).html("AWARE&trade;");
	
	if($(this).html() == "Diamond Logic")
		$(this).html("Diamond Logic&reg;");
	if($(this).html() == "Local Regional Delivery")
		$(this).html("Local &#47; Regional Delivery");
});
$(".leftNavLines a").each(function() {
	if($(this).html() == "AWARE")
		$(this).html("AWARE&trade;");
	
	if($(this).html() == "Diamond Logic")
		$(this).html("Diamond Logic&reg;");
});
$(".leftNavSub a").each(function() {
	if($(this).html() == "Local Regional Delivery")
		$(this).html("Local &#47; Regional Delivery");
});
});