	function writeCookie(key, value) 
	{
	 var today = new Date();
	 var the_date = new Date("December 31, 2024");
	 var the_cookie_date = the_date.toGMTString();
	 var the_cookie = key+"="+value;
	 var the_cookie = the_cookie + ";expires=" + the_cookie_date;
	 document.cookie=the_cookie
//	 alert(key+' : '+value);
	}
	
	function delCookie(key) 
	{
	 var today = new Date();
	 var the_date = new Date("December 31, 1979");
	 var the_cookie_date = the_date.toGMTString()-3600;
	 var the_cookie = key+"=";
	 var the_cookie = the_cookie + ";expires=" + the_cookie_date;
	 document.cookie=the_cookie
	}
	
	
	function getObject(layerName) {
		obj = document.getElementById(layerName).style;
		return obj;
	}
	
	function switchit(layerName)
	{
		obj = getObject(layerName);
		
		if (obj.display == 'block')
		{
			obj.display = 'none';
			delCookie('lastmooLayer');
		}
		else
		{
			writeCookie('lastmooLayer', layerName);
			obj.display = 'block';		
		}
	}
	
	function moo(i)
	{
		if (parseInt(lastclick) >= 0)
		{
			switchit('item'+lastclick+'_sub');
		}
	
			switchit('item'+i+'_sub');
			lastclick = i;
			writeCookie('lastclick', lastclick);
			
//			alert(document.cookies['lastmoo']);
	}
	
	
	       var picwin = null;

        function open_pic(url,h,w)
        {
                LeftPosition=(screen.width)?(screen.width-w)/2:100;
                TopPosition=(screen.height)?(screen.height-h)/2:100;

                picwin = window.open(url,'picwin','scrollbars=0,menu=0,height='+h+',width='+w+',left='+LeftPosition+',top='+TopPosition);
        }
