function SymError()
{
  return true;
}

//window.onerror = SymError;
function dateValid(input)      
{
var validformat=/^\d{2}\/\d{2}\/\d{4}$/ //Basic check for format validity
var returnval=false
if (!validformat.test(input))
alert("Invalid Date Format. Please correct.")
else{ //Detailed check for valid date ranges
var dayfield=input.value.split("/")[0]
var monthfield=input.value.split("/")[1]
var yearfield=input.value.split("/")[2]
var dayobj = new Date(yearfield, monthfield, dayfield)
if ((dayobj.getMonth()+1!=monthfield)||(dayobj.getDate()!=dayfield)||(dayobj.getFullYear()!=yearfield))
alert("Invalid Day, Month, or Year range detected. Please correct.")
else
returnval=true
}
return returnval
}

function hidestatus()
{
   window.status=''
   return true
}
            
function padZero(num) 
{
return (num< 10)? '0' + num : num ;
}

function mydate()
{
var today= new Date();
return padZero(today.getDate()) + "/" + padZero(today.getMonth()+1)+ "/" + today.getYear();
}


function dispdate(dt)
{
return padZero(dt.getDate()) + "/" + padZero(dt.getMonth()+1)+ "/" + dt.getYear();
}

var newWin = null;

function closeViewer() { if (newWin!=null && !newWin.closed) { newWin.close(); } }

function openwin(fname, width, height)
{
closeViewer();
newWin=window.open(fname,'','toolbar=no, location=no, directories=no, status=no, menubar=no, resizable=no, alwaysRaised=yes, copyhistory=no, scrollbars=yes, top=0, left=0, width='+width + ',height='+ height+ ',top=150,left=150');
newWin.focus();
}

function imageopen(iname,w,h)
{
closeViewer();

var myBars='directories=no,location=no,menubar=no,status=no,titlebar=no,toolbar=no,scrollbars=no, resizable=yes, statusbar=no width=' + w + ', height=' + h + ', left=' + (screen.width-w)/2 + ', top=' + (screen.height-h)/2 ;
newWin=window.open('','sc',myBars);

newWin.document.writeln("<html><head><title>:: ::</title></head>");
newWin.document.writeln("<body bgcolor='#FFFFFF' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>");
newWin.document.writeln("<table width='100%' cellpadding=0 cellspacing=0><tr align=center><td valign=middle><img src='../upload/" + iname + "'></td></tr></table>");
newWin.document.writeln("</body></html>");
newWin.document.close();
newWin.focus();
}

function validNumber(obj)
{
	if(isNaN(obj.value))
	{
	alert("Please enter Numeric Value or Zero(0)");
	obj.focus();
	obj.select();
	}
}

function del(fname)
{
var bool
bool=window.confirm("Are you sure to delete?");
if(bool)
window.location.href=fname;
//window.open(fname,'','toolbar=no, location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,scrollbars=yes,width=10,height=10,top=10,left=1300');
}

function recd(fname)
{
var bool
bool=window.confirm("Payment Received \n Are you sure ?");
if(bool)
window.location.href=fname;
//window.open(fname,'','toolbar=no, location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,scrollbars=yes,width=10,height=10,top=10,left=1300');
}

function chgbgcolor(obj, col) 
{
	obj.style.backgroundColor=col
}

function ltrim(ObjectValue)
{
ctr=0
for(i=0; i < ObjectValue.length;i++)
{
  if(ObjectValue.charAt(i) == " ")
    ctr = ctr + 1 
    else
    break
}
return ObjectValue.substr(ctr,ObjectValue.length)
} // end of function ltrim

function rtrim(ObjectValue)
{
ctr=0
for(i=ObjectValue.length -1; i >=0 ;i--)
{
  if(ObjectValue.charAt(i) == " ")
    ctr = ctr + 1 
    else
    break
}
return ObjectValue.substr(0,ObjectValue.length-ctr)
} // end of function rtrim


function alltrim(ObjectValue)
{
 return rtrim(ltrim(ObjectValue))
} // end of function alltrim
//****End Of Code For Removing The Spaces****


function ltrimZero(ObjectValue)
{
ctr=0
for(i=0; i < ObjectValue.length;i++)
{
  if(ObjectValue.charAt(i) == "0")
    ctr = ctr + 1 
    else
    break
}
return ObjectValue.substr(ctr,ObjectValue.length)
} // end of function ltrim