
mouseOver = function(obj) {
	ext = obj.src.substring(obj.src.lastIndexOf('.'), obj.src.length);
	if (obj.src.indexOf('_s' + ext) == -1) obj.src = obj.src.replace(ext, '_s'+ext);
}

mouseOut = function(obj) {
	ext = obj.src.substring(obj.src.lastIndexOf('.'), obj.src.length);
	if (obj.src.indexOf('_s' + ext) != -1) obj.src = obj.src.replace('_s'+ext, ext);
}

window.onload = function() { 
	var docHeight = 0; 
	var winHeight = 650;
	if (document.documentElement != null) { 
		docHeight = document.documentElement.scrollHeight;
		winHeight = document.documentElement.clientHeight;
	} else { 
		if (document.body.scrollHeight) { 
			docHeight = document.body.scrollHeight 
			winHeight = document.body.clientHeight;
		}
	}
	if (docHeight > winHeight + 200) {
		if (document.getElementById('up') != null) document.getElementById('up').style.display = 'block';
	}
}

openWindow = function (url, name, w, h, menubar, toolbar, scrollbars) {
	var x = parseInt(screen.width / 2) - parseInt(w/2);
	var y = parseInt(screen.height / 2) - parseInt(h/2);
	var parameters = 'toolbar=0,location=0,menubar=' + menubar + ',toolbar=' + toolbar + ',scrollbars=' + scrollbars + ',width=' + w + ',height=' + h + ',top=' + y + ',left=' + x + ',screenY=' + y + ',screenX=' + x;
	var w = window.open(url, name, parameters);
	if (w.focus) w.focus();
	return w;
}

var servicesClass = '';
overServices = function(obj) {
	if (obj.className != '') {
		servicesClass = obj.className;
		obj.className = '';
	}
}

outServices = function(obj) {
	if (servicesClass != '') {
		obj.className = servicesClass;
		servicesClass = '';
	}
}

createMailto = function(pers, domain) {
	var email = pers + '@' + domain;
	document.write('<a href="mailto:'+email+'">'+email+'</a>');
}

imagePreview = function(){	
	xOffset = 5;
	yOffset = 0;
	$(".adviseur_intro .thumbnail img").hover(function(e){
		$("body").append('<div id="preview"><img src="'+ this.src +'" alt="" /></div>');		 
		$("#preview")
			.css("top",(e.pageY + yOffset) + "px")
			.css("left",(e.pageX + xOffset) + "px")
			.fadeIn("fast");						
	},
	function(){
		$("#preview").remove();
	});	
	$(".adviseur_intro .thumbnail img").mousemove(function(e){
		$("#preview")
			.css("top",(e.pageY + yOffset) + "px")
			.css("left",(e.pageX + xOffset) + "px");
	});			
};


$(document).ready(function(){
	imagePreview();
});

createFlashMovie = function(id, src, width, height, isSolid) {
	var str = '';
	str += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+width+'" height="'+height+'" id="'+id+'">';
	str += '<param name="allowScriptAccess" value="sameDomain" />\n';
	str += '<param name="movie" value="'+src+'" />\n';
	str += '<param name="quality" value="high" />\n';
	str += '<param name="menu" value="false" />\n';
	if (!isSolid) str += '<param name="wmode" value="transparent" />\n';
	str += '<embed src="'+src+'" quality="high" ';
	if (!isSolid) str += 'wmode="transparent" ';
	str += 'width="'+width+'" height="'+height+'" name="'+id+'" menu="false" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\n';
	str += '</object>\n';
	document.write(str);
}
