// COMMON PURPOSE Javascript FUNCTIONS

// String trimming
function ltrim(str){return typeof(str)=='string' ?str.replace(/^\s+/,'') :str;}
function rtrim(str){return typeof(str)=='string' ?str.replace(/\s+$/,'') :str;}
function trim(str) {return typeof(str)=='string' ?str.replace(/^\s+/,'').replace(/\s+$/,'') :str;}

/**
 * Verifies the existence of an object, function parameter, etc.
 * o	The Object to be verified
 */
function IsValid (o) {return o!=null && typeof(o)!='undefined';}

/**
 * Sets the visibility of a control
 * ctrl				Control instance
 * bIsVisible		true to make the control visible, false otherwise
 * [bPreserveSpace]	true to preserve the space occupied by the control,
 *					false otherwise. Default value is false
 */
function CtrlVisible(ctrl,bIsVisible,bPreserveSpace){
if (!IsValid(ctrl)) return;
if (bPreserveSpace==null) bPreserveSpace=false;
ctrl.style.display=bIsVisible || bPreserveSpace ?'inline':'none';
ctrl.style.visibility=bIsVisible || !bPreserveSpace ?'visible':'hidden';
}

/**
 * Sets the visibility of a control
 * strCtrlID		String containing Control's id
 * bIsVisible		true to make the control visible, false otherwise
 * [bPreserveSpace]	true to preserve the space occupied by the control,
 *					false otherwise. Default value is false
 */
function CtrlVisibleByID(strCtrlID,bIsVisible,bPreserveSpace){
CtrlVisible(document.getElementById(strCtrlID),bIsVisible,bPreserveSpace);
}

/**
 * Gets the control's visibility.
 *
 * ctrl	Control instance
 *
 * Returns true if the control is visible, false otherwise.
 */
function IsCtrlVisible(ctrl){
return typeof(ctrl)!='undefined' && !(ctrl.style.display=='none' || ctrl.style.visibility=='hidden');
}

/**
 * Gets the control's visibility.
 *
 * strCtrlID	String containing Control's id
 *
 * Returns true if the control is visible, false otherwise.
 */
function IsCtrlVisibleByID(strCtrlID){
return IsCtrlVisible(document.getElementById(strCtrlID));
}

/**
 * Sets a Cookie with the given name and value.
 *
 * name       Name of the cookie
 * value      Value of the cookie
 * [expires]  Expiration date of the cookie (default: end of current session)
 * [path]     Path where the cookie is valid (default: path of calling document)
 * [domain]   Domain where the cookie is valid
 *              (default: domain of calling document)
 * [secure]   Boolean value indicating if the cookie transmission requires a
 *              secure transmission
 */
function setCookie(name, value, expires, path, domain, secure)
{
    if (expires==null)
    {
        expires = new Date();
        var today = new Date();
        //expire the cookie in a year (365 days)
        expires.setTime(today.getTime() + 3600000*24*365);
    }

    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}

/**
 * Gets the value of the specified cookie.
 *
 * name  Name of the desired cookie.
 *
 * Returns a string containing value of specified cookie,
 *   or null if cookie does not exist.
 */
function getCookie(name)
{
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1)
    {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    }
    else
    {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1)
    {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}

/**
 * Deletes the specified cookie.
 *
 * name      name of the cookie
 * [path]    path of the cookie (must be same as path used to create cookie)
 * [domain]  domain of the cookie (must be same as domain used to create cookie)
 */
function deleteCookie(name, path, domain)
{
    if (getCookie(name))
    {
        document.cookie = name + "=" + 
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
    }
}

// Remove all items from a SELECT control
function SelectClear(oSelect){
	while(oSelect.options.length>0)
		oSelect.options.remove(0);
}

// Add a SELECT control item
function SelectAddOption(oSelect, strVal, strText, bSelected){
	var oOption=document.createElement('OPTION');
	oSelect.options.add(oOption);
	oOption.innerText=strText;
	oOption.value=strVal;
	oOption.selected=bSelected;
}

// Finds and sets selected item of a SELECT control by its value.
// If match doesn't exist returns -1, otherwise returns the selected index.
function SelectSetOptionByValue(oSelect, strVal){
	for(i=0; i < oSelect.options.length; i++)
		if(oSelect.options[i].value==strVal){
			oSelect.options[i].selected=true;
			return i;
		}
	return -1;
}

// Finds and sets selected item of a SELECT control by its text.
// If match doesn't exist returns -1, otherwise returns the selected index.
function SelectSetOptionByText(oSelect, strVal){
	for(i=0; i < oSelect.options.length; i++)
		if(oSelect.options[i].text==strVal){
			oSelect.options[i].selected=true;
			return i;
		}
		return -1;
}

// Moves selected item UP or DOWN. If an Item is not selected returns false.
function SelectMoveItem(oSelect, strCmd)
{
	if(oSelect == null) return true;

	if(oSelect.selectedIndex != -1 && oSelect.type == "select-one")
	{
		var selVal = oSelect.options[oSelect.selectedIndex].value;
		var selTxt = oSelect.options[oSelect.selectedIndex].text;

		if(strCmd == "UP")
		{
			if(oSelect.selectedIndex == 0) return true;
			oSelect.options[oSelect.selectedIndex].value = oSelect.options[oSelect.selectedIndex - 1].value
			oSelect.options[oSelect.selectedIndex].text = oSelect.options[oSelect.selectedIndex - 1].text
			oSelect.options[oSelect.selectedIndex - 1].value = selVal;
			oSelect.options[oSelect.selectedIndex - 1].text = selTxt;
			oSelect.selectedIndex--;
		}
		else
		{
			if(oSelect.selectedIndex == oSelect.length - 1) return true;
			oSelect.options[oSelect.selectedIndex].value = oSelect.options[oSelect.selectedIndex + 1].value
			oSelect.options[oSelect.selectedIndex].text = oSelect.options[oSelect.selectedIndex + 1].text
			oSelect.options[oSelect.selectedIndex + 1].value = selVal;
			oSelect.options[oSelect.selectedIndex + 1].text = selTxt;
			oSelect.selectedIndex++;
		}
	}
	else
		return false;
	
	return true;
}

// Transfers selected option item between two select controls.
// Returns true if the transfer is successful
function SelectXsferOption(oSelSrc,oSelDst)
{
if(oSelSrc.selectedIndex<0) return false;
SelectAddOption(oSelDst,oSelSrc.value,oSelSrc.options[oSelSrc.selectedIndex].text,true);
oSelSrc.options.remove(oSelSrc.selectedIndex);
if(oSelSrc.options.length>0) oSelSrc.selectedIndex=0;
return true;
}
/*
function SelectTransferOptionByIDs(oSelSrcID,oSelDstID)
{
var oSelSrc = document.getElementById(oSelSrcID);
var oSelDst = document.getElementById(oSelDstID);
if (oSelSrc == null || oSelDst == null) return false;
//if(oSelSrc.selectedIndex<0) return false;
if (oSelSrc.options[oSelSrc.selectedIndex].value=="") return false;
SelectAddOption(oSelDst,oSelSrc.value,oSelSrc.options[oSelSrc.selectedIndex].text,false);
oSelSrc.options.remove(oSelSrc.selectedIndex);
if(oSelSrc.options.length>0) oSelSrc.selectedIndex=0;
return false;
}
*/

// Populates Select with data passed via AjaxDDLContent object in the DDLContent parameter using AJAX call
function SelectAjaxDDLContentPopulate(DDLContent,oSelect,sUndefined)
{
var ddlCtnt=DDLContent==null?null:DDLContent.value;
SelectClear(oSelect);
if(IsValid(sUndefined) && sUndefined!='')
	SelectAddOption(oSelect,'',sUndefined,ddlCtnt == null || ddlCtnt.SelectedID=='');
if(ddlCtnt==null) return;
for(var i=0;i<ddlCtnt.IDs.length;i++)
	SelectAddOption(oSelect,ddlCtnt.IDs[i],ddlCtnt.Names[i],ddlCtnt.IDs[i]==ddlCtnt.SelectedID);
}

function SetScreenHeight()
{
var iHeight = (window.innerHeight) ? window.innerHeight
	: document.body.offsetHeight;
setCookie("ht", iHeight);
}

function SetScreenWidth()
{
var iWidth = (window.innerWidth) ? window.innerWidth
	: document.body.offsetWidth;
setCookie("wt", iWidth);
}

function ConfirmDelete(eventObj)
{
    if (confirm("Are you sure you want to delete this record?"))
        eventObj.returnValue = true;
    else
        eventObj.returnValue = false;   
}

/*
var today = new Date();
var expire = new Date();
//expire the cookie in a year (365 days)
expire.setTime(today.getTime() + 3600000*24*365);

setCookie("FS"+userID+"DR", (chk.checked)?"1":"0", expire);


 if (Request.Cookies["FS"+sUserID+"VIEW"] != null)
 {
       //Else case not needed since default is view by qty
       if (Request.Cookies["FS"+sUserID+"VIEW"].Value =="2")
             ShowViewBy = 2;   //by Price
 }

*/

function OpenReport(sParam) 
{
    FWAJAX.SetReportParameter(sParam);
    var url = '../FWReport/ReportDisplayPDF.aspx';
    var sRetVal = window.open(url);        
    return false;
}

function OpenARMSHelp() 
{
    var url = '../Attachments/ARMS User Manual.pdf';
    var sRetVal = window.open(url);        
    return false;
}

function OpenSearch(eventObj) 
{
    //var url = '/framework/Support/SearchPopup.aspx?Option=' + strOption + '&Title=' + strTitle;
    var url = '../Support/SearchPopup.aspx';
    var sRetVal = window.showModalDialog(url,self,'dialogWidth:40;center:Yes;resizable:Yes;status:No;help:No');    
    eventObj.returnValue = (sRetVal=='Search');
    return (sRetVal == 'Search');
}
function OpenUpload(iRequestId)
{
    var url = '../Support/UploadPopup.aspx?RequestId='+iRequestId;
    var sRetVal = window.showModalDialog(url,self,'dialogWidth:800px;dialogHeight:250px;center:Yes;resizable:Yes;status:No;help:No');    
    return (sRetVal == 'Upload');    
}
/*
function ViewUpload(iAttachmentId)
{
    var url = '../Support/UploadViewer.aspx?AttachmentId='+iAttachmentId;
    var sParams = 'directories=no,location=no,menubar=yes,scrollbars=yes,status=yes,resizable=yes,toolbar=no,maximize=yes';
    window.open(url, '_blank', sParams);
}
function CloseSearch()
{    
    window.returnValue = '';
    window.close();
    return false;
}
*/
function OpenSearchPicker(sClientID) 
{
//    if (PageMethods.IsSessionAlive())
//        alert('Session Alive');
//    else
//        alert('Session Dead');   

        var url = '../Support/SearchPicker.aspx?ClientID=' + sClientID;
        var sRetVal = window.showModalDialog(url,self,'dialogWidth:50;center:Yes;resizable:Yes;status:No;help:No');    
        return (sRetVal == 'SearchPicked');
//    }
//    else
//    {
//        alert("Session has Expired...please login again");
//        return false; 
//    }      
//   return false; 
}

function CancelPopupWindow()
{
    window.returnValue = '';
    window.close();
    return false;
}


function OnSearchInputChange(sID)
{
    //var ddl = document.getElementById('ddlOp_' + sID);    
    var ddl = $get(sID);
    if (ddl == null) alert('ddl is null');
    if (ddl != null && ddl.selectedIndex == 0)
        ddl.selectedIndex = 1;
        
}
/*
function OnSearchOk()
{
    alert('SearchOk fired');
    return true;
}
function OnSearchClose()
{
    alert('SearchClose fired');
    return true;
}
*/
function PersistSelectedTab()
{
    var hdn = document.getElementById('hdnSelectedTab');
    if (hdn != null)
    {        
        var sKeyVals = hdn.value;
        //alert('hiddenval='+sKeyVals);
        SetActiveTabByKeyVals(sKeyVals);
    }
}

function SetActiveTabByKeyVals(sKeyVals)
{
    if (sKeyVals != null && sKeyVals.length > 0)
    {            
        var sTabs = sKeyVals.split(';');
        for(var i=0; i < sTabs.length; i++)
        {
            var bVisible = (sTabs[i].split('|')[1] == '1' ? true: false);
            var sID = sTabs[i].split('|')[0];
            //alert(sID + '=' + bVisible);
            CtrlVisibleByID(sID,bVisible,false);
        }
    }    
}

function ToggleCheckboxes(chkHeader)
{
    var sContainer = chkHeader.id.split("_");
    //alert(sContainer[0]);    
    var bChecked = chkHeader.checked;
    var frm = document.forms[0];
    for(var i=0; i < frm.elements.length; i++)
    {
        if (frm.elements[i].type=="checkbox" 
            && frm.elements[i].name.indexOf("chkSelect") != -1
            && frm.elements[i].name.indexOf(sContainer[0]) != -1
            && frm.elements[i].disabled==false)
                frm.elements[i].checked = bChecked;
    }
    
}

//Allow numbers and a single decimal
function ChkNum(eventObj, obj)
{
    //alert('ChkNum fired');
	var keyCode;
	var shift;
	// Check For Browser Type
	if (document.all){ 
		keyCode=eventObj.keyCode;
		shift=(eventObj.shiftKey);
	}
	else{
		keyCode=eventObj.which;
		shift=(eventObj.modifiers==4);
	}
    if (shift)
	{
        eventObj.returnValue = false;	
        return false;	    
	}

	var str=obj.value
	if(keyCode==110 || keyCode==190){ 
		if (str.indexOf(".")>0){
			eventObj.returnValue = false;
			return false;
		}
	}
	switch(keyCode)
	{
	    case 8:     //Backspace
	    case 46:    //Delete
	    case 9:     //Tab
	    case 13:    //Enter
	    case 37:    //37-40 = Arrows
	    case 38:
	    case 39:
	    case 40:
	        eventObj.returnValue = true; 
	        return true;
	    default:
	        if ((keyCode > 47 && keyCode < 59) || (keyCode > 95 && keyCode < 106) || (keyCode==110 || keyCode==190)){
	            eventObj.returnValue = true; 
	            return true;
	        } 
	}
	eventObj.returnValue = false;
    return false;
}
//Allow numbers only with no decimals
function ChkInt(eventObj, obj)
{
	var keyCode;
	var shift;
	// Check For Browser Type
	if (document.all){ 
		keyCode=eventObj.keyCode;
		shift=(eventObj.shiftKey);
	}
	else{
		keyCode=eventObj.which;
		shift=(eventObj.modifiers==4);
	}
	if (shift)
	{
        eventObj.returnValue = false;	
        return false;	    
	}
	var str=obj.value
	switch(keyCode)
	{
	    case 8:     //Backspace
	    case 46:    //Delete
	    case 9:     //Tab
	    case 13:    //Enter
	    case 37:    //37-40 = Arrows
	    case 38:
	    case 39:
	    case 40:
	        eventObj.returnValue = true; 
	        return true;
	    default:
	        if ((keyCode > 47 && keyCode < 59) || (keyCode > 95 && keyCode < 106)){
	            eventObj.returnValue = true; 
	            return true;
	        } 
	}
    eventObj.returnValue = false;	
    return false;
}

function CurrencyToNumber(num)
{
    var noJunk = "";
    var withDollar = "";
    var foundDecimal = 0;
    var foundAlphaChar = 0;
    num += "";

    if (num == "") { return(0); }
    for (i=0; i <= num.length; i++)
    {
        var thisChar = num.substring(i, i+1);
        if (thisChar == ".")
        {
          foundDecimal = 1;
          noJunk = noJunk + thisChar;
        }
        if ((thisChar < "0") || (thisChar > "9"))
        {
          if ((thisChar != "$") && (thisChar !=".") && (thisChar != ",") && (thisChar != " ") && (thisChar !="")) foundAlphaChar = 1;
        }
        else 
        {
            withDollar = withDollar + thisChar
            noJunk = noJunk + thisChar
        }

        if ((thisChar == "$") || (thisChar == ".") || (thisChar == ","))
        {
            withDollar = withDollar + thisChar
        }
    }
    if (foundDecimal) { return parseFloat(noJunk); }
    else if (noJunk.length > 0) { return parseFloat(noJunk); }
    else return 0;
}

function NumberToCurrency(num) {
    num = num.toString().replace(/\$|\,/g,'');
    if(isNaN(num))
        num = "0";
    sign = (num == (num = Math.abs(num)));
    num = Math.floor(num*100+0.50000000001);
    cents = num%100;
    num = Math.floor(num/100).toString();
    if(cents<10)
        cents = "0" + cents;
    for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
        num = num.substring(0,num.length-(4*i+3))+','+
    num.substring(num.length-(4*i+3));
    return (((sign)?'':'-') + '$' + num + '.' + cents);
}

function DecimalToNumber(strNum)
{
  var objRegExp = /,/g; //search for commas globally
  //replace all matches with empty strings
  return parseFloat(strNum.replace(objRegExp,''));
}

function ToggleMenuItem(sControlID)
{
	//alert('hiding '+sControlID);
	var objCtl = document.getElementById(sControlID);
	
	if (objCtl == null)
		return;
	
	//alert('objCtl found');
		
	var ar = sControlID.split('_');
	var iCatID = ar[ar.length-1];
	
	//alert('CatID='+iCatID);
	
	var bVisible = IsCtrlVisible(objCtl);
	CtrlVisible(objCtl, !bVisible, false);
	
	//alert('setting cookie for ' + iCatID + ' = ' + !bVisible);
	setCookie('m_'+iCatID, !bVisible);
	
	var imgMinus = document.getElementById('mimg_'+iCatID);
	var imgPlus = document.getElementById('pimg_'+iCatID);
		    
	if (imgMinus != null && imgPlus != null)
	{
		CtrlVisible(imgMinus, !bVisible, false);
		CtrlVisible(imgPlus, bVisible, false);
	}	
}

function FadeTreeView(tdFader)
{
    var td = document.getElementById('tdTree');
    if (IsCtrlVisible(td))
    {
        tdFader.innerText = "Show Tree";
        CtrlVisible(td, false, false);
    }
    else
    {
        tdFader.innerText = "Hide Tree";
        CtrlVisible(td, true, false);
    }
}


var cX = 0; var cY = 0; var rX = 0; var rY = 0;
function UpdateCursorPosition(e){ cX = e.pageX; cY = e.pageY;}
function UpdateCursorPositionDocAll(e){ cX = event.clientX; cY = event.clientY;}
if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; }
else { document.onmousemove = UpdateCursorPosition; }
function AssignPosition(d) {
if(self.pageYOffset) {
	rX = self.pageXOffset;
	rY = self.pageYOffset;
	}
else if(document.documentElement && document.documentElement.scrollTop) {
	rX = document.documentElement.scrollLeft;
	rY = document.documentElement.scrollTop;
	}
else if(document.body) {
	rX = document.body.scrollLeft;
	rY = document.body.scrollTop;
	}
if(document.all) {
	cX += rX; 
	cY += rY;
	}
d.style.left = (cX+10) + "px";
d.style.top = (cY+10) + "px";
}
//function HideContent(d) {
//if(d.length < 1) { return; }
//document.getElementById(d).style.display = "none";
//}
//function ShowContent(d) {
//if(d.length < 1) { return; }
//var dd = document.getElementById(d);
////AssignPosition(dd);
//dd.style.display = "block";
//}

function HideContent(d, lnkShow, lnkHide) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
var s = document.getElementById(lnkShow);
var h = document.getElementById(lnkHide);
s.style.display = "block";
h.style.display = "none";
}
function ShowContent(d, lnkShow, lnkHide) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
var s = document.getElementById(lnkShow);
var h = document.getElementById(lnkHide);
//AssignPosition(dd);
dd.style.display = "inline";
s.style.display = "none";
h.style.display = "block";
}

function ReverseContentDisplay(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
//AssignPosition(dd);
if(dd.style.display == "none") { dd.style.display = "inline"; }
else { dd.style.display = "none"; }
}

function IsValidDate(fld) {
    var RegExPattern = /^(?=\d)(?:(?:(?:(?:(?:0?[13578]|1[02])(\/|-|\.)31)\1|(?:(?:0?[1,3-9]|1[0-2])(\/|-|\.)(?:29|30)\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})|(?:0?2(\/|-|\.)29\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))|(?:(?:0?[1-9])|(?:1[0-2]))(\/|-|\.)(?:0?[1-9]|1\d|2[0-8])\4(?:(?:1[6-9]|[2-9]\d)?\d{2}))($|\ (?=\d)))?(((0?[1-9]|1[012])(:[0-5]\d){0,2}(\ [AP]M))|([01]\d|2[0-3])(:[0]\d){1,2})?$/;
    var errorMessage = 'Please enter a valid date in the following format: mm/dd/yyyy.';
    if (fld.value=='')
        return;
          
    if (fld.value.match(RegExPattern)) {
        return;
    } else {
        alert(errorMessage);
        fld.focus();
    } 
}

function MLTBdoBeforePaste(control)
{   
    maxLength = control.attributes["maxLength"].value;   
    if(maxLength)   
    {       
        event.returnValue = false;   
    }
}
function MLTBdoPaste(control)
{   
    maxLength = control.attributes["maxLength"].value;   
    value = control.value;   
    if(maxLength)
    {        
        event.returnValue = false;        
        maxLength = parseInt(maxLength);        
        var o = control.document.selection.createRange();        
        var iInsertLength = maxLength - value.length + o.text.length;        
        var sData = window.clipboardData.getData("Text").substr(0,iInsertLength);        
        o.text = sData;    
    }
}
function MLTBLimitInput(control)
{
    if(control.value.length >= control.attributes["maxLength"].value)    
    {
        alert('Maximum length of ' + control.attributes["maxLength"].value + ' characters reached.');         
        control.value = control.value.substring(0,control.attributes["maxLength"].value);    
        event.returnValue = false;
    }
} 
      
function isAlphaNumericKey(keyCode)  
{  
    if ((keyCode > 47 && keyCode < 58) || (keyCode > 64 && keyCode < 91) || (keyCode > 95 && keyCode < 112))  
    {  
        return true;  
    }  
    return false;  
}  
function CalculateRadEditorLength(editor)  
{  
    var textLength = editor.GetText().length;  
    var clipboardLength = window.clipboardData.getData("Text").length;  
    textLength += clipboardLength;  
    return textLength;  
}  

function OpenNewPersonLink(eventObj) 
{
    var url = '../BOI/NewPersonLink.aspx';
    var sRetVal = window.showModalDialog(url,self,'dialogWidth:45;dialogHeight:10;center:Yes;resizable:Yes;status:No;help:No');    
    eventObj.returnValue = (sRetVal=='Link');
    return (sRetVal == 'Link');
}

function OpenReportCriteria(eventObj, sCommand)
{
    var url = '../BOI/ReportCriteria.aspx?Command='+sCommand;
    var sRetVal = window.showModalDialog(url,self,'dialogWidth:50;dialogHeight:45;center:Yes;resizable:Yes;status:No;help:No');    
    eventObj.returnValue = (sRetVal=='generate');
    return (sRetVal == 'generate');
}

function OpenFYIReport(eventObj)
{
    var url = '../BOI/FYIReport.aspx';
    /*
    var sRetVal = window.showModalDialog(url,self,'dialogWidth:50;dialogHeight:45;center:Yes;resizable:Yes;status:No;help:No');    
    var sRetVal = window.open(url);   
    return (sRetVal == 'FYIReport'); 
     var sRetVal = window.open(url,'FYI Report','left=20,top=20,width=500,height=500,toolbar=0,location=0,status=0,menubar=0,resizable=1');    
     var sRetVal = window.open(url,'FYI Report','left=20,top=20,width=500,height=500,toolbar=1,resizable=0');    
    */
    var sRetVal = window.open(url,'_blank','left=20,top=20,width=500,height=500,toolbar=0,location=0,status=0,menubar=0,titlebar=0,resizable=1');    
    return false;
}

function OpenReportDisplay(eventObj)
{
    var url = '../BOI/ReportDisplay.aspx';
    /*
    var sRetVal = window.showModalDialog(url,self,'dialogWidth:50;dialogHeight:45;center:Yes;resizable:Yes;status:No;help:No');    
    var sRetVal = window.open(url);   
    return (sRetVal == 'FYIReport'); 
     var sRetVal = window.open(url,'FYI Report','left=20,top=20,width=500,height=500,toolbar=0,location=0,status=0,menubar=0,resizable=1');    
     var sRetVal = window.open(url,'FYI Report','left=20,top=20,width=500,height=500,toolbar=1,resizable=0');    
    */
    var sRetVal = window.open(url,'_blank','left=20,top=20,width=500,height=500,toolbar=0,location=0,status=0,menubar=0,titlebar=0,resizable=1');    
    return false;
}

