function ValidateAction(Message)
{
	if(confirm(Message))
		return true;
	else
		return false;
}
function sm(n,k,s)
{		
	var d="";
	for(i=0;i<s.length;i++)
		d+=String.fromCharCode(k.charCodeAt(i)^s.charCodeAt(i));
	n.innerHTML='<a hr'+'ef="'+'ma'+'i'+'lto'+':'+ d + '">' + d + '</a>';
}
function sm_wrap(n,k,s)
{		
	var d="";
	for(i=0;i<s.length;i++)
		d+=String.fromCharCode(k.charCodeAt(i)^s.charCodeAt(i));
	
	if(d.length>30)
	{
		if(d.indexOf('@')>30)
			n.innerHTML='<a hr'+'ef="'+'ma'+'i'+'lto'+':'+ d + '" style="font-weight:normal; color:#666666;">' + d.substr(0,20) + '<br>' + d.substring(20, d.indexOf('@')) + '<br>' + d.substr(d.indexOf('@')) + '</a>';
		else
			n.innerHTML='<a hr'+'ef="'+'ma'+'i'+'lto'+':'+ d + '" style="font-weight:normal; color:#666666;">' + d.replace('@','<br>@') + '</a>';
	}
	else
		n.innerHTML='<a hr'+'ef="'+'ma'+'i'+'lto'+':'+ d + '" style="font-weight:normal; color:#666666;">' + d + '</a>';
}
function BigImagePopup(ListingID, ImageOrder)
{
	if( (ListingID===undefined) || (ImageOrder===undefined) )
	{
		var tmp = document.getElementById('FeatImg').src.split('&');
		tmp.splice(0,1);
		var MyURL = '/getimage.php?' + tmp.join('&');
	}
	else
		var MyURL = '/getimage.php?ListingID=' + ListingID + '&ImageOrder=' + ImageOrder;
	MyPop = window.open("", "Details", "status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=0,scrollbars=0,width=656,height=500");
	MyPop.document.write('<html><head><title>Details</title></head>');
	MyPop.document.write('<center><img src=\''+ MyURL +'\'></center></html>');
	MyPop.document.close();
	MyPop.focus();
}
function LimitText(TextArea, MaxLength) 
{
    if (TextArea.value.length > MaxLength) 
        TextArea.value = TextArea.value.substr(0,MaxLength);
}