function checkInt(obj)
{
if(obj.value*1 - obj.value*1!=0)
	{obj.value="";}

if(obj.value.indexOf(" ",0)!=-1)
	{
	obj.value="";
	alert ("No Spaces Allowed");	
	obj.focus();
	obj.value="";
	}


}


function checkPercent(obj)
{

	if(obj.value<=100 && obj.value>00)
	{return;}
	else
	{obj.value='';}
}


function makeDisabled(obj)
{
	if(document.layers)
	{obj.blur();}
	if(document.all)
	{obj.readOnly=true;}

}



function format(num,fstyle)
{


	if(fstyle=='float')
{				
		temp1=num;
		numDec=parseFloat(num)-Math.floor(temp1);
		numDec=parseInt(numDec*100);
		if(numDec)
		{
		
		numDec=""+numDec;
		numFloat=Math.floor(temp1)+"."+numDec;
		}
		else
		{
		numFloat=Math.floor(temp1)+".00";
		}

return numFloat;		

}


	if(fstyle=='currency'||fstyle=='RupeePaise')	
		
{		
		temp1=format(num,'float');
		
		temp1*=1;
		numDec=temp1-parseInt(temp1);
		
		
		temp1=parseInt(temp1);
		temp1=temp1.toString();
		arr="";
		
		if(temp1.length>3)
		{
		inc=3;
		for(i=temp1.length-3;i>0;i-=inc)
		{
		
		arr= ","+temp1.substr(i,inc)+arr;
		
		inc=2;
		}
		
		arr=temp1.substring(0,i+2)+arr;
		}
		else
		{			
		arr=temp1;
		}		
		
		if(fstyle=='RupeePaise')
		{arr=arr+Math.abs(numDec);}
return arr;
}


}




function getPureNumber(num)
{
newnum='';
num=""+num;

	for(i=0;i<num.length;i++)
	{	
		
		if(num.substring(i,i+1)!=',')
		{  
			newnum=newnum+num.substring(i,i+1);
			
		}
	}

return parseFloat(newnum);

}



function checkNeg(obj)
{

	if(obj.value.charAt(0)=="-")
	{
	obj.value="";
	alert ("Negative Numbers are not Valid");	
	obj.focus();
	obj.value="";
	}

	if(obj.value.indexOf('.',0) != -1)
	{
	obj.value="";
	alert ("Decimal values are not Valid");	
	obj.focus();
	obj.value="";
	}

	if(obj.value.indexOf(" ",0)!=-1)
	{
	obj.value="";
	alert ("No Spaces Allowed");	
	obj.focus();
	obj.value="";
	}
  

}

function checkNegative(obj)
{

	if(obj.value.charAt(0)=="-")
	{
	obj.value="";
	alert ("Negative Numbers are not Valid");	
	obj.focus();
	obj.value="";
	}

}
