function array_combine( keys, values ) { // Creates an array by using one array for keys and another for its values
//
// + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
var new_array = {}, keycount=keys.length, i;
// input sanitation
if( !keys || !values || keys.constructor !== Array || values.constructor !== Array ){
return false;
}
// number of elements does not match
if(keycount != values.length){
return false;
}
for ( i=0; i < keycount; i++ ){
new_array[keys[i]] = values[i];
}
return new_array;
}