function selectField(field)
{
	var f = field;
	f.focus();
	f.select();
}

function showStates(country_selector, state_field_prefix)
{
	var country = $('select#' + country_selector).val();
	$('#' + state_field_prefix + 'us').hide();
	$('#' + state_field_prefix + 'ca').hide();
	$('#' + state_field_prefix + 'intl').hide();
    if (country == 'US')
    {
        $('#' + state_field_prefix + 'us').show();
    }
    else if (country == 'CA')
    {
		$('#' + state_field_prefix + 'ca').show();
    }
    else
    {
        $('#' + state_field_prefix + 'intl').show();
    }
}


//for readiness test
function test_js()
{
    this.document.getElementById('test_js').className = 'passed';
    this.document.getElementById('test_js').innerHTML = 'Enabled';
}

function test_display()
{
    result = this.document.getElementById('test_display');
    x = screen.width;
    y = screen.height;
    if (x > 800 && y > 600)
    {
        result.className = 'passed';
    }
    else
    {
        result.className = 'failed';
    }
    result.innerHTML = x + 'x' + y;
}

function test_wmp()
{
    result = this.document.getElementById('test_wmp');
    if (typeof(Player) != 'undefined')
    {
        result.innerHTML = 'Installed';
        result.className = 'passed';
    }
    else if (typeof(Player2) != 'undefined')
    {
        result.innerHTML = 'Installed';
        result.className = 'passed';
    }
    else
    {
        result.innerHTML = 'Not Installed';
        result.className = 'failed';
    }
}
//for readiness test

function showMediaPanel(url)
{
    window.open(url, 'MediaPanel', 'location=no,menubar=no,resizable=yes,titlebar=no,toolbar=no,status=no');
}