/*
 * Index page scripts 
 */

/* 
 * Preload onmouseover images
 */
function preload_image(_image) {
	var image = new Image;
	image.src = _image;
	}

/* 
 * Change county image onmouseover on index page 
 */
function change_image(region) {
	var ShowItem = document.getElementById("area_image");
	var LinkItem = document.getElementById("county_" + region);
	ShowItem.style.backgroundImage = 'url(http://immocherche.com/images/maps/_blue_map_' + region + '.gif)';
	LinkItem.style.textDecoration = "underline";
	return true;
	}

/* 
 * Change back county image onmouseout on index page
 */ 
function hide_image(region) {
	var ShowItem = document.getElementById("area_image");
	var LinkItem = document.getElementById("county_" + region);
	ShowItem.style.backgroundImage = 'url(http://immocherche.com/images/maps/_none.gif)';
	LinkItem.style.textDecoration = "none";
	return true;
}

/*
 * Popup new news window
 */
var newWin;
function popUp(page, name, details) {
	newWin=window.open(page, name, details);
	newWin.focus();    
	return false;  
	}    

function add_bookmark() {
	var ua=navigator.userAgent.toLowerCase();
	var konq=(ua.indexOf('konqueror')!=-1);
	var saf=(ua.indexOf('webkit')!=-1);
	var mac=(ua.indexOf('mac')!=-1);
	var ctrlKey=mac?'Command/Cmd':'CTRL';

	if(window.external && (!document.createTextNode ||(typeof(window.external.AddFavorite)=='unknown'))) {
		window.external.AddFavorite("http://www.inncherche.com/","La reseau d'annonces immobiliére le plus preferé par les acquereurs - immocherche.com");
		}
		else if(konq) {
			alert('Veuillez appuyer sur CTRL + B pour ajouter ce site à vos favoris.');
		} else if(window.opera) {
			void(0);
		} else if(window.home||saf) {
			alert('Veuillez appuyer sur '+ctrlKey+' + D pour ajouter ce site à vos favoris.');
		} else if(!window.print || mac) {
			alert('Veuillez appuyer sur Command/Cmd + D pour ajouter ce site à vos favoris.');    
		} else {
			alert('Votre navigateur internet n\'étant pas reconnu, vous devrez ajouter ce site manuellement à vos favoris.');
		}
	}
/* END */
