/**
 * @author fakbar
 */
function trackMemberProfileStats(memberNickName,type,cookieName)
{
	//alert("memberNickName" + " " +memberNickName);
	
	var today = new Date();
	var d = today.getDate() + today.getTime();
	var statImage = "http://profile-stats.break.com/invoke.gif?m="+memberNickName+"&type="+type+"&s=1&d="+d;
	var isSet = false;

// LC: 5/7/2007, try to see if that improve the profile view count
/*	
	if(getCookie(cookieName) != null)
	{
		var profileCookie = getCookie(cookieName);
		//alert("profileCookie" + " " +profileCookie);
		
		
		if(profileCookie.length < 300000) //see the size if 
		{	//alert("profileCookie.length " + profileCookie.length);
			//alert(profileCookie.indexOf(memberNickName));
			if(profileCookie.indexOf(memberNickName) != -1) //see if the nick name exists in the list. 
			{	//alert("isSET true 1");
				isSet = true;
			}
			else if (profileCookie == memberNickName)
			{	//alert("isSET true 2");
				isSet = true;
			}
			else
			{	//alert("here ? Y ");
				var theNewValue = profileCookie + "-" + memberNickName; //append the id to the value. 
				setCookie(cookieName,theNewValue,24,"","","");
			}
		}
		else
		{
			setCookie(cookieName,memberNickName,24,"","","");
		}
	}
	else
	{
		setCookie(cookieName,memberNickName,24,"","","");
	}
*/
	
	if(!isSet)
	{
		//alert(isSet);
		//var image = new Image(1,1);
		//image.src = statImage;	
	}
}

function getCookie(name) 
{
	var start = document.cookie.indexOf( name + "=" );
	var len = start + name.length + 1;
	if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) {
		return null;
	}
	if ( start == -1 ) return null;
	var end = document.cookie.indexOf( ";", len );
	if ( end == -1 ) end = document.cookie.length;
	return unescape( document.cookie.substring( len, end ) );
}

function setCookie(name,value,expires,path,domain,secure) 
{
	var today = new Date();
	today.setTime( today.getTime() );
	if ( expires ) {
		expires = 365 * expires * 1000 * 60 * 60 * 24;
	}
	var expires_date = new Date( today.getTime() + (expires) );
	
	
	document.cookie = name+"="+escape( value ) +
		( ( expires ) ? ";expires="+expires_date.toGMTString() : "" ) + //expires.toGMTString()
		( ( path ) ? ";path=" + path : "" ) +
		( ( domain ) ? ";domain=" + domain : ".break.com" ) +
		( ( secure ) ? ";secure" : "" );
}

