var map = null;
var geocoder = null;
		
function GMAP_initialize()
{
	if (GBrowserIsCompatible())
	{
		map = new GMap2(document.getElementById("map_canvas"));
		map.addControl(new GSmallMapControl());
 		map.addControl(new GMapTypeControl());
		/*
		geocoder = new GClientGeocoder();
		
		if (geocoder)
		{
			geocoder.getLatLng
			(
				GMAP_address,
				function(point)
				{
					if (point)
					{
						map.setCenter(point, 15);
				
						var baseIcon = new GIcon();
						baseIcon.iconSize = new GSize(20, 22);
						baseIcon.iconAnchor = new GPoint(10, 22);
						var myIcon = new GIcon(baseIcon);
						myIcon.image = "http://www.glokaal.com/img/arrow_down.gif";
			
						var marker = new GMarker(point, {icon: myIcon});
						map.addOverlay(marker);
					}
				}
			);
		}
		
		*/
		point = new GLatLng(GMAP_lat, GMAP_long);
		if (point)
		{
			map.setCenter(point, 15);
	
			var baseIcon = new GIcon();
			baseIcon.iconSize = new GSize(20, 22);
			baseIcon.iconAnchor = new GPoint(10, 22);
			var myIcon = new GIcon(baseIcon);
			myIcon.image = "http://www.glokaal.com/img/arrow_down.gif";

			var marker = new GMarker(point, {icon: myIcon});
			map.addOverlay(marker);
		}
					
	}
}
		    

function area_oc(obj) 
{ 
	var a = obj.href; 
	var area = a.substr(a.lastIndexOf('=') + 1, 1000); 
	var a  = document.getElementById('category_selected').href; 
	var category = a.substr(a.lastIndexOf('=') + 1, 1000); 
	//var item_html =  
	 
	var os = path + 'category_select.inc.php?lang=' + lang + '&area=' + area + '&selected=' + category; 
	//alert(os);  
	document.getElementById('hidden_iframe').src = os; 
	 
	document.getElementById('area_selected').innerHTML = obj.innerHTML; 
	document.getElementById('area_selected').href = obj.href; 
	document.getElementById('category_menu').disabled = true; 
} 

function area_oc2(obj) 
{ 
	var category = document.forms['search_form']['category'].value; 
	var os = path + 'category_select.inc.php?lang=' + lang + '&area='  + obj.value + '&selected='  + category; 
//	alert(os);  
	document.getElementById('hidden_iframe').src = os; 
} 

function swap(elm) 
{ 
	if(typeof(elm) == 'string') elm = document.getElementById(elm); 
	var stupid_ie = document.all? 'inline' : 'table-row';
	elm.style.display = elm.style.display == 'none'? stupid_ie : 'none'; 
} 
 
				 
var x = 200; 
var x1 = 5; 
var IE = (document.all);  
 
function hide_elms_if_ie() 
{ 
	if(document.all) 
		if(document.getElementById('adv_search')) 
			document.getElementById('adv_search').style.display = 'none'; 
}		 
 
 
function search_but_anim() 
{ 
	 
	elm = document.getElementById('submit_but'); 
	if(x<3000) 
	{		 
		elm.style.marginLeft = (x += (x1 += 1)) + 'px'; 
		setTimeout('search_but_anim()', 10); 
	} 
	else  
		elm.style.display = 'none'; 
 
	if(!IE) 
	{ 
		setTimeout("document.forms['search_form'].submit();", 1000); 
		return false; 
	} 
	return true; 
} 