var telefonList=new Array(
	'telefonb0',
	'telefonb1',
	'telefonb2',
	'telefonb3'
);

function telefonszamUgralo(id) {
	var obj=document.getElementById(telefonList[id]);
	if (id+1<=telefonList.length)var nextobj=document.getElementById(telefonList[id+1]);
	if(!obj) return false;
//	alert(obj.length);
	switch(id) {
		default:
		case 0:
			if(obj.value.length>=2 && nextobj.focus)nextobj.focus(); 
		break;
		
		case 1:
			if(	(obj.value.length>=2 || obj.value=='1')
				 && nextobj.focus)nextobj.focus(); 
		break;
		
		case 2:
			if(	(obj.value.length>=3)
				 && nextobj.focus)nextobj.focus(); 
		break;
		
		case 3:
		break;
	}
}

	
	
function setSearchAction(formobj, id) {
	if (!id) return false;
  var prefix = '';
  
  var obj = document.getElementById(id);
  if (! obj) 
    return false;
  
  //alert(id + ' ' + obj.name + ' ' + obj.id);
  var prefix = obj.options[obj.selectedIndex].text;
  
  if (prefix == '-mind-')
  {
    prefix = 'mind';
  }
  
	prefix=prefix
		.replace(/[á]/gi,"a")
		.replace(/[é]/gi,"e")
		.replace(/[û]/gi,"u")
		.replace(/[õ]/gi,"o")
		.replace(/[ú]/gi,"u")
		.replace(/[ö]/gi,"o")
		.replace(/[ü]/gi,"u")
		.replace(/[ó]/gi,"o")
		.replace(/[í]/gi,"i")
		.toLowerCase();
	var domains=new Array(
			"az.ingatlan.hu",
			"euingatlan.com",
			"euingatlan.net",
			"eulakas.com",
			"eulakas.net",
			"eulakas.hu",
			"ingatlanlap.com",
			"lakoparkok.net"
		);
	var action = String(formobj.action);
	if (!action.match(/http:/) && document.getElementById('formaction'))action=document.getElementById('formaction').value;
	var thisdomain='';
	for (var i=0; i<domains.length; i++) {
		if (action.match(new RegExp(domains[i]))) {
			var thisdomain=domains[i];
		}
	}
	if (!thisdomain) return false;
	var matched="http://"+prefix+".";
	var preok=matched+thisdomain+"/";
	if (prefix && !action.match(new RegExp(matched))) {
		action=action.replace(/http:\/\/[^\/]+\//,preok);
		formobj.action=action;
	}
  
	return true;
}
