var textline = '';
var defaultdisplay = 'N/A';

function getphonecode()
{
	h = document.getElementById('phonecode').innerHTML;
	h = h.replace(/(<([^>]+)>)/ig, '');
	h = (h.replace(/^\W+/, '')).replace(/\W+$/, '');
	
	p = getPartnerId();

	code = 'N/A';
	if (h != 'N/A')
		code = h;
	if (p)
		code = 'P' + p;
	if (h != 'N/A' && p)
		code = h + '/P' + p;
	
	return code;
}

function phoneonmover()
{
	if (typeof(oldphone) == 'undefined')
		oldphone = document.getElementById('topphone').innerHTML;

	document.getElementById('topphone').innerHTML = 'Phone Code:<br />' + getphonecode();
}

function phoneonmout()
{
	document.getElementById('topphone').innerHTML = oldphone;
}

function getPartnerId()
{
	var re=new RegExp("PartnerID=[^;]+", "i"); //construct RE to search for target name/value pair
	if (document.cookie.match(re)) //if cookie found
		return document.cookie.match(re)[0].split("=")[1] //return its value
	return null
}
