

//------------------------------------------------------------------------------
// FUNCTION: toggleItemVisibility
//
// DESCRIPTION:	
//		Toggles the visibility of the html item identified by the given ID.
//		If it is currently visibile, it will make it invisbile.  If it is currently
//		invisibile, it will make it visible.
//
//
//	PARAMETERS:
//		targetId - HTML ID of the item to toggle
//
//------------------------------------------------------------------------------
function toggleItemVisibility(targetId)
{
	var arrDiv=document.getElementById(targetId);
	if(arrDiv.style.display=="none")
	{
		arrDiv.style.display="block";
	}
	else
	{
		arrDiv.style.display="none";
	}
}


//------------------------------------------------------------------------------
// FUNCTION: setItemVisibilityOff
//
// DESCRIPTION:	
//		Sets the visibility of the html item identified by the given ID to "none"
//
//	PARAMETERS:
//		targetId - HTML ID of the item to toggle
//
//------------------------------------------------------------------------------
function setItemVisibilityOff(targetId)
{
	var arrDiv=document.getElementById(targetId);
	arrDiv.style.display="none";
}


//------------------------------------------------------------------------------
// FUNCTION: setItemVisibilityOn
//
// DESCRIPTION:	
//		Sets the visibility of the html item identified by the given ID to "block"
//
//	PARAMETERS:
//		targetId - HTML ID of the item to toggle
//
//------------------------------------------------------------------------------
function setItemVisibilityOn(targetId)
{
	var arrDiv=document.getElementById(targetId);
	arrDiv.style.display="block";
}


//------------------------------------------------------------------------------
// FUNCTION: doZipToggle
//
// DESCRIPTION:	
//		
//
//
//	PARAMETERS:
//		isDomesticHiddenFieldId - ID of the HTML "hidden" form element that indicates whether
//										          the value is domestic or international
//		linkTextDivID			 - ID of the HTML "div" form element that contains the "In the
//										     US?" / "Not in the US?" text
//		toggleA	- ID of first item to toggle visibility of
//		toggleB	- ID of second item to toggle visibility of
//		toggleC	- ID of third item to toggle visibility of
//		toggleD	- ID of fourth item to toggle visibility of
//  	toggleE	- ID of fifth item to toggle visibility of
//
//------------------------------------------------------------------------------
function doZipToggle( isDomesticHiddenFieldId, linkTextDivId, toggleA, toggleB, toggleC, toggleD, toggleE )
{
	// Use given isDomesticHiddenFieldId to get a variable to access the "is domestic" hidden HTML form field
	var isDomesticHiddenField = document.getElementById(isDomesticHiddenFieldId);	
	
	// Use given linkTextDivId to get a variable to access to the link div area 
	var linkTextDiv = document.getElementById(linkTextDivId);

	// If the current state of the In-US flag show we are in the US
	if(isDomesticHiddenField.value==1)
	{
		toggleItemVisibility(toggleA);
		toggleItemVisibility(toggleB);
		toggleItemVisibility(toggleC);
		toggleItemVisibility(toggleD);	
		toggleItemVisibility(toggleE);			
		isDomesticHiddenField.value=0;
		linkTextDiv.innerHTML="In the US?";
	}
	
	// Else, the current state of the In-Us flag is international
	else
	{
		toggleItemVisibility(toggleA);
		toggleItemVisibility(toggleB);
		toggleItemVisibility(toggleC);
		toggleItemVisibility(toggleD);		
		toggleItemVisibility(toggleE);			
		isDomesticHiddenField.value=1;
		linkTextDiv.innerHTML="Not In US?";
	}
}


//------------------------------------------------------------------------------
// FUNCTION: doZipToggle5Items
//
// DESCRIPTION:	
//		
//
//
//	PARAMETERS:
//		isDomesticHiddenFieldId - ID of the HTML "hidden" form element that indicates whether
//										          the value is domestic or international
//		linkTextDivID			 - ID of the HTML "div" form element that contains the "In the
//										     US?" / "Not in the US?" text
//		toggleA	- ID of first item to toggle visibility of
//		toggleB	- ID of second item to toggle visibility of
//		toggleC	- ID of third item to toggle visibility of
//		toggleD	- ID of fourth item to toggle visibility of
//  	toggleE	- ID of fifth item to toggle visibility of
//  	toggleF	- ID of sixth item to toggle visibility of
//  	toggleG	- ID of seventh item to toggle visibility of
//
//------------------------------------------------------------------------------
function doZipToggle5Items( isDomesticHiddenFieldId, linkTextDivId, toggleA, toggleB, toggleC, toggleD, toggleE )
{
	// Use given isDomesticHiddenFieldId to get a variable to access the "is domestic" hidden HTML form field
	var isDomesticHiddenField = document.getElementById(isDomesticHiddenFieldId);	
	
	// Use given linkTextDivId to get a variable to access to the link div area 
	var linkTextDiv = document.getElementById(linkTextDivId);

	// If the current state of the In-US flag show we are in the US
	if(isDomesticHiddenField.value==1)
	{
		toggleItemVisibility(toggleA);
		toggleItemVisibility(toggleB);
		toggleItemVisibility(toggleC);
		toggleItemVisibility(toggleD);	
		toggleItemVisibility(toggleE);
		//toggleItemVisibility(toggleF);
		//toggleItemVisibility(toggleG);
		//toggleItemVisibility(toggleH);
		//toggleItemVisibility(toggleI);
		isDomesticHiddenField.value=0;
		linkTextDiv.innerHTML="In the US?";
	}
	
	// Else, the current state of the In-Us flag is international
	else
	{
		toggleItemVisibility(toggleA);
		toggleItemVisibility(toggleB);
		toggleItemVisibility(toggleC);
		toggleItemVisibility(toggleD);		
		toggleItemVisibility(toggleE);		
		//toggleItemVisibility(toggleF);
		//toggleItemVisibility(toggleG);
		//toggleItemVisibility(toggleH);
		//toggleItemVisibility(toggleI);		
		isDomesticHiddenField.value=1;
		linkTextDiv.innerHTML="Not In the US?";
	}
}



//------------------------------------------------------------------------------
// FUNCTION: doZipToggle6Items
//
// DESCRIPTION:	
//		
//
//
//	PARAMETERS:
//		isDomesticHiddenFieldId - ID of the HTML "hidden" form element that indicates whether
//										          the value is domestic or international
//		linkTextDivID			 - ID of the HTML "div" form element that contains the "In the
//										     US?" / "Not in the US?" text
//		toggleA	- ID of first item to toggle visibility of
//		toggleB	- ID of second item to toggle visibility of
//		toggleC	- ID of third item to toggle visibility of
//		toggleD	- ID of fourth item to toggle visibility of
//  	toggleE	- ID of fifth item to toggle visibility of
//  	toggleF	- ID of sixth item to toggle visibility of
//  	toggleG	- ID of seventh item to toggle visibility of
//
//------------------------------------------------------------------------------
function doZipToggle6Items( isDomesticHiddenFieldId, linkTextDivId, toggleA, toggleB, toggleC, toggleD, toggleE, toggleF )
{
	// Use given isDomesticHiddenFieldId to get a variable to access the "is domestic" hidden HTML form field
	var isDomesticHiddenField = document.getElementById(isDomesticHiddenFieldId);	
	
	// Use given linkTextDivId to get a variable to access to the link div area 
	var linkTextDiv = document.getElementById(linkTextDivId);

	// If the current state of the In-US flag show we are in the US
	if(isDomesticHiddenField.value==1)
	{
		toggleItemVisibility(toggleA);
		toggleItemVisibility(toggleB);
		toggleItemVisibility(toggleC);
		toggleItemVisibility(toggleD);	
		toggleItemVisibility(toggleE);
		toggleItemVisibility(toggleF);
		//toggleItemVisibility(toggleG);
		//toggleItemVisibility(toggleH);
		//toggleItemVisibility(toggleI);
		isDomesticHiddenField.value=0;
		linkTextDiv.innerHTML="In the US?";
	}
	
	// Else, the current state of the In-Us flag is international
	else
	{
		toggleItemVisibility(toggleA);
		toggleItemVisibility(toggleB);
		toggleItemVisibility(toggleC);
		toggleItemVisibility(toggleD);		
		toggleItemVisibility(toggleE);		
		toggleItemVisibility(toggleF);
		//toggleItemVisibility(toggleG);
		//toggleItemVisibility(toggleH);
		//toggleItemVisibility(toggleI);		
		isDomesticHiddenField.value=1;
		linkTextDiv.innerHTML="Not In the US?";
	}
}