function SF_Ctrl(ctrl_name)
{
 return document.getElementById(ctrl_name);
}

function SF_Value(ctrl_name)
{
 return document.getElementById(ctrl_name).value;
}


function SF_SetBGColor(ctrl_id, color_id)
{
 SF_Ctrl(ctrl_id).style.backGroundColor=color_id;
}

function SF_SetAlpha(ctrl_id, alpha)
{
 SF_Ctrl(ctrl_id).style.filters = 'alpha(opacity=' + alpha.toString() + ')';
 SF_Ctrl(ctrl_id).style.MozOpacity = alpha / 100;
}

function SF_SetVisible(ctrl_id, visible)
{
 var vis_str = (visible)?'visible':'hidden';
 SF_Ctrl(ctrl_id).style.visibility = vis_str;
}

function SF_SetEnabled(ctrl_id, enabled)
{
 var is_disabled = (enabled)?false:true;
 SF_Ctrl(ctrl_id).disabled = is_disabled;
}

function SetPos(ctrl_id, x, y)
{
 SF_Ctrl(ctrl_id).style.top= y.toString() + 'px';
 SF_Ctrl(ctrl_id).style.left= x.toString() + 'px';
}

function SF_SetX(ctrl_id, x)
{

 SF_Ctrl(ctrl_id).style.left= x.toString() + 'px';
}

function SF_SetY(ctrl_id, y)
{
 SF_Ctrl(ctrl_id).style.top= y.toString() + 'px';

}

function SF_SetWidth(ctrl_id, width)
{
 SF_Ctrl(ctrl_id).style.width= width.toString() + 'px';
}

function SF_SetHeight(ctrl_id, height)
{
 SF_Ctrl(ctrl_id).style.width= height.toString() + 'px';
}

function SF_Scale(ctrl_id, scale_factor)
{
 var divisor = 100 /  scale_factor;
 SF_Ctrl(ctrl_id).style.width= (parseInt(SF_Ctrl(ctrl_id).style.width.toString()) / divisor) + 'px';
 SF_Ctrl(ctrl_id).style.height= (parseInt(SF_Ctrl(ctrl_id).style.height.toString()) / divisor) + 'px';
}

function SF_OpenDialogWindow(url, width, height)
{
 return window.open(url, "", "width=" + width.toString() + ", height=" + height.toString() + ", location=no, toolbar=no,titlebar=no, scrollbars=no, resizable=no, status=no, menubar=no");
}

function SF_OpenScrollDialogWindow(url, width, height)
{
 return window.open(url, "", "width=" + width.toString() + ", height=" + height.toString() + ", location=no, toolbar=no,titlebar=no, scrollbars=yes, resizable=no, status=no, menubar=no");
}

function SF_OpenFullScreenWindow(url)
{
 return window.open(url, "", "fullscreen=yes, location=no, toolbar=no,titlebar=no, scrollbars=no, resizable=no, status=no, menubar=no");
}

function SF_GetParentCtrl(ctrlid)
{
 return opener.document.getElementById(ctrlid);
}


function SF_ClearComboBox(ctrlid)
{
 SF_Ctrl(ctrlid).options = new Array(); // NOT TESTED
}

function SF_AddToCombo(ctrlid, label, value)
{
 
}



