﻿

function showDynBoxes() 
{
    for (var i = 2; i <= 7; i++) {
        if (document.getElementById("hpRow" + i).innerHTML.indexOf("dynamicBox")<=0) {
            document.getElementById("hpRow" + i).style.display = "none";
        }
    }
    if (document.getElementById("hpRow8").innerHTML.indexOf("dynamicBox")<=0)
        document.getElementById("hpRow8").style.display = "none";
}

var hpTabFlag = 0;

function hpTabSelect(active_tab,clicked)
{
    if(clicked=='clicked')
    {
        hpTabFlag = 1;
    }
    for(iTmp=1;iTmp<=4;iTmp++)
    {
        var str = "hptab" + iTmp;
        var str2 = "hptabcontent" + iTmp;
        if (iTmp==active_tab)
        {
            var x = document.getElementById(str); 
            var c = document.getElementById(str2);
            x.className = "tabSelected";
            c.style.display = "block";
        }
        else
        {
            var x = document.getElementById(str); 
            x.className = "tab";
            var c = document.getElementById(str2);
            c.style.display = "none";
        }
    }
}

function hpTabCycle(iTab)
{
   if(hpTabFlag == 0)
   {
       hpTabSelect(iTab);
       if(iTab<4)
       {
	       iTab=iTab+1;
	       setTimeout('hpTabCycle('+ iTab +')',4000);
       }
       else
       {
	       iTab = 1
	       setTimeout('hpTabCycle('+ iTab +')',4000);
       }
    }
}
    
function showSideVid(vidSrc)
{
	$('.videoImgSrc').html($('#videoTmp').html());
}



    
function get_tips(result)
{
 document.getElementById('folderContent').innerHTML = result;
} 


function ShowToolTip(show,eleNum)
{
    if (show=="1")
      document.getElementById(eleNum).style.display = "block"
    if (show=="0")
        document.getElementById(eleNum).style.display = "none"
}

function backToTop(){
	document.location.href = document.location.href + "#top";
}

function addCommas(nStr)
{
	nStr += '';
	x = nStr.split('.');
	x1 = x[0];
	x2 = x.length > 1 ? '.' + x[1] : '';
	var rgx = /(\d+)(\d{3})/;
	while (rgx.test(x1)) {
		x1 = x1.replace(rgx, '$1' + ',' + '$2');
	}
	return x1 + x2;
}


//if(typeof(Sys) != 'undefined') Sys.Application.notifyScriptLoaded();
