<!--

var ref = document.referrer;

if(ref.substring(0,24) != "http://www.littlepim.com" && !get_cookie('pimURL')){
	ref='<a href="http://www.littlepim.com/store">Return to the Little Pim Store</a>';
}else{
	var current_date = new Date;
    var cookie_year = current_date.getFullYear ( );
    var cookie_month = current_date.getMonth ( );
    var cookie_day = current_date.getDate ( ) + 15;
    
	if(!get_cookie('pimURL')){
		ref = '<a href="' + ref + '">Continue Shopping</a>';
		set_cookie('pimURL', ref, cookie_year, cookie_month, cookie_day);
	}else{
		if(ref.substring(0,24) == "http://www.littlepim.com" && get_cookie('pimURL') != ref){
			delete_cookie('pimURL');
			set_cookie('pimURL', ref, cookie_year, cookie_month, cookie_day);
		}
		ref = '<a href="' + get_cookie('pimURL') + '">Continue Shopping</a>';
	}
}

var header = document.getElementById('header');

header.innerHTML = '<div id="pimlogo"><a href="http://www.littlepim.com"><img src="http://www.littlepim.com/nf_store/images/header_notype.gif" alt="LittlePim" width="305" height="106"/></a><span class="return">' + ref + '</div>';


//Cookie methods

function get_cookie ( cookie_name )
{
  var results = document.cookie.match ( cookie_name + '=(.*?)(;|$)' );

  if ( results )
    return ( unescape ( results[1] ) );
  else
    return null;
}

function set_cookie ( name, value, exp_y, exp_m, exp_d, path, domain, secure )
{
  var cookie_string = name + "=" + escape ( value );

  if ( exp_y )
  {
    var expires = new Date ( exp_y, exp_m, exp_d );
    cookie_string += "; expires=" + expires.toGMTString();
  }

  if ( path )
        cookie_string += "; path=" + escape ( path );

  if ( domain )
        cookie_string += "; domain=" + escape ( domain );
  
  if ( secure )
        cookie_string += "; secure";
  
  document.cookie = cookie_string;
}

function delete_cookie ( cookie_name )
{
  var cookie_date = new Date ( );  // current date & time
  cookie_date.setTime ( cookie_date.getTime() - 1 );
  document.cookie = cookie_name += "=; expires=" + cookie_date.toGMTString();
}

// -->



