function doLogin()
{	
	var username = document.getElementById('usernameTextBox').value;
	var password = document.getElementById('passwordTextBox').value;
	var iframe = document.getElementById('ss');
	var terms = document.getElementById('terms');
	var jumpX = -950;

	if (username == '' || username == 'username') { alert('Please enter a valid username'); return false; }
	if (password == '') { alert('Please enter a valid password'); return false; }

	var url = 'http://ws.harvestmedia.net/login.aspx';
	url += '?username=' + username;
	url += '&password=' + do_md5(password);
	url += '&acctid=' + document.getElementById('login_acctid').value;
	url += '&loginurl=http://www.repertoiremusic.com/invalid.html';
	//url += '&loginurl=' + this.location.href.replace(/\//g, '%2F');
	url += '&dt=' + new Date().getTime();
	
	iframe.contentWindow.location.href = url;
	terms.style.visibility = 'hidden';

	goLocation( jumpX*3, 0 );
}

function getContent(iframe)
{
	//var location = iframe.contentWindow.location.toString();
	//alert ('Iframe content = ' + location);
}

function goPwd()
{
	var iframe = document.getElementById('ss');
	var jumpX = -950;
	iframe.contentWindow.location.href = 'search/password.htm';
	goLocation( jumpX*3, 0 );
}

function goReg()
{
	var iframe = document.getElementById('ss');
	var jumpX = -950;
	iframe.contentWindow.location.href = 'search/register.htm';
	goLocation( jumpX*3, 0 );
}


function key_pressed(evt)
{
	
    var enterKeyPressed = (evt.charCode ? evt.charCode : evt.keyCode) == 13;
    if (enterKeyPressed)
    {
		doLogin();
	}	
}

