window.onload = function() {
	ClearLogin();
	
	

	var loginInput = document.getElementById('loginUsername');
	if (loginInput == null)
		return;
	if( loginInput.addEventListener ) 
	{
	  loginInput.addEventListener('focus',UserClearBG,false);
	} 
	else if( loginInput.attachEvent ) 
	{
	  loginInput.attachEvent('onfocus',UserClearBG);
	}
	
	var loginInput = document.getElementById('loginPass');
	if( loginInput.addEventListener ) 
	{
	  loginInput.addEventListener('focus',PasswordClearBG,false);
	} 
	else if( loginInput.attachEvent ) 
	{
	  loginInput.attachEvent('onfocus',PasswordClearBG);
	}
};


function UserClearBG()
{
	document.getElementById('loginUsername').style.background = '#ffffff' ;	
}

function PasswordClearBG()
{
	document.getElementById('loginPass').style.background = '#ffffff' ;	
}

function ClearLogin()
{
	if (document.getElementById('loginUsername') != null)
		document.getElementById('loginUsername').value = '' ;	
	if (document.getElementById('loginPass') != null)
		document.getElementById('loginPass').value = '' ;	
}

function ClearEnews()
{
	document.getElementById('enewsInput').value = '' ;	
}


/*************************************************************************/
http = getHTTPObject();

function getNewSportTab(oem,tabName)
{
	tabIdToUpdate = tabName + "Content";
	sportNewTitleDiv = tabName + "_Sport_hidden";	//hidden div that holds the sport name passed back through ajax
	sportTitleDiv = tabName + "_Sport";	//div that holds the title/sport name of each tab
	var url = "/Tabs/ajax.dbml?DB_OEM_ID=18400&SPID=" + oem + "&section=" + tabName;

 
	http.open("GET", url, true);
	http.onreadystatechange = handleHttpResponse;
	
	http.send(null);
}
 
function getHTTPObject()
{
  var xmlhttp;
 
  /*@cc_on
 
  @if (@_jscript_version >= 5)
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    }catch(e){
      try{
      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }catch(E){
      xmlhttp = false;
    }
  }
  @else
    xmlhttp = false;
  @end @*/
 
  if(!xmlhttp && typeof XMLHttpRequest != 'undefined'){
    try {
      xmlhttp = new XMLHttpRequest();
    }catch(e){
      xmlhttp = false;
    }
  }
 
  return xmlhttp;
}
 
function handleHttpResponse()
{
	if(http.readyState == 4)
	{
		//alert(tabIdToUpdate);
    	document.getElementById(tabIdToUpdate).innerHTML = http.responseText;
    	changeSportTitle();
	}
}

//This function changes the title of each tab section
function changeSportTitle()
{
	document.getElementById(sportTitleDiv).innerHTML = document.getElementById(sportNewTitleDiv).innerHTML;
}




