var arr3=new Array();
var arr4=new Array();

for(i=0;i<arr3.length;i++){
if(arr3[i]!=undefined && indexarr[i]!=undefined){
arr4.push(arr3[i]);
indexarr1.push(indexarr[i]); } }