var g_Setup = window.external;

function ShowHideTVSystemList(obj) 
{
	var Items, strComma = ",";	
	var Setup = window.external;
	var LeftIndex = 0;	
	for (var x = 0; x < obj.length; x++)
	{			
		Items = obj[x].split(strComma);
		if (Setup.GetProperty(Items[0]) == "0")
			document.getElementById(Items[1]).style.display = "none";				
		else
		{				
			document.getElementById(Items[1]).style.left = LeftIndex+"px";
			LeftIndex += 350;		
		}
	}	
}

function ShowHideDBJPath(obj) 
{
	var Items, strComma = ",";	
	var Setup = window.external;
	var TopIndex = 70;	
	for (var x = 0; x < obj.length; x++)
	{		
		Items = obj[x].split(strComma);
		if (Setup.GetProperty(Items[0]) == "0")
			document.getElementById(Items[1]).style.display = "none";
		else
		{		
			document.getElementById(Items[1]).style.top = TopIndex+"px";			
			TopIndex += 70;
		}	
	}		
}

function ShowHideBDRegionInfo(obj) 
{
	var Items, strComma = ",";	
	var Setup = window.external;
	var TopIndex = 100;	
	for (var x = 0; x < obj.length; x++)
	{		
		Items = obj[x].split(strComma);
		if (Setup.GetProperty(Items[0]) == "0")
			document.getElementById(Items[1]).style.display = "none";
		else
		{		
			document.getElementById(Items[1]).style.top = TopIndex+"px";			
			TopIndex += 70;
		}	
	}		
}

function ShowHideControls(obj) 
{
	var Items, strComma = ",";	
	var Setup = window.external;
	var TopIndex = 39;
	
	for (var x = 0; x < obj.length; x++)
	{
		Items = obj[x].split(strComma);
		if (Setup.GetProperty(Items[0]) == "0")
			document.getElementById(Items[1]).style.display = "none";
		else
		{
			document.getElementById(Items[1]).style.top = TopIndex+"px";
			TopIndex += 67;
		}	
	}
}

function GoToDialog()
{
	var g_Setup = window.external;
	var currentPage = window.location.href;
   
	currentPage = currentPage.substring(currentPage.lastIndexOf("/")+1,currentPage.length); 	
	
	if ("false" == g_Setup.GetProperty("SHOWSERIALDIALOG"))
	{
		if (currentPage == "License.htm")		
			window.location = "Settings.htm";
		else
			window.location = "License.htm";
	}
	else
	{
		window.location = "SN.htm";
	}
	return true;
} //function GoToDialog()

function IPM_Replacement()
{
	// replace PRODUCTREGKEY
	g_Setup.SetProperty("PRODUCTREGKEY", g_Setup.GetProperty("PLUS_PRODUCTREGKEY"));
	// replace INSTALL_TYPE
	g_Setup.SetProperty("INSTALL_TYPE", g_Setup.GetProperty("PLUS_INSTALL_TYPE"));
	// replace LICENSEID
	g_Setup.SetProperty("LICENSEID", g_Setup.GetProperty("PLUS_LICENSEID"));
	// replace PCU_LICID
	g_Setup.SetProperty("PCU_LICID", g_Setup.GetProperty("PLUS_PCU_LICID"));
	// replace PCUSOURCEID
	g_Setup.SetProperty("PCUSOURCEID", g_Setup.GetProperty("PLUS_PCUSOURCEID"));
	// replace DTAFILENAME
	g_Setup.SetProperty("DTAFILENAME", g_Setup.GetProperty("PLUS_DTAFILENAME"));
	// replace PIDPREFIX
	g_Setup.SetProperty("PIDPREFIX", g_Setup.GetProperty("PLUS_PIDPREFIX"));
	// replace NLRFILE
	g_Setup.SetProperty("NLRFILE", g_Setup.GetProperty("SETUP.EXE.DIR") + g_Setup.GetProperty("PLUS_NLRFILE"));
	// replace Product
	g_Setup.SetProperty("PRODUCT", g_Setup.GetProperty("PLUS_PRODUCT"));
}
function ShowHideInstallNowAndNext()
{
	var showToolbar = g_Setup.GetProperty("ShowGoogleToolbarPage")
	var showChrome = g_Setup.GetProperty("ShowGoogleChromePage")
	if (showToolbar!="1" && showChrome!="1")
	{
		idInstallNow.style.display="block";
		idNext1.style.display="none";
		idNext2.style.display="none";
	}
	else if (showToolbar=="1")
	{
		idInstallNow.style.display="none";
		idNext1.style.display="block";
		idNext2.style.display="none";
	}
	else if (showChrome=="1")
	{
		idInstallNow.style.display="none";
		idNext1.style.display="none";
		idNext2.style.display="block";
	}
}
