// JavaScript Document
function numbertofigures(ddamt)
{
	url         =   base_url+"ajaxschooldata.php";
    params      =   "ddamt="+escape(ddamt);
    new Ajax.Request(url,
                        {
                            method      :   "post",
                            parameters  :   params,
                            onComplete  :   update_dd_amount
                        }
                    );
    function update_dd_amount(req_obj)
    {
        $("txtDDWords").value = req_obj.responseText;
    }                    
}

function numbertofigures_forschool(ddamt)
{ 
	url         =   base_url+"ajaxschooldata.php";
    params      =   "ddamt="+escape(ddamt);
    new Ajax.Request(url,
                        {
                            method      :   "post",
                            parameters  :   params,
                            onComplete  :   update_dd_amount
                        }
                    );
    function update_dd_amount(req_obj)
    {
        $("Inwords").value = req_obj.responseText;
    }                    
}
function showbalance()
{	 
	var totAmt = Number($('txtNo').value);
	var ddAmt  = Number($('txtDD').value);
	var balance	=	 totAmt - ddAmt;
	$('balamt').value = balance;
}
function editnews()
{ 
	thisForm.txtWhat2Do.value = 'EDITNEWS';
	thisForm.action='addnews.php';
	thisForm.submit();
}
function updatenews()
{ 	
	if($('news').value == '')
	{
		alert('Please Enter Your News Content');
		$('news').focus();
		return;
	}
	thisForm.txtWhat2Do.value = 'UPDATENEWS';
	thisForm.action='addnews.php';
	thisForm.submit();
}
function savenewsdata()
{ 
	if($('news').value == '')
	{
		alert('Please Enter Your News Content');
		$('news').focus();
		return;
	}
	thisForm.txtWhat2Do.value = 'SAVENEWS';
	thisForm.action='addnews.php';
	thisForm.submit();
}


function addnews()
{
	thisForm.txtWhat2Do.value = 'ADDNEWS';
	thisForm.action='addnews.php';
	thisForm.submit();
}
function cancelnewspanel()
{ 

	thisForm.action='addnews.php';
	thisForm.submit();
}
