		function getCookie(name)
		{
			return unescape(doGetCookie(name));
		}
		
		function setCookie(namestr, value, time)
		{
			doSetCookie(escape(namestr), escape(value), time);
		}

		var arwin;
		
		function shopen(href, width, height)
		{
			width = width?width:550;
			height = height?height:500;
			if(arwin&&!arwin.closed)
			{
				arwin.location=href;
				arwin.focus();
			}
			else
			{
				arwin=window.open(href, '_blank', 'location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no,width='+width+',height='+height+',top=0,left=0');
			}
			return false;
		}

		function doSetCookie(namestr, value, time)
		{
			time = time ? time : 4 * 60 * 60 * 1000;
			len = document.cookie.length;
			var now = new Date();
			if (value)
			{
				now.setTime(now.getTime() + time);
			}
			else
			{
				now.setTime(now.getTime() - time);
				len = 0;
			}
		    document.cookie = namestr + '=' + value + '; path=/; expires=' + now.toGMTString() ;
		}

		function doGetCookie(name)
		{
			var cookie = ' ' + document.cookie;
			var search = ' ' +  escape(name) + '=';
			var setStr = null;
			var offset = 0;
			var end = 0;
			if (cookie.length > 0)
			{
				offset = cookie.indexOf(search);
				if (offset != -1)
				{
					offset += search.length;
					end = cookie.indexOf(';', offset)
					if (end == -1)
					{
						end = cookie.length;
					}
					setStr = cookie.substring(offset, end);
				}
				else
				{
					setStr = '';
				}
			}
			else
			{
				setStr = '';
			}
			return(setStr);
		}

