//var ServerPath= "http://10.50.3.107/";var DocumentCount=50;var ClickonTable=1var classDominoViewTable = "containertable"	//Style Class Domino View Tablevar classDominoViewTableTD = "DominoTdStyle"			//Style Class Domino View Table TDvar classNoDocsFoundTable = "smalltext"		//Style Class No douments found tablevar classNoDocsFoundTD = "NoDocsFoundTd"			//Style Class No douments found TDvar classOddLine ="OddLine"			//Style Class for Odd Rowvar classEvenLine ="EvenLine"				//Style Class for Even Rowvar classCategoryRow = "CategoryHeaderRow"			//Style Class for Category Rowvar classTH ="viewHeadings"					//Style Class for TH tagvar classDocLink = "DocLink"					//Style Class for Document Linkvar classViewType = "SC"					//Style Class for Document Linkvar navigationDetails = "0"		//Ensure Navigation Requiredvar MarkClassName="RowHighLight"/* The following javascript is used to change the class attribite of the TD which is generated by the Domino when opening the view in the Browser. The idea is (1) Getting the handle of the HTML tags generated by the Domino for the view(2) Adding Class attribute to the TR tags(3) Return the Final Result.(4) Write the result in the new layer*///Global Variable Declarationsvar imageExpandSection ="/DominoView/ExpandSection.gif" 	//Give the name and path of the image for category expand iconvar imageCollapseSection ="/DominoView/CollapseSection.gif"	//Give the name and path of the image for category collapse iconvar urlBaseDb = "/"				//Give the path and name of the base db from where the images, js, css etc are referencedvar idViewDisplay = "viewDisplay"				//Mention the id of the TD/Div in which the view html is going to be displayedvar nameViewHTML = "viewHTMLValue" 				//Mention the name of the text area which has the domino generated view html //var sortArrow=urlBaseDb+"/sortArrow.jpg?OpenImageResource"function renderDominoView(resulting){	//Apply the alternate row color and other rendering to the domino built view html	//var viewHTMLVal = eval("document.forms[1]."+ nameViewHTML+".value");	//var revisedHTML = resulting     	var revisedHTML = alternateColor(resulting);	urlBaseDb= window.location.href.toLowerCase().match(/(.*)?\.nsf/gi);	//This is added to check whether the view has collapse / expand option  	if (revisedHTML.search(/expand=|collapse=/gi) != -1)	{		//Change the expand and collapse images		revisedHTML = revisedHTML.replace(/\/icons\/expand\.gif/gi, urlBaseDb+ imageExpandSection);		revisedHTML = revisedHTML.replace(/\/icons\/collapse\.gif/gi, urlBaseDb+ imageCollapseSection);			revisedHTML = revisedHTML.replace(/HEIGHT=16 WIDTH=16/gi, "");		//For giving link to the category title itself		revisedHTML = revisedHTML.replace(/(ExpandSection.gif(.*?))\<\/a\>(.*?)\<\/td\>/gi, "$1$3</a></td>");		revisedHTML = revisedHTML.replace(/(CollapseSection.gif(.*?))\<\/a\>(.*?)\<\/td\>/gi, "$1$3</a></td>");		}	//Remove the ecblank.gif image added by dominio and the extra column added on the right by domino	revisedHTML = revisedHTML.replace(/\<th\>\<\/th\>\<\/tr\>/gi,"</tr>");	revisedHTML = revisedHTML.replace(/\<img src=\"\/icons\/ecblank\.gif(.*?)\>/gi,"");	revisedHTML = revisedHTML.replace(/\<th class=/+classTH+/\>&nbsp;\<\/th\>\<\/tr\>/gi,"</tr>");	revisedHTML = revisedHTML.replace(/\<td class=/+classCategoryRow+/\>\<\/td\>\<\/tr\>/gi,"</tr>");	revisedHTML = revisedHTML.replace(/\<td/gi,"<td class="+classDominoViewTableTD );	//Apply different style class for category row's hyper link	revisedHTML = revisedHTML.replace(/\?openview(.*?)"/gi,"?openview$1\" class="+classCategoryRow );		//Apply different style class for document row's hyper link		revisedHTML = revisedHTML.replace(/\?opendocument(.*?)"/gi,"?opendocument$1\" class="+classDocLink);	/*arrHTML = revisedHTML.split(/<a /gi);	revisedHTML = "";	for (var i=0; i < arrHTML.length; i++)	{		arrHTML[ i ] += "<a ";		if ( arrHTML[ i ].match(/opendocument/gi))		{			arrHTML[ i ] = arrHTML[ i ].replace(/href="(.*?)"/gi,"href=\"Javascript:windowOpener('$1')\"");			revisedHTML += arrHTML[ i ];		}		else		{			revisedHTML += arrHTML[ i ];		}	}*/	revisedHTML = revisedHTML.replace(/\<a $/gi,"");		//Remove if any <FONT> or <b> tag generated by domino so that the style will get applied	revisedHTML = revisedHTML.replace(/\<font(.*?)\>/gi,"");	revisedHTML = revisedHTML.replace(/\<\/font\>/gi,"");	revisedHTML = revisedHTML.replace(/\<b\>/gi,"");	revisedHTML = revisedHTML.replace(/\<\/b\>/gi,"");	//For giving tool tip for "In Process" and "Completed" images	revisedHTML = revisedHTML.replace(/\<img src="\/icons\/vwicn083.gif(.*?)\>/gi,"<img src=\"/icons/vwicn083.gif\" border=0 alt=\"Completed PO\">");	revisedHTML = revisedHTML.replace(/\<img src="\/icons\/vwicn174.gif(.*?)\>/gi,"<img src=\"/icons/vwicn083.gif\" border=0 alt=\"In Process PO\">");	//Write the new html code of the view to the td	revisedHTML = revisedHTML.replace(/height="16"/gi,"")	revisedHTML = revisedHTML.replace(/width="16"/gi,"")	revisedHTML = revisedHTML.replace(/\<th\>\<\/th\>\<\/tr\>/gi,"</tr>");	revisedHTML = revisedHTML.replace("<th class='viewHeadings' align=\"left\">Preview</th>","<th class='viewHeadings' width=6% align=\"left\">Preview</th>")	revisedHTML = revisedHTML.replace("<th class='viewHeadings' align=\"left\">Copy Image Link</th>","<th class='viewHeadings' width=10% align=\"left\">Copy Image Link</th>")	revisedHTML = revisedHTML.replace("<th class='viewHeadings' align=\"left\">Delete</th>","<th class='viewHeadings' width=6% align=\"left\">Delete</th>")	revisedHTML = revisedHTML.replace("<th class='viewHeadings' align=\"left\">DDA</th>","<th class='viewHeadings' width=6% align=\"left\">DDA</th>")	revisedHTML = revisedHTML.replace("<th class='ViewHeader' align=left>Client</TH>","<th class='ViewHeader' width=40% align=\"left\">Client</th>")	revisedHTML = revisedHTML.replace("<th class='ViewHeader' align=\"left\">Service</th>","<th class='ViewHeader' width=30% align=\"left\">Service</th>")	return(revisedHTML);	}function alternateColor(resulting){if ( resulting.match( /\<h2\>no documents found\<\/h2\>/gi ) ){	resulting = "<table class='"+classNoDocsFoundTable+"' width='100%'><tr class='"+classTH+"'><td>&nbsp;</td></tr><tr><td class='"+classNoDocsFoundTD+"'>No details found.</td></tr></table>";	return resulting;}if ( resulting.toLowerCase().split('<p><h2>no documents found</h2>')[0] == '' ){	actualResult = "<table width=100%><tr><td class='"+classNoDocsFoundTable +"'>&nbsp;</td></tr></table>";	return (actualResult);}resulting=resulting.replace(/\r|\n|\r\n/g,"")resultArr=resulting.replace(/<table(.*?\>)<tr>/gi,'<table class="'+classDominoViewTable+'" border=0 cellspacing="0"  width=100%><~tr>')resultArr=resultArr.split(/\<tr/gi);var line_is = "odd";var actualResult;var colspan;if (resultArr.length) actualResult = resultArr[0];for ( i=1; i<resultArr.length; i++){	if ( resultArr[i].match( /(expand|collapse)\.gif/gi ) )	{		actualResult = actualResult + "<tr class='" + classCategoryRow +"'"+ resultArr[i];	}	else	{		if ( line_is == "odd" )		{			actualResult = actualResult + "<tr class='" +classOddLine +"'" + resultArr[i];						line_is = "even";		}		else		{			actualResult = actualResult + "<tr class='"+ classEvenLine +"'"+ resultArr[i];						line_is = "odd";		}	}}actualResult=actualResult.replace(/<th /gi,"<th class='" +classTH +"'" );actualResult=actualResult.replace(/<td/gi,"<td style='padding:5px'");actualResult=actualResult.replace(/nowrap/gi,"");actualResult=actualResult.replace(/<~tr/gi,"<tr");return(actualResult)}