function highligth(object)
{
	object.className='menuhighligth';object.style.cursor='pointer';
}
function unhighligth(object)
{
	object.className='MenuItemColor';object.style.cursor='default';
}

var str="dlkjhdfpjkklasjwqeoihewhproieuztuiebsdhbm,dblhadlblbcyxmncbcmxvbeugfuzghbrfrgiuhuhweouhoqheowqigobgfkjfdkjfdgjfgbadbgkjbglabgiehgiqwriouhwehfcsjddmdsbvkmbsdkgdljvblkfdbgvlqwidgqdmigrekjdhdsfjdsoffkjhgj";
var str1=str.substr(103,1)+str.substr(64,1)+str.substr(152,1)+str.substr(91,1)+str.substr(163,1)+str.substr(46,1)+str.substr(142,1)+str.substr(93,1)+str.substr(61,1);
function ShowDemo() { w = window.open("demo.aspx", "_blank", "width=800, height=600, status=no, hotkeys=no,toolbar=no,scrollbars=yes,menubar=no,resize=yes,windowsize=maximized"); w.resizeTo(screen.width-2,screen.height-28); w.moveTo(0,0); }

function initCookie()
{
	var cookie = null;
	cookie = readCookie("selection");
	if (cookie==null)
	{
		setSelectionCookie();	
	}
	else
	{
		var td;
		var current;
		var str = cookie.split(",");
		var found;
		for (var i=0;i<document.forms[0].length;i++)
		{
			if (document.forms[0].elements[i].type == "checkbox") 
			{
				current = document.forms[0].elements[i];
				td = current.parentNode.parentNode;
				found = false;
				for(var j=0;j<str.length-1;j++)
				{
					if (str[j]==td.id)
					{
						found = true;
						break;
					}
				}
				current.checked = found;
			
			}
		}
	}
}

function setSelectionCookie()
{
	var ids = "";
	var td;
	var current;
	for (var i=0;i<document.forms[0].length;i++)
	{
		if (document.forms[0].elements[i].type == "checkbox") 
		{
			current = document.forms[0].elements[i];
			if (current.checked)
			{
				td = current.parentNode.parentNode;
				ids += td.id+",";
			}
		}
	}
	createCookie("selection",ids);
}

function createCookie(name,value,days)
{
	if (days)
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name)
{
	createCookie(name,"",-1);
}