
function bsl_setFlag(id)
{
    document.getElementById(id).value='SET';
}

function bsl_resetFlag(id)
{
    document.getElementById(id).value='';
}

function bsl_visible(id)
{
    document.getElementById(id).className="visible";
}

function bsl_invisible(id)
{
    document.getElementById(id).className="invisible";
}

function createDivAtCenter(divHeight,divWidth,id)
{
   if(document.getElementById(id))
       {
           document.body.removeChild(document.getElementById(id));
       }
    var myHeight=0,myWidth=0,outerHeight=0,outerWidth=0,Height=0;
		myHeight=getScrolledHeight();
		Height=getInnerHeight();
		myWidth=getInnerWidth();
		var outerLoaderDiv = document.createElement("div");
        var outerDivHeight=divHeight;
        outerLoaderDiv.setAttribute('id',id);
        if(navigator.appName == "Microsoft Internet Explorer")
		{
			var styleOuter = outerLoaderDiv.style;

			styleOuter.position='absolute';
			styleOuter.top=(myHeight+(Height-outerDivHeight)/2);

			styleOuter.left=((myWidth-divWidth-40)/2)+'px';

			styleOuter.color='#000';
			styleOuter.height=outerDivHeight+'px';
			styleOuter.width=divWidth+'px';

			outerLoaderDiv.setAttribute('style',styleOuter);

		}
		else
		{
			outerLoaderDiv.setAttribute('style','position:absolute;color: #000; top: '+(myHeight+(Height-outerDivHeight)/2)+'px; left: '+((myWidth-divWidth-40)/2)+'px;height: '+(outerDivHeight)+'px;width: '+(divWidth)+'px');

        }
		outerLoaderDiv.innerHTML='&nbsp';

		document.body.appendChild(outerLoaderDiv);

}

function bsl_removeDiv(id)
{
    if(document.getElementById(id))
        {
            document.body.removeChild(document.getElementById(id));
        }
}

function bsl_displayHelpNoteDiv(evt,id,divContent)
{
    arr=bsl_getMouseXY(evt);
    mouseX=arr[0]+10;
    mouseY=arr[1]+10;
    if(divContent=='')
        return;
      var outerHelperDiv = document.createElement("div");
     outerHelperDiv.setAttribute('id',id);
        if(navigator.appName == "Microsoft Internet Explorer")
		{
			var styleOuter = outerHelperDiv.style;

			styleOuter.position='absolute';
			styleOuter.top=mouseY+'px';
			styleOuter.left=mouseX+'px';
			styleOuter.color='#000';
    		outerHelperDiv.setAttribute('style',styleOuter);
		}
		else
		{
			outerHelperDiv.setAttribute('style','position:absolute;color: #000; top: '+mouseY+'px; left: '+mouseX+'px;');
        }
        outerHelperDiv.className="help-meaasge";
		outerHelperDiv.innerHTML=divContent;
		document.body.appendChild(outerHelperDiv);
}


function bsl_getMouseXY(e) {
        if(navigator.appName == "Microsoft Internet Explorer"){ // grab the x-y pos.s if browser is IE

       if (document.documentElement && document.documentElement.scrollLeft){	 // Explorer 6 Strict
		xScrollleft = document.documentElement.scrollLeft;
        }
        else if (document.body)
        {// all other Explorers
            xScrollleft = document.body.scrollLeft;
        }
        tempX = event.clientX + xScrollleft;
        
        if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScrolltop = document.documentElement.scrollTop;
        } 
        else if (document.body)
        {// all other Explorers
            yScrolltop = document.body.scrollTop;
        }
        tempY = event.clientY + yScrolltop;

        }
        else {  // grab the x-y pos.s if browser is NS
        tempX = e.pageX;
        tempY = e.pageY;
        }
        if (tempX < 0){tempX = 0;}
        if (tempY < 0){tempY = 0;}
       arr[0]=tempX;
       arr[1]=tempY;
       return arr;
}

function bsl_removeChildDiv(parentId,childId)
{
      if(document.getElementById(childId))
        {
            document.getElementById(parentId).removeChild(document.getElementById(childId));
        }
}

function bsl_setFocus(id)
{
    if(document.getElementById(id))
        {
            document.getElementById(id).focus();
        }
}

function bsl_acceptIntegersOnly(evt)
{
    if (navigator.appName=="Microsoft Internet Explorer")
	{
		if (evt.keyCode>47 && evt.keyCode<58 || evt.keyCode==8)
			{}
		else
			return false;
	}
	else
	{
		if (evt.which>47 && evt.which<58 || evt.which==8)
			{}
		else
			return false;
	}

}

function bsl_acceptFloatsOnly(evt)
{
    if (navigator.appName=="Microsoft Internet Explorer")
	{
		if (evt.keyCode>46 && evt.keyCode<58 || evt.keyCode==8)
			{}
		else
			return false;
	}
	else
	{
		if (evt.which>46 && evt.which<58 || evt.which==8)
			{}
		else
			return false;
	}

}

function showChangePasswordWindow(url)
    {
        //var url="add_dptform.php";
        myWindow=window.open(url,"","status=1,scrollbars=0,titlebar=yes,width=430,height=450");
       // myWindow.moveTo(180,30);
    }
