/************************************************************/
function ChangeBackgroundImage(Id, Src){
    //Desc: Changes the background image for the object with the sent id
    
    //Check if any Id and Src was sent
    if(!(Id != null && Id != '' && Src != null && Src != ''))
        return;
    
    //Swap background image
    GetObjStyleRefById(Id).backgroundImage = 'url(' + Src + ')';
}//end ChangeBackgroundImage
/************************************************************/
function ChangeCSSClass(Id, ClassName){
    //Desc: Chages the classname for the control with the sent id.
    
    //Check args
    if((Id == '' || Id == null) || (ClassName == '' || ClassName == null))
        return;
        
    //Locals
    var obj = GetObjRefById(Id);
    
    if(obj == null)
        return;
    
    obj.className = ClassName;
}//end ChangeCSSClass
/************************************************************/
function ChangeColors(Id, BgColor, FgColor){
    //Desc: Changes color for the object with id x
    
    //Locals
    var tmpObj = GetObjStyleRefById(Id);
    
    tmpObj.backgroundColor = BgColor;
    tmpObj.color = FgColor;
}//end ChangeColors
/************************************************************/
function GetObjRefById(Id){
    //Desc: Returns object-reference, depending on browser
    
    //Check Id
    if(Id == '' || Id == null)
        return null;
    
    if(document.getElementById)//NS6+, IE6+
        return eval('document.getElementById(\'' + Id + '\')');
    else if(document.all)//IE4+
		return eval('document.all.' + Id);
	else if(document.layers)//NS4
		return eval('document.layers.' + Id);
}//end GetObjRefById
/************************************************************/
function GetObjStyleRefById(Id){
    //Desc: Returns object.style-reference, depending on browser
    
    //Check id
    if(Id == '' || Id == null)
        return null;
    
    if(document.getElementById)//NS6+, IE6+
        return eval('document.getElementById(\'' + Id + '\').style');
    else if(document.all)//IE4+
		return eval('document.all.' + Id + '.style');
	else if(document.layers)//NS4
		return eval('document.layers.' + Id);
}//end GetObjStyleRefById
/************************************************************/
function HideById(id)
{
    var ctrl = GetObjStyleRefById(id);
    
    if(ctrl)
    {
        ctrl.visibility = 'hidden';
        ctrl.display = 'none';
    }//end if
}//end HideById
/************************************************************/
function ShowById(id)
{
    var ctrl = GetObjStyleRefById(id);
    
    if(ctrl)
    {
        ctrl.visibility = '';
        ctrl.display = '';
    }//end if
}//end ShowById
/************************************************************/
function SwapImage(Id, Src){
    //Desc: Swaps the image for the object with id x
    
    //Locals
    var tmpObj = GetObjRefById(Id);
    
    if(tmpObj == null)
        return;
    
    tmpObj.src = Src;
}//end SwapImage
/************************************************************/
function ToggleVisibilityById(id)
{
    var ctrl = GetObjStyleRefById(id);
    
    if(ctrl.visibility != '' || ctrl.display != '')
    {
        ctrl.visibility = '';
        ctrl.display = '';
    }
    else
    {
        ctrl.visibility = 'hidden';
        ctrl.display = 'none';
    }//end if        
}//end ToggleVisibilityById
/************************************************************/