﻿

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";
            document.getElementById("hpRow" + i + "sep").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)
{
    document.getElementById('sideBarVideo').innerHTML = document.getElementById('sideBarVideoTemp').innerHTML;
}



    
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 addToFav(){
    var url = location.href;
    var title = document.title;

    if (window.sidebar) // firefox
        window.sidebar.addPanel(title, url, "");
    else if(window.opera && window.print){ // opera
        var elem = document.createElement('a');
        elem.setAttribute('href',url);
        elem.setAttribute('title',title);
        elem.setAttribute('rel','sidebar');
        elem.click();
    } 
    else if(document.all)// ie
        window.external.AddFavorite(url, title);
}

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;
}

function UpdateJackpot(value, tagid, amount)
{     
    s = tagid
    var m = amount*100;
    var v = value*100;
    var k;
    k = (v + m)/100;
    var j = k.toFixed(2);
    
    document.getElementById("Jackpot_" + s).innerHTML = addCommas(j);
    setTimeout('UpdateJackpot(' + k + ',' + s + ',' + amount + ')',1000);
}


function s(active_video, maxVideos)
{
  for(i=1;i<=maxVideos;i++)
  { 
    var str2 = "v" + i;
    if (i==active_video)
    {
       document.getElementById(str2).style.display = "block";
       document.getElementById("img_" + i).className = 'vidImgSelected';
    }
    else
    {
       document.getElementById(str2).style.display = "none";
       document.getElementById("img_" + i).className = 'vidImg';
       document.getElementById("img_" + i).style.border='4px solid #f5a248';
    }
  }
  //PageMethods.GetContent1(str,t);
}

function t(result)
{
   document.getElementById('VidDisplay').innerHTML = result;
}

//if(typeof(Sys) != 'undefined') Sys.Application.notifyScriptLoaded();