var m_nItemId
/*
gets the text area and input boxes
necessary to edit the the address on a given card
*/
function GetEditAddressUI( nItemId )
{ 
	m_nItemId = nItemId;
	//Append the name to search for to the requestURL 
	var url = requestURL + "editCard/EditAddress.asp?itemid=" + nItemId + "&datacd=" + Math.floor(Math.random()*1000); 
	    
	//Create the xmlHttp object to use in the request 
	//stateChangeHandler will fire when the state has changed, i.e. data is received back 
	// This is non-blocking (asynchronous) 
	xmlHttp = GetXmlHttpObject(CardEditStateChangeHandler); 
	    
	//Send the xmlHttp get to the specified url 
	xmlHttp_Get(xmlHttp, url, true); 

}

/*
places the selected UI for editing 
the card in the web page
*/		
function CardEditStateChangeHandler() 
{ 
	//readyState of 4 or 'complete' represents that data has been returned 
	if (xmlHttp.readyState == 4 || xmlHttp.readyState == 'complete')
	{ 
		var obj
		obj = document.getElementById("editArea_" + m_nItemId);
		if(xmlHttp.status == 200)
		{
			//Gather the results from the callback 
			var str = xmlHttp.responseText; 

			//Populate the innerHTML of the div with the results
					
			obj.innerHTML = str; 
		}
		else
		{
			obj.innerHTML = strErrorMessageStart + "Sorry due to a system error we cannot currently access the card information" + strErrorMessageEnd;
		}
	} 
}

/*
gets the text areas and input boxes
necessary to edit the the address on a given card
*/
function editGreeting(nItemId)
{
	m_nItemId = nItemId;
	//Append the name to search for to the requestURL 
	var url = requestURL + "editCard/EditMessage.asp?itemid=" + nItemId + "&datacd=" + Math.floor(Math.random()*1000); 
	    
	//Create the xmlHttp object to use in the request 
	//stateChangeHandler will fire when the state has changed, i.e. data is received back 
	// This is non-blocking (asynchronous) 
	xmlHttp = GetXmlHttpObject(CardEditStateChangeHandler); 
	    
	//Send the xmlHttp get to the specified url 
	xmlHttp_Get(xmlHttp, url, true); 
}

/*
gets the input boxes
necessary to edit the the post date on a given card
*/
function editPostDate(nItemId)
{
	m_nItemId = nItemId;
	//Append the name to search for to the requestURL 
	var url = requestURL + "editCard/EditPostDate.asp?itemid=" + nItemId + "&datacd=" + Math.floor(Math.random()*1000); 
	    
	//Create the xmlHttp object to use in the request 
	//stateChangeHandler will fire when the state has changed, i.e. data is received back 
	// This is non-blocking (asynchronous) 
	xmlHttp = GetXmlHttpObject(CardEditStateChangeHandler); 
	    
	//Send the xmlHttp get to the specified url 
	xmlHttp_Get(xmlHttp, url, true); 
}




function CheckAddress(strAddress)
{
	if (strAddress == "") 
	{
		alert("Please ensure you enter an address and country to send the card to. Thank you.")
				//return false
	}
}


