
//Initializes the javascript objects on the page based on the pageSet value of each page that is now passed into a form for js to access

function getBrowserObject()
{
	//alert ("get browser object");
	if (document.layers)
	{
	//alert ("document.layers");
	getPageSet(document.layers['pageSet'].value, "NS")
	}
	//else
	else if (document.all)
	{
	//alert ("document.all");
	getPageSet(document.all.pageSet.value, "IE")
	}
	//else
	else if(document.getElementById)
	{
	//alert ("document.get");
	getPageSet(document.getElementById('pageSet').value, "NSIE")
	}
}
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

function getPageSet(x,z)
{
//alert (z);
	switch (x)
	{
	case "EMAIL_ENTRY":
		EM_Objects(z);
	break	
	case "REGISTRATION":
		RG_Objects(z);
	break
	case "CO_DETAILS":
		CO_Objects(z);
	break
	case "ADDRESS_DETAILS":
		AD_Objects(z);
	break
	case "OFFICERS_MEMBERS_DATA":
		OM_Objects(z);
	break	
	case "OFFICERS_MEMBERS_SOLE":
		OMS_Objects(z);
	break	
		case "OFFICERS_MEMBERS":
		OM_Entry_Objects(z);
	break
		case "ADDRESS_VERIFICATION":
		
	default:
	}

}

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

function EM_Objects(i)
{

	switch (i)
	{
	case "NS":
	//if (document.layers) {  // for Netscape
		
		emDiv_emailAddress = document.layers['username'];
		emDiv_emailAddress2 = document.layers['username2'];
		
		StagePage = document.layers['pageSet'].value
	break
	case "IE":
		emDiv_emailAddress = document.all.username;
		emDiv_emailAddress2 = document.all.username2;
		
		StagePage = document.all.pageSet.value;
	break
	case "NSIE":
		emDiv_emailAddress = document.getElementById('username');
		emDiv_emailAddress2 = document.getElementById('username2');
		
		StagePage = document.getElementById('pageSet').value;
	break
	default:
	//else if (document.getElementById) {  // for Netscape 6+ and IE 5+
	
		emDiv_emailAddress = document.getElementById('username');
		emDiv_emailAddress2 = document.getElementById('username2');
	

		StagePage = document.getElementById('pageSet').value;
	}

}
///////////////////////////////////////////////////
function RG_Objects(i)
{

	/* rgDiv_isRSVD, divRSV, */
	switch (i)
	{
	case "NS":
	//if (document.layers) {  // for Netscape
		//for show/hide
		rgDiv_isRSVD = document.layers['rgDiv_isRSVD'];
		rgDiv_divRSV = document.layers['divRSV']
		rgDiv_isBN = document.layers['rgDiv_isBN']
		rgDiv_divBN = document.layers['divBN']

		rg_companyName = document.layers['companyName'];
		rg_useACNasName = document.layers['useACNasName']
		rg_companyName2 = document.layers['companyName2']

		
		StagePage = document.layers['pageSet'].value
	break
	case "IE":
	//else if (document.all) {     // for IE
	//for show/hide
		rgDiv_isRSVD = document.all.rgDiv_isRSVD[0];
		rgDiv_divRSV = document.all.divRSV;
		rgDiv_isBN = document.all.rgDiv_isBN[0];
		rgDiv_divBN = document.all.divBN;

		rg_companyName = document.all.companyName;
		rg_companyName2 = document.all.companyName2;
		rg_useACNasName = document.all.useACNasName;
		
		StagePage = document.all.pageSet.value;
	break
	case "NSIE":
	//else if (document.getElementById) {  // for Netscape 6+ and IE 5+
	//for show/hide
		rgDiv_isRSVD = document.getElementById('rgDiv_isRSVD');
		rgDiv_divRSV = document.getElementById('divRSV');
		rgDiv_isBN = document.getElementById('rgDiv_isBN');
		rgDiv_divBN = document.getElementById('divBN');

		rg_companyName = document.getElementById('companyName');
		rg_useACNasName = document.getElementById('useACNasName');
		rg_companyName2 = document.getElementById('companyName2');
		

		StagePage = document.getElementById('pageSet').value;
	break
	default:
	//else if (document.getElementById) {  // for Netscape 6+ and IE 5+
	//for show/hide
		rgDiv_isRSVD = document.getElementById('rgDiv_isRSVD');
		rgDiv_divRSV = document.getElementById('divRSV');
		rgDiv_isBN = document.getElementById('rgDiv_isBN');
		rgDiv_divBN = document.getElementById('divBN');

		rg_companyName = document.getElementById('companyName');
		rg_useACNasName = document.getElementById('useACNasName');
		rg_companyName2 = document.getElementById('companyName2');
		

		StagePage = document.getElementById('pageSet').value;
	}

//run show hide
showHide()
}

function CO_Objects(i)
{
	/*CompanyTypeID,isSoleMD[0],divSoleSec,hasHolding[0],titleHolding,divHolding,divHoldingName,holdingCoCountry,divHoldingACN,companyClass,divGuarantee,divGuaranteeAmount*/
	switch (i)
	{
	case "NS":
	//if (document.layers) {  // for Netscape
	coDiv_CompanyTypeID = document.layers['CompanyTypeID'];

	if(coDiv_CompanyTypeID.value == "APTY") {
	coDiv_isSoleMD = document.layers['isSoleMD'];

	//validation
	co_isSoleMD = document.layers['isSoleMD'];
	co_hasSoleSec = document.layers['hasSoleSec'];
	}
	//show/hide
		coDiv_divSoleSec = document.layers['divSoleSec'];
		coDiv_hasHolding = document.layers['hasHolding'];
		coDiv_titleHolding = document.layers['titleHolding'];
		coDiv_divHoldingName = document.layers['divHoldingName'];
		coDiv_holdingCoCountry = document.layers['holdingCoCountry'];
		coDiv_divHoldingACN = document.layers['divHoldingACN'];
		coDiv_companyClass = document.layers['companyClass'];
		coDiv_divGuarantee= document.layers['divGuarantee'];
		coDiv_divGuaranteeAmount = document.layers['divGuaranteeAmount'];
		StagePage = document.layers['pageSet'].value

//co_hasHolding = document.layers['hasHolding'];

	break
	case "IE":
	//else if (document.all) {     // for IE
	coDiv_CompanyTypeID = document.all.CompanyTypeID;
	if(coDiv_CompanyTypeID.value == "APTY") {
	coDiv_isSoleMD = document.all.isSoleMD[0];
	//validation
	co_isSoleMD = document.all.isSoleMD[0];
	//co_hasSoleSec = document.all.hasSoleSec[0];
	}
		coDiv_divSoleSec = document.all.divSoleSec;
		coDiv_hasHolding = document.all.hasHolding[0];
		coDiv_titleHolding = document.all.titleHolding;
		coDiv_divHolding = document.all.divHolding;
		coDiv_divHoldingName = document.all.divHoldingName;
		coDiv_holdingCoCountry = document.all.holdingCoCountry;
		coDiv_divHoldingACN = document.all.divHoldingACN;
		coDiv_divHoldingReg = document.all.divHoldingReg;
		coDiv_companyClass = document.all.companyClass;
		coDiv_titleGuarantee = document.all.titleGuarantee;
		coDiv_divGuarantee = document.all.divGuarantee;
		coDiv_divGuaranteeAmount = document.all.divGuaranteeAmount;
		StagePage = document.all.pageSet.value;




break
	case "NSIE":
	//else if (document.getElementById) {  // for Netscape 6+ and IE 5+
	coDiv_CompanyTypeID = document.getElementById('CompanyTypeID');
	if(coDiv_CompanyTypeID.value == "APTY") {
	coDiv_isSoleMD = document.getElementById('isSoleMD');

	//validation
	co_isSoleMD = document.getElementById('isSoleMD');
	co_hasSoleSec = document.getElementById('hasSoleSec');
	}
		coDiv_divSoleSec = document.getElementById('divSoleSec');
		coDiv_hasHolding = document.getElementById('hasHolding');
		coDiv_titleHolding = document.getElementById('titleHolding');
		coDiv_divHolding = document.getElementById('divHolding');
		coDiv_divHoldingName = document.getElementById('divHoldingName');
		coDiv_holdingCoCountry = document.getElementById('holdingCoCountry');
		coDiv_divHoldingReg = document.getElementById('divHoldingReg');
		coDiv_divHoldingACN = document.getElementById('divHoldingACN');
		coDiv_companyClass = document.getElementById('companyClass');
		coDiv_divGuarantee = document.getElementById('divGuarantee');
		coDiv_titleGuarantee = document.getElementById('titleGuarantee');
		coDiv_divGuaranteeAmount = document.getElementById('divGuaranteeAmount');
		StagePage = document.getElementById('pageSet').value;


	break
	default:
	//else if (document.getElementById) {  // for Netscape 6+ and IE 5+
	coDiv_CompanyTypeID = document.getElementById('CompanyTypeID');
		if(coDiv_CompanyTypeID.value == "APTY") {
		coDiv_isSoleMD = document.getElementById('isSoleMD');

		//validation
		co_isSoleMD = document.getElementById('isSoleMD');
		co_hasSoleSec = document.getElementById('hasSoleSec');
		}

		coDiv_isSoleMD = document.getElementById('isSoleMD');
		coDiv_divSoleSec = document.getElementById('divSoleSec');
		coDiv_hasHolding = document.getElementById('hasHolding');
		coDiv_titleHolding = document.getElementById('titleHolding');
		coDiv_divHolding = document.getElementById('divHolding');
		coDiv_divHoldingName = document.getElementById('divHoldingName');
		coDiv_holdingCoCountry = document.getElementById('holdingCoCountry');
		coDiv_divHoldingACN = document.getElementById('divHoldingACN');
		coDiv_companyClass = document.getElementById('companyClass');
		coDiv_divGuarantee = document.getElementById('divGuarantee');
		coDiv_titleGuarantee = document.getElementById('titleGuarantee');
		coDiv_divGuaranteeAmount = document.getElementById('divGuaranteeAmount');
		StagePage = document.getElementById('pageSet').value;


	}
coDiv_titleGuarantee.style.backgroundColor = "#e6e6d7";
coDiv_titleHolding.style.backgroundColor = "#e6e6d7";
//run show hide
showHide()
}


function AD_Objects(i)
{	/*CompanyTypeID,isSoleOccupier[0],regOfficeOccupier,isPPoB[0],titlePPoB,divPPoB,divPPoBDetails*/
	switch (i)
	{
	case "NS":
	//if (document.layers) {  // for Netscape
	adDiv_CompanyTypeID = document.layers['CompanyTypeID'];
		
		adDiv_SoleOccupier = document.layer['isSoleOccupier'];
		adDiv_regOfficeOccupierName = document.layer['regOfficerOccupierName'];
		adDiv_divPPoB = document.layer['regOfficerOccupier'];
		adDiv_titlePPoB = document.layer['titlePPoB'];
		adDiv_divPPoB = document.layer['divPPoB'];
		adDiv_divPPoBDetails = document.layer['divPPoBDetails'];
		StagePage = document.layer['pageSet'].value;
		//address details declaration
		adDiv_ppobStreet1 = document.layer['ppobStreet1']
		adDiv_ppobSreet2 = document.layer['ppobSreet2']
		adDiv_ppobState = document.layer['ppobState']
		adDiv_ppobCity = document.layer['ppobCity']
		adDiv_ppobPC = document.layer['ppobPC']
		adDiv_regOfficeStreet1 = document.layer['regOfficeStreet1']
		adDiv_regOfficeStreet2 = document.layer['regOfficeStreet2']
		adDiv_regOfficeState = document.layer['regOfficeState']
		adDiv_regOfficeCity = document.layer['regOfficeCity']
		adDiv_regOfficerPC = document.layer['regOfficerPC']
		if(adDiv_CompanyTypeID.value == "APUB")
		{
			adDiv_stdHours_Y = document.layer['stdHours']
			adDiv_divOfficeHours = document.layer['divOfficeHours']
			adDiv_titleOfficeHours = document.layer['titleOfficeHours']
			adDiv_divHours = document.layer['divHours']
		}
	break
	case "IE":
	//else if (document.all) {     // for IE
	adDiv_CompanyTypeID = document.all.CompanyTypeID;
		
		adDiv_isSoleOccupier_Y = document.all.isSoleOccupier[0];
		adDiv_isSoleOccupier_N = document.all.isSoleOccupier[1];
		
		adDiv_regOfficeOccupierName = document.all.regOfficeOccupierName;
		
		adDiv_isPPoB_Y = document.all.isPPoB[0];
		adDiv_isPPoB_N = document.all.isPPoB[1];
		
		adDiv_titlePPoB = document.all.titlePPoB;
		adDiv_divPPoB = document.all.divPPoB;
		adDiv_divPPoBDetails = document.all.divPPoBDetails;
		StagePage = document.all.pageSet.value;
		//address details declaration
		adDiv_ppobStreet1 = document.all.ppobStreet1
		adDiv_ppobStreet2 = document.all.ppobStreet2
		adDiv_ppobState = document.all.ppobState
		adDiv_ppobCity = document.all.ppobCity
		adDiv_ppobPC = document.all.ppobPC
		adDiv_regOfficeStreet1 = document.all.regOfficeStreet1
		adDiv_regOfficeStreet2 = document.all.regOfficeStreet2
		adDiv_regOfficeState = document.all.regOfficeState
		adDiv_regOfficeCity = document.all.regOfficeCity
		adDiv_regOfficePC = document.all.regOfficePC
		if(adDiv_CompanyTypeID.value == "APUB")
		{
			adDiv_stdHours_Y = document.all.stdHours[0]
			adDiv_titleOfficeHours = document.all.titleOfficeHours
			adDiv_OfficeHours = document.all.divOfficeHours
			adDiv_divHours = document.all.divHours
		}
	break
	case "NSIE":
	//else if (document.getElementById) {  // for Netscape 6+ and IE 5+
	adDiv_CompanyTypeID = document.getElementById('CompanyTypeID');
		
		adDiv_isSoleOccupier_Y = document.getElementById('isSoleOccupier_Y');
		adDiv_isSoleOccupier_N = document.getElementById('isSoleOccupier_N');
		
		adDiv_regOfficeOccupierName = document.getElementById('regOfficeOccupierName');
		
		adDiv_isPPoB_Y = document.getElementById('isPPoB_Y');
		adDiv_isPPoB_Y = document.getElementById('isPPoB_Y');
		
		adDiv_titlePPoB = document.getElementById('titlePPoB');
		adDiv_divPPoB = document.getElementById('divPPoB');
		adDiv_divPPoBDetails = document.getElementById('divPPoBDetails');
		StagePage = document.getElementById('pageSet').value;
		//address details declaration
		adDiv_ppobStreet1 = document.getElementById('ppobStreet1')
		adDiv_ppobStreet2 = document.getElementById('ppobStreet2')
		adDiv_ppobState = document.getElementById('ppobState')
		adDiv_ppobCity = document.getElementById('ppobCity')
		adDiv_ppobPC = document.getElementById('ppobPC')
		adDiv_regOfficeStreet1 = document.getElementById('regOfficeStreet1')
		adDiv_regOfficeStreet2 = document.getElementById('regOfficeStreet2')
		adDiv_regOfficeState = document.getElementById('regOfficeState')
		adDiv_regOfficeCity = document.getElementById('regOfficeCity')
		adDiv_regOfficePC = document.getElementById('regOfficePC')
		if(adDiv_CompanyTypeID.value == "APUB")
		{
			adDiv_stdHours_Y = document.getElementById('stdHours_Y')
			adDiv_divOfficeHours = document.getElementById('divOfficeHours')
			adDiv_titleOfficeHours = document.getElementById('titleOfficeHours')
			adDiv_divHours = documentgetElementById('divHours')
		}
	break
	default:
	//else if (document.getElementById) {  // for Netscape 6+ and IE 5+
	adDiv_CompanyTypeID = document.getElementById('CompanyTypeID');
	
		adDiv_isSoleOccupier_Y = document.getElementById('isSoleOccupier_Y');
		adDiv_isSoleOccupier_N = document.getElementById('isSoleOccupier_N');
	
		adDiv_regOfficeOccupierName = document.getElementById('regOfficeOccupierName');
		
		adDiv_isPPoB_Y = document.getElementById('isPPoB_Y');
		adDiv_isPPoB_Y = document.getElementById('isPPoB_Y');
		
		adDiv_titlePPoB = document.getElementById('titlePPoB');
		adDiv_divPPoB = document.getElementById('divPPoB');
		adDiv_divPPoBDetails = document.getElementById('divPPoBDetails');
		StagePage = document.getElementById('pageSet').value;
		//address details declaration
		adDiv_ppobStreet1 = document.getElementById('ppobStreet1')
		adDiv_ppobStreet2 = document.getElementById('ppobStreet2')
		adDiv_ppobState = document.getElementById('ppobState')
		adDiv_ppobCity = document.getElementById('ppobCity')
		adDiv_ppobPC = document.getElementById('ppobPC')
		adDiv_regOfficeStreet1 = document.getElementById('regOfficeStreet1')
		adDiv_regOfficeStreet2 = document.getElementById('regOfficeStreet2')
		adDiv_regOfficeState = document.getElementById('regOfficeState')
		adDiv_regOfficeCity = document.getElementById('regOfficeCity')
		adDiv_regOfficePC = document.getElementById('regOfficePC')
		if(adDiv_CompanyTypeID.value == "APUB")
		{
			adDiv_stdHours_Y = document.getElementById('stdHours_Y')
			adDiv_divOfficeHours = document.getElementById('divOfficeHours')
			adDiv_titleOfficeHours = document.getElementById('titleOfficeHours')
			adDiv_divHours = documentgetElementById('divHours')
		}
	}
//adDiv_titlePPoB.style.backgroundColor = "#e6e6d7";
if(adDiv_CompanyTypeID.value == "APUB")
		{
			adDiv_titleOfficeHours.style.backgroundColor = "#e6e6d7";

		}
showHide()
}



<!--- ///////////////////////////////////// --->

function OM_Objects(i)
{	/*CompanyTypeID,isSoleOccupier[0],regOfficeOccupier,isPPoB[0],titlePPoB,divPPoB,divPPoBDetails*/

//alert ("om objects");

switch (i)
	{
	
		case "NS":
		//if (document.layers) {  // for Netscape
		omDiv_MOType = document.layers['MOType'].value;
		omIndividualDetails = document.layers['omIndividualDetails'];
		omCompanyDetails = document.layers['omCompanyDetails'];
		om_omBirthCountry = document.layers['omBirthCountry'];
		om_omBirthState = document.layers['omBirthState'];
			
		StagePage = document.layers['pageSet'].value;

		if (omDiv_MOType == "M")
		{
			omDiv_MemberType = document.layers['omMemberType'];
		}
		break

		case "IE":
		//alert (i);
		//else if (document.all) {     // for IE
		omDiv_MOType = document.all.MOType.value;
		//alert (omDiv_MOType);
		//omIndividualDetails = document.all.omIndividualDetails;
		//omCompanyDetails = document.all.omCompanyDetails;
		om_omBirthCountry = document.all.omBirthCountry;
		om_omBirthState = document.all.omBirthState;
		
		StagePage = document.all.pageSet.value;
		

		if (omDiv_MOType == "M")
		{
			omDiv_MemberType = document.all.omMemberType[0];
		}
		break

		case "NSIE":
		//else if (document.getElementById) {  // for Netscape 6+ and IE 5+
		omDiv_MOType = document.getElementById('MOType').value;
		omIndividualDetails = document.getElementById('omIndividualDetails');
		omCompanyDetails = document.getElementById('omCompanyDetails');
		om_omBirthCountry = document.getElementById('omBirthCountry');
		om_omBirthState = document.getElementById('omBirthState');

		
		StagePage = document.getElementById('pageSet').value;

		if (omDiv_MOType == "M")
		{
			omDiv_MemberType = document.getElementById('omMemberType')
		}
		break

		default:
		//else if (document.getElementById) {  // for Netscape 6+ and IE 5+
		omDiv_MOType = document.getElementById('MOType').value;
		omIndividualDetails = document.getElementById('omIndividualDetails');
		omCompanyDetails = document.getElementByid('omCompanyDetails');
		om_omBirthCountry = document.getElementById('omBirthCountry');
		om_omBirthState = document.getElementById('omBirthState');
		
		StagePage = document.getElementById('pageSet').value;

		if (omDiv_MOType == "M")
		{
			omDiv_MemberType = document.getElementById('omMemberType')
		}
	}

	if (omDiv_MOType == "M")
	{
		showHide()
	}
	else
	{
		omIndividualDetails.style.overflow = "visible";
		omIndividualDetails.style.visibility = "visible";
}

}


function OMS_Objects(i)
{	/*CompanyTypeID,isSoleOccupier[0],regOfficeOccupier,isPPoB[0],titlePPoB,divPPoB,divPPoBDetails*/

//alert ("om objects");

switch (i)
	{
	
		case "NS":
		//if (document.layers) {  // for Netscape
		//omDiv_MOType = document.layers['MOType'].value;
		//omIndividualDetails = document.layers['omIndividualDetails'];
		//omCompanyDetails = document.layers['omCompanyDetails'];
		om_omBirthCountry = document.layers['omBirthCountry'];
		om_omBirthState = document.layers['omBirthState'];
			
		StagePage = document.layers['pageSet'].value;

		//if (omDiv_MOType == "M")
		//{
			omDiv_MemberType = document.layers['omMemberType'];
		//}
		break

		case "IE":
		//alert (i);
		//else if (document.all) {     // for IE
		//omDiv_MOType = document.all.MOType.value;
		//alert (omDiv_MOType);
		//omIndividualDetails = document.all.omIndividualDetails;
		//omCompanyDetails = document.all.omCompanyDetails;
		om_omBirthCountry = document.all.omBirthCountry;
		om_omBirthState = document.all.omBirthState;
		
		StagePage = document.all.pageSet.value;
		

		//if (omDiv_MOType == "M")
		//{
			//omDiv_MemberType = document.all.omMemberType[0];
		//}
		break

		case "NSIE":
		//else if (document.getElementById) {  // for Netscape 6+ and IE 5+
		//omDiv_MOType = document.getElementById('MOType').value;
		//omIndividualDetails = document.getElementById('omIndividualDetails');
		//omCompanyDetails = document.getElementById('omCompanyDetails');
		om_omBirthCountry = document.getElementById('omBirthCountry');
		om_omBirthState = document.getElementById('omBirthState');

		
		StagePage = document.getElementById('pageSet').value;

		//if (omDiv_MOType == "M")
		//{
			//omDiv_MemberType = document.getElementById('omMemberType')
		//}
		break

		default:
		//else if (document.getElementById) {  // for Netscape 6+ and IE 5+
		//omDiv_MOType = document.getElementById('MOType').value;
		//omIndividualDetails = document.getElementById('omIndividualDetails');
		//omCompanyDetails = document.getElementByid('omCompanyDetails');
		om_omBirthCountry = document.getElementById('omBirthCountry');
		om_omBirthState = document.getElementById('omBirthState');
		
		StagePage = document.getElementById('pageSet').value;

		//if (omDiv_MOType == "M")
		//{
			//omDiv_MemberType = document.getElementById('omMemberType')
		//}
	//}

	//if (omDiv_MOType == "M")
	//{
		
	//}
	//else
	//{
		//omIndividualDetails.style.overflow = "visible";
		//omIndividualDetails.style.visibility = "visible";
}
showHide()
}


function OM_Entry_Objects(i)
{	

/*CompanyTypeID,isSoleOccupier[0],regOfficeOccupier,isPPoB[0],titlePPoB,divPPoB,divPPoBDetails*/

//adDiv_CompanyTypeID = document.getElementById('CompanyTypeID');
//alert (i);
switch (i)
	{
		
		case "NS":
		//if (document.layers) {  // for Netscape
		ome_CompanyTypeID = document.layers['CompanyTypeID'];
		
		break

		case "IE":
		//document.all
		ome_CompanyTypeID = document.all.CompanyTypeID;
		ome_omBirthCountry = document.all.omBirthCountry;
		ome_omBirthState = document.all.omBirthState;

		break

		case "NSIE":
		ome_CompanyTypeID = document.getElementById('CompanyTypeID');
		ome_omBirthCountry = document.getElementById('omBirthCountry');
		ome_omBirthState = document.getElementById('omBirthState');

		break

		default:
		//else if (document.getElementById) {  // for Netscape 6+ and IE 5+
		ome_CompanyTypeID = document.getElementById('CompanyTypeID');
		ome_omBirthCountry = document.getElementById('omBirthCountry');
		ome_omBirthState = document.getElementById('omBirthState');

	}
//alert (ome_CompanyTypeID.value);
}


