function get_cookie(cookie_name)
{
  var results = document.cookie.match ( cookie_name + '=(.*?)(;|$)' );

  if ( results )
    return ( unescape ( results[1] ) );
  else
    return null;
}


function affiliate_Cookie()
{
  var name = "SSAID";
  var mainUrl; 
  var value ="111";
  var URLparts;
  var Arguments;
  mainURL = window.location.search;
  URLparts = mainURL.split('?');
  if (URLparts != "/" && URLparts != ""){
  Arguments = URLparts[1].split('&');
  for (i in Arguments) {
	pair = Arguments[i].split('=');
  	//document.write("Parameter: "+pair[0]+"<br>");
  	//document.write("Value    : "+pair[1]+"<p>");
  }
  value =  pair[1];
  var cookie_string = name + "=" + escape(value);
  //var dt= new Date();
  var today = new Date();
  var expires = new Date(today.getYear(),today.getMonth() + 1,today.getDate(),today.getHours(),today.getMinutes(),today.getSeconds());
  //var expires = dt.getDate()+3;   
  cookie_string += "; expires=" + expires.toGMTString();
  document.cookie = cookie_string;
  }
  return true;
}