    function go(){
    document.getElementById('lblMessage').innerHTML = 'Please wait while we process your request.';
    }

function popitup(url)
{
	newwindow=window.open(url,'name','width=1000,resizable=1,scrollbars=1');
	if (window.focus) {newwindow.focus()}
	return false;
}
function popup(url,name,stat)
{
	newwindow=window.open(url,name,stat);
	if (window.focus) {newwindow.focus()}
	return false;
}
// close button when it's pressed
function hidebutton()
{
	var btn = document.getElementById('NewSearch');
	
	btn.style.display = 'none';
	
	
				var r1 = document.getElementById('FlexRow1');
				var r2 = document.getElementById('FlexRow2');
				var r3 = document.getElementById('FlexRow3');
				var r4 = document.getElementById('FlexRow4');
				
						r1.style.display = 'block'; 
						r2.style.display = 'block'; 
						r3.style.display = 'block'; 
						r4.style.display = 'block'; 
}

// get the width of the current window
function getWindowWidth () 
{
    var width = 0;
    if (typeof(window.outerWidth) == 'number') {
        width = window.outerWidth;
    }
    else if (
        document.documentElement
            && document.documentElement.clientWidth
    ) {
        width = document.documentElement.clientWidth;
    }
    else if (document.body && document.body.clientWidth) {
        width = document.body.clientWidth;
    }
    return width;
}

/* This function turns rows on and off according to dropdownlist 
 	
		row 1,2,3 = Home Loans
		row 4,5 	= Credit Card
		row 6			= Personal Loans
		row 7			= Business Loans
		row 8			= Non-Conforming Loans
*/

/* 	Don't forget to put this in the Page_Load sub to add the javascript attribute to the control 
		as asp.net web controls use the same event names for server side events as javascript uses for its client side events

			ddl1.Attributes.Add("onChange", "navSelection()")
*/





// hover function for table row results

function SubRollOverRow(oTr) {if (!oTr.contains(event.fromElement)) {oTr.bgColor="#CEF824";}}
function SubRollOutRow(oTr) {if (!oTr.contains(event.toElement)) {oTr.bgColor="#FFFFFF";}}
function SubRollOverRowAlt(oTr) {if (!oTr.contains(event.fromElement)) {oTr.bgColor="#CEF824";}}
function SubRollOutRowAlt(oTr) {if (!oTr.contains(event.toElement)) {oTr.bgColor="#F6F6F6";}}




/*function HighlightRow(chkB)
{

	var xState=chkB.checked;

	if(xState)
	{
		chkB.parentElement.parentElement.style.backgroundColor='black'; 
		chkB.parentElement.parentElement.style.color='white'; 
	}
	else
	{
		chkB.parentElement.parentElement.style.backgroundColor='ghostwhite'; 
		chkB.parentElement.parentElement.style.color='#404042'; 
	}
}
*/
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


/*******************************************************************
This is the javascript function that is invoked when the checkboxlist
is clicked.

Function:    disableListItems.
Inputs:        checkBoxListId - The id of the checkbox list.

            checkBoxIndex - The index of the checkbox to verify.
            i.e If the 4th checkbox is clicked and 
            you want the other checkboxes to be
            disabled the index would be 3.
            
            numOfItems - The number of checkboxes in the list.
Purpose:  Disables all the checkboxes when the checkbox to verify is
            checked.  The checkbox to verify is never disabled.
********************************************************************/
function disableListItems(checkBoxListId, checkBoxIndex, numOfItems)
{
    // Get the checkboxlist object.
    objCtrl = document.getElementById(checkBoxListId);
    
    // Does the checkboxlist not exist?
    if(objCtrl == null)
    {
        return;
    }

    var i = 0;
    var objItem = null;
    // Get the checkbox to verify.
    var objItemChecked = 
       document.getElementById(checkBoxListId + '_' + checkBoxIndex);

    // Does the individual checkbox exist?
    if(objItemChecked == null)
    {
        return;
    }

    // Is the checkbox to verify checked?
    var isChecked = objItemChecked.checked;
    
    // Loop through the checkboxes in the list.
    for(i = 0; i < numOfItems; i++)
    {
        objItem = document.getElementById(checkBoxListId + '_' + i);

        if(objItem == null)
        {
            continue;
        }

        // If i does not equal the checkbox that is never to be disabled.
        if(i != checkBoxIndex)
        {
            // Disable/Enable the checkbox.
            objItem.disabled = isChecked;
            // Should the checkbox be disabled?
            if(isChecked)
            {
                // Uncheck the checkbox.
                objItem.checked = false;
            }
        }
    }
}

//    var timerID = null;
//    var delay = 500;

//    function swap(filename){

//    clearTimeout(timerID);

//    if (document.layers){
//    filename = filename.replace(/\\/g,'/');
//    document.getElementById('image1').src='file://'+filename;} 
//    //document.layers['FileUpload1'].document.images['image1'].src='file://'+filename;} 
//    else{document.getElementById('image1').src='file://'+filename;}
//    }

//    function StartTimer()
//    {
//        if (document.form1.FileUpload1.value > ""){
//        swap(document.form1.FileUpload1.value);}
//        else{timerID = self.setTimeout('StartTimer()', delay);}

//    }

    var timerID = null;
    var delay = 500;

    function swap(filename){

    clearTimeout(timerID);

    if (document.layers){
    filename = filename.replace(/\\/g,'/');
    document.getElementById('image1').src='file://'+filename;} 
    //document.layers['FileUpload1'].document.images['image1'].src='file://'+filename;} 
    else{document.getElementById('image1').src='file://'+filename;}
    }

    function StartTimer(name)
    {
        if (document.form1.FileUpload1.value > ""){
        swap(document.form1.FileUpload1.value);}
        else{timerID = self.setTimeout('StartTimer()', delay);}

    }

