﻿function Prehome() {}

Prehome.TimerId = null;


Prehome.Open = function(baseDirectory, fileName)
{
	var prehomeHeight = 550;
	var prehomeWidth = 680;

	document.getElementById('contenu_prehome').innerHTML = '<a id="a_prehome" style="display: none" href="'+baseDirectory+'/'+fileName+'?width=680&amp;height=550&amp;wmode=transparent&amp;movie='+baseDirectory+'/'+fileName+'&amp;quality=high" rel="prettyPhoto[flash]">Pretty Photo</a>';

	$(document).ready(function(){
		$("a[rel^='prettyPhoto']").prettyPhoto({theme: 'dark_rounded', allowresize: false, animationspeed: 'animationSpeed'});
		setTimeout("$('a#a_prehome').click();", 2);
	});
}

Prehome.Close = function()
{
	$('a.pp_close').click();
	clearInterval(Prehome.TimerId);
}

Prehome.Open2 = function(baseDirectory, fileName)
{
	var headerStyle = 'background-color: #c00; height: 32px; border: solid 1px #cf7126; text-align: left; position: relative;';
	var headerImgSrc = 'http://photos.marmara.com/designimages/icons/logoMblanc_renvoi_home.gif';
	
	var bodyStyle = 'padding-top: 2px;';
	
	var closeLinkStyle = 'position: absolute; display: block; right: 6px; top: 7px; text-decoration: none; color: #fff; font-weight: normal; font-size: 14px;';
	
	
	var prehomeHeight = 550;
	var prehomeWidth = 680;

	var modalOptions =  {
		opacity: 80, 
		overlayCss: { backgroundColor: '#000', cursor: 'wait' },
		containerCss: { width: prehomeWidth, height: prehomeHeight + 36, position: 'relative', backgroundColor: '#200', border: '2px solid #f2cc43', color: '#f2cc43', fontSize: '14px', fontWeight: 'normal', padding: '2px' }
	}

	var modalHTML = [];

	modalHTML.push('<div style="' + headerStyle + '">');
	modalHTML.push('<img src="' + headerImgSrc + '" alt="contactez-marmara.com" />');
	modalHTML.push('<a href="#" xtclib="Prehome_ClickFermeture" onclick="Prehome.Close(); return false;" style="'+closeLinkStyle+'">');
	modalHTML.push('&rarr;&nbsp;Accéder directement au site');
	modalHTML.push('</a>');
	modalHTML.push('</div>');

	modalHTML.push('<div style="' + bodyStyle + '">');
	modalHTML.push('<object xtclib="Prehome_ClickBanniere" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="' + prehomeWidth + '" height="' + prehomeHeight + '" title="marmara">');
	modalHTML.push('<param name="movie" value="' + baseDirectory + '/' + fileName + '" />');
	modalHTML.push('<param name="quality" value="high" />');
	modalHTML.push('<param name="wmode" value="transparent" />');
	modalHTML.push('<embed src="' + baseDirectory + '/' + fileName + '" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="' + prehomeWidth + '" height="' + prehomeHeight + '"></embed>');
	modalHTML.push('</object>');
	modalHTML.push('</div>');
	
	jQuery( function($) { $.modal(modalHTML.join(''), modalOptions) } );
}

Prehome.Close2 = function()
{
	jQuery( function($) { $.modal.close(); } );
	clearInterval(Prehome.TimerId);
}
