var newwindow;
function popURL(url)
{
	newwindow=window.open(url,'name','height=500,width=525,left=10, top=1,resizable=yes,scrollbars=yes,toolbar=no,status=no');
}
function setCookie(name, value, expires, path, domain, secure)
{
    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}
function getCookie(name)
{
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1)
    {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    }
    else
    {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1)
    {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}
function deleteCookie(name, path, domain)
{
    if (getCookie(name))
    {
        document.cookie = name + "=" + 
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
    }
}
function addBuildingToCookie(id)
{
	if (getCookie('saved_buildings'))
	{
		var cData = getCookie('saved_buildings');
		cData = cData + ',' + id;
		setCookie('saved_buildings',cData,25902000);
	}
	else
	{
		setCookie('saved_buildings',id,25902000);
	}
}
        function toggleLayer(whichLayer,vistext) 
        {
                if (document.getElementById)
                {
                        // this is the way the standards work
                        var style2 = document.getElementById(whichLayer).style;
                        style2.display = vistext;
                }
                else if (document.all)
                {
                        // this is the way old msie versions work
                        var style2 = document.all[whichLayer].style;
                        style2.display = vistext;
                }
                else if (document.layers)
                {
                        // this is the way nn4 works
                        var style2 = document.layers[whichLayer].style;
                        style2.display = vistext;
        	}
	}

