function setOpacity(obj, opacity) {
	opacity = (opacity == 100)?99.999:opacity;
  
	// IE/Win
	obj.style.filter = "";
  
	// Safari<1.2, Konqueror
	obj.style.KHTMLOpacity = opacity/100;
  
	// Older Mozilla and Firefox
	obj.style.MozOpacity = opacity/100;
  
	// Safari 1.2, newer Firefox and Mozilla, CSS3
	obj.style.opacity = opacity/100;
}
function faderIn(objId,opacity) {
	if (document.getElementById) {
		obj = document.getElementById(objId);
		if (opacity <= 100) {
			setOpacity(obj, opacity);
			opacity += 10;
			window.setTimeout("faderIn('"+objId+"',"+opacity+")", 100);
		}
	}
}
/*
var intra_photographie = {
	'.intra_photographie' : function(element){
		element.onclick = function(){
			setOpacity($('photo'), 0);
			var href = this.getAttribute('href');
			var url = href.substring(1);
			var reg = new RegExp("=", "g");
            var image = "images/"+url.split(reg)[1]+".jpg";
			imageId = 'photo';
			imgobj = document.getElementById(imageId);
			imgobj.src = "/images/blank.jpg";
			imgobj.src = image;
			Effect.Appear('photo');
			return false;
		}
    }
};
Behaviour.register(intra_photographie);*/
/*
var intra_photography = {
	'.intra_photography' : function(element){
		element.onclick = function(){
			setOpacity($('photo'), 0);
			var href = this.getAttribute('href');
			var url = href.substring(1);
			var reg = new RegExp("=", "g");
			var image = img_folder+"images/"+url.split(reg)[1]+".jpg";
			imageId = 'photo';
			imgobj = document.getElementById(imageId);
			imgobj.src = "/images/blank.jpg";
			imgobj.src = image;
			Effect.Appear('photo');
			return false;
		}
    }
};
Behaviour.register(intra_photography);
*/
var intra_site_web = {
	'.intra_site_web' : function(element){
		element.onclick = function(){
			var href = this.getAttribute('href');
			var url = href.substring(1);
			new Ajax.Request('contenu.php?' + url, {
				method: 'get',
				onSuccess: function(transport) {
					$('div_contenu_2').replace(transport.responseText);
				}
			});
			return false;
		}
    }
};
Behaviour.register(intra_site_web);

/*var menu_ajax = {
	'.lien_ajax' : function(element){
		element.onclick = function(){
			var href = this.getAttribute('href');
			var url = href.substring(1);
			new Ajax.Request('/tools/getContenu.php?page=' + url, {
				method: 'get',
				onSuccess: function(transport) {
					$('div_principal').replace(transport.responseText);
				}
			});
			new Ajax.Request('/tools/getTitre.php?page=' + url, {
				method: 'get',
				onSuccess: function(transport2) {
					var title = transport2.responseText;
					document.title = title;
				}
			});
			parent.location.hash = url;
			return false;
		}
    }
};

Behaviour.register(menu_ajax);

function fn_ajax(element) {
	var href = element.getAttribute('href');
	var url = href.substring(1);
	new Ajax.Request('/tools/getContenu.php?page=' + url, {
		method: 'get',
		onSuccess: function(transport) {
			$('div_principal').replace(transport.responseText);
		}
	});
	new Ajax.Request('/tools/getTitre.php?page=' + url, {
		method: 'get',
		onSuccess: function(transport2) {
			var title = transport2.responseText;
			document.title = title;
		}
	});
	parent.location.hash = url;
	return false;
}*/


/*
Interaction Javascript avec le Player
*/
function sendEvent(swf,typ,prm) { 
	thisMovie(swf).sendEvent(typ,prm); 
};

function thisMovie(swf) {
	if(navigator.appName.indexOf("Microsoft") != -1) {
		return window[swf];
	} else {
		return document[swf];
	}
};

function afficherImage(index) {
	sendEvent('diaporama','playitem',index);
};

/*
Changement des images (rollover)
*/		
function changerImage(balise, new_img) {
	balise.src = new_img;
}


