function ExpandGroup(me,expandedImage,collapseImage)
{			
			var trarray = new Array;
			trarray = document.getElementsByTagName("tr")
			for(var i =0;i<=trarray.length-1;i++)
			{
							
				if (trarray[i].getAttribute('MenuItemParent') != null)
				{
					
					if(trarray[i].getAttribute('MenuItemParent') == me.getAttribute('MenuID'))
					{
					
						if(trarray[i].getAttribute('MenuID') != me.getAttribute('MenuID'))
						{
						
							var tid ;
							tid = trarray[i].id;
							
							// For IE Only on Windows Machine
									if (navigator.appName.indexOf('Microsoft Internet Explorer') > -1 && navigator.platform.indexOf('Mac') == -1)
									{
											if(trarray[i].style.visibility=='hidden')
											{							
												trarray[i].style.visibility='visible';
												trarray[i].style.display='block';								
												document.getElementById("img_" + me.getAttribute('MenuID')).src = expandedImage;
											}
											else
											{
												trarray[i].style.visibility='hidden';
												trarray[i].style.display='none';
												document.getElementById("img_" + me.getAttribute('MenuID')).src = collapseImage;

											} // end if trarray[i].style.visibility=='hidden'
									}
									else // For all browsers on any platform
									{
											if(trarray[i].style.visibility=='hidden')
											{							
												trarray[i].style.visibility='visible';
												trarray[i].style.display='table-row';								
												document.getElementById("img_" + me.getAttribute('MenuID')).src = expandedImage;
											}
											else
											{
												trarray[i].style.visibility='hidden';
												trarray[i].style.display='none';
												document.getElementById("img_" + me.getAttribute('MenuID')).src = collapseImage;

											} // end if trarray[i].style.visibility=='hidden'
									} // end for else
							}	// end if	trarray[i].getAttribute('ItemKey') != me.ItemKey				
					}// end if trarray[i].getAttribute('ParentKey') == me.ItemKey
								
					
				}	// end if trarray[i].getAttribute('ParentKey') != null			
			} //end for
			
			//alert(document.getElementById("img_" + me.getAttribute('MenuID')).src);
			
			// Change the display image for expanded and collapse 
			
			//var src;
			//src = new String();
			//src = document.getElementById("img_" + me.getAttribute('MenuID')).src;
			
			//if(src.indexOf('arrowopen.gif',1) > 0)				
			//	document.getElementById("img_" + me.getAttribute('MenuID')).src = 'UserControls/images/navimages/arrowclosed.gif';
			//else
			//	document.getElementById("img_" + me.getAttribute('MenuID')).src = 'UserControls/images/navimages/arrowopen.gif';			
			
}

		var match = new String();
		match ='';
			function getHTML(searchstr)
			{
				
				var str = new String();
				if (searchstr=='') 
				{
					str = document.body.innerHTML;					
				}
				else
				{
					str = searchstr;
				}
			
				str = str.substr(0,str.length);									
				
				if(str.indexOf('<!--StartPrint-->') > -1 &  str.indexOf('<!--EndPrint-->') > -1)
				{
					var start = str.indexOf('<!--StartPrint-->');
					var end =  str.indexOf('<!--EndPrint-->');
					match +=  str.substr(start,end - start);				
					
					//Add 15 to get the <!--EndPrint--> out 
					str = str.substr(end+15,str.length);
					
					// Check > 30 which is the combine length of <!--StartPrint--> and <!--EndPrint-->
					if(str.length > 30 & str.indexOf('<!--StartPrint-->') > -1 & str.indexOf('<!--EndPrint-->') > -1)
					{	getHTML(str);	}				
				}
			}
			
			function getPrintAreas()
			{
				match = '';
				getHTML('');
				if (match.length > 0) 
				{
					var printWin = window.open('PrintView.aspx','PrintDoc','toolbars=no,scrollbars=yes,location=no,status=no,menubar=yes,resizable=yes,width=900,height=750');
					printWin.document.open();
					printWin.document.write('<HTML>');
					printWin.document.write('<HEAD>')
					printWin.document.write('<LINK href="UserControls/Includes/Styles.css" type="text/css" rel="stylesheet" media="all">')					
					printWin.document.write('</HEAD>')
					printWin.document.write('<BODY>');
					printWin.document.write('<table cellpading=0 cellspacing=0 width=90%>');
					printWin.document.write('<tr><td>');
					printWin.document.write(match);
					printWin.document.write('</td></tr>');						
					printWin.document.write('</table>');
					printWin.document.write('</BODY></HTML>');
					printWin.document.close();
					printWin.focus();
					//printWin.window.print();
				}
			
			}
			
			
			
			
			function getPrintAreas1()
			{
			
				var reg = new RegExp("<!--StartPrint-->(.|\n)*<!--EndPrint-->","gi")
				
				//var reg = /<!--StartPrint-->(.|\n)*<!--EndPrint-->/\gim
				
				//alert(reg.global);
				//alert(reg.ignoreCase);
				//reg.multiline=true;
				//alert(reg.multiline);
				
				match=reg.exec('<!--StartPrint-->  Hello this is a test for regular expressions for you <!--EndPrint--> Hey This is not a Test'); //document.body.innerHTML
			//	alert(match.length);
			//	alert(match);
				
		
				
				
				if(match!=null)
				{
					
					var printWin = window.open('','PrintDoc','toolbars=no,scrollbars=yes,location=no,status=no,menubar=no,resizable=yes,width=900,height=750');
					printWin.document.open();
					
					printWin.document.write('<table cellpading=0 cellspacing=0 width=90%>');
					printWin.document.write('<tr><td>');
					printWin.document.write(match[0]);
					printWin.document.write('</td></tr>');						
					printWin.document.write('</table>');
				
					printWin.document.close();
					printWin.focus();
				//	printWin.window.print();
					
					//printWin.close();
				}
		
			}

