﻿			var cookies = new Object();
			
			function extractCookies()
			{
				var name, value;
				var beginning, middle, end;
				for (name in cookies)
				{ // if there are any entries currently, get rid of them 
					cookies = new Object();
					break;
				}
				beginning = 0;  // start at beginning of cookie string
				
				while (beginning < document.cookie.length)
				{
					middle = document.cookie.indexOf('=', beginning);  // find next =
					end = document.cookie.indexOf(';', beginning);  // find next ;

					if (end == -1)  // if no semicolon exists, it's the last cookie
						end = document.cookie.length;
						
					if ( (middle > end) || (middle == -1) )
					{ // if the cookie has no value... 
						name = document.cookie.substring(beginning, end);
						value = "";
					}
					else
					{ // extract its value
						name = document.cookie.substring(beginning, middle);
						value = document.cookie.substring(middle + 1, end);
					}
					cookies[name] = unescape(value);  // add it to the associative array
					beginning = end + 2;  // step over space to beginning of next cookie
				}
			}

//			document.onmousedown = CheckButton;

//			function CheckButton()
//			{
//				if (event.button == 2 || event.button == 3)
//				{
//					alert("这个……不能点右键哦^o^");
//				}
//			}

	function TopicGameTypeChanged()
	{
		// 仅仅是该游戏
		if (document.Form1.TopicGameType[0].checked)
		{
			document.getElementById("PublishTopicLink").setAttribute("href", "/orzbbs/PublishTopic.aspx?gtype=1&gid" 
				+ document.Form1.action.substring(document.Form1.action.indexOf("=")));
		}
		else if (document.Form1.TopicGameType[1].checked)
		{
			document.getElementById("PublishTopicLink").setAttribute("href", "/orzbbs/PublishTopic.aspx?gtype=2&gid" 
				+ document.Form1.action.substring(document.Form1.action.indexOf("=")));
		}
		else if (document.Form1.TopicGameType[2].checked)
		{
			document.getElementById("PublishTopicLink").setAttribute("href", "/orzbbs/PublishTopic.aspx?gtype=3&gid" 
				+ document.Form1.action.substring(document.Form1.action.indexOf("=")));
		}
	}
