function changeState(city, state)
{

    statename = state.options[state.selectedIndex].text;
    stateid = state.options[state.selectedIndex].value;

    while(city.options.length) city.options[0] = null;

    opt = new Option(l_other,0, false, false);
    city.options[0] = opt;

    var j = 0;
    for(i = 0; i < cityarr.length; i++){
            if((statearr[i] == statename) || (stateid == 0)){
                opt = new Option(cityarr[i],cityids[i], false, false);
                city.options[j+1] = opt;
                j++;
            }
    }

}

function changeCity(city, state)
{
	cityname = city.options[city.selectedIndex].text;

	for (i=0; i<statearr.length;i++){
		if (cityarr[i] == cityname){
			var statename = statearr[i];
		}
	}

	
	for (i=0; i<state.options.length;i++){
		if (statename == state.options[i].text){
			state.selectedIndex = i;
		}
	}

}

function checkLen(f){
	var maxLen=500;
	str=f.value;
	len=str.length;
	if(len>maxLen)f.value=str.substring(0,maxLen);
	informer.innerHTML='(' + (maxLen-len) + ')';
}