// subScript.js

// newFunction
var pRow=1;
var pBackground=new String("#ffffff");
var idarray=new Array()
var oldcell=null;
function select(row) 
{

try 
{
	if (oldcell != null)
	{
	//document.flagF.flag.value="false";
	var tds = oldcell.getElementsByTagName('TD');	
	for (var z = 0; z < tds.length ; z ++)
	{
		tds[z].style.background='#ffffff' ; 
	}

	}
}catch (e){}
try{
if(row!=oldcell) 
{

cellSelect(row.id);
	eval('row'+".style.background=\"#ffffff\"")
	var tds = row.getElementsByTagName('TD');	
	for (var z = 0; z < tds.length ; z ++)
	{
		tds[z].style.background='#ffffff' ; 
	}
}
}catch(e){}
var bol = eval('row'+".style.background") == '#ffffff' ; 
var bol2 = eval('row'+".style.background") == '' ; 

if(bol || bol2) 
{
	if (oldcell != null)
  	eval('oldcell'+".style.background=\"#ffffff\"")	
  var tds = row.getElementsByTagName('TD');
 
	eval('row'+".style.background=\"#E0E0E0\"")
	for (var z = 0; z < tds.length ; z ++)
	{
		tds[z].style.background='#E0E0E0' ; 
	}
	oldcell=row
} 
 else
 {//document.flagF.flag.value="false";
 	eval('row'+".style.background=\"#ffffff\"")	
 	var tds = row.getElementsByTagName('TD');	
	for (var z = 0; z < tds.length ; z ++)
	{
		tds[z].style.background='#ffffff' ; 
	}
	oldcell = null ; 

 }
 
}





function cellSelect(row)
   {   

   	   index=parseInt(row)-1;

   	   
	
      
document.intercom.Code.value=eval("document.getElementById('ID"+index+"').value");

try{
document.intercom.UserCode.value=eval("document.getElementById('UserID"+index+"').value");
}
catch(e){}


try{
		document.intercom.branchCode.value=eval("document.getElementById('branchCode"+index+"').value");
//		document.intercom.AccountTypeCode.value=eval("document.getElementById('AccountTypeCode"+index+"').value");
//		document.intercom.currencyCode.value=eval("document.getElementById('currencyCode"+index+"').value");
		document.intercom.accountNo.value=eval("document.getElementById('accountNo"+index+"').value");

}

catch(e){}
 
 
 
 
}

    
    
    
    
    
    
function myRegister(action, opValue, width, height) {
width="400";
height="160";

op=opValue;
document.intercom.op.value=op;


		if(action=="register"){
		
		if (oldcell == null) {
					alert("Please select first.")
					return; 
				}
				Code = document.intercom.Code.value;
				
		windowType="true";
		
		status=document.intercom.status.value;
		ChannelCode=document.intercom.ChannelCode.value;
		
		
		path="/FIBAdmin/AdminController?op="+opValue+"&Code="+Code+"&status="+status+"&ChannelCode="+ChannelCode+"&windowType="+windowType;
		
		window.open(path, 'swindow', 'height='+height+',width='+width+', toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, directories=no, status=no ');
		
		}



		else if(action=="view"){
		
		if (oldcell == null) {
					alert("Please select first.")
					return; 
				}
		Code = document.intercom.Code.value;
		windowType="true";
		
		status=document.intercom.status.value;
		ChannelCode=document.intercom.ChannelCode.value;
		
		if(op=="viewUserCard"){
		path="/FIBAdmin/AdminController?op="+opValue+"&Code="+Code+"&status="+status+"&ChannelCode="+ChannelCode+"&windowType="+windowType;	
		}
		
		else{
		branchCode=document.intercom.branchCode.value;
		AccountTypeCode=document.intercom.AccountTypeCode.value;
		currencyCode=document.intercom.currencyCode.value;
		accountNo=document.intercom.accountNo.value;
		path="/FIBAdmin/AdminController?op="+opValue+"&Code="+Code+"&status="+status+"&ChannelCode="+ChannelCode+"&windowType="+windowType+"&branchCode="+branchCode+"&AccountTypeCode="+AccountTypeCode+"&currencyCode="+currencyCode+"&accountNo="+accountNo;
		
		}
			
		window.open(path, 'swindow', 'height='+height+',width='+width+', toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, directories=no, status=no ');
		
		}
		else if(action=="card"){
		
		if (oldcell == null) {
					alert("Please select first.")
					return; 
				}
		Code = document.intercom.Code.value;
		windowType="true";
		status=document.intercom.status.value;
		ChannelCode=document.intercom.ChannelCode.value;
		UserCode=document.intercom.UserCode.value;
		if(op=="approveUserCard"){
		
		document.intercom.op.value=op;
		document.intercom.submit();
		return;
		}
		else{
		path="/FIBAdmin/AdminController?op="+opValue+"&Code="+Code+"&status="+status+"&ChannelCode="+ChannelCode+"&UserCode="+UserCode+"&windowType="+windowType;	
	
			
		window.open(path, 'swindow', 'height='+height+',width='+width+', toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, directories=no, status=no ');
		}
		}
		
		
		else if(action=="log"){
		
		if (oldcell == null) {
					alert("Please select first.")
					return; 
				}
				Code = document.intercom.Code.value;
				
		windowType="true";
		
		path="/FIBAdmin/AdminController?op="+opValue+"&Code="+Code+"&windowType="+windowType;
		
		window.open(path, 'swindow', 'height='+height+',width='+width+', toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, directories=no, status=no ');
		
		}


		else if(action=="submit"){
		
		if (oldcell == null) {
					alert("Please select first.")
					return; 
				}
		Code = document.intercom.Code.value;
		windowType="true";
		
		status=document.intercom.status.value;
		ChannelCode=document.intercom.ChannelCode.value;
		
		
		
		
		branchCode=document.intercom.branchCode.value;
		AccountTypeCode=document.intercom.AccountTypeCode.value;
		currencyCode=document.intercom.currencyCode.value;
		accountNo=document.intercom.accountNo.value;
		document.intercom.submit();
		//path="/FIBAdmin/AdminController?op="+opValue+"&Code="+Code+"&status="+status+"&ChannelCode="+ChannelCode+"&windowType="+windowType+"&branchCode="+branchCode+"&AccountTypeCode="+AccountTypeCode+"&currencyCode="+currencyCode+"&accountNo="+accountNo;
		
			
		//window.open(path, 'swindow', 'height='+height+',width='+width+', toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, directories=no, status=no ');
		
		}



   
   
}



img1=new Image(10,10)
img1.src="/FIBAdmin/images/1.jpg"
img2=new Image(10,10)
img2.src="/FIBAdmin/images/2.jpg"
ns6_index=0


function collapse()
{
 for(i=0;i<document.images.length;i++)
 {    
  if (document.images[i].className=="folding"){
   source=document.images[i].parentElement.all   
    source[0].src=img1.src
    source[2].style.display="none"
  }
 }
}




function expand()
{
 for(i=0;i<document.images.length;i++)
 {    
  if (document.images[i].className=="folding"){
   source=document.images[i].parentElement.all   
    source[0].src=img2.src
    source[2].style.display=''
  }
 }
}

function change(e)
{//1
if(!document.all&&!document.getElementById)
return

if (!document.all&&document.getElementById)
ns6_index=1

var source=document.getElementById&&!document.all? e.target:event.srcElement
if (source.className=="folding")
{//2

var source2=document.getElementById&&!document.all? source.parentNode.childNodes:source.parentElement.all


if (source2[2+ns6_index].style.display=="none")
{//3
source2[0].src=img2.src
source2[2+ns6_index].style.display=''
}//\3
else
{//4
source2[0].src=img1.src
source2[2+ns6_index].style.display="none"
}//\4

}//\2


if (source.className=="bfolding")
{//2

var source2=document.getElementById&&!document.all? source.parentNode.childNodes:source.parentElement.all
if (source2[2+ns6_index].style.display=="none")
{//3
source2[0].src=img4.src
source2[2+ns6_index].style.display=''
}//\3
else
{//4
source2[0].src=img3.src
source2[2+ns6_index].style.display="none"
}//\4
}//\2

}//\1

