$(document).ready(function () { 
	$.ifixpng('{$this->webroot}img/pixel.gif');
	$('#content h2.signe, #content h2.ascendant, #docWarpper, #nav, #content  div.bd div.equipier, #content  div.bd div.equipier div.details').ifixpng();

	$('input').each(function (i) {
		$(this).addClass($(this).attr("type"));
    });


	$('#doc.c-pages.a-display.p0-voyance_directe #nav li.voyance_directe a,' +
			'#doc.c-pages.a-display.p0-voyance_avec_cb #nav li.voyance_avec_cb a,' +
			'#doc.c-pages.a-display.p0-voyance_par_sms #nav li.voyance_par_sms a,' +
			'#doc.c-pages.a-display.p0-voyance_duo #nav li.voyance_duo a,' +
			'#doc.c-pages.a-display.p0-notre_equipe #nav li.notre_equipe a,' +
			'#doc.c-pages.a-display.p0-tarifs_et_prestations #nav li.tarifs_et_prestations a').each(function (i) {
		$(this).addClass("active");
    });


	var navConf = {
		'voyance_directe': [225,43],
		'voyance_avec_cb': [164,26],	
		'voyance_par_sms': [235,26],	
		'voyance_duo': [189,26],	
		'notre_equipe': [183,26],
		'tarifs_et_prestations': [190,26]
		}

	//var imgHeight = btHeight = elt = null;
	for(i in navConf) {
		var selector = '#nav li.' + i + ' a';
		elt = $(selector);
		elt.attr('id', i);
	}
	
	for(i in navConf) {
		var imgHeight = navConf[i][0];
		var btHeight = 26;
		
		
		var selector = '#nav li.' + i + ' a';
		elt = $(selector);
		var id = elt.attr('id');
		
		if(navConf[i][1]) {
			btHeight = navConf[i][1];
		}

		elt.mouseover(function () {
			if($('#nav li a div.hover').length) {
				return;
			}
			
			var id = $(this).attr('id');
		
			for(a in navConf) {
				var timerName = 'timerNavOver' + a;
				if (jQuery.timers[timerName] != undefined) {
					jQuery.stopTimer(timerName);
				}
			}

			var elt = $(this).next();
			elt.addClass('hover');
			
			var timerName = 'timerNavOver'+id;
			var imgHeight = navConf[id][0];
			var btHeight = navConf[id][1];

			$.timer({name:timerName, interval: 0.2, end: 1}, function() {
			      elt.animate({ 
				      	height: imgHeight-btHeight*2 + "px"
			      }, 400, 'easeInOutQuad', function() { });
			});
		});

		elt.mouseout(function () {
			var id = $(this).attr('id');
			var elt = $(this).next();

			for(a in navConf) {
				var timerName = 'timerNavOver' + a;
				if (jQuery.timers[timerName] != undefined) {
					jQuery.stopTimer(timerName);
				}
			}
					
			//var btHeight = navConf[id][1];

			elt.animate({
				height: "0px"
			}, 200, 'easeInOutQuad', function() { elt.removeClass('hover');});
		});
	}

	//$('#content div.formset div.input.required:not(.controlset) label, #content div.formset div.input.required span.label').append('<span class="required">*</span>');

	$('input').each(function (i) {
		$(this).addClass($(this).attr("type"));
			$(this).mouseover(function () {
				$(this).addClass('hover');
			});
			$(this).mouseout(function () {
				$(this).removeClass('hover');
			});
    });
    
   	var flashvars = {};
	var params = {};
	var flashvars = {};
	
	var attributes = {'id': 'bandeau', 'name': 'bandeau'};
	swfobject.embedSWF(appConstant.webroot + "swf/bandeau.swf", "bandeau", "572", "115", "9.0.0", false, flashvars, params, attributes);

	var attributes = {'id': 'audiotel', 'name': 'audiotel'};
	swfobject.embedSWF(appConstant.webroot + "swf/audiotel.swf", "audiotel", "572", "77", "9.0.0", false, flashvars, params, attributes);
	
	var flashvars = {};
	var params = {'wmode':'transparent'};
	var flashvars = {'url':appConstant.webroot + 'actualites'};
	
	var attributes = {'id': 'newsDeLaSemaine', 'name': 'newsDeLaSemaine'};
	//swfobject.embedSWF(appConstant.webroot + "swf/news_de_la_semaine.swf", "newsDeLaSemaine", "162", "124", "9.0.0", false, flashvars, params, attributes);
	swfobject.embedSWF(appConstant.webroot + "swf/news_de_la_semaine.swf", "newsDeLaSemaine", "162", "132", "9.0.0", false, flashvars, params, attributes);
	
	var flashvars = {};
	var params = {'wmode':'transparent'};
	var flashvars = {'url':appConstant.webroot + 'pages/jeu_de_tarots'};
	
	var attributes = {'id': 'jeuDeTarots', 'name': 'jeuDeTarots'};
	swfobject.embedSWF(appConstant.webroot + "swf/jeu_de_tarots.swf", "jeuDeTarots", "162", "238", "9.0.0", false, flashvars, params, attributes);
});
function favoris() {
if ( navigator.appName != 'Microsoft Internet Explorer' )
{ window.sidebar.addPanel("Jélissa International - Le cabinet n°1 en France","http://www.jelissa-voyance.com/",""); }
else { window.external.AddFavorite("http://www.jelissa-voyance.com/","Jélissa International - Le cabinet n°1 en France"); } }
