﻿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 CheckEngUserName(){
	var Users_UserName = eval(window.document.getElementById("Users_UserName"));

	if (Users_UserName != null && Users_UserName.value != ""){
		var URL = "../Common/CheckEngUserName.asp?Users_UserName=" + Users_UserName.value;
		popUpWindow(URL, 200, 200, 200, 100);
	}
}

function CheckIntroducedUserName(){
	var Users_UserIntroducedUserName = eval(window.document.getElementById("Users_UserIntroducedUserName"));

	if (Users_UserIntroducedUserName != null && Users_UserIntroducedUserName.value != ""){
		var URL = "../Common/CheckIntroducedUserName.asp?Users_UserName=" + Users_UserIntroducedUserName.value;
		popUpWindow(URL, 200, 200, 200, 100);
	}
}
function CheckEngIntroducedUserName(){
	var Users_UserIntroducedUserName = eval(window.document.getElementById("Users_UserIntroducedUserName"));

	if (Users_UserIntroducedUserName != null && Users_UserIntroducedUserName.value != ""){
		var URL = "../Common/CheckEngIntroducedUserName.asp?Users_UserName=" + Users_UserIntroducedUserName.value;
		popUpWindow(URL, 200, 200, 200, 100);
	}
}
function KnowledgeCheckTile(){
	var Knowledge_Title = eval(window.document.getElementById("Knowledge_Title"));
	var Knowledge_Column = eval(window.document.getElementById("Knowledge_Column"));

	if (Knowledge_Title != null && Knowledge_Title.value != "" && Knowledge_Column != null && Knowledge_Column.value != ""){
		var URL = "../Admin/KnowledgeCheckTile.asp?Knowledge_Title=" + Knowledge_Title.value + "&Knowledge_Column=" + Knowledge_Column.value;
		popUpWindow(URL, 200, 200, 200, 100);
	}
}

function GetRegion(Region_Id_Name, Region_Name_Name, XLanguage){
	var Region_Id = eval(window.document.getElementById(Region_Id_Name));
	var Region_Name = eval(window.document.getElementById(Region_Name_Name));

	var URL = "../Common/XTreeSelect.asp?Foo=1&Foo_Table=Region";
	if (XLanguage == "Eng"){
		URL = "../Common/EngXTreeSelect.asp?Foo=1&Foo_Table=Region";
	}
	if (Region_Id != null){
		URL = URL + "&Region_Id=" + Region_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 (Region_Id != null){
			Region_Id.value = aReturnValue[0];
		}
		if (Region_Name != null){
			Region_Name.value = aReturnValue[1];
		}
	}
}

function GetSettlementTerms(SettlementTerms_Id_Name, SettlementTerms_Name_Name, XLanguage){
	var SettlementTerms_Id = eval(window.document.getElementById(SettlementTerms_Id_Name));
	var SettlementTerms_Name = eval(window.document.getElementById(SettlementTerms_Name_Name));

	var URL = "SettlementTermsSelect.asp?Foo=1";
	if (XLanguage == "Eng"){
		URL = "SettlementTermsSelect.asp?Foo=1";
	}
	if (SettlementTerms_Id != null){
		URL = URL + "&SettlementTerms_Id=" + SettlementTerms_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 (SettlementTerms_Id != null){
			SettlementTerms_Id.value = aReturnValue[0];
		}
		if (SettlementTerms_Name != null){
			SettlementTerms_Name.value = aReturnValue[1];
		}
	}
}

function GetIndustryType(IndustryType_Id_Name, IndustryType_Name_Name, XLanguage){
	var IndustryType_Id = eval(window.document.getElementById(IndustryType_Id_Name));
	var IndustryType_Name = eval(window.document.getElementById(IndustryType_Name_Name));

	var URL = "../Common/XTreeSelect.asp?Foo=1&Foo_Table=IndustryType";
	if (XLanguage == "Eng"){
		URL = "../Common/EngXTreeSelect.asp?Foo=1&Foo_Table=IndustryType";
	}
	if (IndustryType_Id != null){
		URL = URL + "&IndustryType_Id=" + IndustryType_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 (IndustryType_Id != null){
			IndustryType_Id.value = aReturnValue[0];
		}
		if (IndustryType_Name != null){
			IndustryType_Name.value = aReturnValue[1];
		}
	}
}

function GetVocation(Vocation_Id_Name, Vocation_Name_Name, XLanguage){
	var Vocation_Id = eval(window.document.getElementById(Vocation_Id_Name));
	var Vocation_Name = eval(window.document.getElementById(Vocation_Name_Name));

	var URL = "../Common/XTreeSelect.asp?Foo=1&Foo_Table=Vocation";
	if (XLanguage == "Eng"){
		URL = "../Common/EngXTreeSelect.asp?Foo=1&Foo_Table=Vocation";
	}
	if (Vocation_Id != null){
		URL = URL + "&Vocation_Id=" + Vocation_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 (Vocation_Id != null){
			Vocation_Id.value = aReturnValue[0];
		}
		if (Vocation_Name != null){
			Vocation_Name.value = aReturnValue[1];
		}
	}
}

function GetUserTypeExt(UserType_Id_Name, UserType_Name_Name, XLanguage){
	var UserType_Id = eval(window.document.getElementById(UserType_Id_Name));
	var UserType_Name = eval(window.document.getElementById(UserType_Name_Name));

	var URL = "../Common/XTreeSelect2nd.asp?Foo=1&Foo_Table=UserType";
	if (XLanguage == "Eng"){
		URL = "../Common/EngXTreeSelect.asp?Foo=1&Foo_Table=UserType";
	}
	if (UserType_Id != null){
		URL = URL + "&UserType_Id=" + UserType_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 (UserType_Id != null){
			UserType_Id.value = aReturnValue[0];
		}
		if (UserType_Name != null){
			UserType_Name.value = aReturnValue[1];
		}
	}
}

function GetUserType(UserType_Level_Name, UserType_Name_Name, XLanguage){
	var UserType_Level = eval(window.document.getElementById(UserType_Level_Name));
	var UserType_Name = eval(window.document.getElementById(UserType_Name_Name));
	

	var URL = "UserTypeSelect.asp?Foo=1";
	if (XLanguage != null){
		URL = "UserTypeSelect.asp?Foo=1&UserType_ParentId=" + XLanguage;
	}

    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 (UserType_Level != null){
			UserType_Level.value = aReturnValue[0];
		}
		if (UserType_Name != null){
			UserType_Name.value = aReturnValue[1];
		}
	}
}

function GetDepartment(Department_Id_Name, Department_Name_Name, XLanguage){
	var Department_Id = eval(window.document.getElementById(Department_Id_Name));
	var Department_Name = eval(window.document.getElementById(Department_Name_Name));

	var URL = "DepartmentSelect.asp?Foo=1";
	if (XLanguage == "Eng"){
		URL = "DepartmentSelect2nd.asp?Foo=1";
	}
	if (Department_Id != null){
		URL = URL + "&Department_Id=" + Department_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 (Department_Id != null){
			Department_Id.value = aReturnValue[0];
		}
		if (Department_Name != null){
			Department_Name.value = aReturnValue[1];
		}
	}
}

function GetQualificationType(QualificationType_Id_Name, QualificationType_Name_Name, XLanguage){
	var QualificationType_Id = eval(window.document.getElementById(QualificationType_Id_Name));
	var QualificationType_Name = eval(window.document.getElementById(QualificationType_Name_Name));

	var URL = "QualificationTypeSelect.asp?Foo=1";
	if (XLanguage == "Eng"){
		URL = "QualificationTypeSelect2nd.asp?Foo=1";
	}
	if (QualificationType_Id != null){
		URL = URL + "&QualificationType_Id=" + QualificationType_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 (QualificationType_Id != null){
			QualificationType_Id.value = aReturnValue[0];
		}
		if (QualificationType_Name != null){
			QualificationType_Name.value = aReturnValue[1];
		}
	}
}

function GetProductType(ProductType_Id_Name, ProductType_Name_Name, XLanguage){
	var ProductType_Id = eval(window.document.getElementById(ProductType_Id_Name));
	var ProductType_Name = eval(window.document.getElementById(ProductType_Name_Name));

	var URL = "../Common/XTreeSelect.asp?Foo=1&Foo_Table=ProductType";
	if (XLanguage == "Eng"){
		URL = "../Common/EngXTreeSelect.asp?Foo=1&Foo_Table=ProductType";
	}
	if (ProductType_Id != null){
		URL = URL + "&ProductType_Id=" + ProductType_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 (ProductType_Id != null){
			ProductType_Id.value = aReturnValue[0];
		}
		if (ProductType_Name != null){
			ProductType_Name.value = aReturnValue[1];
		}
	}
}

function GetGenericType(GenericType_Id_Name, GenericType_Name_Name, XLanguage){
	var GenericType_Id = eval(window.document.getElementById(GenericType_Id_Name));
	var GenericType_Name = eval(window.document.getElementById(GenericType_Name_Name));

	var URL = "GenericTypeSelect.asp?Foo=1";
	if (XLanguage == "Eng"){
		URL = "GenericTypeSelect2nd.asp?Foo=1";
	}
	if (GenericType_Id != null){
		URL = URL + "&GenericType_Id=" + GenericType_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 (GenericType_Id != null){
			GenericType_Id.value = aReturnValue[0];
		}
		if (GenericType_Name != null){
			GenericType_Name.value = aReturnValue[1];
		}
	}
}


function GetProduct(Product_Id_Name, Product_Name_Name, XLanguage){
	var Product_Id = eval(window.document.getElementById(Product_Id_Name));
	var Product_Name = eval(window.document.getElementById(Product_Name_Name));

	var URL = "ProductSelect.asp?Foo=1";
	if (XLanguage == "Eng"){
		URL = "ProductSelect2nd.asp?Foo=1";
	}
	if (Product_Id != null){
		URL = URL + "&SelectedProduct_Id=" + Product_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 (Product_Id != null){
			Product_Id.value = aReturnValue[0];
		}
		if (Product_Name != null){
			Product_Name.value = aReturnValue[1];
		}
	}
}

function GetProductExt112(Product_Id_Name, Product_Name_Name, XLanguage, Product_Owner_Name, Product_ServiceType_Name){
	var Product_Id = eval(window.document.getElementById(Product_Id_Name));
	var Product_Name = eval(window.document.getElementById(Product_Name_Name));
	var Product_Owner = eval(window.document.getElementById(Product_Owner_Name));
	var Product_ServiceType = eval(window.document.getElementById(Product_ServiceType_Name));

     var URL = "ProductSelect.asp?Foo=1";
	
	if (XLanguage == "Eng"){
		URL = "ProductSelect2nd.asp?Foo=1";
	}
	
	if (Product_Id != null){
		URL = URL + "&SelectedProduct_Id=" + Product_Id.value;
	}
	if (Product_Owner != null){
		URL = URL + "&Product_Owner=" + Product_Owner.value;
	}
	if (Product_ServiceType != null){
		URL = URL + "&Product_ServiceType=" + Product_ServiceType.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 (Product_Id != null){
			Product_Id.value = aReturnValue[0];
		}
		if (Product_Name != null){
			Product_Name.value = aReturnValue[1];
		}
	}
}

function GetProductExt115(Product_Id_Name, Product_Name_Name, XLanguage, Product_Owner_Name, Product_ServiceType_Name){
	var Product_Id = eval(window.document.getElementById(Product_Id_Name));
	var Product_Name = eval(window.document.getElementById(Product_Name_Name));
	var Product_Owner = eval(window.document.getElementById(Product_Owner_Name));
	var Product_ServiceType = eval(window.document.getElementById(Product_ServiceType_Name));

    var URL = "ProductSelect2nd.asp?Foo=1";
	
	if (XLanguage == "Eng"){
		URL = "ProductSelect2nd.asp?Foo=1";
	}
	if (Product_Id != null){
		URL = URL + "&SelectedProduct_Id=" + Product_Id.value;
	}
	if (Product_Owner != null){
		URL = URL + "&Product_Owner=" + Product_Owner.value;
	}
	if (Product_ServiceType != null){
		URL = URL + "&Product_ServiceType=" + Product_ServiceType.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 (Product_Id != null){
			Product_Id.value = aReturnValue[0];
		}
		if (Product_Name != null){
			Product_Name.value = aReturnValue[1];
		}
	}
}

function GetProductExt111(Product_Id_Name, Product_Name_Name, XLanguage, Product_Owner_Name, Product_ServiceType_Name){
	var Product_Id = eval(window.document.getElementById(Product_Id_Name));
	var Product_Name = eval(window.document.getElementById(Product_Name_Name));
	var Product_Owner = eval(window.document.getElementById(Product_Owner_Name));
	var Product_ServiceType = eval(window.document.getElementById(Product_ServiceType_Name));

   	var URL = "ProductSelect3rd.asp?Foo=1";
	
	if (XLanguage == "Eng"){
		URL = "ProductSelect2nd.asp?Foo=1";
	}
	if (Product_Id != null){
		URL = URL + "&SelectedProduct_Id=" + Product_Id.value;
	}
	if (Product_Owner != null){
		URL = URL + "&Product_Owner=" + Product_Owner.value;
	}
	if (Product_ServiceType != null){
		URL = URL + "&Product_ServiceType=" + Product_ServiceType.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 (Product_Id != null){
			Product_Id.value = aReturnValue[0];
		}
		if (Product_Name != null){
			Product_Name.value = aReturnValue[1];
		}
	}
}

function GetProductExt2nd(Product_Id_Name, Product_Name_Name, XLanguage, Product_Owner_Name, Product_OwnerName_Name){
	var Product_Id = eval(window.document.getElementById(Product_Id_Name));
	var Product_Name = eval(window.document.getElementById(Product_Name_Name));
	var Product_Owner = eval(window.document.getElementById(Product_Owner_Name));
	var Product_OwnerName = eval(window.document.getElementById(Product_OwnerName_Name));

	var URL = "ProductSelect.asp?Foo=1";
	if (XLanguage == "Eng"){
		URL = "ProductSelect2nd.asp?Foo=1";
	}
	if (Product_Id != null){
		URL = URL + "&SelectedProduct_Id=" + Product_Id.value;
	}
	if (Product_Owner != null){
		URL = URL + "&Product_Owner=" + Product_Owner.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 (Product_Id != null){
			Product_Id.value = aReturnValue[0];
		}
		if (Product_Name != null){
			Product_Name.value = aReturnValue[1];
		}
		if (Product_Owner != null){
			Product_Owner.value = aReturnValue[2];
		}
		if (Product_OwnerName != null){
			Product_OwnerName.value = aReturnValue[3];
		}
	}
}

function GetMultiProduct(Product_Id_Name, Product_Name_Name, XLanguage, Product_Owner_Name, Product_OwnerName_Name){
	var Product_Id = eval(window.document.getElementById(Product_Id_Name));
	var Product_Name = eval(window.document.getElementById(Product_Name_Name));
	var Product_Owner = eval(window.document.getElementById(Product_Owner_Name));
	var Product_OwnerName = eval(window.document.getElementById(Product_OwnerName_Name));

	var URL = "ProductMultiSelect.asp?Foo=1";
	if (XLanguage == "Eng"){
		URL = "ProductMultiSelect2nd.asp?Foo=1";
	}
	if (Product_Id != null){
		URL = URL + "&SelectedProduct_Id=" + Product_Id.value;
	}
	if (Product_Owner != null){
		URL = URL + "&Product_Owner=" + Product_Owner.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 (Product_Id != null){
			Product_Id.value = aReturnValue[0];
		}
		if (Product_Name != null){
			Product_Name.value = aReturnValue[1];
		}
	}
}

function GetTP(TP_Id_Name, TP_Name_Name){
	var TP_Id = eval(window.document.getElementById(TP_Id_Name));
	var TP_Name = eval(window.document.getElementById(TP_Name_Name));

	var URL = "TPSelect.asp?Foo=1";
	if (TP_Id != null){
		URL = URL + "&SelectedTP_Id=" + TP_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 (TP_Id != null){
			TP_Id.value = aReturnValue[0];
		}
		if (TP_Name != null){
			TP_Name.value = aReturnValue[1];
		}
	}
}

function GetAdZone(AdZone_Id_Name, AdZone_Name_Name){
	var AdZone_Id = eval(window.document.getElementById(AdZone_Id_Name));
	var AdZone_Name = eval(window.document.getElementById(AdZone_Name_Name));

	var URL = "AdZoneSelect.asp?Foo=1";
	if (AdZone_Id != null){
		URL = URL + "&SelectedAdZone_Id=" + AdZone_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 (AdZone_Id != null){
			AdZone_Id.value = aReturnValue[0];
		}
		if (AdZone_Name != null){
			AdZone_Name.value = aReturnValue[1];
		}
	}
}

function GetKeyword(Keyword_Id_Name, Keyword_Name_Name){
	var Keyword_Id = eval(window.document.getElementById(Keyword_Id_Name));
	var Keyword_Name = eval(window.document.getElementById(Keyword_Name_Name));

	var URL = "KeywordSelect.asp?Foo=1";
	if (Keyword_Id != null){
		URL = URL + "&SelectedKeyword_Id=" + Keyword_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 (Keyword_Id != null){
			Keyword_Id.value = aReturnValue[0];
		}
		if (Keyword_Name != null){
			Keyword_Name.value = aReturnValue[1];
		}
	}
}

function GetUsers(Users_Id_Name, Users_UserName_Name, UserType_Id_Name, Users_Code_Name, Users_Name1_Name, Users_EngName1_Name, Users_Name2_Name, Users_EngName2_Name, Users_Address_Name, Users_EngAddress_Name, Users_Postcode_Name){
	var Users_Id = eval(window.document.getElementById(Users_Id_Name));
	var Users_UserName = eval(window.document.getElementById(Users_UserName_Name));
	var UserType_Id = eval(window.document.getElementById(UserType_Id_Name));
	var Users_Code = eval(window.document.getElementById(Users_Code_Name));
	var Users_Name1 = eval(window.document.getElementById(Users_Name1_Name));
	var Users_EngName1 = eval(window.document.getElementById(Users_EngName1_Name));
	var Users_Name2 = eval(window.document.getElementById(Users_Name2_Name));
	var Users_EngName2 = eval(window.document.getElementById(Users_EngName2_Name));
	var Users_Address = eval(window.document.getElementById(Users_Address_Name));
	var Users_EngAddress = eval(window.document.getElementById(Users_EngAddress_Name));
	var Users_Postcode = eval(window.document.getElementById(Users_Postcode_Name));

	var URL = "UsersSelect.asp?Foo=1";
	if (Users_Id != null){
		URL = URL + "&SelectedUsers_Id=" + Users_Id.value;
	}
	if (UserType_Id != null){
		URL = URL + "&UserType_Id=" + UserType_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 (Users_Id != null){
			Users_Id.value = aReturnValue[0];
		}
		if (Users_UserName != null){
			Users_UserName.value = aReturnValue[1];
		}
//		if (UserType_Id != null){
//			UserType_Id.value = aReturnValue[2];
//		}
		if (Users_Code != null){
			Users_Code.value = aReturnValue[3];
		}
		if (Users_Name1 != null){
			Users_Name1.value = aReturnValue[4];
		}
		if (Users_EngName1 != null){
			Users_EngName1.value = aReturnValue[5];
		}
		if (Users_Name2 != null){
			Users_Name2.value = aReturnValue[6];
		}
		if (Users_EngName2 != null){
			Users_EngName2.value = aReturnValue[7];
		}
		if (Users_Address != null){
			Users_Address.value = aReturnValue[8];
		}
		if (Users_EngAddress != null){
			Users_EngAddress.value = aReturnValue[9];
		}
		if (Users_Postcode != null){
			Users_Postcode.value = aReturnValue[10];
		}
	}
}

function GetUsers3rd(Users_Id_Name, Users_UserName_Name, UserType_Id_Name, Users_Code_Name, Users_Name1_Name, Users_EngName1_Name, Users_Name2_Name, Users_EngName2_Name, Users_Address_Name, Users_EngAddress_Name, Users_Postcode_Name){
	var Users_Id = eval(window.document.getElementById(Users_Id_Name));
	var Users_UserName = eval(window.document.getElementById(Users_UserName_Name));
	var UserType_Id = eval(window.document.getElementById(UserType_Id_Name));
	var Users_Code = eval(window.document.getElementById(Users_Code_Name));
	var Users_Name1 = eval(window.document.getElementById(Users_Name1_Name));
	var Users_EngName1 = eval(window.document.getElementById(Users_EngName1_Name));
	var Users_Name2 = eval(window.document.getElementById(Users_Name2_Name));
	var Users_EngName2 = eval(window.document.getElementById(Users_EngName2_Name));
	var Users_Address = eval(window.document.getElementById(Users_Address_Name));
	var Users_EngAddress = eval(window.document.getElementById(Users_EngAddress_Name));
	var Users_Postcode = eval(window.document.getElementById(Users_Postcode_Name));

	var URL = "UsersSelect3rd.asp?Foo=1";
	if (Users_Id != null){
		URL = URL + "&SelectedUsers_Id=" + Users_Id.value;
	}
	if (UserType_Id != null){
		URL = URL + "&UserType_Id=" + UserType_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 (Users_Id != null){
			Users_Id.value = aReturnValue[0];
		}
		if (Users_UserName != null){
			Users_UserName.value = aReturnValue[1];
		}
//		if (UserType_Id != null){
//			UserType_Id.value = aReturnValue[2];
//		}
		if (Users_Code != null){
			Users_Code.value = aReturnValue[3];
		}
		if (Users_Name1 != null){
			Users_Name1.value = aReturnValue[4];
		}
		if (Users_EngName1 != null){
			Users_EngName1.value = aReturnValue[5];
		}
		if (Users_Name2 != null){
			Users_Name2.value = aReturnValue[6];
		}
		if (Users_EngName2 != null){
			Users_EngName2.value = aReturnValue[7];
		}
		if (Users_Address != null){
			Users_Address.value = aReturnValue[8];
		}
		if (Users_EngAddress != null){
			Users_EngAddress.value = aReturnValue[9];
		}
		if (Users_Postcode != null){
			Users_Postcode.value = aReturnValue[10];
		}
	}
}




function GetMultUsers(Users_Id_Name, Users_UserName_Name, UserType_Id_Name, Users_Code_Name, Users_Name1_Name, Users_EngName1_Name, Users_Name2_Name, Users_EngName2_Name, Users_Address_Name, Users_EngAddress_Name, Users_Postcode_Name){
	var Users_Id = eval(window.document.getElementById(Users_Id_Name));
	var Users_UserName = eval(window.document.getElementById(Users_UserName_Name));
	var UserType_Id = eval(window.document.getElementById(UserType_Id_Name));
	var Users_Code = eval(window.document.getElementById(Users_Code_Name));
	var Users_Name1 = eval(window.document.getElementById(Users_Name1_Name));
	var Users_EngName1 = eval(window.document.getElementById(Users_EngName1_Name));
	var Users_Name2 = eval(window.document.getElementById(Users_Name2_Name));
	var Users_EngName2 = eval(window.document.getElementById(Users_EngName2_Name));
	var Users_Address = eval(window.document.getElementById(Users_Address_Name));
	var Users_EngAddress = eval(window.document.getElementById(Users_EngAddress_Name));
	var Users_Postcode = eval(window.document.getElementById(Users_Postcode_Name));

	var URL = "UsersMultSelect.asp?Foo=1";
	if (Users_Id != null){
		URL = URL + "&SelectedUsers_Id=" + Users_Id.value;
	}
	if (UserType_Id != null){
		URL = URL + "&UserType_Id=" + UserType_Id.value;
	}
	var EncodedURL = encodeURIComponent(URL);
	var vReturnValue = showModalDialog("ModalDialogBroker.asp?URL=" + EncodedURL, URL, "dialogWidth:800px;dialogHeight:600px;status:no;center:true");
	var OnlySelect;
	document.all.OnlySelect.value =  vReturnValue;
	
//	if (vReturnValue!="" && vReturnValue!=null){
//		var aReturnValue = vReturnValue.split("_");
//		if (Users_Id != null){
//			Users_Id.value = aReturnValue[0];
//		}
//		if (Users_UserName != null){
//			Users_UserName.value = aReturnValue[1];
//		}
////		if (UserType_Id != null){
////			UserType_Id.value = aReturnValue[2];
////		}
//		if (Users_Code != null){
//			Users_Code.value = aReturnValue[3];
//		}
//		if (Users_Name1 != null){
//			Users_Name1.value = aReturnValue[4];
//		}
//		if (Users_EngName1 != null){
//			Users_EngName1.value = aReturnValue[5];
//		}
//		if (Users_Name2 != null){
//			Users_Name2.value = aReturnValue[6];
//		}
//		if (Users_EngName2 != null){
//			Users_EngName2.value = aReturnValue[7];
//		}
//		if (Users_Address != null){
//			Users_Address.value = aReturnValue[8];
//		}
//		if (Users_EngAddress != null){
//			Users_EngAddress.value = aReturnValue[9];
//		}
//		if (Users_Postcode != null){
//			Users_Postcode.value = aReturnValue[10];
//		}
//	}
}


function GetSingleUsers(Users_Id_Name, Users_UserName_Name, UserType_Id_Name, Users_Code_Name, Users_Name1_Name, Users_EngName1_Name, Users_Name2_Name, Users_EngName2_Name, Users_Address_Name, Users_EngAddress_Name, Users_Postcode_Name){
	var Users_Id = eval(window.document.getElementById(Users_Id_Name));
	var Users_UserName = eval(window.document.getElementById(Users_UserName_Name));
	var UserType_Id = eval(window.document.getElementById(UserType_Id_Name));
	var Users_Code = eval(window.document.getElementById(Users_Code_Name));
	var Users_Name1 = eval(window.document.getElementById(Users_Name1_Name));
	var Users_EngName1 = eval(window.document.getElementById(Users_EngName1_Name));
	var Users_Name2 = eval(window.document.getElementById(Users_Name2_Name));
	var Users_EngName2 = eval(window.document.getElementById(Users_EngName2_Name));
	var Users_Address = eval(window.document.getElementById(Users_Address_Name));
	var Users_EngAddress = eval(window.document.getElementById(Users_EngAddress_Name));
	var Users_Postcode = eval(window.document.getElementById(Users_Postcode_Name));

	var URL = "UsersSingleSelect.asp?Foo=1";
	if (Users_Id != null){
		URL = URL + "&SelectedUsers_Id=" + Users_Id.value;
	}
	if (UserType_Id != null){
		URL = URL + "&UserType_Id=" + UserType_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 (Users_Id != null){
			Users_Id.value = aReturnValue[0];
		}
		if (Users_UserName != null){
			Users_UserName.value = aReturnValue[1];
		}
//		if (UserType_Id != null){
//			UserType_Id.value = aReturnValue[2];
//		}
		if (Users_Code != null){
			Users_Code.value = aReturnValue[3];
		}
		if (Users_Name1 != null){
			Users_Name1.value = aReturnValue[4];
		}
		if (Users_EngName1 != null){
			Users_EngName1.value = aReturnValue[5];
		}
		if (Users_Name2 != null){
			Users_Name2.value = aReturnValue[6];
		}
		if (Users_EngName2 != null){
			Users_EngName2.value = aReturnValue[7];
		}
		if (Users_Address != null){
			Users_Address.value = aReturnValue[8];
		}
		if (Users_EngAddress != null){
			Users_EngAddress.value = aReturnValue[9];
		}
		if (Users_Postcode != null){
			Users_Postcode.value = aReturnValue[10];
		}
	}
}


function GetPollQuestion(PollQuestion_Id_Name, PollQuestion_Name_Name, XLanguage){
	var PollQuestion_Id = eval(window.document.getElementById(PollQuestion_Id_Name));
	var PollQuestion_Name = eval(window.document.getElementById(PollQuestion_Name_Name));

	var URL = "PollQuestionSelect.asp?Foo=1";
	if (XLanguage == "Eng"){
		URL = "PollQuestionSelect2nd.asp?Foo=1";
	}
	if (PollQuestion_Id != null){
		URL = URL + "&PollQuestion_Id=" + PollQuestion_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 (PollQuestion_Id != null){
			PollQuestion_Id.value = aReturnValue[0];
		}
		if (PollQuestion_Name != null){
			PollQuestion_Name.value = aReturnValue[1];
		}
	}
}

function GetFavoriteType(FavoriteType_Id_Name, FavoriteType_Name_Name, XLanguage){
	var FavoriteType_Id = eval(window.document.getElementById(FavoriteType_Id_Name));
	var FavoriteType_Name = eval(window.document.getElementById(FavoriteType_Name_Name));

	var URL = "FavoriteTypeSelect.asp?Foo=1";
	if (XLanguage == "Eng"){
		URL = "FavoriteTypeSelect2nd.asp?Foo=1";
	}
	if (FavoriteType_Id != null){
		URL = URL + "&FavoriteType_Id=" + FavoriteType_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 (FavoriteType_Id != null){
			FavoriteType_Id.value = aReturnValue[0];
		}
		if (FavoriteType_Name != null){
			FavoriteType_Name.value = aReturnValue[1];
		}
	}
}


function GetPreferenceType(PreferenceType_Id_Name, PreferenceType_Name_Name, XLanguage){
	var PreferenceType_Id = eval(window.document.getElementById(PreferenceType_Id_Name));
	var PreferenceType_Name = eval(window.document.getElementById(PreferenceType_Name_Name));

	var URL = "PreferenceTypeSelect.asp?Foo=1";
	if (XLanguage == "Eng"){
		URL = "PreferenceTypeSelect2nd.asp?Foo=1";
	}
	if (PreferenceType_Id != null){
		URL = URL + "&PreferenceType_Id=" + PreferenceType_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 (PreferenceType_Id != null){
			PreferenceType_Id.value = aReturnValue[0];
		}
		if (PreferenceType_Name != null){
			PreferenceType_Name.value = aReturnValue[1];
		}
	}
}

function GetMultiKnowledgeType(KnowledgeType_Id_Name, KnowledgeType_Name_Name){
	var KnowledgeType_Id = eval(window.document.getElementById(KnowledgeType_Id_Name));
	var KnowledgeType_Name = eval(window.document.getElementById(KnowledgeType_Name_Name));

	var URL = "KnowledgeTypeMultiSelect.asp?Foo=1";
	if (KnowledgeType_Id != null){
		URL = URL + "&SelectedKnowledgeType_Id=" + KnowledgeType_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 (KnowledgeType_Id != null){
			KnowledgeType_Id.value = aReturnValue[0];
		}
		if (KnowledgeType_Name != null){
			KnowledgeType_Name.value = aReturnValue[1];
		}
	}
}

function GetSingleKnowledgeType(KnowledgeType_Id_Name, KnowledgeType_Name_Name){
	var KnowledgeType_Id = eval(window.document.getElementById(KnowledgeType_Id_Name));
	var KnowledgeType_Name = eval(window.document.getElementById(KnowledgeType_Name_Name));

	var URL = "KnowledgeTypeSelect.asp?Foo=1";
	if (KnowledgeType_Id != null){
		URL = URL + "&SelectedKnowledgeType_Id=" + KnowledgeType_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 (KnowledgeType_Id != null){
			KnowledgeType_Id.value = aReturnValue[0];
		}
		if (KnowledgeType_Name != null){
			KnowledgeType_Name.value = aReturnValue[1];
		}
	}
}


function GetStrategyFunction(StrategyFunction_Id_Name, StrategyFunction_Name_Name, StrategyFunction_Type_Name){
	var StrategyFunction_Id = eval(window.document.getElementById(StrategyFunction_Id_Name));
	var StrategyFunction_Name = eval(window.document.getElementById(StrategyFunction_Name_Name));
	var StrategyFunction_Type = eval(window.document.getElementById(StrategyFunction_Type_Name));

	var URL = "StrategyFunctionSelect.asp?Foo=1";
	if (StrategyFunction_Id != null){
		URL = URL + "&SelectedStrategyFunction_Id=" + StrategyFunction_Id.value;
	}
	if (StrategyFunction_Type != null){
		URL = URL + "&StrategyFunction_Type=" + StrategyFunction_Type.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 (StrategyFunction_Id != null){
			StrategyFunction_Id.value = aReturnValue[0];
		}
		if (StrategyFunction_Name != null){
			StrategyFunction_Name.value = aReturnValue[1];
		}
	}
}

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 GetPA(PA_Id_Name, PA_Name_Name, XLanguage){
	var PA_Id = eval(window.document.getElementById(PA_Id_Name));
	var PA_Name = eval(window.document.getElementById(PA_Name_Name));

	var URL = "PASelect.asp?Foo=1";
	if (XLanguage == "Eng"){
		URL = "PASelect2nd.asp?Foo=1";
	}
	if (PA_Id != null){
		URL = URL + "&PA_Id=" + PA_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 (PA_Id != null){
			PA_Id.value = aReturnValue[0];
		}
		if (PA_Name != null){
			PA_Name.value = aReturnValue[1];
		}
	}
}
