function resize(width,height)
{
    window.resizeTo(width,height);
}

function LoadMunicipals(l, lk, allm, choosec)
{
	var l = document.getElementById(l);
	var lk = document.getElementById(lk);
	var m = 1;
	
	if (l.value != 0)
	{
		lk.options.length = 0;
		lk.options[0] = new Option(allm, "0");
		
		for( municipal = 0 ; municipal < municipals.length; municipal++ )
		{
			if ( municipals[municipal] == l.value )
			{
				lk.options[m++] = new Option( municipals[municipal + 2], municipals[municipal + 1]);
			}
		}
	}
	else
	{
		lk.options.length = 0;
		lk.options[0] = new Option(choosec, "0");
	}

	lk.options[0].selected = true;

	return false;
}

function isKeyPressed(e, key){
	// handle i.e. (window.event) and firefox (e)
	var eventInstance = window.event ? event : e;
	 
	// handle i.e. (charCode) and firefox (keyCode)
	var unicode = eventInstance.charCode ? eventInstance.charCode : eventInstance.keyCode;
	return (unicode == key ? true : false);
}

function ce()
{
	var e = document.getElementsByTagName("a");
	
	var ie = (navigator.appName == "Microsoft Internet Explorer")? true : false;
	
	for(var i = 0; i < e.length ; i++)
	{
		if(e[i].name == "em")
		{
			var em =  (ie)? e[i].href.substring(10,e[i].href.indexOf(';')) : e[i].href.substring(2,e[i].href.indexOf(';'));
			var ed = rev(e[i].href.substring(e[i].href.indexOf(';') + 1));
			e[i].href = "mai" + "lto:" + em + "@" + ed;
		}
	}
}

function rev(s)
{ 
    var r = "";

    for (i = s.length - 1; i > -1; i--)
    { 
        r += s.charAt(i);
    }
    
    return r;
} 
