	//Customised for printing
	var startString = "<SPAN class=checkBox>";
	var endString = "</SPAN>";
	
	function getFront (searchStr)
	{
		foundOffset = searchStr.indexOf(startString);
		if (foundOffset == -1)
		{
			return null;
		}
		return searchStr.substring(0, foundOffset)
	}
	
	function getEnd (searchStr)
	{
		foundOffset = searchStr.indexOf(endString);
		if (foundOffset == -1)
		{
			return null;
		}
		return searchStr.substring(foundOffset + endString.length, searchStr.length)
	}
	
	function replaceString (mainStr, replacement)
	{
		var front = getFront(mainStr);
		var end   = getEnd(mainStr);
		if (front != null && end != null)
		{
			return front + replacement + end;
		}
		return null;
	}
	
	function PrintSearhResult ()
	{	
		var mainstr = document.getElementById('SearchResultList').innerHTML;
		var tmpStr = "";
		var done = false;
		while (!done)
		{
			tmpStr = replaceString(mainstr, "&nbsp");
			if (tmpStr != null)
			{
				mainstr = tmpStr;
			}
			else
			{
				done = true;
			}
		}
		
		newWindow = window.open('','SearchResultPrinterVersion','toolbar=yes,menubar=1,left=0,location=yes,scrollbars=yes,resizable=yes,width=800,height=590,top=0');
		newWindow.document.write('<HTML><HEAD><title>Search Result Printer Version</title><link href=\"../Resources/CSS/GLobalAgency.css\" type=\"text/css\" rel=\"stylesheet\"></HEAD><body>');				
		newWindow.document.write('<table cellSpacing=\"0\" cellPadding=\"0\" border=\"0\" width=\"100%\">\n');
		newWindow.document.write('<tr><td colSpan=\"2\" >&nbsp;</td></tr>\n');
		newWindow.document.write('<tr><td width=\"5px\">&nbsp;</td><td width=\"100%\"><H3>SEARCH RESULT</H3></td></tr>\n');
		newWindow.document.write('</table>\n');		
		newWindow.document.write('<table bgColor=\"#f1f1f1\"  cellSpacing=\"0\" cellPadding=\"0\" width=\"100%\" border=\"0\" ID=\"Tablex\">\n');
		newWindow.document.write('<tr><td colSpan=\"4\"></td></tr>\n');
		newWindow.document.write('<tr>\n');
		newWindow.document.write('<td width=\"5px\" >&nbsp;</td>\n');
		newWindow.document.write('<td bgcolor=\"#cccccc\" vAlign=\"middle\" style=\"WIDTH: 116px\">\n');
		newWindow.document.write('<A class=\"submenu1\"\n');
		newWindow.document.write('href=\"javascript:window.print();\" name=\"ClosePage\">Print This Page</A>\n');
		newWindow.document.write('</td>\n');
		newWindow.document.write('<td width=\"1px\"><IMG src=\"/images/blank.gif\" border=\"0\" width=\"1px\"></td>\n');
		newWindow.document.write('<td bgcolor=\"#cccccc\" vAlign=\"middle\">\n');
		newWindow.document.write('<A class=\"submenu1\"\n');
		newWindow.document.write('href=\"javascript:window.close();\" name=\"ClosePage\">Close</A>\n');
		newWindow.document.write('</td>\n');
		newWindow.document.write('</tr>\n');
		newWindow.document.write('</table>\n');		
		newWindow.document.write(mainstr);
		newWindow.document.write('</body></html>');
		newWindow.document.close();
	}


