function setupPage()
{
	
	// round corners
	document.getElementsByClassName("box1", 'left').each(function(box){var box1h2 = box.getElementsByTagName("h3");if(box1h2.length > 0) Rico.Corner.round(box1h2[0], {corners:"top", color:"#143aa9", bgColor:"#e3e9f7"});});
	document.getElementsByClassName("box1", 'right').each(function(box){var box1h2 = box.getElementsByTagName("h3");if(box1h2.length > 0) Rico.Corner.round(box1h2[0], {corners:"top", color:"#143aa9", bgColor:"#eddcc2"});});
	document.getElementsByClassName("round").each(function(r){Rico.Corner.round(r, {corners:"top"});});

	// emphasize current nav point
	if(document.location.href.match(/\/online-traffic-school\//)) Element.addClassName($('nav_online_traffic_school'), 'navActive');
	else if(document.location.href.match(/\/defensive-driving-online\.html/)) Element.addClassName($('nav_defensive_driving_online'), 'navActive');
	else if(document.location.href.match(/\/florida-traffic-school\/auto-insurance-discount\.html/)) Element.addClassName($('nav_auto_insurance_discount'), 'navActive');
	else if(document.location.href.match(/\/florida-traffic-school\//)) Element.addClassName($('nav_florida_traffic_school'), 'navActive');
	else if(document.location.href.match(/\/florida\//)) Element.addClassName($('nav_florida_traffic_school'), 'navActive');
	else if(document.location.href.match(/\/newdrivers\.php/)) Element.addClassName($('nav_learner_permit'), 'navActive');
	else if(document.location.href.match(/\/driver-education\//)) Element.addClassName($('nav_learner_permit'), 'navActive');
	else if(document.location.href.match(/\/dmv-approved\.html/)) Element.addClassName($('nav_dmv'), 'navActive');
	else if(document.location.href.match(/\/links\.html/)) Element.addClassName($('nav_resources'), 'navActive');
	else if(document.location.href.match(/\/resources\.html/)) Element.addClassName($('nav_resources'), 'navActive');

	if($('friend_email'))
	{
		Element.addClassName('friend_email', 'default_text');
		$('friend_email').value='Enter email address';
		Event.observe('friend_email', 'focus', function(e){if(Element.hasClassName('friend_email', 'default_text')){Element.removeClassName('friend_email','default_text');$('friend_email').value='';}});
	}
}

function rotateTestimonials(cur, tot)
{
	if(!($('testimonial'+cur))) return;
	Element.addClassName('testimonial'+cur, 'hide');
	do { cur++; if(cur >= tot) cur = 0; } while(!$('testimonial'+cur));
	Element.removeClassName('testimonial'+cur, 'hide');
	setTimeout('rotateTestimonials('+cur+','+tot+')', 10000);
}

function nscTrack(id)
{
	var c = Cookie.get('nscTrack');
	if(c != null)
	{
		if(!c.match('(?:^|#)'+escape(id)+'(?:#|$)')) Cookie.set('nscTrack', c+'#'+escape(id));
	} else Cookie.set('nscTrack', escape(id));
	return true;
}

function modelWin(link)
{
	var window_contents = new Element('div',{className: 'window_contents'});
	var w = new Control.Modal($(link), {className:'nscPopup',closeOnClick:false,insertRemoteContentAt:window_contents});
	w.container.insert(window_contents);
	return w;
}