<!-- Hide script from older browsers
//marketing popup section
//enable on all pages, but only if the user hasn't see it before
//PopupNewsletter();

//set unique visitor id
if (GetCookie("ardenhomeid") == null) { SetSonomaID(); }

function PopupNewsletter()
{
	var today = new Date();
	var zero_date = new Date(0,0,0);
	today.setTime(today.getTime() - zero_date.getTime());

	var todays_date = new Date(today.getYear(),today.getMonth(),today.getDate(),0,0,0);
	var expires_date = new Date(todays_date.getTime() + (16 * 7 * 86400000));	//16 weeks from today


	//retrieve cookie
	if (GetCookie("mtpopupseen") == null)
	{
		popWindowGeneric("pop-home.asp",345,575);
		SetCookie("mtpopupseen","true");
	}
}

function SetSonomaID()
{
	var today = new Date();
	var day = padnumber(today.getDate());
	var month = padnumber(today.getMonth() + 1);
	var year = today.getYear();
	var randomkey = rand(1000000000);
	var sonomaid = year + '' + month + '' + day + "-" + randomkey;
	var todays_date = new Date(today.getYear(),today.getMonth(),today.getDate(),0,0,0);
//	var expires_date = new Date(todays_date.getTime() + (104 * 7 * 86400000));	//104 weeks (2 years) from today
	var expires_date = new Date("01/01/2004"); //set to expire 1/1/2004
	SetCookie("ardenhomeid",sonomaid,expires_date);
}


//standard randomizer functions
function rnd() 
{
	rnd.today=new Date();
	rnd.seed=rnd.today.getTime();
  rnd.seed = (rnd.seed*9301+49297) % 233280;
  return rnd.seed/(233280.0);
}

function rand(number) { return Math.ceil(rnd()*number); }

//standard cookie functions
function GetCookie(name) {
  var start = document.cookie.indexOf(name+"=");
  var len = start+name.length+1;
  if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
  if (start == -1) return null;
  var end = document.cookie.indexOf(";",len);
  if (end == -1) end = document.cookie.length;
  return unescape(document.cookie.substring(len,end));
}

function SetCookie(name,value,expires,path,domain,secure) {
	document.cookie = name + "=" +escape(value) +
			( (expires) ? ";expires=" + expires.toGMTString() : "") +
			( (path) ? ";path=" + path : "") + 
			( (domain) ? ";domain=" + domain : "") +
			( (secure) ? ";secure" : "");
}

//common javascript functions
function padnumber(number) { return (number < 10) ? '0' + number : number; }


function ConfirmDelete (sURL, sName)
{
	var bDelete;
	bDelete = false;
	bDelete = confirm("Are you sure you want to delete " + sName + "?");
	if (bDelete) { window.top.location.href = sURL; }
}

var childWindow=null ;
function openChild(loc,w,h)
{
	closeChild() ;
	
	var leftPos ;
	//if (window.screen) leftPos=window.screen.width-w-50 ; else leftPos=0 ;
	leftPos = 450;
	childWindow=window.open(loc,'childWindow','width=' + w + ',height=' + h + ',scrollbars=1,left=' + leftPos + ',top=0') ;
}

function closeChild()
{
	if (childWindow && childWindow.open && !childWindow.closed) childWindow.close() ;
	childWindow=null ;
}

function popWindow( s )
{
	openChild( s,840,740 );
}

function popWindowGeneric( s,w,h )
{
	openChild(s,w,h);	
}

// End hiding script from older browsers -->

