// JavaScript Document
function zipUpdate(source,target_zip,target_state){
	if(source.value=="{postcode}"){
		target_zip.value = "";
	} else {
		if(typeof source.value == "undefined") {
			target_state.options[0].selected = true;
			target_zip.value = "";
		} else {
			if(source[0]){
				source=source[0]; // if more than 1 result, just use the first
			}
			target_zip.value = source.value;
			if(parseInt(source.value)>=2000 && parseInt(source.value)<=2599){
				for(var i=0;i<target_state.options.length;i++){
					if(target_state.options[i].value == "NSW"){
						target_state.options[i].selected = true;
					}
				}
			}
		}
	}
}


