function SetLastVisitCookie( name, value, expires, path, domain, secure ){ var today = new Date(); today.setTime( today.getTime() ); if ( expires ) expires = expires *24* 60 * 60000; var expires_date = new Date( today.getTime() + (expires) ); document.cookie = name + "=" +escape( value ) + ( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + ( ( path ) ? ";path=" + path : "" ) + ( ( domain ) ? ";domain=" + domain : "" ) + ( ( secure ) ? ";secure" : "" ); } function GetLastCookie( 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 lastVisited(notation,sType){ sValue=notation+sType; if (!GetLastCookie('sLastVisited')){ SetLastVisitCookie( "sLastVisited", sValue ,365); }else{ var lastNotation = GetLastCookie('sLastVisited'); var notations = lastNotation.split(','); var counter = 0; for (i=0;i < notations.length; i++){ if (sValue==notations[i]) { counter ++; } } if (counter == 0){ if (notations.length <= 4){ lastNotation = sValue+','+lastNotation; }else{ notations.pop() lastNotation = sValue+','+notations.toString(); } SetLastVisitCookie( "sLastVisited", lastNotation,365); } } }