var Gcont = "";			// global variable holding the current continent
var Gccode = "";			// global variable holding the current country code
var Gregioncode = "";	// global variable holding the current region code
var Glocid = "";			// global variable holding the current locality ID

function showform(theForm,a,b)
{
	// THIS FUNCTION SHOWS YOU WHAT A FORM ACTUALLY CONTAINS.
	// THE PARAMETER A ALLOW YOU TO ADD SOME MORE MEANINGFULL INFORMATION, LIKE WHAT FUNCTION YOU ARE IN.
	var txt = "Form name: " + theForm.name + "\r\n";
	txt += "theForm.elements.length = "+theForm.elements.length+"\r\n";
	for (var i=0; i<theForm.elements.length; i++)
		txt += theForm.elements[i].name + " = " + theForm.elements[i].value + "\r\n";
	txt += "a: "+a+"\r\n";
	txt += "b: "+b+"\r\n";
	alert(txt);
}
function js_change_continent(newcont)
{
	Gcont = newcont;
	alert ("Change continent: "+Gcont);
	sajax_target_id = 'countrieslist'; 
	x_p_list_countries(Gcont,Gccode); 
	sajax_target_id = '';
}
function js_change_country(newccode)
{
	Gccode = newccode;
	alert ("Change country: "+Gccode);
	sajax_target_id = 'regionslist'; 
	x_p_list_provinces(Gccode,""); 
	sajax_target_id = '';
}
function js_change_region(newregion)
{
	Gregioncode = newregion;
	alert ("Change region: "+Gregioncode);
	sajax_target_id = 'townslist'; 
	x_p_list_towns(Gccode,Gregioncode,""); 
	sajax_target_id = '';
}
function js_change_town(newlocid)
{
	Glocid = newlocid;
	alert ("Change town: "+Glocid);
	sajax_target_id = 'ipslist'; 
	x_p_list_ips(Glocid); 
	sajax_target_id = '';
}