
var map;
var geocoder;
var mapDiv;

function doFrame(page)
{
	parent.location.href = "http://www.stadskartan.se/start/kartor/index.asp?page=" + page
}

<!--

function mySpec()
{

	 myVar = document.forms[0].textfield.value
	 rUrl = "/specialitet.php?fNamn=" + myVar + "&select=0";

	 opener.location.href=rUrl;
	 self.close();

}

function MM_openBrWindow(theURL,winName,features) {
	window.open(theURL,winName,features);
}

function visaVal2(val) {
	parent.self.location = "/regions.php?code=" + val.options[val.selectedIndex].value;
}

function visaVal(val) {
	parent.self.location = "/regions.php?code=" + val.options[val.selectedIndex].value;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}


function xpnSizer()
{
	if (navigator.appName != 'Netscape' && document.xpn)

	{
		document.xpn.gatunamn1.size = "31";
		document.xpn.area1.size = "31";
		document.xpn.gatunr1.size = "3";
	}
}

function alertMe()
{
	text="Ytterligare information kommer inom kort.";
	alert(text);
}

function alertSel(F1)
{
	if (F1.ftg_id.value == "0")
	{
		alert("Du maste välja en gata i listmenyn.");
		F1.ftg_id.focus();
		return (false);
	}
	if (F1.gatunamn1.value == "")
	{
		alert("Du maste fylla i ett gatunamn.");
		F1.gatunamn1.focus();
		return (false);
	}
	return (true);
}

function setSection(section) {

	elm = document.getElementById("aktiverad");
	if(!elm) return;
	elm.className = section;
}

function setAdvanced(section) {
	elm = document.getElementById("foretag");
	if(!elm) return;
	elm.className = section;
}

function showExtendedView(item,mapItem,mapAddress,latitude,longitude,el) {
	if(document.getElementById(item).style.display == 'block') {
		document.getElementById(item).style.display = 'none';
		el.className='minfo';
	} else {
		document.getElementById(item).style.display = 'block';
		el.className='minfo open';
		//mapDiv = mapItem;
		/*if(latitude && longitude)
			load(mapItem,latitude,longitude);
		else
			adressToMap(mapItem,mapAddress);*/
	}
}

function hideExtendedView(item) {
	document.getElementById(item).style.display = 'none';
	return false;
}


function adressToMap(mapItem,adress) {
	if (GBrowserIsCompatible()) {
		geocoder = new GClientGeocoder();
		geocoder.getLocations(adress,paintMap);
	}
}

function paintMap(response) {
	if(response.Placemark) {
		var place = response.Placemark[0];
		load(mapDiv,place.Point.coordinates[1],place.Point.coordinates[0]);
	} else {
		load(mapDiv,0,0,1);
	}
}

function load(mapItem,latitude,longitude,zoom) {
		map = new GMap2(document.getElementById(mapItem));
		var center = new GLatLng(latitude, longitude);
		if(!zoom)
			var zoom = 14;
		map.setCenter(center, zoom);
		marker = new GMarker(center);
		map.addOverlay(marker);
}

function clearForm(formIdent)
{
	var form, elements, i, elm;
	form = document.getElementById
		? document.getElementById(formIdent)
		: document.forms[formIdent];

	if (document.getElementsByTagName)
	{
		elements = form.getElementsByTagName('input');
		for( i=0, elm; elm=elements.item(i++); )
		{
			if (elm.getAttribute('type') == "text")
			{
				elm.value = '';
			}
		}
	}

	// Actually looking through more elements here
	// but the result is the same.
	else
	{
		elements = form.elements;
		for( i=0, elm; elm=elements[i++]; )
		{
			if (elm.type == "text")
			{
				elm.value ='';
			}
		}
	}
}


//-->