<!--
function Set_Cookie(name,value,expires,path,domain,secure)
{
    document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}
function Get_Cookie(name) 
{
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) 
	{
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg) {
		  return Get_CookieVal(j);
		}
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) {
		  break; 
		}
	}
    return 0;
}

function Get_CookieVal(offset) 
{
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1) {
		endstr = document.cookie.length;
	}
	return unescape(document.cookie.substring(offset, endstr));
}

function randomize(page) {
	//Get random number between 1 and 5 if cookies has not been set
	if(!Get_Cookie("ID_random") || page == "1") {
		ID_value = Math.round(Math.random() * 2) + 1;
		if(Get_Cookie("ID_random") == ID_value) {
			if(ID_value == 3) {
				ID_value--;
			} else {
				ID_value++;
			}
		}
		Set_Cookie("ID_random", ID_value, null, "/");
	//Get the stored cookie value
	} else {
		var ID_value = Get_Cookie("ID_random");
	}
	//Display the random image for the home or secondary page
	if (page == "1") {
		document.write('<img src="images/img_home_0' + ID_value + '.jpg" width="550" height="160">');
	} else if(page == "2") {
		document.write('<img src="images/img_download_0' + ID_value + '.jpg" width="175" height="125">');
	} else if(!page) {
		document.write('<img src="images/img_sec_0' + ID_value + '.jpg" width="550" height="160">');
	}
}


  var qs = location.search.substring(1);
  var nv = qs.split('&');
  var url = new Object();
  if(qs.length > 2){
	for(i = 0; i < nv.length; i++)
	{
	  eq = nv[i].indexOf('=');
	  url[nv[i].substring(0,eq).toLowerCase()] = unescape(nv[i].substring(eq + 1));
	  var urlCookie = qs.split('=');
	  Set_Cookie(urlCookie[0], urlCookie[1], null, "/");
	}
  }

//-->
