//Added for declaring variables

var g_ActiveCommandLink = null;
var g_CommandLinkDefault = null;


//RunOnce3 Added here
var g_HasRequiredSetting = false;
var g_HasOptionalSetting = false;
var g_TempCommandLink = null;
var g_LoadInit = true;
var iFlag = 0;

//Language dropdown starts here
function SetLangDropdown()
{
    if (document.Form1.rblLocation_1.checked == true)
    {
		document.Form1.selLocale.disabled=false;
    }
    else
    {
		document.Form1.selLocale.disabled=true;
	}
}
//Language dropdown ends here
function DDClick()
{		
	document.Form1.rblLocation_1.checked = true;
}
//for choose save you settings
function choosesavebuttonover()
{   
    document.getElementById("SaveBtnSpan").style.color ="#cf0";
    document.getElementById("SaveBtnSpanPage").style.color ="#cf0";
}
function choosesavebuttonout()
{
	document.getElementById("SaveBtnSpan").style.color ="#fff";
	document.getElementById("SaveBtnSpanPage").style.color ="#fff";
}
//Save your settings
function ShowSuccessScreen()
{
	document.getElementById("requiredSettings").style.display = "none";
	document.getElementById("SaveButtonInput").style.display = "none";
	document.getElementById("SaveBtnSpan").style.display = "none";
	document.getElementById("SettingsContent").style.display = "none";
	document.getElementById("SettingsHeaderContentid").style.display = "none";
	document.getElementById('welcomebackid').style.display = "none";
	document.getElementById('welcomebackContent').style.display = "none"; 
	document.getElementById("HeaderContent").style.display = "none";
	document.getElementById('SettingsContentid').style.display = "none";  
	document.getElementById('SettingContent').style.display = "none"; 
	document.getElementById('FiveimgSettings').style.display = "none"; 
	document.getElementById("subheadercnt").style.display = "block";
	document.getElementById("SuccessHeaderContentid").style.display = "block";
	document.getElementById("successimg").style.display = "block";
	window.scrollTo(0,0);
}
function ShowErrorScreen()
{	
    document.getElementById("errorpageheading").style.display = "block";
    document.getElementById("SuccessHeaderContentid").style.display = "none";
}
// load function
var g_DisplayObject = {
    searchProvider: {
        setting: 'searchProviderSetting'
    },
    phishingFilter:
    {
        setting: 'phishingdvhd'
    },
    clearType:
    {
        setting: 'cleartypeSetting'
    },
    location:
    {
        setting: 'locationSetting'
    },  
    improvement:
    {
       setting: 'improvementSetting'
    }      
};
// function for welcome back page
function NavigateHP()
{
	oHomePage.navigateHomePage();
}
function ShowSetting( setting )
{
    var obj = g_DisplayObject[ setting ];
    document.getElementById( obj.setting ).style.display = "block";
}
function ShowClearTypeWarning()
{
    var ref = document.getElementById('chkCleartype');
    if (ref.checked)
    {		
        document.getElementById('clearTypeWarning').style.visibility = "hidden";
    }
    else
    {		
        document.getElementById( 'clearTypeWarning' ).style.visibility = "visible";
    }
}
//IsVista()
function IsVista()
{
    if ( navigator.userAgent.indexOf( "Windows NT 6" ) != -1 )
    {
        return true;
    }
    else
    {
        return false; 
    }
}

function DefaultLangClick()
{
	//document.Form1.rblLocation[0].checked = true;
}
function skip()
{
	window.external.SkipRunOnce();
	NavigateHP();              
}
//for navigating urls
function PressCommandLink(commandLink, command)
{
    RestoreCommandLink(commandLink);
    g_ActiveCommandLink = commandLink;
    
    g_ActiveCommandLink.className = "commandLinkPressed";
    
    var f = eval( command );
    
    setTimeout( f, 100 ); // mini lag to show pressed state
    
    g_TempCommandLink = commandLink;
    setTimeout( "RestoreCommandLink()", 500 );
}

function RestoreCommandLink(commandLink)
{
    if ( !commandLink )
    {
        g_ActiveCommandLink = g_TempCommandLink;
    }
    if ( g_ActiveCommandLink )
    {
        if ( g_CommandLinkDefault == g_ActiveCommandLink )
        {
            g_ActiveCommandLink.className = "commandLinkDefault";
        }
        else
        {
            g_ActiveCommandLink.className = "commandLink";
        }
    }
}

//Final Success page Navigation URL's is in RunOnce4.aspx page
function keycode()
{
      var key = window.event.keyCode;
       if(key==32 || key==13)
      {
        return true;
      }
    
}
function savebuttonenter()
{
       var key=keycode()
      if(keycode)
      {
        SaveSettings();
      }         
}


