var t1;

function f1(lay1,lay2,lay3){
   document.getElementById(lay1).style.visibility="visible";
   document.getElementById(lay2).style.visibility="hidden";
   document.getElementById(lay3).style.visibility="hidden";
   
}
function f2(laye1){
     thisobj=document.getElementById(laye1);
	 thisobj.style.height=parseInt(thisobj.style.height)+10+"px";
	 
	 if(parseInt(thisobj.style.height)<=520){
		 t1=setTimeout("f2('"+laye1+"')",60);
     }
	 else {
    	 clearTimeout(t1);
	 }
}



function sortTable(tableId,columnIndex)//(var sTableID)
{
	//var oTable = document.getElementById(sTableID);
	var oTable = document.getElementById("tblSort");
	var oTBody = oTable.tBodies[0];
	var colDataRows = oTBody.rows;
	
	var trs = new Array;
	
	for (var i=0; i < colDataRows.length; i++) 
	{
		trs.push(colDataRows[i]);
	}
	
	trs.sort(generateCompareTRs(columnIndex));
	
	var oFragment = document.createDocumentFragment();	
		for (var i=0; i < trs.length; i++) 
		{
			oFragment.appendChild(trs[i]);
		}
			oTBody.appendChild(oFragment);
	
}

function generateCompareTRs(iCol) {
	return function compareTRs(oTR1, oTR2) {
		var sValue1 = oTR1.cells[iCol].firstChild.nodeValue;
		var sValue2 = oTR2.cells[iCol].firstChild.nodeValue;
		return sValue1.localeCompare(sValue2);
	};
}

function compareTRs(oTR1,oTR2) 
{
		var sValue1 = oTR1.cells[0].firstChild.nodeValue;
		var sValue2 = oTR2.cells[0].firstChild.nodeValue;
		
	return sValue1.localeCompare(sValue2);
}