// JavaScript Document
var www = window.location.hostname;
if (www.substring(0,3) != 'www') {
	//alert('www='+www);
	location.replace('http://www.aaker.com/index.html');
}
// 

//Creates a statement in the status bar when mouse is over a link-->
function mouseOver(text) {
	window.status = text;
	return true;
}
//Replaces statement in status bar with defalut statement-->
function mouseOut() {
	window.status = "Welcome to Aaker.com";
}


var session;
var referedFrom = document.referrer;
var navName = window.navigator.appName + "_" +window.navigator.platform;

// * return string containing value of specified cookie or null if cookie does not exist
function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return "";
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

var i = new Image;
if (document.referrer.length >= 1) {
	// alert('ref='+document.referrer);
	i.src = 'http://www.aaker.com/cgi-bin/bake_sale.pl/5WAYS.gif?'+document.referrer;
}
else {
	// alert('noref');
	i.src = 'http://www.aaker.com/cgi-bin/bake_sale.pl/5WAYS.gif';
}

//make the variable string to be passed to swf
function makeVarString(passedSession){
	var tempString = "cookie="+passedSession;
	
	//document info to record
	tempString += "&referrer="+escape(document.referrer);
	tempString += "&viewWidth="+document.width;
	tempString += "&viewHeight="+document.height;
	
	//screen object info to record
	tempString += "&screenWidth="+screen.width;
	tempString += "&screenHeight="+screen.height;
	
	//document location info to record
	tempString += "&pathname="+document.location.pathname;
	tempString += "&search="+escape(document.location.search);
	//alert(window.location["search"]);
	
	//navigator object info to record
	tempString += "&userAgent="+navigator.userAgent;
	tempString += "&platform="+navigator.platform;
	
	//alert("tempString \n" +tempString);
	return(tempString);
	
}
	


