﻿$(document).ready(function() {

	var protocol	= jQuery.url.attr("protocol");
	var host 		= jQuery.url.attr("host");
	var path 		= jQuery.url.attr("path");
	var file 		= jQuery.url.attr("file");
	var directory 	= jQuery.url.attr("directory");
	var target 		= "";   		
	var match 		= directory.match("/3d/");
	
	if (match) {
		directory	= directory.replace("3d/","");
		target		= protocol + "://" + host + directory + file;			
	}
	else {
		target = protocol + "://" + host + directory + "3d/" + file;
	}
	
	$("#bouton3D1").click(function() {
		document.location.href = target;
	});
	
	$("#bouton3D").click(function() {
		document.location.href = target;
	});

});
