﻿// JScript File

function ToggleList(div_in, img_in)
{
	var div = document.getElementById(div_in);
	$(div).toggle('fast');
	
	var img = document.getElementById(img_in);

	if(img.src.indexOf("images/collapsed_toggleExpand.gif") > 0)
	{
		img.src = "images/toggle_expand.gif";
	}
	else
	{
		img.src = "images/collapsed_toggleExpand.gif";
	}
}

function ExpandCollapseList(div_in, img_in)
{
	var div = document.getElementById(div_in);
	$(div).toggle('fast');
	
	var img = document.getElementById(img_in);

	if(img.src.indexOf("images/topItem_col.gif") > 0)
	{
		img.src = "images/topItem_exp.gif";
	}
	else
	{
		img.src = "images/collapsed_toggleExpand.gif";
	}
}

/*Lookup properties and functions*/
var lookups_Val_Control = "";
var lookups_Text_Control = "";
var lookups_Type_Control = "";
var lookups_Close_Function;


function ProcessLookupSelection(val,text)
{
	var val_ctrl = document.getElementById(lookups_Val_Control);
	val_ctrl.value = val;
	var text_ctrl = document.getElementById(lookups_Text_Control);
	text_ctrl.value = text;
	lookups_Close_Function();

}

function OpenLookup(fnc_ref, val_ctrl, text_ctrl,cls_fnc_ref)
{
	lookups_Val_Control = val_ctrl;
	lookups_Text_Control = text_ctrl;
	lookups_Close_Function = cls_fnc_ref;
	fnc_ref();
}

function OpenUserLookup(fnc_ref, val_ctrl, text_ctrl,type_ctrl,cls_fnc_ref)
{
	lookups_Val_Control = val_ctrl;
	lookups_Text_Control = text_ctrl;
	lookups_Type_Control = type_ctrl;
	lookups_Close_Function = cls_fnc_ref;
	fnc_ref();
}
