
isNS4 = (document.layers) ? true : false;
isIE4 = (document.all && !document.getElementById) ? true : false;
isIE5 = (document.all && document.getElementById) ? true : false;
isNS6 = (!document.all && document.getElementById) ? true : false;	

function Move(StartRec)
{
	document.SearchForm.StartRec.value = StartRec;
	document.SearchForm.submit();
}

function HighLightMember(OldPos, NewPos)
{
	f0 = "no_" + OldPos;
	f1 = "surname_" + OldPos;
	f2 = "firstname_" + OldPos;
	f3 = "middlename_" + OldPos;
	f4 = "medals_" + OldPos;
	f5 = "year_" + OldPos;	
	document.getElementById(f0).style.backgroundColor="Gainsboro";
	document.getElementById(f1).style.backgroundColor="Gainsboro";
	document.getElementById(f2).style.backgroundColor="Gainsboro";
	document.getElementById(f3).style.backgroundColor="Gainsboro";
	document.getElementById(f4).style.backgroundColor="Gainsboro";
	document.getElementById(f5).style.backgroundColor="Gainsboro";
	
	f0 = "no_" + NewPos;
	f1 = "surname_" + NewPos;
	f2 = "firstname_" + NewPos;
	f3 = "middlename_" + NewPos;
	f4 = "medals_" + NewPos;
	f5 = "year_" + NewPos;
	document.getElementById(f0).style.backgroundColor="#f5deb3";
	document.getElementById(f1).style.backgroundColor="#f5deb3";
	document.getElementById(f2).style.backgroundColor="#f5deb3";
	document.getElementById(f3).style.backgroundColor="#f5deb3";
	document.getElementById(f4).style.backgroundColor="#f5deb3";
	document.getElementById(f5).style.backgroundColor="#f5deb3";
}

function HighLightMemberAll(OldPos, NewPos)
{
	f0 = "no_" + OldPos;
	f1 = "surname_" + OldPos;
	f2 = "firstname_" + OldPos;
	f3 = "middlename_" + OldPos;
	f4 = "medals_" + OldPos;
	f5 = "year_" + OldPos;	
	document.all(f0).style.backgroundColor="Gainsboro";
	document.all(f1).style.backgroundColor="Gainsboro";
	document.all(f2).style.backgroundColor="Gainsboro";
	document.all(f3).style.backgroundColor="Gainsboro";
	document.all(f4).style.backgroundColor="Gainsboro";
	document.all(f5).style.backgroundColor="Gainsboro";
	
	f0 = "no_" + NewPos;
	f1 = "surname_" + NewPos;
	f2 = "firstname_" + NewPos;
	f3 = "middlename_" + NewPos;
	f4 = "medals_" + NewPos;
	f5 = "year_" + NewPos;
	document.all(f0).style.backgroundColor="#f5deb3";
	document.all(f1).style.backgroundColor="#f5deb3";
	document.all(f2).style.backgroundColor="#f5deb3";
	document.all(f3).style.backgroundColor="#f5deb3";
	document.all(f4).style.backgroundColor="#f5deb3";
	document.all(f5).style.backgroundColor="#f5deb3";
}

function HighLightTradeMark(OldPos, NewPos)
{
	f0 = "no_" + OldPos;
	f1 = "title_" + OldPos;
	f2 = "desc_" + OldPos;
	document.getElementById(f0).style.backgroundColor="Gainsboro";
	document.getElementById(f1).style.backgroundColor="Gainsboro";
	document.getElementById(f2).style.backgroundColor="Gainsboro";
	
	f0 = "no_" + NewPos;
	f1 = "title_" + NewPos;
	f2 = "desc_" + NewPos;
	document.getElementById(f0).style.backgroundColor="#f5deb3";
	document.getElementById(f1).style.backgroundColor="#f5deb3";
	document.getElementById(f2).style.backgroundColor="#f5deb3";
}

function HighLightTradeMarkAll(OldPos, NewPos)
{
	f0 = "no_" + OldPos;
	f1 = "title_" + OldPos;
	f2 = "desc_" + OldPos;
	document.all(f0).style.backgroundColor="Gainsboro";
	document.all(f1).style.backgroundColor="Gainsboro";
	document.all(f2).style.backgroundColor="Gainsboro";
	
	f0 = "no_" + NewPos;
	f1 = "title_" + NewPos;
	f2 = "desc_" + NewPos;
	document.all(f0).style.backgroundColor="#f5deb3";
	document.all(f1).style.backgroundColor="#f5deb3";
	document.all(f2).style.backgroundColor="#f5deb3";
}

function HighLightProduct(OldPos, NewPos)
{
	f0 = "no_" + OldPos;
	f1 = "title_" + OldPos;
	f2 = "type_" + OldPos;
	document.getElementById(f0).style.backgroundColor="Gainsboro";
	document.getElementById(f1).style.backgroundColor="Gainsboro";
	document.getElementById(f2).style.backgroundColor="Gainsboro";
	
	f0 = "no_" + NewPos;
	f1 = "title_" + NewPos;
	f2 = "type_" + NewPos;
	document.getElementById(f0).style.backgroundColor="#f5deb3";
	document.getElementById(f1).style.backgroundColor="#f5deb3";
	document.getElementById(f2).style.backgroundColor="#f5deb3";
}

function HighLightProductAll(OldPos, NewPos)
{
	f0 = "no_" + OldPos;
	f1 = "title_" + OldPos;
	f2 = "type_" + OldPos;
	document.all(f0).style.backgroundColor="Gainsboro";
	document.all(f1).style.backgroundColor="Gainsboro";
	document.all(f2).style.backgroundColor="Gainsboro";
	
	f0 = "no_" + NewPos;
	f1 = "title_" + NewPos;
	f2 = "type_" + NewPos;
	document.all(f0).style.backgroundColor="#f5deb3";
	document.all(f1).style.backgroundColor="#f5deb3";
	document.all(f2).style.backgroundColor="#f5deb3";
}

function HighLightCompany(OldPos, NewPos)
{
	f0 = "no_" + OldPos;
	f1 = "coname_" + OldPos;
	f2 = "phone_" + OldPos;
	f3 = "fax_" + OldPos;
	f4 = "email_" + OldPos;
	document.getElementById(f0).style.backgroundColor="Gainsboro";
	document.getElementById(f1).style.backgroundColor="Gainsboro";
	document.getElementById(f2).style.backgroundColor="Gainsboro";
	document.getElementById(f3).style.backgroundColor="Gainsboro";
	document.getElementById(f4).style.backgroundColor="Gainsboro";
	
	f0 = "no_" + NewPos;
	f1 = "coname_" + NewPos;
	f2 = "phone_" + NewPos;
	f3 = "fax_" + NewPos;
	f4 = "email_" + NewPos;
	document.getElementById(f0).style.backgroundColor="#f5deb3";
	document.getElementById(f1).style.backgroundColor="#f5deb3";
	document.getElementById(f2).style.backgroundColor="#f5deb3";
	document.getElementById(f3).style.backgroundColor="#f5deb3";
	document.getElementById(f4).style.backgroundColor="#f5deb3";
}

function HighLightCompanyAll(OldPos, NewPos)
{
	f0 = "no_" + OldPos;
	f1 = "coname_" + OldPos;
	f2 = "phone_" + OldPos;
	f3 = "fax_" + OldPos;
	f4 = "email_" + OldPos;
	document.all(f0).style.backgroundColor="Gainsboro";
	document.all(f1).style.backgroundColor="Gainsboro";
	document.all(f2).style.backgroundColor="Gainsboro";
	document.all(f3).style.backgroundColor="Gainsboro";
	document.all(f4).style.backgroundColor="Gainsboro";
	
	f0 = "no_" + NewPos;
	f1 = "coname_" + NewPos;
	f2 = "phone_" + NewPos;
	f3 = "fax_" + NewPos;
	f4 = "email_" + NewPos;
	document.all(f0).style.backgroundColor="#f5deb3";
	document.all(f1).style.backgroundColor="#f5deb3";
	document.all(f2).style.backgroundColor="#f5deb3";
	document.all(f3).style.backgroundColor="#f5deb3";
	document.all(f4).style.backgroundColor="#f5deb3";
}

function SelectMember(pos)
{
	id = "CoInfo_" + pos;	
	for (var i = 0; i < document.MyForm.elements.length; i++) {
		if (document.MyForm.elements[i].name == id) {
			y = document.MyForm.elements[i];
		}
	}

	if (document.getElementById) //Netscape 6+, IE5+
	{
		x = document.getElementById("CoInfoDIV");
		x.innerHTML = y.value;
		HighLightMember(CurrPos,pos);		
	}	
	else if (document.all) //IE4
	{
		x = document.all["CoInfoDIV"];
		x.innerHTML = y.value;
		HighLightMemberAll(CurrPos,pos);		
	}
	else if (document.layers) //Netscape 4
	{			
		//x = document.layers["CoInfoLAYER"];
		//x.document.open();
		//x.document.write(y.value);
		//x.document.close();
		
		document.layers['CoInfoILAYER'].document.layers['CoInfoLAYER'].document.open();
		document.layers['CoInfoILAYER'].document.layers['CoInfoLAYER'].document.write(y.value);
		document.layers['CoInfoILAYER'].document.layers['CoInfoLAYER'].document.close();
	}
	
	CurrPos = pos;
}

function SelectTradeMark(pos)
{
	id = "CoInfo_" + pos;	
	for (var i = 0; i < document.MyForm.elements.length; i++) {
		if (document.MyForm.elements[i].name == id) {
			y = document.MyForm.elements[i];
		}
	}
	
	if (document.getElementById) //Netscape 6+, IE5+
	{
		x = document.getElementById("CoInfoDIV");
		x.innerHTML = y.value;
		HighLightTradeMark(CurrPos,pos);		

	}	
	else if (document.all) //IE4
	{
		x = document.all["CoInfoDIV"];
		x.innerHTML = y.value;
		HighLightTradeMarkAll(CurrPos,pos);		
	}
	else if (document.layers) //Netscape 4
	{			
		//x = document.layers["CoInfoLAYER"];
		//x.document.open();
		//x.document.write(y.value);
		//x.document.close();
		document.layers['CoInfoILAYER'].document.layers['CoInfoLAYER'].document.open();
		document.layers['CoInfoILAYER'].document.layers['CoInfoLAYER'].document.write(y.value);
		document.layers['CoInfoILAYER'].document.layers['CoInfoLAYER'].document.close();
	}
	
	CurrPos = pos;
}

function SelectProduct(pos)
{
	id = "CoInfo_" + pos;	
	for (var i = 0; i < document.MyForm.elements.length; i++) {
		if (document.MyForm.elements[i].name == id) {
			y = document.MyForm.elements[i];
		}
	}
	
	if (document.getElementById) //Netscape 6+, IE5+
	{
		x = document.getElementById("CoInfoDIV");
		x.innerHTML = y.value;
		HighLightProduct(CurrPos,pos);		

	}	
	else if (document.all) //IE4
	{
		x = document.all["CoInfoDIV"];
		x.innerHTML = y.value;
		HighLightProductAll(CurrPos,pos);		
	}
	else if (document.layers) //Netscape 4
	{			
		//x = document.layers["CoInfoLAYER"];
		//x.document.open();
		//x.document.write(y.value);
		//x.document.close();
		document.layers['CoInfoILAYER'].document.layers['CoInfoLAYER'].document.open();
		document.layers['CoInfoILAYER'].document.layers['CoInfoLAYER'].document.write(y.value);
		document.layers['CoInfoILAYER'].document.layers['CoInfoLAYER'].document.close();
	}
	
	CurrPos = pos;
}


function SelectCompany(pos)
{
	id = "MemInfo_" + pos;	
		
	for (var i = 0; i < document.MyForm.elements.length; i++) {
		if (document.MyForm.elements[i].name == id) {
			y = document.MyForm.elements[i];
			
		}
	}

	if (document.getElementById) //Netscape 6+, IE5+
	{
		x = document.getElementById("CoInfoDIV");
		x.innerHTML = y.value;
		HighLightCompany(CurrPos,pos);		
	}	
	else if (document.all) //IE4
	{
		x = document.all["CoInfoDIV"];
		x.innerHTML = y.value;
		HighLightCompanyAll(CurrPos,pos);		
	}
	else if (document.layers) //Netscape 4
	{			
		document.layers['CoInfoILAYER'].document.layers['CoInfoLAYER'].document.open();
		document.layers['CoInfoILAYER'].document.layers['CoInfoLAYER'].document.write(y.value);
		document.layers['CoInfoILAYER'].document.layers['CoInfoLAYER'].document.close();
	}
	
	CurrPos = pos;
}
