function check_resolution()     {
  if (screen.width < 800) {
        if (!(get_string = document.location.search))   {
                var newloc= document.location.pathname + "?style=small";
                document.location.href = newloc;
        } else {
                if (!get_string.match('style')) {
                         var newloc2= document.location.pathname + get_string + "&style=small";
                         document.location.href = newloc2;
                }

        }
  }
}
check_resolution();

function setCookie(name, value, expires, path, domain, secure)
{
// set time, it's in milliseconds
var today = new Date();
today.setTime( today.getTime() );

/*
if the expires variable is set, make the correct 
expires time, the current script below will set 
it for x number of days, to make it for hours, 
delete * 24, for minutes, delete * 60 * 24
*/
if ( expires )
{
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
( ( 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 setstylecookie() {
  get_string = document.location.search;
  if (
	(get_string.match('style'))
      &&(!get_string.match('style=print'))
  ) {
	setCookie("stylecookie", get_string,"","/");
  }
}
setstylecookie();

function toggleLayer(whichLayer) {
	if (document.getElementById) {
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
		if (style2.display=="block") {
			style2.display="none";
		} else {
			style2.display="block";
		}
	}
}

function dealerLogout() {
  setCookie('dealercookieu','','','','');
  window.location='http://www.landoll.com/';
}

