﻿function CheckUserName(){
	var Users_UserName = eval(window.document.getElementById("Users_UserName"));

	if (Users_UserName != null && Users_UserName.value != ""){
		var URL = "../Common/CheckUserName.asp?Users_UserName=" + Users_UserName.value;
		popUpWindow(URL, 200, 200, 200, 100);
	}
}

function GetFoo(Foo_Table, Foo_Id_Name, Foo_Name_Name){
	var Foo_Id = eval(window.document.getElementById(Foo_Id_Name));
	var Foo_Name = eval(window.document.getElementById(Foo_Name_Name));

	var URL = "../Common/XTreeSelect.asp?Foo_Table=" + Foo_Table;
	if (Foo_Id != null){
		URL = URL + "&SelectedTreeNode_Id=" + Foo_Id.value;
	}
	var EncodedURL = encodeURIComponent(URL);
	var vReturnValue = showModalDialog("ModalDialogBroker.asp?URL=" + EncodedURL, URL, "dialogWidth:800px;dialogHeight:600px;status:no;center:true");
	if (vReturnValue!="" && vReturnValue!=null){
		var aReturnValue = vReturnValue.split("_");
		if (Foo_Id != null){
			Foo_Id.value = aReturnValue[0];
		}
		if (Foo_Name != null){
			Foo_Name.value = aReturnValue[1];
		}
	}
}

function GetMultiFoo(Foo_Table, Foo_Id_Name, Foo_Name_Name){
	var Foo_Id = eval(window.document.getElementById(Foo_Id_Name));
	var Foo_Name = eval(window.document.getElementById(Foo_Name_Name));

	var URL = "../Common/XTreeMultiSelect.asp?Foo_Table=" + Foo_Table;
	if (Foo_Id != null){
		URL = URL + "&SelectedTreeNode_Id=" + Foo_Id.value;
	}
	var EncodedURL = encodeURIComponent(URL);
	var vReturnValue = showModalDialog("ModalDialogBroker.asp?URL=" + EncodedURL, URL, "dialogWidth:800px;dialogHeight:600px;status:no;center:true");
	if (vReturnValue!="" && vReturnValue!=null){
		var aReturnValue = vReturnValue.split("_");
		if (Foo_Id != null){
			Foo_Id.value = aReturnValue[0];
		}
		if (Foo_Name != null){
			Foo_Name.value = aReturnValue[1];
		}
	}
}

function GetFooExt(Foo_Table, ParentFoo_Id, Foo_Id_Name, Foo_Name_Name){
	var Foo_Id = eval(window.document.getElementById(Foo_Id_Name));
	var Foo_Name = eval(window.document.getElementById(Foo_Name_Name));

	var URL = "../Common/XTreeSelect.asp?Foo_Table=" + Foo_Table;
	if (Foo_Id != null){
		URL = URL + "&SelectedTreeNode_Id=" + Foo_Id.value;
	}
    URL = URL + "&ParentFoo_Id=" + ParentFoo_Id;
	var EncodedURL = encodeURIComponent(URL);
	var vReturnValue = showModalDialog("ModalDialogBroker.asp?URL=" + EncodedURL, URL, "dialogWidth:800px;dialogHeight:600px;status:no;center:true");
	if (vReturnValue!="" && vReturnValue!=null){
		var aReturnValue = vReturnValue.split("_");
		if (Foo_Id != null){
			Foo_Id.value = aReturnValue[0];
		}
		if (Foo_Name != null){
			Foo_Name.value = aReturnValue[1];
		}
	}
}

function GetMultiFooExt(Foo_Table, ParentFoo_Id, Foo_Id_Name, Foo_Name_Name){
	var Foo_Id = eval(window.document.getElementById(Foo_Id_Name));
	var Foo_Name = eval(window.document.getElementById(Foo_Name_Name));

	var URL = "../Common/XTreeMultiSelect.asp?Foo_Table=" + Foo_Table;
	if (Foo_Id != null){
		URL = URL + "&SelectedTreeNode_Id=" + Foo_Id.value;
	}
    URL = URL + "&ParentFoo_Id=" + ParentFoo_Id;
    alert(URL);
var EncodedURL = encodeURIComponent(URL);
	var vReturnValue = showModalDialog("ModalDialogBroker.asp?URL=" + EncodedURL, URL, "dialogWidth:800px;dialogHeight:600px;status:no;center:true");
	if (vReturnValue!="" && vReturnValue!=null){
		var aReturnValue = vReturnValue.split("_");
		if (Foo_Id != null){
			Foo_Id.value = aReturnValue[0];
		}
		if (Foo_Name != null){
			Foo_Name.value = aReturnValue[1];
		}
	}
}

function menuChange(obj,menu)
{
	if(menu.style.display=="")
	{
		//obj.background="images/admin_left/admin_title_bg_hide.gif";
		menu.style.display="none";
	}
	else
	{
		//obj.background="images/admin_left/admin_title_bg_show.gif";
		menu.style.display="";
	}
}

function changeXL(obj1, obj2)
{
    document.getElementById(obj1).style.display="";
    document.getElementById(obj2).style.display="none";
}
