var cX = 0; var cY = 0; var rX = 0; var rY = 0;
function UpdateCursorPosition(e){ cX = e.pageX; cY = e.pageY;}
function UpdateCursorPositionDocAll(e){ cX = event.clientX; cY = event.clientY;}
if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; }
else { document.onmousemove = UpdateCursorPosition; }
function AssignPosition(d) {
if(self.pageYOffset) {
	rX = self.pageXOffset;
	rY = self.pageYOffset;
	}
else if(document.documentElement && document.documentElement.scrollTop) {
	rX = document.documentElement.scrollLeft;
	rY = document.documentElement.scrollTop;
	}
else if(document.body) {
	rX = document.body.scrollLeft;
	rY = document.body.scrollTop;
	}
if(document.all) {
	cX += rX; 
	cY += rY;
	}
d.style.left = (cX+10) + "px";
d.style.top = (cY+10) + "px";
}
function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);
dd.style.display = "block";
}
function ReverseContentDisplay(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);
if(dd.style.display == "none") { dd.style.display = "block"; }
else { dd.style.display = "none"; }
}


function confirm_cancel_membership()
{
	var r=confirm("Are you sure you want to cancel your membership?");
	if (r==true)
	{
		// send the user to the cancel membership action page
		window.location = 'cancelmembershipaction.php' ;
	}
}

function confirm_remove_photo()
{
	var r=confirm("Are you sure you want to remove your photo?") ;
	if (r==true)
	{
		// send the user to the remove photo action page
		window.location = 'removephotoaction.php' ;
	}
}

function confirm_delete_inbox_message(id)
{
	var r=confirm("Are you sure you want to delete this mail?") ;
	if (r==true)
	{
		// send the user to the remove inbox message action page
		goto = 'removeinboxmessageaction.php?id=' + id ;
		window.location = goto ;
	}
}

function confirm_delete_sentmail_message(id)
{
	var r=confirm("Are you sure you want to delete this mail?") ;
	if (r==true)
	{
		// send the user to the remove sent mail message action page
		goto = 'removesentmailmessageaction.php?id=' + id ;
		window.location = goto ;
	}
}

function limitText(limitField, limitNum) {
    if (limitField.value.length > limitNum)
	{
        limitField.value = limitField.value.substring(0, limitNum);
    } 
}