if (window.location == 'http://bid.mclemoreauction.com/cgi-bin/mncal.cgi?mclemore')
	window.location = 'http://www.mclemoreauction.com';

// Cookies code: http://www.w3schools.com/JS/js_cookies.asp

function getCookie(c_name)
{
	if (document.cookie.length > 0)
	{
		c_start = document.cookie.indexOf(c_name + "=");
		if (c_start != -1)
		{
			c_start = c_start + c_name.length + 1;
			c_end = document.cookie.indexOf(";", c_start);
			if (c_end == -1) c_end = document.cookie.length;
			return unescape(document.cookie.substring(c_start,c_end));
		}
	}
	
	return '';
}

function setCookie(c_name, value)//, expiredays)
{
	var expiredays = 14;
	var exdate = new Date();
	exdate.setDate(exdate.getDate() + expiredays);
	document.cookie = c_name + '=' + escape(value) + ((expiredays == null) ? '' : ';expires=' + exdate.toUTCString());
}

function toggleMore(idName)
{
    var moreObject = document.getElementById('more_' + idName);
    var moreButtonObject = document.getElementById('more_' + idName + '_button');
    
    if (moreObject.style.display == 'none')
    {
    	moreObject.style.display = 'block';
    	moreButtonObject.className = 'show_fewer_button';
    	moreButtonObject.innerHTML = moreButtonObject.innerHTML.replace(/ All /, ' Fewer ');
    }
    else
    {
    	moreObject.style.display = 'none';
    	moreButtonObject.className = 'show_all_button';
    	document.getElementById(idName).scrollIntoView(true);
    	moreButtonObject.innerHTML = moreButtonObject.innerHTML.replace(/ Fewer /, ' All ');
    }
}

function zoomMap(thisMapLinkObject, zoomIn)
{
    var mapImageObject = thisMapLinkObject.firstChild;
    mapImageObject.src = mapImageObject.src.replace(/\&zoom\=\d+\&/, '&zoom=' + (zoomIn ? '15' : '13') + '&');
}
