/**
 * Set the cookie value.
 */
function setResourceViewEventCookieValue(resType, resourceId)
{
	// get the cookie value using common.js function.
	var c_name = 'rv_' + resType;
	var cookieValue = Get_Cookie(c_name);
	if (cookieValue == null) {
		cookieValue = '';
	}
	var idFound = false; 
	var resIds = cookieValue.split(':');
	for (id in resIds) {
		if (id == resourceId) {
			idFound = true;
			break;
		}
	}
	if (!idFound) {
		var len = resIds.length;
		if (len >= 15) {
			cookieValue = '';
			for (var i = 1; i < len; i++) {
				cookieValue = cookieValue + resIds[i];
				if (i < len - 1) {
					cookieValue = cookieValue + ":";
				} 
			}
		}
		if (cookieValue != '') {
			cookieValue = cookieValue + ":";
		}
		cookieValue = cookieValue + resourceId;	
		var expiredays = 10;
		var exdate = new Date();
		exdate.setDate(exdate.getDate() + expiredays);
		document.cookie = c_name + "=" + escape(cookieValue) + ((expiredays==null) ? "" : ";path=/;expires=" + exdate.toGMTString());
	}
}
