
function embedPage (url)
{
			var existingIFrame = $('#embeddedIFrame')[0];

			if (!existingIFrame)
			{
				var backGroundLayer = document.createElement('div');
				backGroundLayer.id = 'BackGroundLayer';
				backGroundLayer.style.position = 'absolute';
				backGroundLayer.style.top = '0px';
				backGroundLayer.style.width = '100%';
				backGroundLayer.style.height = $(document.body).height() + 'px';
				backGroundLayer.style.zIndex = '9';
				backGroundLayer.style.backgroundColor = '#000';
				backGroundLayer.style.opacity = '0.3';
				backGroundLayer.style.filter = 'Alpha(opacity=30, finishopacity=30, style=0)';

				document.body.appendChild(backGroundLayer);

				var iFrame = document.createElement('iframe');
				iFrame.id = 'embeddedIFrame';
				iFrame.src = url;
				iFrame.style.position = 'absolute';
				iFrame.style.top = '0px';
				iFrame.style.marginTop = ($(document).scrollTop() + 170) + 'px';
				iFrame.style.left = '260px';
				iFrame.style.width = '735px';
				iFrame.style.height = '100%';
				iFrame.style.overflow = 'hidden';
				iFrame.style.zIndex = '10';
				iFrame.scrolling = 'no';

				document.body.appendChild(iFrame);

				$('#' + iFrame.id).bind
				(
					'load',
					function ()
					{
						resizeEmbeddedIFrame(iFrame);

						var iFrameDocument;

						if (iFrame.contentDocument)
						{
							iFrameDocument = iFrame.contentDocument;

						}
						else if (iFrame.contentWindow.document)
						{
							iFrameDocument = iFrame.contentWindow.document;
						}

						iFrameDocument.getElementById('tabFeedback').onclick = function ()
						{
							resizeEmbeddedIFrame(iFrame);
						};

						iFrameDocument.getElementById('tabCompanyProfil').onclick = function ()
						{
							resizeEmbeddedIFrame(iFrame);
						};

						iFrameDocument.getElementById('tabReferences').onclick = function ()
						{
							resizeEmbeddedIFrame(iFrame);
						};
					}
				);
			}
}

function resizeEmbeddedIFrame (iFrame, delay)
{
	if (!delay)
	{
		window.setTimeout
		(
			function ()
			{
				resizeEmbeddedIFrame(iFrame, true);
			},
			2000
		);
	}
	else
	{
		var iFrameDocument;
		
		if (iFrame.contentDocument)
		{
			iFrameDocument = iFrame.contentDocument;
		}
		else if (iFrame.contentWindow.document)
		{
			iFrameDocument = iFrame.contentWindow.document;
		}
	
		iFrame.style.height = $(iFrameDocument.body).height() + 'px';
		
		changeIFrameLinks(iFrameDocument);
	}
}

function changeIFrameLinks (iFrameDocument)
{
	var links = iFrameDocument.getElementsByTagName('a');
	
	for (var i = 0, c = links.length; i < c; i++)
	{
		links[i].target = '_blank';
	}
}

function hideEmbeddedIFrame ()
{
	var iFrame = document.getElementById('embeddedIFrame');
	var layer = document.getElementById('BackGroundLayer');
	
	document.body.removeChild(layer);
	document.body.removeChild(iFrame);
}

