function rollover1(target,imgName) {
	if (document.images) {
		imgchange = 'images/' + imgName;
		document[target].src = imgchange;
	}
}

function highlightRow(rowid,row) {
	row.style.cursor='pointer';
	var x = getObj(rowid + 'Text');
	x.style.color='#ed7d13';
}

function unhighlightRow(rowid,IsPopular) {
	var x = getObj(rowid + 'Text');
	x.style.color='#707070';
}

clickedSomeTopics=0;
function toggleCheck(checkid,formname,img) {
	if (!formname) formname = "selform";
	if (isChecked(checkid, formname)) {
		markCheck(checkid,"",formname,img);
		clickedSomeTopics--;
	} else {
		markCheck(checkid,"checked",formname,img);
		clickedSomeTopics++;
	}
	if (checkid == "Category113_135" || checkid == "Category114_135" || checkid == "Category115_135" || checkid == "Category116_135") colorMap();
}

function colorMap() {
	(isChecked("Category113_135", "selform"))? $('#midwestImg').attr('src','images/map_midwest-on.gif') : $('#midwestImg').attr('src','images/map_midwest.gif');
	(isChecked("Category114_135", "selform"))? $('#neastImg').attr('src','images/map_neast-on.gif') : $('#neastImg').attr('src','images/map_neast.gif');
	(isChecked("Category115_135", "selform"))? $('#southImg').attr('src','images/map_south-on.gif') : $('#southImg').attr('src','images/map_south.gif');
	(isChecked("Category116_135", "selform"))? $('#westImg').attr('src','images/map_west-on.gif') : $('#westImg').attr('src','images/map_west.gif');
}

function recordStats(type,desc) {
	$.ajax({
  	url: "post.asp",
  	data: "action=jsRecord&type=" + type + "&description=" + desc,
  	cache: false
	});
}

function isChecked(checkid,formname) {
	return (eval('document.' + formname + '.' + checkid + '.value=="checked"'));
}

function markCheck(checkid,checked,formname,img) {
	if (!formname) formname = "selform";
	eval('document.' + formname + '.' + checkid + '.value="' + checked + '"');
	if (checked == "checked") {
		if (!img) document[checkid + 'Img'].src = "images/topics_checked.gif";
		else document[checkid + 'Img'].src = "images/topics_checked" + img + ".gif";
	} else {
		if (!img) document[checkid + 'Img'].src = "images/topics_unchecked.gif";
		else document[checkid + 'Img'].src = "images/topics_unchecked" + img + ".gif";
	}			
}

function toggleCheckGroup(checkid,img,a) {
	if (toggleCheckEx(checkid,img)) {
		for (i=0;i<a.length;i++)
			if (a[i] != checkid)
				document[a[i] + 'Img'].src = "images/topics_unchecked" + img + ".gif";
	}		
}

function toggleCheckEx(checkid,img) {
	if (isCheckedEx(checkid,img)) {
		document[checkid + 'Img'].src = "images/topics_unchecked" + img + ".gif";
		return false;
	}
	else {
		document[checkid + 'Img'].src = "images/topics_checked" + img + ".gif";
		return true;
	}
}

function getCheckGroupValue(img,a) {
	for (i=0;i<a.length;i++) {
		if (isCheckedEx(a[i], img))
			return a[i];
	}
	return '';
}

function isCheckedEx(checkid,img) {
	if (document[checkid + 'Img'])
		return (document[checkid + 'Img'].src.indexOf("images/topics_checked" + img + ".gif") >= 0);
	return false;
}

function reposition(targetDiv,positionDiv,plusLeft,plusTop) {
	var offset = $("#" + positionDiv).offset();
	$("#" + targetDiv).css("left",offset.left+plusLeft);
	$("#" + targetDiv).css("top",offset.top+plusTop);
}

function repositionCenter(targetDiv,plusLeft,plusTop) {
	width = $("#" + targetDiv).width();
	height = $("#" + targetDiv).height();
	$("#" + targetDiv).css("top",($(window).height()-height) / 2+($(window).scrollTop()+plusTop) + "px");
	$("#" + targetDiv).css("left",($(window).width()-width) / 2+($(window).scrollLeft()+plusLeft) + "px");
}

function repositionQuickView(plusLeft,plusTop) {
	targetDiv = "quickView";
	width = $("#" + targetDiv).width();
	height = $("#" + targetDiv).height();
	//$("#" + targetDiv).css("top",($(window).height()-height) / 2+$(window).scrollTop() + "px");
	$("#" + targetDiv).css("top",($(window).scrollTop()+50+plusTop) + "px");
	$("#" + targetDiv).css("left",($(window).width()-width) / 2+($(window).scrollLeft()+plusLeft) + "px");
}

function showToolTip(tip) {
	switch(tip) {
		case "aboutdata": moveLeft=-40;
		case "help": moveLeft=30;
		case "home": moveLeft=130;
		case "takeatour": moveLeft=-7;
		case "savedresults": moveLeft=-38;
	}
	$("#tooltip").css("background","url(images/tooltip-" + tip + ".gif) no-repeat top left");
	reposition("tooltip",tip + "Btn",-10,29);
	$("#tooltip").toggle();
}

function hideToolTip(tip) {
	$("#tooltip").hide();
}

pageLocation = "";
function printFrameTop(location,step) {
	pageLocation = location;
	document.writeln('<div id="tooltip"></div><table border=0 width=721 cellpadding=0 cellspacing=0>');
	document.writeln('<tr><td><img src="images/bluecorner-topleft.gif" width="12" height="12" alt="" border="0"></td>');
	document.writeln('<td width=697 bgcolor="#006699" colspan=2><img src="images/trans.gif" width="697" height="1" alt="" border="0"></td>');
	document.writeln('<td><img src="images/bluecorner-topright.gif" width="12" height="12" alt="" border="0"></td>');
	document.writeln('</tr>');
	document.writeln('<tr valign="top">');
	document.writeln('<td bgcolor="#006699"><img src="images/trans.gif" width="12" height="1" alt="" border="0"></td><td bgcolor="#006699" height=47>');
	if (location != "home") document.writeln('<img src="images/titleonblue-tool.gif" vspace=8 hspace=2 width="335" height="22" alt="" border="0">');
	document.writeln('</td><td bgcolor="#006699" align=right height=47 nowrap>');

	if (location == "home") document.writeln('<a href="post.asp?type=resourceView&description=Take+a+Tour&file=http%3A%2F%2Fbreeze%2Emetlife%2Ecom%2Fbenchmark09%2F" target="_blank"><img src="images/nav-tour.gif" width="145" height="30" alt="" border="0" hspace=1 id="takeatourBtn"></a>');
	else document.writeln('<a href="post.asp?type=resourceView&description=Take+a+Tour&file=http%3A%2F%2Fbreeze%2Emetlife%2Ecom%2Fbenchmark09%2F" target="_blank" onmouseover="showToolTip(\'takeatour\');" onmouseout="hideToolTip();"><img src="images/nav-tour-sm.gif" width="28" height="30" alt="" border="0" id="takeatourBtn"></a>');
	
	if (step == "step4") document.writeln('<a href="registration.asp"><img src="images/nav-results-on.gif" width="28" height="30" alt="" border="0" id="savedresultsBtn"></a>');
	else document.writeln('<a href="registration.asp" onmouseover="showToolTip(\'savedresults\');" onmouseout="hideToolTip();"><img src="images/nav-results.gif" width="28" height="30" alt="" border="0" id="savedresultsBtn"></a>');

	if (location == "about") document.writeln('<a href="about.asp"><img src="images/nav-about-on.gif" width="28" height="30" alt="" border="0" id="aboutdataBtn"></a>');
	else document.writeln('<a href="about.asp" onmouseover="showToolTip(\'aboutdata\');" onmouseout="hideToolTip();"><img src="images/nav-about.gif" width="28" height="30" alt="" border="0" id="aboutdataBtn"></a>');

	if (location == "help") document.writeln('<a href="help.asp"><img src="images/nav-help-on.gif" width="28" height="30" alt="" border="0" id="helpBtn"></a>');
	else document.writeln('<a href="help.asp" onmouseover="showToolTip(\'help\');" onmouseout="hideToolTip();"><img src="images/nav-help.gif" width="28" height="30" alt="" border="0" id="helpBtn"></a>');

	if (location == "home") document.writeln('<a href="default.asp"><img src="images/nav-home-on.gif" width="28" height="30" alt="" border="0" id="homeBtn"></a>');
	else document.writeln('<a href="default.asp" onmouseover="showToolTip(\'home\');" onmouseout="hideToolTip();"><img src="images/nav-home.gif" width="28" height="30" alt="" border="0" id="homeBtn"></a>');
	
	document.writeln('</td><td bgcolor="#006699"><img src="images/trans.gif" width="12" height="1" alt="" border="0"></td>');
	document.writeln('</tr>');
	document.writeln('</table>');
	if (step) {
		document.writeln('<table border=0 width=721 cellpadding=0 cellspacing=0>');
		document.writeln('<tr valign="top">');
		document.writeln('<td width=1 bgcolor="#006699"><img src="images/trans.gif" width="1" height="1" alt="" border="0"></td>');
		document.writeln('<td width=719 height=29 bgcolor="#e7e7eb"><img src="images/' + step + '.gif" width="270" height="19" vspace=5 hspace=12 alt="" border="0"></td>');
		document.writeln('<td width=1 bgcolor="#006699"><img src="images/trans.gif" width="1" height="1" alt="" border="0"></td>');
		document.writeln('</tr>');
		document.writeln('</table>');
	}
	document.writeln('<table border=0 width=721 cellpadding=0 cellspacing=0>');
	document.writeln('<tr valign="top">');
	document.writeln('<td width=1 bgcolor="#006699"><img src="images/trans.gif" width="1" height="1" alt="" border="0"></td>');
	if (location != "home") {
		if (step != "step4") pad = ' style="padding:15px 10px 15px 10px;'; else pad = "";
		document.writeln('<td width=719 bgcolor="#ffffff"' + pad + '>');
	} else {
		document.writeln('<td width=719 bgcolor="#ffffff" style="padding:25px 20px 25px 20px;">');
	}
}

function printFrameBottom() {
	document.writeln('</td>');
	document.writeln('<td width=1 bgcolor="#006699"><img src="images/trans.gif" width="1" height="1" alt="" border="0"></td>');
	document.writeln('</tr>');
	if (pageLocation == "home") {
		document.writeln('</table>');
		document.writeln('<table border=0 width=721 cellpadding=0 cellspacing=0 style="clear:both;">');
		document.writeln('<tr><td><img src="images/bluecorner-botleft-white.gif" width="12" height="12" alt="" border="0"></td>');
		document.writeln('<td width=697 bgcolor="#ffffff" background="images/bluecorner-botbg-white.gif"></td>');
		document.writeln('<td><img src="images/bluecorner-botright-white.gif" width="12" height="12" alt="" border="0"></td>');
	} else {
		document.writeln('<tr valign="top"><td width=1 bgcolor="#006699"><img src="images/trans.gif" width="1" height="1" alt="" border="0"></td><td width=719 bgcolor="#e7e7eb"><img src="images/trans.gif" width="719" height="18" alt="" border="0"></td><td width=1 bgcolor="#006699"><img src="images/trans.gif" width="1" height="1" alt="" border="0"></td></tr>');	
		document.writeln('</table>');
		document.writeln('<table border=0 width=721 cellpadding=0 cellspacing=0 style="clear:both;">');
		document.writeln('<tr><td><img src="images/bluecorner-botleft-gray.gif" width="12" height="12" alt="" border="0"></td>');
		document.writeln('<td width=697 bgcolor="#e7e7eb" background="images/bluecorner-botbg-gray.gif"></td>');
		document.writeln('<td><img src="images/bluecorner-botright-gray.gif" width="12" height="12" alt="" border="0"></td>');
	}	
	document.writeln('</tr>');
	document.writeln('</table><p>');
}

var coColor,coWidth,coHeight,coBgcolor;

function doCallout(color,width,height) { 
	coColor = color;
	coWidth = width;
	coHeight = height;
	if (coColor == "yellow") coBgcolor="#fff6dc";
	if (coColor == "blue") coBgcolor="#dae9f5";
	if (coColor == "green") coBgcolor="#eaeedc";
	document.writeln('<table width="' + coWidth + '" border=0 cellpadding=0 cellspacing=0>');
	document.writeln('<tr valign="top"><td><img src="images/callout-' + coColor + '-topleft.gif" width="8" height="8" alt="" border="0"></td>');
	document.writeln('<td background="images/callout-' + coColor + '-topbg.gif" width=' + (coWidth-16) + ' colspan=2><img src="images/trans.gif" width="' + (coWidth-16) + '" height="1" alt="" border="0"></td>');
	document.writeln('<td><img src="images/callout-' + coColor + '-topright.gif" width="8" height="8" alt="" border="0"></td></tr>');
	document.writeln('<tr valign="top">');
	document.writeln('<td background="images/callout-' + coColor + '-leftbg.gif" width="8"><img src="images/trans.gif" width="8" height="1" alt="" border="0"></td>');
	document.writeln('<td bgcolor="' + coBgcolor + '" width=1>');
	if (coHeight>0) document.writeln('<img src="images/trans.gif" width="1" height="' + coHeight + '" alt="" border="0"></td>');
	document.writeln('<td width=' + (coWidth-17) + ' bgcolor="' + coBgcolor + '" style="padding:8px 10px 10px 10px;" class="callout">');
}

function closeCallout() {
	document.writeln('</td>');
	document.writeln('<td background="images/callout-' + coColor + '-rightbg.gif" width="8"><img src="images/trans.gif" width="8" height="1" alt="" border="0"></td>');
	document.writeln('</tr>');
	document.writeln('<tr valign="top"><td><img src="images/callout-' + coColor + '-botleft.gif" width="8" height="8" alt="" border="0"></td>');
	document.writeln('<td background="images/callout-' + coColor + '-botbg.gif" width=' + (coWidth-16) + ' colspan=2><img src="images/trans.gif" width="' + (coWidth-16) + '" height="1" alt="" border="0"></td>');
	document.writeln('<td><img src="images/callout-' + coColor + '-botright.gif" width="8" height="8" alt="" border="0"></td></tr>');
	document.writeln('</table>');
}

function buildPopup(color,width,urlContent,popName,doClose,doStats) { 
	if (color == "pink") bgcolor="#f4e7f1";
	if (color == "blue") bgcolor="#dae9f5";
	if (color == "green") bgcolor="#eaeedc";
	closeTxt = '';
	if (doClose) {
		closeTxt = '<div style="width:' + (width-32) + ';text-align:right;"><a href="" id="' + popName + 'Close" class="popClose' + color + '"><b>Close</b></a></div>';
	}
	//png fix
	if ($.browser.msie && parseInt($.browser.version) < 7) ieFix = "-noshdw.gif";
	else ieFix = ".png";
	document.writeln('<table id="' + popName + 'Div" style="position:absolute;z-index:2;display:none;" width="' + width + '" border=0 cellpadding=0 cellspacing=0>');
	document.writeln('<tr valign="top"><td><img src="images/popup-' + color + '-topleft' + ieFix + '" width="15" height="14" alt="" border="0"></td>');
	document.writeln('<td background="images/popup-' + color + '-topbg' + ieFix + '" width=' + (width-32) + ' colspan=2><img src="images/trans.gif" width="' + (width-32) + '" height="1" alt="" border="0"></td>');
	document.writeln('<td><img src="images/popup-' + color + '-topright' + ieFix + '" width="17" height="14" alt="" border="0"></td></tr>');
	document.writeln('<tr valign="top">');
	document.writeln('<td background="images/popup-' + color + '-leftbg' + ieFix + '" width="15"><img src="images/trans.gif" width="15 height="1" alt="" border="0"></td>');
	document.writeln('<td bgcolor="' + bgcolor + '" width=1></td>');
	document.writeln('<td width=' + (width-17) + ' bgcolor="' + bgcolor + '" style="padding:0px 3px 8px 0px;" class="popcontent" id="' + popName + 'Text">' + closeTxt + '</td>');
	document.writeln('<td background="images/popup-' + color + '-rightbg' + ieFix + '" width="17"><img src="images/trans.gif" width="17" height="1" alt="" border="0"></td>');
	document.writeln('</tr>');
	document.writeln('<tr valign="top"><td><img src="images/popup-' + color + '-botleft' + ieFix + '" width="15" height="18" alt="" border="0"></td>');
	document.writeln('<td background="images/popup-' + color + '-botbg' + ieFix + '" width=' + (width-32) + ' colspan=2><img src="images/trans.gif" width="' + (width-32) + '" height="1" alt="" border="0"></td>');
	document.writeln('<td><img src="images/popup-' + color + '-botright' + ieFix + '" width="17" height="18" alt="" border="0"></td></tr>');
	document.writeln('</table>');	

	$.ajax({
	  url: urlContent,
	  cache: false,
	  success: function(html){
	  $("#" + popName + "Text").append(html);
	  }
	});
 
	$(function() {
	    // wireupevents
		$("#" + popName).click(function() {
			$("#" + popName + "Div").toggle();
			if (doStats != "" && $("#" + popName + "Div").css("display") != "none") recordStats("pageView","Definition: " + doStats);
			return false;
		});
		if (doClose) {
			$("#" + popName + "Close").click(function() {
				$("#overlay").hide();
				$("#" + popName + "Div").hide();
				return false;
			});
		}
	});
}

var popColor,popWidth,popHeight,popBgcolor;

function buildPopupTop(color,width,popName,doClose) { 
	if (color == "pink") bgcolor="#f4e7f1";
	if (color == "blue") bgcolor="#dae9f5";
	if (color == "green") bgcolor="#eaeedc";
	popBgcolor=bgcolor;
	popColor=color;
	popWidth=width;	
	closeTxt = '';
	if (doClose) {
		closeTxt = '<div style="width:' + (width-32) + ';text-align:right;"><a href="" id="' + popName + 'Close" class="popClose' + color + '"><b>Close</b></a></div>';
	}
	//png fix
	if ($.browser.msie && parseInt($.browser.version) < 7) ieFix = "-noshdw.gif";
	else ieFix = ".png";
	document.writeln('<table id="' + popName + '" style="position:absolute;z-index:4;display:none;" width="' + width + '" border=0 cellpadding=0 cellspacing=0>');
	document.writeln('<tr valign="top"><td><img src="images/popup-' + color + '-topleft' + ieFix + '" width="15" height="14" alt="" border="0"></td>');
	document.writeln('<td background="images/popup-' + color + '-topbg' + ieFix + '" width=' + (width-32) + ' colspan=2><img src="images/trans.gif" width="' + (width-32) + '" height="1" alt="" border="0"></td>');
	document.writeln('<td><img src="images/popup-' + color + '-topright' + ieFix + '" width="17" height="14" alt="" border="0"></td></tr>');
	document.writeln('<tr valign="top">');
	document.writeln('<td background="images/popup-' + color + '-leftbg' + ieFix + '" width="15"><img src="images/trans.gif" width="15 height="1" alt="" border="0"></td>');
	document.writeln('<td bgcolor="' + bgcolor + '" width=1></td>');
	document.writeln('<td width=' + (width-17) + ' bgcolor="' + bgcolor + '" class="popcontent">' + closeTxt);

	if (doClose) {
		$("#" + popName + "Close").click(function() {
			$("#" + popName).hide();
			$("#overlay").hide();
			return false;
		});
	}
}

function closePopup() { 
	if ($.browser.msie && parseInt($.browser.version) < 7) ieFix = "-noshdw.gif";
	else ieFix = ".png";
	document.writeln('</td>');
	document.writeln('<td background="images/popup-' + popColor + '-rightbg' + ieFix + '" width="17"><img src="images/trans.gif" width="17" height="1" alt="" border="0"></td>');
	document.writeln('</tr>');
	document.writeln('<tr valign="top"><td><img src="images/popup-' + popColor + '-botleft' + ieFix + '" width="15" height="18" alt="" border="0"></td>');
	document.writeln('<td background="images/popup-' + popColor + '-botbg' + ieFix + '" width=' + (popWidth-32) + ' colspan=2><img src="images/trans.gif" width="' + (popWidth-32) + '" height="1" alt="" border="0"></td>');
	document.writeln('<td><img src="images/popup-' + popColor + '-botright' + ieFix + '" width="17" height="18" alt="" border="0"></td></tr>');
	document.writeln('</table>');	
}

function buildQuickView() { 
	width=730;
	color="green";
	if ($.browser.msie && parseInt($.browser.version) < 7) ieFix = "-noshdw.gif";
	else ieFix = ".png";
	document.writeln('<div id="quickView" style="position:absolute;z-index:4;display:none;" width="' + width + '">');
	document.writeln('<table width=' + width + ' border=0 cellpadding=0 cellspacing=0><tr valign="top"><td><img src="images/popup-' + color + '-topleft' + ieFix + '" width="15" height="14" alt="" border="0"></td>');
	document.writeln('<td background="images/popup-' + color + '-topbg' + ieFix + '" width=' + (width-36) + ' colspan=2><img src="images/trans.gif" width="' + (width-36) + '" height="1" alt="" border="0"></td>');
	document.writeln('<td><img src="images/popup-' + color + '-topright' + ieFix + '" width="21" height="14" alt="" border="0"></td></tr></table><table width=' + width + ' border=0 cellpadding=0 cellspacing=0');
	document.writeln('<tr valign="top" height=26>');
	document.writeln('<td background="images/popup-' + color + '-leftbg' + ieFix + '" width="2"><img src="images/trans.gif" width="2" height="1" alt="" border="0"></td><td bgcolor="#748e16"><div style="float:left;display:inline;padding-left:8px;"><img src="images/subtitle-quickview.gif" width="89" height="15" alt="" border="0"></div>');
	document.writeln('<div style="float:right;display:inline;" id="closeQuickView">Close Window</div>');
	document.writeln('</td><td background="images/popup-' + color + '-rightbg' + ieFix + '" width="2"><img src="images/trans.gif" width="9" height="1" alt="" border="0"></td></tr></table><table width=' + width + ' border=0 cellpadding=0 cellspacing=0><tr valign="top" height=50><td background="images/popup-' + color + '-leftbg' + ieFix + '" width="2"><img src="images/trans.gif" width="2" height="1" alt="" border="0"></td><td bgcolor="#e7e7eb"><div id="quickViewButtons"><img src="images/quickview-print.gif" width="56" height="33" alt="" border="0" id="quickViewPrint"><img src="images/quickview-download.gif" width="140" height="33" alt="" border="0" id="quickViewDownload"></div><div id="quickViewChartLink">To scroll through full-sized charts, go to <span style="text-decoration:underline;">Chart View</span> ></div></td><td background="images/popup-' + color + '-rightbg' + ieFix + '" width="2"><img src="images/trans.gif" width="9" height="1" alt="" border="0"></td></tr></table>');
	//graph
	document.writeln('<table width=' + width + ' border=0 cellpadding=0 cellspacing=0><tr valign="top"><td background="images/popup-' + color + '-leftbg' + ieFix + '" width="2"><img src="images/trans.gif" width="2" height="1" alt="" border="0"></td><td align="center" bgcolor="white"><img id="quickViewSlide" name="quickViewSlide" src="images/trans.gif" border="0" width="680"></td><td background="images/popup-' + color + '-rightbg' + ieFix + '" width="2"><img src="images/trans.gif" width="9" height="1" alt="" border="0"></td></tr>');
	//footer
	document.writeln('<tr valign="top" height=8><td background="images/popup-' + color + '-leftbg' + ieFix + '" width="2"><img src="images/trans.gif" width="2" height="1" alt="" border="0"></td><td bgcolor="#748e16"><img src="images/trans.gif" width="' + (width-11) + '" height="1" alt="" border="0"></td><td background="images/popup-' + color + '-rightbg' + ieFix + '" width="2"><img src="images/trans.gif" width="9" height="1" alt="" border="0"></td></tr>');
	document.writeln('<tr valign="top" height=17><td background="images/popup-' + color + '-leftbg' + ieFix + '" width="2"><img src="images/trans.gif" width="2" height="1" alt="" border="0"></td><td bgcolor="#b9c68a">&nbsp;</td><td background="images/popup-' + color + '-rightbg' + ieFix + '" width="2"><img src="images/trans.gif" width="9" height="1" alt="" border="0"></td></tr></table>');
	document.writeln('<table width=' + width + ' border=0 cellpadding=0 cellspacing=0><tr valign="top"><td><img src="images/popup-' + color + '-botleft' + ieFix + '" width="15" height="21" alt="" border="0"></td>');
	document.writeln('<td background="images/popup-' + color + '-botbg' + ieFix + '" width=' + (width-34) + ' colspan=2><img src="images/trans.gif" width="' + (width-34) + '" height="1" alt="" border="0"></td>');
	document.writeln('<td><img src="images/popup-' + color + '-botright' + ieFix + '" width="19" height="21" alt="" border="0"></td></tr>');
	document.writeln('</table></div>');	
}

function buildRegistrationView() { 
	width=470;
	color="green";
	if ($.browser.msie && parseInt($.browser.version) < 7) ieFix = "-noshdw.gif";
	else ieFix = ".png";
	document.writeln('<div id="new-registration-popup" style="position:absolute;z-index:99;display:none;" width="' + width + '">');
	document.writeln('<table width=' + width + ' border=0 cellpadding=0 cellspacing=0><tr valign="top"><td><img src="images/popup-' + color + '-topleft' + ieFix + '" width="15" height="14" alt="" border="0"></td>');
	document.writeln('<td background="images/popup-' + color + '-topbg' + ieFix + '" width=' + (width-36) + ' colspan=2><img src="images/trans.gif" width="' + (width-36) + '" height="1" alt="" border="0"></td>');
	document.writeln('<td><img src="images/popup-' + color + '-topright' + ieFix + '" width="21" height="14" alt="" border="0"></td></tr></table><table width=' + width + ' border=0 cellpadding=0 cellspacing=0');
	document.writeln('<tr valign="top" height=26>');
	document.writeln('<td background="images/popup-' + color + '-leftbg' + ieFix + '" width="2"><img src="images/trans.gif" width="2" height="1" alt="" border="0"></td><td bgcolor="#748e16"><div style="float:left;display:inline;padding-left:8px;"><img src="images/subtitle-registration.gif" alt="" width="95" height="18" border="0"></div>');
	document.writeln('<div style="float:right;display:inline;" id="closeRegistrationView">Close Window</div>');
	document.writeln('</td><td background="images/popup-' + color + '-rightbg' + ieFix + '" width="2"><img src="images/trans.gif" width="9" height="1" alt="" border="0"></td></tr></table>');
	document.writeln('<table width=' + width + ' border=0 cellpadding=0 cellspacing=0><tr valign="top"><td background="images/popup-' + color + '-leftbg' + ieFix + '" width="2"><img src="images/trans.gif" width="2" height="1" alt="" border="0"></td><td bgcolor="white">');
}

function closeRegistrationView() { 
	width=470;
	color="green";
	if ($.browser.msie && parseInt($.browser.version) < 7) ieFix = "-noshdw.gif";
	else ieFix = ".png";
	document.writeln('</td><td background="images/popup-' + color + '-rightbg' + ieFix + '" width="2"><img src="images/trans.gif" width="9" height="1" alt="" border="0"></td></tr>');
	document.writeln('<tr valign="top" height=17><td background="images/popup-' + color + '-leftbg' + ieFix + '" width="2"><img src="images/trans.gif" width="2" height="1" alt="" border="0"></td><td bgcolor="#b9c68a">&nbsp;</td><td background="images/popup-' + color + '-rightbg' + ieFix + '" width="2"><img src="images/trans.gif" width="9" height="1" alt="" border="0"></td></tr></table>');
	document.writeln('<table width=' + width + ' border=0 cellpadding=0 cellspacing=0><tr valign="top"><td><img src="images/popup-' + color + '-botleft' + ieFix + '" width="15" height="21" alt="" border="0"></td>');
	document.writeln('<td background="images/popup-' + color + '-botbg' + ieFix + '" width=' + (width-34) + ' colspan=2><img src="images/trans.gif" width="' + (width-34) + '" height="1" alt="" border="0"></td>');
	document.writeln('<td><img src="images/popup-' + color + '-botright' + ieFix + '" width="19" height="21" alt="" border="0"></td></tr>');
	document.writeln('</table></div>');	
}

function loadTopicStats(topicType) {
	var randomnumber=Math.floor(Math.random()*7)+1;
	topicStat = eval(topicType + 'Stat[' + randomnumber + ']');
	var fcolor="#748e16";
	document.writeln('<p><table width="189" border=0 cellpadding=0 cellspacing=0><tr valign="top"><td><img src="images/callout-whitecorner-topleft.gif" width="3" height="3" alt="" border="0"></td><td width="183" bgcolor="white"><img src="images/trans.gif" width="1" height="1" alt="" border="0"></td><td><img src="images/callout-whitecorner-topright.gif" width="3" height="3" alt="" border="0"></td></tr><tr valign="top"><td colspan=3 width="183" style="background-color:white;padding:7px 10px 7px 10px;color:' + fcolor + ';font-weight:bold;font-size:12px;">' + topicStat + '<p style="font-size:10px;color:#717378;font-weight:normal;font-family:arial;">Source: 7th annual MetLife Study of Employee Benefits Trends</p></td></tr><tr valign="top"><td><img src="images/callout-whitecorner-botleft.gif" width="3" height="3" alt="" border="0"></td><td width="183" bgcolor="white"><img src="images/trans.gif" width="1" height="1" alt="" border="0"></td><td><img src="images/callout-whitecorner-botright.gif" width="3" height="3" alt="" border="0"></td></tr></table>');
}

function updateLoggedinText() {
	$.ajax({
	  url: "_login-text.asp",
	  cache: false,
	  success: function(html){
	  $("#loginMessage").html(html);
	  }
	});
}