Dovrebbe essere:
codice:
location.href = "http://www.google.com"+array;
Il window iniziale non è strettamente necessario.
Non sarebbe più comodo usare un <form method="get">?