


//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=145>'+
		'<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(dsplyrem == 1) {
		strcontent = RemovalToolsLayouts();
		DisplayLayout(REMOVAL_TOOLS);


	}
	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 = "<style>" +
		"table#mcafee_virus_alerts td{font-family:Arial,Helvetica,sans-serif;font-size:11px;color:#000000}" +
		"table#mcafee_virus_alerts input{font-family:Arial,Helvetica,sans-serif;font-size:11px;color:#000000}" +
		"table#mcafee_virus_alerts select{font-family:Arial,Helvetica,sans-serif;font-size:11px;color:#000000}" +
		"table#mcafee_virus_alerts td.title {font-family:arial;font-size:12px;font-weight:bold;}" +
		"</style>"
	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 + 

			'<b><img src="' + ImageServerDomain +
			'/' + RiskBullet + '" alt="" width="7" height="7" border="0">' +
			'&nbsp;&nbsp;&nbsp;<a href="'+ McAfeeDomain + ArrayCT[i][6] +'" target="McAfee">' + 
			'<font color=' + collnk + '>' +  ArrayCT[i][1] + '</font></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">' + '<font color=' + collnk + '>' + 
			      ArrayRT[i][1] + '</font></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">' +
			'<font color=' + collnk + '>' + COMPLETE_LIST + '</font></a>';

	return  strcontent;

}

function RemovalToolsLayouts()
{

	strcontent = 
		'<img src="' + ImageServerDomain + '/btn_hammer_12x12.gif" alt="" width="12" height="12" border="0">' +
		'&nbsp;&nbsp;<a href="' + McAfeeDomain + '/virusInfo/default.asp?id=lovsan" target="McAfee">' +
		'<font color=' + collnk + '>' + REMOVAL_TOOLS_LOVESCAN + '</font></a><br>' +
		'<img src="' + ImageServerDomain + '/btn_hammer_12x12.gif" alt="" width="12" height="12" border="0">' +
		'&nbsp;&nbsp;<a href="' + McAfeeDomain + '/virusInfo/default.asp?path=/virusInfo/virusRemoval/klez.asp" target="McAfee">' +
		'<font color=' + collnk + '>' + REMOVAL_TOOLS_KLEZ + '</font></a><br>' +
		'<img src="' + ImageServerDomain + '/btn_hammer_12x12.gif" alt="" width="12" height="12" border="0">' +
		'&nbsp;&nbsp;<a href="' + McAfeeDomain + '/virusInfo/default.asp?path=/virusInfo/virusRemoval/bugbear.asp" target="McAfee">' +
		'<font color=' + collnk + '>' + REMOVAL_TOOLS_BUGBEAR + '</font></a><br>' +
		'<img src="' + ImageServerDomain + '/btn_hammer_12x12.gif" alt="" width="12" height="12" border="0">' +
		'&nbsp;&nbsp;<a href="' + McAfeeDomain + '/virusInfo/default.asp?id=stinger" target="McAfee">' +
		'<font color=' + collnk + '>' + REMOVAL_TOOLS_STRINGER + '</font></a>';

	return  strcontent;

}

function DisplayLayout(t) {
	strbox = strbox + 
		//Form the table
		'<table id=mcafee_virus_alerts cellpadding=0 cellspacing=0 border=0 width=145>'+
		'<tr>'+
		'<td colspan=4 width=100% height=20 bgcolor=' + colbor + ' class=title >'+
		'&nbsp;<font color=' + coltlt + '>' + t + '</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();
		
}


