function isEmpty(s)
{   
	return ((s == null) || (s.length == 0))
}
function isWhitespace(s)
{   
	var i;
    if (isEmpty(s)) return true;
    for (i = 0; i < s.length; i++)
    {   
		  var c = s.charAt(i);
        if (c != " ") return false;

    }
    return true;
}

function pop1(variable)
{   
	var vary=variable+"";
window.open(vary,"1","width=700,height=400,top=50,left=50,resizable=no,value=top,toolbar=no,scrollbars=yes");
}

function ol()
{
	document.forms[0].user.focus();
}

function alphanumch(x)
{
 var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  var checkStr = x;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    return (false);
  }
return (true);
}



<!-- Begin
var AscendDescendOrd;
AscendDescendOrd = "A";
function setDataType(cValue)
{
var isDate = new Date(cValue);
if (isDate == "NaN")
  {
    if (isNaN(cValue))
 {
  cValue = cValue.toUpperCase();
        return cValue;
      }
    else
      {
        var myNum;
        myNum = String.fromCharCode(48 + cValue.length) + cValue;
        return myNum;
      }
    }
 }
function sortTable(col, tableToSort)
{
  var iCurCell = col + tableToSort.cols;
  var totalRows = tableToSort.rows.length;
  var bSort = 0;
  var colArray = new Array();
  var oldIndex = new Array();
  var indexArray = new Array();
  var bArray = new Array();
  var newRow;
  var newCell;
  var i;
  var c;
  var j;
  var cArray = new Array();
  var k;
 for (i=1; i < tableToSort.rows.length; i++)
 {
colArray[i - 1] = setDataType(tableToSort.cells(iCurCell).innerText);
iCurCell = iCurCell + tableToSort.cols;
 }
for (i=0; i < colArray.length; i++)
{
bArray[i] = colArray[i];
}
colArray.sort();
k = colArray.length;
for (i=0; i <colArray.length; i++){
    cArray[k] = colArray[i];
    k = k-1;
}
if(AscendDescendOrd == "D")
{
     for (i=0; i < cArray.length; i++)
{
        colArray[i] = cArray[i];
    }
 }
for (i=0; i < colArray.length; i++)
{
 indexArray[i] = (i+1);
 for(j=0; j < bArray.length; j++)
   {
  if (colArray[i] == bArray[j])
    {
 for (c=0; c<i; c++)
  {
      if ( oldIndex[c] == (j+1) )
      {
        bSort = 1;
     }
  }
if (bSort == 0)
  {
    oldIndex[i] = (j+1);
  }
    bSort = 0;
}
 }
 }
for (i=0; i<oldIndex.length; i++)
  {
    newRow = tableToSort.insertRow();
    for (c=0; c<tableToSort.cols; c++)
      {
        newCell = newRow.insertCell();
        newCell.innerHTML = tableToSort.rows(oldIndex[i]).cells(c).innerHTML;
     }
    }
for (i=1; i<totalRows; i++)
{
tableToSort.moveRow((tableToSort.rows.length -1),1);
}
if(AscendDescendOrd == "D")
{
      totalRows = totalRows + 1;
     AscendDescendOrd = "A";
 }
 else
 {
     AscendDescendOrd = "D";
}
for (i=1; i<totalRows; i++)
{
tableToSort.deleteRow();
}
}
function WriteToFile(rs, mf)
{
try
{
var fso, s;
if (mf == '')
{
alert('Please enter the output file path');
}
else
{
fso = new ActiveXObject('Scripting.FileSystemObject');
s = fso.OpenTextFile(mf , 8, 1, -2);
var len = rs.rows.length;
for (var i=1; i < rs.rows.length; i++)
 {
for (var j=0; j < rs.cols; j++)
{
 s.write(rs.rows(i).cells(j).innerText);
if (j != rs.cols - 1)
{
 s.write('^');
  }
}
 s.writeline();
}
s.Close();
alert('File saved successfully');
}
}
catch (Err)
{
 var strErr = 'Error:';
 strErr += '\nNumber:' + err.number;
 strErr += '\nDescription:' + err.description;
 document.write(strErr);
}
}


function echeck(str) 
{

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1)
		{
		  return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr)
		{
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr)
		{
		    return false
		}

		if (str.indexOf(at,(lat+1))!=-1)
		{
		    return false
		}

		if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot)
		{
		    //alert("Invalid E-mail ID")
		    return false
		}

		if (str.indexOf(dot,(lat+2))==-1)
		{
		    //alert("Invalid E-mail ID")
		    return false
		}
		
		if (str.indexOf(" ")!=-1)
		{
		    //alert("Invalid E-mail ID")
		    return false

		}

 		return true					
}





function pop3(variable)
{   
	var Nvary=variable+"";
window.open(Nvary,"1","width=800,height=500,top=50,left=50,resizable=no,value=top,toolbar=no,scrollbars=yes");
}
