


//Writes Alert Box Display to Screen with Content
function DisplayMcAfeeAlerts() {
	strcontent = "";
	strlogo = "";
	strbox = "";
	//flag = 0;
//	if(dspylogolnk == 1) {
//		if (VALIDATE_MCAFEE_URL)
//		{
//			if (lnklogo.search(SEARCH_EXPRESSION) > 0)
//				lnklogo=DefaultLinklogo;
//		}
//
//		strlogo = strlogo + '<a href="' + lnklogo + '" target="McAfee">';
//		strlogo = strlogo + '<img src="' + ImageServerDomain + '/McAfeeLogo.gif" alt="" border="0"></a><br>'
//		//flag = 0;
//	}
//	else {
//		strlogo = strlogo + '<img src="' + ImageServerDomain + '/McAfeeLogo.gif" alt="" border="0"><br>'
//		//flag = 0;
//	}
	strbox = '<table cellpadding=0 cellspacing=0 border=0 width=100%>'+
		'<tr>'+
		'<td align=center>'+ strlogo + '</td>'+
		'</tr>' +
		'</table>';
	if(dsplycur == 1) {
		strcontent =""
		if ( MAX_CURRENT_THREATS_DISPLAY_COUNT > 0)
		{
			if (CurrentThreatsRecordCount > 0 )
				strcontent = CurrentThreatsLayouts();
			else
				strcontent = NO_CURRENT_THREATS_MESSAGE;
			DisplayLayout(CURRENT_THREATS);
		}			

	}
	if(dsplyrec == 1) {
		strcontent = "";
		if ( MAX_RECENT_THREATS_DISPLAY_COUNT > 0)
		{
			if (RecentThreatsRecordCount > 0 )
			strcontent = RecentThreatsLayouts();
			else
				strcontent = NO_RECENT_THREATS_MESSAGE;
			DisplayLayout(RECENT_THREATS);
		}			
	}
	
	if(dsplyfs == 1) {
		if (VALIDATE_MCAFEE_URL)
		{
			if (lnkfs.search(SEARCH_EXPRESSION) > 0)
				lnkfs=DefaultLinkfs;
		}

		strcontent = '<img src="' + ImageServerDomain + '/icon_download_12x12.gif" alt="" width="12" height="12" border="0">' +
		'&nbsp;<a href="' + lnkfs + '" target="McAfee">' +
		'<font color=' + collnk + '>' + WORRIED_ABOUT_VIRUSES_TEXT + '</font></a>';
		//flag = 1;	
		DisplayLayout(WORRIED_ABOUT_VIRUSES);
	}
	if(dsplyvs == 1) {
		if (VALIDATE_MCAFEE_URL)
		{
			if (lnkvs.search(SEARCH_EXPRESSION) > 0)
				lnkvs=DefaultLinkvs;
		}

		strcontent = '<img src="' + ImageServerDomain + '/icn_arrow_box_12x12.gif" alt="" width="12" height="12" border="0">' +
		'&nbsp;<a href="' + lnkvs + '" target="McAfee">' +
		'<font color=' + collnk + '>' + NEED_PROTECTION_TEXT + '</font></a>';
		//flag = 1;
		DisplayLayout(NEED_PROTECTION);
	}
//	if(dsplysrc == 1) {
//		strcontent = '<select name="SearchType" class="medBodyText">' +
//		'<option value="1">' + VIRUS_SEARCH_TEXT1 + '</option>' +
//		'<option value="2" selected>' + VIRUS_SEARCH_TEXT2 + '</option>' +
//		'<option value="3">' + VIRUS_SEARCH_TEXT3 + '</option>' +
//		'</select>' +
//		'<br>' +
//		'<input name="searchString" type="text" size="13" value="">' +
//		'&nbsp;&nbsp;<input type=submit value="Go" onClick="javascript:return validateSearchInput(this);">';	
//		//flag = 1;	
//		DisplayLayout(VIRUS_SEARCH);
//	}

	strclass = ""
	frmstart = 	'<form action=' + SearchDomainWithID +' method="post" id="frmSearch" name="frmSearch" onxSubmit="return validateSearch(this);" target="McAfee">';
	strbox = frmstart + strclass + strbox + '</form>';
	document.write (strbox);
}

function CurrentThreatsLayouts()
{
	RecordDisplayCount = ArrayCT.length

	if (RecordDisplayCount > MAX_CURRENT_THREATS_DISPLAY_COUNT)
		RecordDisplayCount = MAX_CURRENT_THREATS_DISPLAY_COUNT
		
	for (i=0; i < RecordDisplayCount; i++) 
	{ 

		if (ArrayCT[i][3].toUpperCase().substr(0,3) =="HIG")
			RiskBullet = "bullet_risk_high_7x7.gif"
		else if (ArrayCT[i][3].toUpperCase().substr(0,3)=="MED")
			RiskBullet = "bullet_risk_medium_7x7.gif"
		else
			RiskBullet = "bullet_risk_low_7x7.gif"
		
	    	strcontent = strcontent + 
			'<img src="' + ImageServerDomain +
			'/' + RiskBullet + '" alt="" width="7" height="7" border="0">' +
			'&nbsp;&nbsp;&nbsp;<a href="'+ McAfeeDomain + ArrayCT[i][6] +'" target="McAfee">' + 
			ArrayCT[i][1] + '</a><br>' +
			'<img src="' + ImageServerDomain +
			'/clear.gif" alt="" width="11" height="7" border="0"><font color=' + 
			ArrayCT[i][4] +	'>' + ArrayCT[i][3].substr(0,1).toUpperCase() + ArrayCT[i][3].substr(1,ArrayCT[i][3].length).toLowerCase() + CURRENT_THREATS_RISK_MESSAGE +
			'</font> ' + ArrayCT[i][5] + '<br>'

	}
	return  strcontent;

}



function RecentThreatsLayouts()
{

	strcontent = "";
	
	RecordDisplayCount = ArrayRT.length
	
	if (RecordDisplayCount > MAX_RECENT_THREATS_DISPLAY_COUNT)
		RecordDisplayCount = MAX_RECENT_THREATS_DISPLAY_COUNT

	for (i=0; i < RecordDisplayCount; i++) 
	{ 

		if (ArrayRT[i][2].toUpperCase().substr(0,3) =="HIG")
			RiskBullet = "bullet_risk_high_7x7.gif"
		else if (ArrayRT[i][2].toUpperCase().substr(0,3)=="MED")
			RiskBullet = "bullet_risk_medium_7x7.gif"
		else
			RiskBullet = "bullet_risk_low_7x7.gif"


		strcontent = strcontent + '<img src="' + ImageServerDomain +'/' + RiskBullet + '" alt="" width="7" height="7" border="0">' +
			     '&nbsp;&nbsp;<a href="' + McAfeeDomain + '/virusInfo/default.asp?id=description&virus_k='+
			      ArrayRT[i][0] + '" target="McAfee">' + 
			      ArrayRT[i][1] + '</a><br>'

	}
	strcontent = strcontent +'<img src="' + ImageServerDomain + '/icn_arrow_4x7.gif" alt="" width="7" height="7" border="0">' +
			'&nbsp;&nbsp;<a href="' + COMPLETE_LIST_URL + '" target="McAfee">' +
			COMPLETE_LIST + '</a>';

	return  strcontent;

}

function DisplayLayout(t) {
	strbox = strbox + 
		//Form the table
		'<table cellpadding=0 cellspacing=0 border=0 width=100% style="border-collapse: collapse">'+
		'<tr>'+
		'<td colspan=4 width=100% height=20 bgcolor=' + colbor + ' class=title>'+
		'&nbsp;<font color=#000000><b>' + t + ':</b></font></td>'+
		'</tr>'+

		// Add space after heading 
		'<tr>'+
		'<td bgcolor=' + colbor + ' width=1 height=5><img src="' + imgtr.src + '" width=1 height=1></td>'+
		'<td bgcolor=' + colbgc + ' width=5><img src="' + imgtr.src + '" width=1 height=1></td>'+
		'<td bgcolor=' + colbgc + '><img src="' + imgtr.src + '" width=1 height=1></td>'+
		'<td bgcolor=' + colbor + ' width=1><img src="' + imgtr.src + '" width=1 height=1></td>'+
		'</tr>'+

		// Display content here 
		'<tr>'+
		'<td bgcolor=' + colbor + '><img src="' + imgtr.src + '" width=1 height=1></td>'+
		'<td bgcolor=' + colbgc + ' width=5><img src="' + imgtr.src + '" width=1 height=1></td>'+
		'<td bgcolor=' + colbgc + '>'+ strcontent +
		'</font></td>'+
		'<td bgcolor=' + colbor + '><img src="' + imgtr.src + '" width=1 height=1></td>'+
		'</tr>'+

		// Add space after content
		'<tr>'+
		'<td bgcolor=' + colbor + ' width=1 height=5><img src="' + imgtr.src + '" width=1 height=1></td>'+
		'<td bgcolor=' + colbgc + ' width=5><img src="' + imgtr.src + '" width=1 height=1></td>'+
		'<td bgcolor=' + colbgc + '><img src="' + imgtr.src + '" width=1 height=1></td>'+
		'<td bgcolor=' + colbor + ' width=1><img src="' + imgtr.src + '" width=1 height=1></td>'+
		'</tr>'+
		'<tr>'+
		'<td colspan=4 width=100% height=1 bgcolor=' + colbor + '>'+
		'<img src="' + imgtr.src + '" width=1 height=1></td>'+
		'</tr>'+
		'</table>';
}


function validateSearchInput(form)
{

	if (document.frmSearch.searchString.value == "") 
	{
		alert(VIRUS_SEARCH_INVALID_MESSAGE);
		document.frmSearch.searchString.focus();
		return false;
	}
	else
		document.frmSearch.submit();
		
}


