wawandas, последний цикл лишний
var arr = [1,2,3,4,1,2,6,7];
var tmp_arr = new Array();
var view = '';
for (i = 0; i < arr.length; i++)
{
if (tmp_arr.indexOf(arr[i]) == "-1")
{
tmp_arr.push(arr[i]);
}
}
/*for(var i in tmp_arr)
{
view += tmp_arr[i] + ',';
}
alert(view)*/
alert(tmp_arr);