	
function SetImage(ImageName)
{
	ctlImage.value = ImageName;
}

function ShowTranslate(PagePath, CtrlName, cssPath, tid, FormName, MaxLength, Rows)    
{  
	ctl = MM_findObj(CtrlName);
	if (FormName == 'frmUnTranslatedText') 
		ctlForm = MM_findObj(FormName);
	ShowWindow(PagePath + '/Translate.aspx?tid=' + tid + '&sValue=' + ctl.value + '&cssPath=' + cssPath + '&FormName=' + FormName + '&MaxLength=' + MaxLength + '&Rows=' + Rows,450,350,true)
} 
    
function SetText(sValue, FormName)
{
	if (ctl!=null)
	{
	ctl.value = sValue;
		}
}

function ShowTranslator(PagePath, cssPath, tid)    
{  
	ShowWindow(PagePath + '/Translate.aspx?tid=' + tid + '&cssPath=' + cssPath + '&Trans=1',400,400,true)
} 

function ReturnTrans()
{
	document.forms(0).submit();
} 

function ShowOutfitClone(PagePath, cssPath, OutfitType, FormName, WID, OID, GID)    
{  
    ctlForm = MM_findObj(FormName);
	ShowWindow(PagePath + '/OutfitClone.aspx?OutfitType=' + OutfitType + '&cssPath=' + cssPath + '&FormName=' + FormName + '&WID=' + WID + '&OID=' + OID + '&GID=' + GID,400,400,true)
} 
function ShowHousingClone(PagePath, cssPath, HousingType, FormName, VID, BID, AID, RID)    
{  
    ctlForm = MM_findObj(FormName);
	ShowWindow(PagePath + '/HousingClone.aspx?HousingType=' + HousingType + '&cssPath=' + cssPath + '&FormName=' + FormName + '&VID=' + VID + '&BID=' + BID + '&AID=' + AID + '&RID=' + RID,400,400,true)
} 

function DrawActualTimeVenue(DRID, EEID, SID)    
{  
	ShowWindow2('schedule/QEDrawActualTimeVenue.aspx?DRID=' + DRID + '&EEID=' + EEID + '&SID=' + SID, 550, 170, false)
} 

function DrawResult(DRID, EEID, SID)    
{  
	ShowWindow2('schedule/QEDRNotes.aspx?DRID=' + DRID + '&EEID=' + EEID + '&SID=' + SID, 460, 200, false)
} 

function HorseGrade(HorseID, DisciplineID)    
{  
	ShowWindow2('HorseGrade.aspx?HorseID=' + HorseID + '&DisciplineID=' + DisciplineID, 400, 300, false)
} 

function RiderGrade(RiderID, DisciplineID)    
{  
	ShowWindow2('../Horse/RiderGrade.aspx?RiderID=' + RiderID + '&DisciplineID=' + DisciplineID, 300, 150, false)
} 

function HeartRate(ResultID, EventID, HorseID)    
{  
	ShowWindow2('Horse/QEHeartRate.aspx?ResultID=' + ResultID + '&EventID=' + EventID + '&HorseID=' + HorseID, 300, 300, false)
} 

function ProfileEdit(BodyID)    
{  
	ShowWindow2('../Admin/ProfileEdit.aspx?BodyID=' + BodyID, 800, 500, true)
} 

function GamesBlurbEdit(GamesID, TypeID)    
{  
	ShowWindow2('../Admin/BlurbEdit.aspx?BlurbID=' + GamesID + '&TypeID=' + TypeID , 800, 500, true)
} 

function SportBlurbEdit(SportID, TypeID)    
{  
	ShowWindow2('../Admin/BlurbEdit.aspx?BlurbID=' + SportID + '&TypeID=' + TypeID , 800, 500, true)
} 

function DisciplineBlurbEdit(DisciplineID, TypeID)    
{  
	ShowWindow2('../Admin/BlurbEdit.aspx?BlurbID=' + DisciplineID + '&TypeID=' + TypeID, 800, 500, true)
} 

function TeamMemberList(TeamID)    
{  
	ShowWindow('TeamMembersList.aspx?TeamID=' + TeamID, 460, 200, true)
} 

function SetTeamName()
{
	var Horse
	var Rider
	
	Horse = document.forms[0].txtFirstName.value + ' ' + document.forms[0].txtLastName.value;
	Rider = document.forms[0].txtFirstName2.value + ' ' + document.forms[0].txtLastName2.value;
	document.forms[0].Team.value = Trim(Horse) + '/' + Trim(Rider);
}

function Trim(s) 
{
// Remove leading spaces and carriage returns
	
while ((s.substring(0,1) == ' ') || (s.substring(0,1) == '\n') || (s.substring(0,1) == '\r'))
{
	s = s.substring(1,s.length);
}

// Remove trailing spaces and carriage returns

while ((s.substring(s.length-1,s.length) == ' ') || (s.substring(s.length-1,s.length) == '\n') || (s.substring(s.length-1,s.length) == '\r'))
{
	s = s.substring(0,s.length-1);
}
return s;
}

function CompSchedulePopup(url)    
{  
	var popupHeight=600
	var popupWidth=700
	ShowWindow(url,popupWidth,popupHeight,true)
} 
    
function GamesProfilePopup(url)    
{  
	var popupHeight=600
	var popupWidth=700
	ShowWindow(url,popupWidth,popupHeight,true)
} 
        
function GamesSearchPopup(url)    
{  
	var popupHeight=600
	var popupWidth=700
	ShowWindow(url,popupWidth,popupHeight,true)
} 
        
function SportProfilePopup(url)    
{  
	var popupHeight=600
	var popupWidth=700
	ShowWindow(url,popupWidth,popupHeight,true)
} 
        
function SportSearchPopup(url)    
{  
	var popupHeight=600
	var popupWidth=700
	ShowWindow(url,popupWidth,popupHeight,true)
} 
        


