function txtInput_OnFocus(event, elementId){
	var txtObj = document.getElementById(elementId);
	if(txtObj.value == txtObj.getAttribute("defaultvalue")){
		txtObj.className = "objInitialInput txtInput";
		txtObj.value = "";
	}
}

function txtInput_OnBlur(event, elementId){
	
	var txtObj = document.getElementById(elementId);
	if(txtObj.value == ""){
		txtObj.className = "objInitialInput txtInputDefault";
		txtObj.value = txtObj.getAttribute("defaultvalue");
	}
}

function txtExecName_OnClick(event){
	var txtObj = document.getElementById("txtExecCompany");
	txtObj.disabled = "disabled";
	txtObj.value = "";
	
	txtObj = document.getElementById("lblExecCompany");
	txtObj.className = "Grayout";
	
	txtObj = document.getElementById("txtExecName");
	txtObj.className = "txtInput";
	txtObj.value = "";
	
	txtObj = document.getElementById("sel_ExecCompany_0");
	txtObj.className = "clickable_text_inactive";

	txtObj = document.getElementById("sel_ExecCompany_1");
	txtObj.className = "clickable_text_inactive";
	
	txtObj = document.getElementById("txtExecCompany");
	txtObj.disabled = "disabled";
	txtObj.value = "";
	
	txtObj = document.getElementById("lblExecCompany");
	txtObj.className = "Grayout";
	
	document.mainform.istickersymbol.value = 0;
	document.getElementById("rdbSearchCat_0").checked = true;
	document.getElementById("rdbSearchCat_1").checked = false;
}

function txtExecCompany_OnClick(event){

	var txtObj = document.getElementById("txtExecName");
	txtObj.disabled = "disabled";
	txtObj.value = "";
	
	txtObj = document.getElementById("lblExecName");
	txtObj.className = "Grayout";
	
	txtObj = document.getElementById("txtExecCompany");
	txtObj.className = "txtInput";
	txtObj.value = "";
	
	document.getElementById("rdbSearchCat_1").checked = true;
	document.getElementById("rdbSearchCat_0").checked = false;
}

function selectSearchCat(event, elementId)
{
	var txtObj;

	if (elementId == "rdbSearchCat_0")
	{
		txtObj = document.getElementById("lblExecName");
		txtObj.className = "";
		
		txtObj = document.getElementById("txtExecName");
		txtObj.disabled = "";
	
		txtObj = document.getElementById("txtExecCompany");
		txtObj.disabled = "disabled";
		txtObj.value = "";
		
		txtObj = document.getElementById("lblExecCompany");
		txtObj.className = "Grayout";
		
		txtObj = document.getElementById("sel_ExecCompany_0");
		txtObj.className = "clickable_text_inactive";

		txtObj = document.getElementById("sel_ExecCompany_1");
		txtObj.className = "clickable_text_inactive";
		document.mainform.istickersymbol.value = 0;
	}
	else
	{
		txtObj = document.getElementById("lblExecCompany");
		txtObj.className = "";
		
		txtObj = document.getElementById("txtExecCompany");
		txtObj.disabled = "";
		
		txtObj = document.getElementById("txtExecName");
		txtObj.disabled = "disabled";
		txtObj.value = "";
		
		txtObj = document.getElementById("lblExecName");
		txtObj.className = "Grayout";
		
		txtObj = document.getElementById("sel_ExecCompany_0");
		txtObj.className = "clickable_text_active";

		txtObj = document.getElementById("sel_ExecCompany_1");
		txtObj.className = "clickable_text";	
		document.mainform.istickersymbol.value = 0;
	}
	
}

function clickNameOrTicker(event, IsSelectTicker)
{

	var txtObj;
	if (IsSelectTicker == 1)
	{
		document.mainform.istickersymbol.value = 1;
		txtObj = document.getElementById("sel_ExecCompany_0");
		txtObj.className = "clickable_text";

		txtObj = document.getElementById("sel_ExecCompany_1");
		txtObj.className = "clickable_text_active";
		
		txtObj = document.getElementById("txtExecCompany");
		txtObj.disabled = "";
		txtObj.value = "ie: MSFT";
		txtObj.className = "txtInputDefault";
		
	}
	else
	{
		document.mainform.istickersymbol.value = 0;
		txtObj = document.getElementById("sel_ExecCompany_0");
		txtObj.className = "clickable_text_active";

		txtObj = document.getElementById("sel_ExecCompany_1");
		txtObj.className = "clickable_text";
		
		txtObj = document.getElementById("txtExecCompany");
		txtObj.disabled = "";
		txtObj.value = "ie: Microsoft";
		txtObj.className = "txtInputDefault";
	}
	
	document.getElementById("rdbSearchCat_1").checked = true;
	document.getElementById("rdbSearchCat_0").checked = false;
	txtObj = document.getElementById("lblExecCompany");
	txtObj.className = "";
	
	
	txtObj = document.getElementById("txtExecName");
	txtObj.disabled = "disabled";
	txtObj.value = "";
	
	txtObj = document.getElementById("lblExecName");
	txtObj.className = "Grayout";
}

function detailDisplay(iCount)
{
	if (document.getElementById("DefDetail_" + iCount).style.display == "none")
	{
		document.getElementById("DefDetail_" + iCount).style.display = "inline";
		document.getElementById("DefinitionImage_" + iCount).src = "/execcomp/graphics/minus_contract.jpg";
		document.getElementById("defItem_" + iCount).className = "clickable_def_txt_expand";
	}
	else
	{
		document.getElementById("DefDetail_" + iCount).style.display = "none";
		document.getElementById("DefinitionImage_" + iCount).src = "/execcomp/graphics/plus_expand.jpg";
		document.getElementById("defItem_" + iCount).className = "clickable_def_txt";
	}
}

function clickDef(event, iCount)
{
	if (document.getElementById("defItem_" + iCount).className == "clickable_def_txt")
	{
		document.getElementById("defItem_" + iCount).className = "clickable_def_txt_expand";
		document.getElementById("DefDetail_" + iCount).style.display = "inline";
		document.getElementById("DefinitionImage_" + iCount).src = "/execcomp/graphics/minus_contract.jpg";
	}
	else
	{
		document.getElementById("defItem_" + iCount).className = "clickable_def_txt";
		document.getElementById("DefDetail_" + iCount).style.display = "none";
		document.getElementById("DefinitionImage_" + iCount).src = "/execcomp/graphics/plus_expand.jpg";
	}
}


function searchExecInfo()
{
	var strExecNameKeyword = "";
	var strCompanyKeyword = "";
	var bIsTickerSymbol = 0;
	var txtObj;
	
	strExecNameKeyword = trim(document.mainform.txtExecName.value);
	strCompanyKeyword = trim(document.mainform.txtExecCompany.value);
	if (strExecNameKeyword == "ie: Steven A. Ballmer")
		strExecNameKeyword = "Steven A. Ballmer";
	
	if (strCompanyKeyword == "ie: Microsoft")
		strCompanyKeyword = "Microsoft";
	else if (strCompanyKeyword == "ie: MSFT")
		strCompanyKeyword = "MSFT";
		
	if(strExecNameKeyword == ""  && strCompanyKeyword == "")
	{
		alert("Please enter an Executive Name, Company Name or Ticker Symbol to search.");
		document.mainform.txtExecName.focus();
		return false;
	}

	document.mainform.txtExecName.value = strExecNameKeyword;
	document.mainform.txtExecCompany.value = strCompanyKeyword;

	return true;
}

function salGetHostName (strLocation){
    if (strLocation == "")	
		return "";
	if (strLocation.indexOf('://')>0)
		strLocation = strLocation.substring(strLocation.indexOf('://')+3, strLocation.length+1);
    
    var iSlashIdx = 0;
    var strValue = "";

    if (strLocation.indexOf('/')>0)
    {    
		iSlashIdx = strLocation.indexOf('/');
	
		strValue = strLocation.substring(0, iSlashIdx);
		//alert(strLocation + " " + strValue + " " + iSlashIdx);
	}   
    return strValue;
    	
}
