			
			function ChangeImages(node, imgpath, imgMain, imgPlusMinusPrefix, imgPlusMinus)
			{
				bSetMainImage = (imgMain != ""); //don't set main image in text modes
				if (node.children.length > 0)
				{
					if (node.children.item(0).tagName == "IMG")
					{
						if (imgPlusMinus != "No") //"No" indicates that it is not needed Plus or Minus image
							node.children.item(0).src = imgpath + imgPlusMinusPrefix + imgPlusMinus + ".gif";
						else //if is not needed Plus/Minus image
						{
							if (bSetMainImage) //if node has image that must be changed
							{
								node.children.item(0).src = imgpath + imgMain;
								bSetMainImage = false;
							}
						}									
					}			
				}
				
				// process situation <A..><Checkbox><needed image></A>
				if (bSetMainImage && node.children.length > 1)
				{
					if (node.children.item(0).tagName == "INPUT" && node.children.item(1).tagName == "IMG")
					{
						node.children.item(1).src = imgpath + imgMain;
						bSetMainImage = false;
					}
				}
				
				//process next tag
				if (bSetMainImage)
				{
					nextNode = node.nextSibling;
					if (nextNode.tagName == "INPUT") //skip checkbox
						nextNode = nextNode.nextSibling;

					if (nextNode.tagName == "IMG") //next tag is needed image
						nextNode.src = imgpath + imgMain;
					else //next tag is <A...>
						if (nextNode.children.length > 0)
						{
							pos = 0;
							if (nextNode.children.item(0).tagName == "INPUT" && nextNode.children.length > 1)	
								pos = 1; // <A..> <Checkbox> <needed image>

							if (nextNode.children.item(pos).tagName == "IMG")							
								nextNode.children.item(pos).src = imgpath + imgMain;
						}
				}		
			}
			
			
			
			function ExpCol(node, imgpath, imgPlusMinus, imgCollapsed, imgExpanded, nodekey)
			{
				if (node != null)
				{
					nextNode = node.nextSibling;
					bFinded = false;
					
					while (nextNode != null && bFinded == false)
					{					
						if (nextNode.tagName == "DIV")
							bFinded = true;	
						else			
							nextNode = nextNode.nextSibling;	
					}
					
					if (nextNode != null && bFinded)
					{						
						if (nextNode.style.display == 'none')
						{
							nextNode.style.display = '';
							ChangeImages(node, imgpath, imgExpanded, 'tv_minus', imgPlusMinus);
						}
						else
						{
							nextNode.style.display = 'none';
							ChangeImages(node, imgpath, imgCollapsed, 'tv_plus', imgPlusMinus);
						}
					}				
				}
			}
	

function logout()
{
  Document.All.LogoutBox.Value="Logout";
  document.submit();
}

function collapseall()
{
  
  parent.frames.content.document.getElementById("ASPTreeView1").ExpandAll =0
}


function PrintFrame()
{
  parent.frames.main.focus();
  parent.frames.main.print();
 
}

function blockError(){return true;}
window.onerror = blockError;

function noRightClick() {
if (event.button==2) {
   alert('The right mouse click option is not available here.')}
}


function QuickQuery()
{
 window.open("quickquery.aspx","QuickQuery","toolbar=no,location=no,menubar=no, resizable=yes");
}


function ReportBuilder()
{
 window.open('reportbuilder.aspx','ReportBuilder',"toolbar=no,location=no,menubar=no, resizable=yes");
}


function PopupReport(Report)
{
var cReport = 'showreport.aspx?ReportName='+Report;
window.open(cReport,' ','toolbar=no,location=yes,menubar=no, resizable=yes');
}

function ViewReport(Report)
{
var cReport = '../showreport.aspx?ReportName='+Report;
window.location = cReport;
}



function ShowDemoApp()
{
var w=800;
var h=600;

if (window.screen) {
   w = parseInt(window.screen.availWidth * 0.85);
   h = parseInt(window.screen.availHeight * 0.70);
}

 window.open("https://www.reportstrader.net","ReportsTrader","toolbar=no,status=yes, location=yes,menubar=yes, resizable=yes, " + "width=" + w + ", height=" + h);
 window.status="";
 
}


function ShowCustomerApp()
{
var w=800;
var h=600;

if (window.screen) {
   w = parseInt(window.screen.availWidth * 0.85);
   h = parseInt(window.screen.availHeight * 0.70);
}

 window.open("https://www.reportstrader.net?AcctID=0","ReportsTrader","toolbar=no,status=yes, location=yes,menubar=yes, resizable=yes, " + "width=" + w + ", height=" + h);
 window.status="";
 
}



function Show(pg)
{

if (pg=="Dashboard"){
        
    document.getElementById('pdfFrame').src = 'Dashboards/VMUnassignedRejectedOrdersDashboard.pdf';
    Popup.HeaderText = 'Open Request Demographic Dashboard';
    LoadingPanel.Show();
    Popup.Show();
    LoadingPanel.Hide();
    }
   
}



document.onmousedown=noRightClick


