<!--
var geoMin = {
	init : function(instanceAPI){
		// vars	
		geoMin.searchquery=document.getElementById('searchquery').value;
		geoMin.effects = new Array;
		geoMin.status = new Array;
		geoMin.effects['sidebar_left'] = new Fx.Morph('sidebar_left', {duration: 'long', transition: Fx.Transitions.Sine.easeOut});
		geoMin.status['sidebar_left']=1;
		geoMin.loader='<img src="/layout/img/ajax-loader.gif" />';
		
		showM.init(instanceAPI,contentSearch,contentCity,true); // Note DG, l'appel se fait dans la page index.html
		document.getElementById('searchquery').setProperty('onfocus','Javascript:if(this.value==geoMin.searchquery){this.value="";}');
	},
	sidebarAction:function(toogletype){
		if(document.getElementById('Geoportal.Control.PermanentLogo_4')){
			var logoEffect = new Fx.Morph(document.getElementById('Geoportal.Control.PermanentLogo_4'), {duration: 'long', transition: Fx.Transitions.Sine.easeOut});
		}
		if(document.body.getProperty('class')==toogletype){
			if(geoMin.status['sidebar_left']==0){
				geoMin.effects['sidebar_left'].start({'left': [-236, 0]});
				logoEffect.start({'left': [44, 280]});												
				geoMin.status['sidebar_left']=1;
			} else {
				geoMin.effects['sidebar_left'].start({'left': [0,-236]});
				logoEffect.start({'left': [280, 44]});
				geoMin.status['sidebar_left']=0;
			}
		} else {
			if(geoMin.status['sidebar_left']==0){
				document.body.setProperty('class', toogletype);
				geoMin.effects['sidebar_left'].start({'left': [-236, 0]});
				logoEffect.start({'left': [44, 280]});
				
				var updateDiv = function(){
					document.getElementById('currentlist').set('html',geoMin.loader);
					showM.contentSearch=toogletype;
					showM.centerisset();
					geoMin.effects['sidebar_left'].removeEvent('complete', this);
				}
				geoMin.effects['sidebar_left'].addEvent('complete', updateDiv);
				
				geoMin.status['sidebar_left']=1;
			} else {
				document.getElementById('currentlist').set('html',geoMin.loader);
				document.body.setProperty('class', toogletype);
				showM.contentSearch=toogletype;
				showM.centerisset();
			}
		}
	},
	sidebarClose:function(){
		if(document.getElementById('Geoportal.Control.PermanentLogo_4')){
			var logoEffect = new Fx.Morph(document.getElementById('Geoportal.Control.PermanentLogo_4'), {duration: 'long', transition: Fx.Transitions.Sine.easeOut});
		}
		logoEffect.start({'left': [280, 44]});
		geoMin.effects['sidebar_left'].start({'left': [0,-236]});
		geoMin.status['sidebar_left']=0;
	},
	mouseOverActions:function(){
		for(i=0;i<document.getElementById('currentlist').getElementsByTagName("div").length;i++){
			var zitem=document.getElementById('currentlist').getElementsByTagName("div")[i];
			var check=zitem.getAttribute("id");
			if(check!= null){
				elem=document.getElementById(check);
				elem.addEvents({
					'click' : function(){
						//
					},
					'mouseenter' : function(){
						geoMin.mouseOutActions();
						this.setProperty('class', 'item current clearfix');
						var zeid=this.getAttribute("id").split('_');
						if(showM.contentSearch=="photographies"){
							showM.aMarker[zeid[1]].icon.imageDiv.firstChild.src='/layout/img/markers/photo_on.png';
						}
						if(showM.contentSearch=="evenements"){
							showM.aMarker[zeid[1]].icon.imageDiv.firstChild.src='/layout/img/markers/event_on.png';
						}
						if(showM.contentSearch=="dossier"){
							showM.aMarker[zeid[1]].icon.imageDiv.firstChild.src='/layout/img/markers/file_on.png';
						}
					},
					'mouseleave' : function(){
						this.setProperty('class', 'item clearfix');
						var zeid=this.getAttribute("id").split('_');
						if(showM.contentSearch=="photographies"){
							showM.aMarker[zeid[1]].icon.imageDiv.firstChild.src='/layout/img/markers/photo.png';
						}
						if(showM.contentSearch=="evenements"){
							showM.aMarker[zeid[1]].icon.imageDiv.firstChild.src='/layout/img/markers/event.png';
						}
						if(showM.contentSearch=="dossier"){
							showM.aMarker[zeid[1]].icon.imageDiv.firstChild.src='/layout/img/markers/file.png';
						}
					}
				});
			}
		}
	},
	mouseOutActions:function(){
		for(i=0;i<document.getElementById('currentlist').getElementsByTagName("div").length;i++){
			var zitem=document.getElementById('currentlist').getElementsByTagName("div")[i];
			var check=zitem.getAttribute("id");
			if(check!= null){
				var zeid=zitem.getAttribute("id").split('_');
				elem=document.getElementById(check);
				elem.setProperty('class', 'item clearfix');	
				if(showM.contentSearch=="photographies"){
					showM.aMarker[zeid[1]].icon.imageDiv.firstChild.src='/layout/img/markers/photo.png';
				}
				if(showM.contentSearch=="evenements"){
					showM.aMarker[zeid[1]].icon.imageDiv.firstChild.src='/layout/img/markers/event.png';
				}
				if(showM.contentSearch=="dossier"){
					showM.aMarker[zeid[1]].icon.imageDiv.firstChild.src='/layout/img/markers/file.png';
				}
			}
		}
	},
	scrollToElem:function(id){
		if(document.getElementById('itemelem_'+id)){
			var newposition = document.getElementById('itemelem_'+id).getPosition(document.getElementById('currentlist'));
			document.getElementById('scroll').scrollTo(0, newposition.y);
			geoMin.mouseOutActions();														
			document.getElementById('itemelem_'+id).setProperty('class', 'item current clearfix');
			if(showM.contentSearch=="photographies"){
				showM.aMarker[id].icon.imageDiv.firstChild.src='/layout/img/markers/photo.png';
			}
			if(showM.contentSearch=="evenements"){
				showM.aMarker[id].icon.imageDiv.firstChild.src='/layout/img/markers/event.png';
			}
			if(showM.contentSearch=="dossier"){
				showM.aMarker[id].icon.imageDiv.firstChild.src='/layout/img/markers/file.png';
			}
		}
	},
	putResizeEvents: function(){
		if(window.attachEvent){
			window.attachEvent("onresize", geoMin.mapsize);
  		} 
		if(window.addEventListener){
			window.addEventListener("resize", geoMin.mapsize, false);
		}	
	},
	getWindowSize : function(){
		windowWidth =  window.innerWidth;
		windowWidth = (windowWidth)? windowWidth : document.documentElement.clientWidth;
		windowWidth = (windowWidth)? windowWidth : document.body.clientWidth;
		windowHeight =  window.innerHeight;
		windowHeight = (windowHeight)? windowHeight: document.documentElement.clientHeight;
		windowHeight = (windowHeight)? windowHeight: document.body.clientHeight;  
		return {'width': windowWidth, 'height': windowHeight};
	},
	mapsize : function(){
		var windowSize = geoMin.getWindowSize();
		document.getElementById('flwloader').style.display="none";
		document.getElementById('map').style.height=(windowSize.height-165)+'px';
		document.getElementById('map').style.width=(windowSize.width)+'px';
		document.getElementById('map').style.visibility="visible";
		if(document.getElementById('map_GpMap')){
			document.getElementById('map_GpMap').style.height=(windowSize.height-165-16)+'px';
			document.getElementById('map_GpMap').style.width=(windowSize.width-6)+'px';
			document.getElementById('map_OlMap').style.height=(windowSize.height-165-16)+'px';
			document.getElementById('map_OlMap').style.width=(windowSize.width-6)+'px';
			
		}
		geoMin.placeControls();
	},
	placeControls : function(){
		var windowSize = geoMin.getWindowSize();
		
		if(document.getElementById('map_OlMap')){
			if(document.getElementById('OpenLayers.Control.Panel_399')){
				// OpenLayers.Control.Panel_399
				document.getElementById('OpenLayers.Control.Panel_399').style.left=(windowSize.width-65)+'px';
			} 
			if(document.getElementById('Geoportal.Control.PermanentLogo_4')){
				document.getElementById('Geoportal.Control.PermanentLogo_4').style.left=280+'px';
			}
		} else {
			timer=setTimeout("geoMin.placeControls()",50);
		}
	},
	launchsearch : function(){
		if(document.getElementById('searchquery').value!="" && document.getElementById('searchquery').value!=geoMin.errorsearch){
			showM.getAdresse(document.getElementById('searchquery').value+",France");
		} else {
			document.getElementById('searchquery').value=geoMin.errorsearch;
			document.getElementById('searchquery').setProperty('class','red');
		}
		return false;
	}
}
-->
