fields = {
	empty : function(which){
		fields.initialValue = $(which).attr('value');
		
		if($(which).attr('value') == fields.initialValue){
			$(which).attr('value', '');
		}

		$(which).bind("blur", function(){
			if(this.value == ""){ this.value = fields.initialValue; }
		});
	}
}


editorsPicks = {
	init : function(w){
		editorsPicks.currentLi = 0;
		editorsPicks.w = w;
		// Set all the li positions
		$.each($('#editorsPicks ul li'), function(i){
			$('#editorsPicks ul li:eq('+i+')').css({
				'position' : 'absolute',
				'left' : editorsPicks.w * i
			});
		});
		
	},
	next : function(){
		$.each($('#editorsPicks ul li'), function(i){
			$('#editorsPicks ul li:eq('+i+')').animate({
			   left: (i * editorsPicks.w) - editorsPicks.w
			 }, 500, function(){
				$.each($('#editorsPicks ul li'), function(i){
					$('#editorsPicks ul li:eq('+i+')').css({
						'position' : 'absolute',
						'left' : editorsPicks.w * i
					});
				});
			});
		});

		$('#editorsPicks ul li:first-child').appendTo($('#editorsPicks ul'));
	},
	previous : function(){
		$('#editorsPicks ul li:last-child').css('left', -editorsPicks.w);
		$('#editorsPicks ul li:last-child').prependTo($('#editorsPicks ul'));
		
		$.each($('#editorsPicks ul li'), function(i){
			$('#editorsPicks ul li:eq('+i+')').animate({
			   left: (i * editorsPicks.w)
			 }, 500);
		});
	}
}

shoppingAlerts = {
	init : function(){
		shoppingAlerts.currentLi = 0;

		// Set all the li positions
		$.each($('#shoppingAlerts ul li'), function(i){
			$('#shoppingAlerts ul li:eq('+i+')').css({
				'position' : 'absolute',
				'left' : 140 * i
			});
		});
		
	},
	next : function(){
		$.each($('#shoppingAlerts ul li'), function(i){
			$('#shoppingAlerts ul li:eq('+i+')').animate({
			   left: (i * 140) - 140
			 }, 500, function(){
				$.each($('#shoppingAlerts ul li'), function(i){
					$('#shoppingAlerts ul li:eq('+i+')').css({
						'position' : 'absolute',
						'left' : 140 * i
					});
				});
			});
		});

		$('#shoppingAlerts ul li:first-child').appendTo($('#shoppingAlerts ul'));
	},
	previous : function(){
		$('#shoppingAlerts ul li:last-child').css('left', - 140);
		$('#shoppingAlerts ul li:last-child').prependTo($('#shoppingAlerts ul'));
		
		$.each($('#shoppingAlerts ul li'), function(i){
			$('#shoppingAlerts ul li:eq('+i+')').animate({
			   left: (i * 140)
			 }, 500);
		});
	}
}

CelebritylooksNav = {
	init : function(){
		shoppingAlerts.currentLi = 0;

		// Set all the li positions
		$.each($('#CelebritylooksNav ul li'), function(i){
			$('#CelebritylooksNav ul li:eq('+i+')').css({
				'position' : 'absolute',
				'left' : 120 * i
			});
		});
		
	},
	next : function(){
		$.each($('#CelebritylooksNav ul li'), function(i){
			$('#CelebritylooksNav ul li:eq('+i+')').animate({
			   left: (i * 120) - 120
			 }, 300, function(){
				$.each($('#CelebritylooksNav ul li'), function(i){
					$('#CelebritylooksNav ul li:eq('+i+')').css({
						'position' : 'absolute',
						'left' : 120 * i
					});
				});
			});
		});

		$('#CelebritylooksNav ul li:first-child').appendTo($('#CelebritylooksNav ul'));
	},
	previous : function(){
		$('#CelebritylooksNav ul li:last-child').css('left', - 120);
		$('#CelebritylooksNav ul li:last-child').prependTo($('#CelebritylooksNav ul'));
		
		$.each($('#CelebritylooksNav ul li'), function(i){
			$('#CelebritylooksNav ul li:eq('+i+')').animate({
			   left: (i * 120)
			 }, 300);
		});
	}
}




CelebritylooksNav_home = {
	init : function(){
		shoppingAlerts.currentLi = 0;

		// Set all the li positions
		$.each($('#CelebritylooksNav_home ul li'), function(i){
			$('#CelebritylooksNav_home ul li:eq('+i+')').css({
				'position' : 'absolute',
				'left' : 150 * i
			});
		});
		
	},
	next : function(){
		$.each($('#CelebritylooksNav_home ul li'), function(i){
			$('#CelebritylooksNav_home ul li:eq('+i+')').animate({
			   left: (i * 150) - 150
			 }, 300, function(){
				$.each($('#CelebritylooksNav_home ul li'), function(i){
					$('#CelebritylooksNav_home ul li:eq('+i+')').css({
						'position' : 'absolute',
						'left' : 150 * i
					});
				});
			});
		});

		$('#CelebritylooksNav_home ul li:first-child').appendTo($('#CelebritylooksNav_home ul'));
	},
	previous : function(){
		$('#CelebritylooksNav_home ul li:last-child').css('left', - 150);
		$('#CelebritylooksNav_home ul li:last-child').prependTo($('#CelebritylooksNav_home ul'));
		
		$.each($('#CelebritylooksNav_home ul li'), function(i){
			$('#CelebritylooksNav_home ul li:eq('+i+')').animate({
			   left: (i * 150)
			 }, 200);
		});
	}
}



BeautylooksNav = {
	init : function(){
		shoppingAlerts.currentLi = 0;

		// Set all the li positions
		$.each($('#BeautylooksNav ul li'), function(i){
			$('#BeautylooksNav ul li:eq('+i+')').css({
				'position' : 'absolute',
				'left' : 120 * i
			});
		});
		
	},
	next : function(){
		$.each($('#BeautylooksNav ul li'), function(i){
			$('#BeautylooksNav ul li:eq('+i+')').animate({
			   left: (i * 120) - 120
			 }, 300, function(){
				$.each($('#BeautylooksNav ul li'), function(i){
					$('#BeautylooksNav ul li:eq('+i+')').css({
						'position' : 'absolute',
						'left' : 120 * i
					});
				});
			});
		});

		$('#BeautylooksNav ul li:first-child').appendTo($('#BeautylooksNav ul'));
	},
	previous : function(){
		$('#BeautylooksNav ul li:last-child').css('left', - 120);
		$('#BeautylooksNav ul li:last-child').prependTo($('#BeautylooksNav ul'));
		
		$.each($('#BeautylooksNav ul li'), function(i){
			$('#BeautylooksNav ul li:eq('+i+')').animate({
			   left: (i * 120)
			 }, 300);
		});
	}
}




BeautylooksNav_home = {
	init : function(){
		shoppingAlerts.currentLi = 0;

		// Set all the li positions
		$.each($('#BeautylooksNav_home ul li'), function(i){
			$('#BeautylooksNav_home ul li:eq('+i+')').css({
				'position' : 'absolute',
				'left' : 70 * i
			});
		});
		
	},
	next : function(){
		$.each($('#BeautylooksNav_home ul li'), function(i){
			$('#BeautylooksNav_home ul li:eq('+i+')').animate({
			   left: (i * 70) - 70
			 }, 300, function(){
				$.each($('#BeautylooksNav_home ul li'), function(i){
					$('#BeautylooksNav_home ul li:eq('+i+')').css({
						'position' : 'absolute',
						'left' : 70 * i
					});
				});
			});
		});

		$('#BeautylooksNav_home ul li:first-child').appendTo($('#BeautylooksNav_home ul'));
	},
	previous : function(){
		$('#BeautylooksNav_home ul li:last-child').css('left', - 70);
		$('#BeautylooksNav_home ul li:last-child').prependTo($('#BeautylooksNav_home ul'));
		
		$.each($('#BeautylooksNav_home ul li'), function(i){
			$('#BeautylooksNav_home ul li:eq('+i+')').animate({
			   left: (i * 70)
			 }, 200);
		});
	}
}




lawNav = {
	init : function(){
		shoppingAlerts.currentLi = 0;

		// Set all the li positions
		$.each($('#lawNav_home ul li'), function(i){
			$('#lawNav_home ul li:eq('+i+')').css({
				'position' : 'absolute',
				'left' : 240 * i
			});
		});
		
	},
	next : function(){
		$.each($('#lawNav_home ul li'), function(i){
			$('#lawNav_home ul li:eq('+i+')').animate({
			   left: (i * 240) - 240
			 }, 300, function(){
				$.each($('#lawNav_home ul li'), function(i){
					$('#lawNav_home ul li:eq('+i+')').css({
						'position' : 'absolute',
						'left' : 240 * i
					});
				});
			});
		});

		$('#lawNav_home ul li:first-child').appendTo($('#lawNav_home ul'));
	},
	previous : function(){
		$('#lawNav_home ul li:last-child').css('left', - 240);
		$('#lawNav_home ul li:last-child').prependTo($('#lawNav_home ul'));
		
		$.each($('#lawNav_home ul li'), function(i){
			$('#lawNav_home ul li:eq('+i+')').animate({
			   left: (i * 240)
			 }, 200);
		});
	}
}


lawNav_home = {
	init : function(){
		shoppingAlerts.currentLi = 0;

		// Set all the li positions
		$.each($('#lawNav_home ul li'), function(i){
			$('#lawNav_home ul li:eq('+i+')').css({
				'position' : 'absolute',
				'left' : 240 * i
			});
		});
		
	},
	next : function(){
		$.each($('#lawNav_home ul li'), function(i){
			$('#lawNav_home ul li:eq('+i+')').animate({
			   left: (i * 240) - 240
			 }, 300, function(){
				$.each($('#lawNav_home ul li'), function(i){
					$('#lawNav_home ul li:eq('+i+')').css({
						'position' : 'absolute',
						'left' : 240 * i
					});
				});
			});
		});

		$('#lawNav_home ul li:first-child').appendTo($('#lawNav_home ul'));
	},
	previous : function(){
		$('#lawNav_home ul li:last-child').css('left', - 240);
		$('#lawNav_home ul li:last-child').prependTo($('#lawNav_home ul'));
		
		$.each($('#lawNav_home ul li'), function(i){
			$('#lawNav_home ul li:eq('+i+')').animate({
			   left: (i * 240)
			 }, 200);
		});
	}
}







hotItems = {	
	init : function(){
		$("a[@rel=hot]").bind('mouseover', function(event){
			hotItems.create();
			hotItems.positionItem(event);
		});
		
		$("a[@rel=hot]").bind('mouseout', function(){
			hotItems.hide(this);
		});
		
		$("a[@rel=hot]").bind('mousemove', function(event){
			hotItems.positionItem(event);
		});
	},
	create : function(caller){
		$("body").append('<span id="hotItem" class="hotItem">Hot!</span>');
	},
	hide : function(){
		$('#hotItem').remove();
	},
	positionItem : function(eventObject){
		if($.browser.msie){
			hotItems.cursorX = eventObject.pageX;
			hotItems.cursorY = eventObject.pageY -35;
		}else{
			hotItems.cursorX = eventObject.pageX;
			hotItems.cursorY = eventObject.pageY - 30;
		}

		$('#hotItem').css({
			'left' : hotItems.cursorX,
			'top' : hotItems.cursorY
		});
	}
}

tendanceItems = {	
	init : function(){
		$("a[@rel=tendance]").bind('mouseover', function(event){
			tendanceItems.create();
			tendanceItems.positionItem(event);
		});
		
		$("a[@rel=tendance]").bind('mouseout', function(){
			tendanceItems.hide(this);
		});
		
		$("a[@rel=tendance]").bind('mousemove', function(event){
			tendanceItems.positionItem(event);
		});
	},
	create : function(caller){
		$('body').append('<span id="tendanceItem" class="tendanceItem">Tendance</span>');
	},
	hide : function(){
		$('#tendanceItem').remove();
	},
	positionItem : function(eventObject){
		if($.browser.msie){
			tendanceItems.cursorX = eventObject.x;
			tendanceItems.cursorY = eventObject.y + document.documentElement.scrollTop - 40;
		}else{
			tendanceItems.cursorX = eventObject.pageX;
			tendanceItems.cursorY = eventObject.pageY - 30;
		}

		$('#tendanceItem').css({
			'left' : tendanceItems.cursorX,
			'top' : tendanceItems.cursorY
		});
	}
}

subitem = {
	open : function(caller){
		// Get the longest item with
		currentLength = 0;
		$.each($(caller).find('ul li a'), function(i){
			currentText = $(caller).find('ul li a:eq('+i+')').text();
			if(currentText.length > currentLength){
				currentLength = currentText.length;
			}
		});
		
		$.each($(caller).find('ul li a'), function(i){
			$(caller).find('ul li a:eq('+i+')').width(currentLength * 7);
			$(caller).find('ul li:eq('+i+')').width(currentLength * 7);
			$(caller).find('ul').width(currentLength * 7);
		});
		
		$(caller).find('ul').show();
	},
	close : function(caller){
		$(caller).find('ul').hide();
	}
}


var obj = null;
var tooltipZindex = 3;

clothesViewer = {
	init : function(){
		$("a[@rel=plus]").hover(function() {
			if (obj) {
				obj.hide();
				obj = null;
			} //if
			$(this).parent().css('z-index',tooltipZindex++);
			$(this).next().show();
		},
		function() {
			obj = $(this).next();
			setTimeout("clothesViewer.checkHover()",1000);
		});
		
		$("a[@rel=plus]").next().hover(function() {
			clearTimeout();
			if (obj) {
				obj.hide();
				obj = null;
			} //if
			$(this).show();
		},
		function() {
			obj = $(this);
			setTimeout("clothesViewer.checkHover()",100);
		});
	},
	checkHover : function(caller){
		if(obj){
			obj.hide();
		}
	}
}

gallery = {
	init : function(){
		$("a[@rel=gallery]").hover(function() {
			if (obj) {
				obj.hide();
				obj = null;
			} //if
			$(this).parent().parent().parent().css('z-index',tooltipZindex++);
			$(this).parent().parent().next().show();    
		},
		function() {
			obj = $(this).parent().parent().next();
			setTimeout("gallery.checkHover()",1000);
		});
		
		$("a[@rel=gallery]").parent().parent().next().hover(function() {
			clearTimeout();
			if (obj) {
				obj.hide();
				obj = null;
			} //if
			$(this).show();
		},
		function() {
			obj = $(this);
			setTimeout("gallery.checkHover()",100);
		});
	},
	checkHover : function(caller){
		if(obj){
			obj.hide();
		}
	}
}

flyout = {
	open : function(){
		$('#flyoutBox').show();
	},
	close : function(){
		$('#flyoutBox').hide();
	}
}

blackBoxes = {
	init : function(){
		$('span.tags_loulou_btns').each(function(){
			if($(this).text() == ""){
				$(this).hide();
			}
		});
		
		//buy online
		var l = $('div.fRight div a:eq(0)').attr('href');
		if(l != undefined){
			var tar = $('div#specials > span.tags_loulou_btns:contains(Buy online)');
			$(tar).eq(0).wrap('<a href="' + l + '" class="noline" target="_blank"></a>');
		}
	}
}

mainMenu = {
	init : function(){
		var t = new Array();
		t.push(['shopping', 'shopping']);
		t.push(['fashion', 'mode']);
		t.push(['beauty', 'beaute']);
		t.push(['14plus', '14plus']);
        t.push(['loulouatwork', 'loulouauboulot']);
		t.push(['athome', 'alamaison']);
		t.push(['dealscontest', 'offresconcours']);
		t.push(['insider', 'encoulisses']);
		t.push(['community', 'communaute']);
        t.push(['blogs', 'blogues']);
   

		for(var i = 0; i < t.length; i++){
			for(var u = 0; u < t[i].length; u++){
				if(location.href.indexOf("/" + t[i][u] + '/') >= 0){
					$('div.menu ul:not(.subitem) > li:eq(' + (i) + ')').addClass('selected');
					return;
				}
			}
		}
		/*$('div.menu ul:not(.subitem) > li:eq(0)').addClass('selected');*/
	}
}

/* Rajout de l'ancien fichier script.js*/

function open_print(){
//	alert(document.location.search);
	window.open('/shared/print.jsp'+document.location.search, 'print', 'scrollbars=yes,menubar=no,status=no,top=100px,left=100px,width='+(screen.width-200)+',height='+(screen.height-400));
}

function open_printoakley(){
//	alert(document.location.search);
	window.open('/shared/print_oakley.jsp'+document.location.search, 'print', 'scrollbars=yes,menubar=no,status=no,top=100px,left=100px,width=400,height=500');
}

function open_email(){
	lang = 'en';
	if(document.location.href.indexOf("/francais/")>0){
		lang = 'fr';
	}
	lang = '/shared/email_'+lang+'.jsp'+document.location.search;
	window.open(lang, 'email', 'scrollbars=yes,menubar=no,status=no,top=100px,left=100px,width=480,height=600');
}

function open_emailOakley(){
	lang = 'en';
	if(document.location.href.indexOf("/francais/")>0){
		lang = 'fr';
	}
	lang = '/shared/emailOakley_'+lang+'.jsp'+document.location.search;
	window.open(lang, 'email', 'scrollbars=yes,menubar=no,status=no,top=100px,left=100px,width=480,height=600');
}


/* function popup pour le formulaire de feedback.*/

function popfeedback() 
	{
	msg=window.open("http://www.louloumagazine.com/feedback/index.html","popv","toolbar=no,left=0,top=360,width=500,height=600,directories=no,status=no,scrollbars=yes,resize=yes,menubar=no");
}

function popfeedbackEn() 
	{
	msg=window.open("http://www.louloumagazine.com/feedback/index_en.html","popv","toolbar=no,left=0,top=360,width=500,height=600,directories=no,status=no,scrollbars=yes,resize=yes,menubar=no");
}

function openWindow(url, width, height) {
	leftPos   = (screen.availWidth-10  - width)  / 2;
	topPos    = (screen.availHeight-20 - height) / 2;
	features  = "width=" + width +",height=" + height;
	features += ",scrollbars=1,resizable=0,location=0";
	features += ",menubar=0,toolbar=0,status=1";
	var myWindow = window.open(url, name, features);
	myWindow.moveTo(leftPos, topPos);
}


  function openit(imgname)
  {
  var OpenWindow=window.open("", "newwin","height=640,width=640");
   OpenWindow.document.write("<div align=\"center\">" +imgname)
   OpenWindow.document.write("<br>")
   OpenWindow.document.write("<a href='javascript:self.close()' target='_self'>Close</a></div>")
   }
   
   
   function openPlayer(stationId, lang) {
  if(lang == null || lang == ''){
    lang='en';
  }
  var url = "http://loulou.rogers.icebergradio.com/loulou-radio-" + lang + ".html";
  if (stationId && stationId > 0) {
    url += "?station=" + stationId
  }

  var w = null;
  w = window.open(url, "PLAYER", "scrollbars=0,width=602,height=351");

  if (w){
    w.focus();
  } else {
    alert('player window failed to open.  perhaps your popup blocker blocked it?');
  }
}

// fonction pour le pulldown menu de TV
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}




/*=======================================
	======================
	FEED AVEC IMAGES : RESTRUCTURE 
	Pour blogue de l'éditos
	======================
	=======================================*/


function changerFeed()
	{
		
	var toutHTMLImg = document.getElementById("image");
	var toutHTMLTexte = document.getElementById("texte");
	var leMax = 90;
	
	for(var i=0;i<toutHTMLTexte.childNodes.length;i++)
	{
		if(toutHTMLTexte.childNodes[i].className == "rss-box")
		{
		toutHTMLTexte = toutHTMLTexte.childNodes[i];
		}
	}
	
	for(var i=0;i<toutHTMLImg.childNodes.length;i++)
	{
		if(toutHTMLImg.childNodes[i].className == "rss-box")
		{
		toutHTMLImg = toutHTMLImg.childNodes[i];
		}
	}
	
	var ulImg = toutHTMLImg.getElementsByTagName("ul")[0];
	var lesLiImg = ulImg.getElementsByTagName("li");
	
	
	var ulTexte = toutHTMLTexte.getElementsByTagName("ul")[0];
	var lesLiTexte = ulTexte.getElementsByTagName("li");
	
	for (var i=0;i<lesLiImg.length;i++)
	{
		
		var firstImage = lesLiImg[i].getElementsByTagName("img")[0];		
		var titre = lesLiImg[i].getElementsByTagName("a")[0];	
		var texte = lesLiTexte[i].childNodes[2].nodeValue;
		
		leMax = 95;
		
		if (firstImage == undefined)
		{
			firstImage = new Image();
			firstImage.src = "http://www.louloumagazine.com/images/llblog_logo.gif";
		}
		

		if(titre.innerHTML.length < 30)
		{
			leMax = 110;
		}
		
		texte = texte.substring(0,texte.lastIndexOf(" ",leMax));		
		
		if(texte[texte.length-1] != ".")
		{
		texte += "[...]";
		}
		lesLiImg[i].innerHTML = "<div style='overflow:hidden;width:93px;height:93px;float:left; margin-right:10px'><img src='"+ firstImage.src + "' style='width:93px'/></div><a class='rss-item' href='" + titre + "'>" + titre.innerHTML + "</a><br />" + texte + "<br style='clear:both;' />";
	}
	}
	/*======================================
	======================================*/



/*=======================================
	======================
	FEED AVEC IMAGES : RESTRUCTURE 
	Pour blogue de célébrités
	======================
	=======================================*/


function changerFeedCeleb(p_divImage,p_divTexte)
	{
		
	var toutHTMLImg = document.getElementById(p_divImage);
	var toutHTMLTexte = document.getElementById(p_divTexte);
	var leMax = 90;
	
	for(var i=0;i<toutHTMLTexte.childNodes.length;i++)
	{
		if(toutHTMLTexte.childNodes[i].className == "rss-box")
		{
		toutHTMLTexte = toutHTMLTexte.childNodes[i];
		}
	}
	
	for(var i=0;i<toutHTMLImg.childNodes.length;i++)
	{
		if(toutHTMLImg.childNodes[i].className == "rss-box")
		{
		toutHTMLImg = toutHTMLImg.childNodes[i];
		}
	}
	
	var ulImg = toutHTMLImg.getElementsByTagName("ul")[0];
	var lesLiImg = ulImg.getElementsByTagName("li");
	
	
	var ulTexte = toutHTMLTexte.getElementsByTagName("ul")[0];
	var lesLiTexte = ulTexte.getElementsByTagName("li");
	
	for (var i=0;i<lesLiImg.length;i++)
	{
		
		var firstImage = lesLiImg[i].getElementsByTagName("img")[0];		
		var titre = lesLiImg[i].getElementsByTagName("a")[0];	
		var texte = lesLiTexte[i].childNodes[2].nodeValue;
		
		leMax = 95;
		
		if (firstImage == undefined)
		{
			firstImage = new Image();
			firstImage.src = "http://www.louloumagazine.com/images/llblog_logo.gif";
		}
		

		if(titre.innerHTML.length < 30)
		{
			leMax = 110;
		}
		
		texte = texte.substring(0,texte.lastIndexOf(" ",leMax));		
		
		if(texte[texte.length-1] != ".")
		{
		texte += "[...]";
		}
		lesLiImg[i].innerHTML = "<div style='overflow:hidden;width:93px;height:93px;float:left; margin-right:10px'><img src='"+ firstImage.src + "' style='width:93px'/></div><a class='rss-item' href='" + titre + "'>" + titre.innerHTML + "</a><br />" + texte + "<br style='clear:both;' />";
	}
	}
	/*======================================
	======================================*/
	
	/*=======================================
	======================
	FEED AVEC IMAGES : RESTRUCTURE - new size April 27 2009
	======================
	=======================================*/

	function changerFeed2()
	{
		
	var toutHTMLImg = document.getElementById("image");
	var toutHTMLTexte = document.getElementById("texte");
	var leMax = 90;
	
	for(var i=0;i<toutHTMLTexte.childNodes.length;i++)
	{
		if(toutHTMLTexte.childNodes[i].className == "rss-box")
		{
		toutHTMLTexte = toutHTMLTexte.childNodes[i];
		}
	}
	
	for(var i=0;i<toutHTMLImg.childNodes.length;i++)
	{
		if(toutHTMLImg.childNodes[i].className == "rss-box")
		{
		toutHTMLImg = toutHTMLImg.childNodes[i];
		}
	}
	
	var ulImg = toutHTMLImg.getElementsByTagName("ul")[0];
	var lesLiImg = ulImg.getElementsByTagName("li");
	
	
	var ulTexte = toutHTMLTexte.getElementsByTagName("ul")[0];
	var lesLiTexte = ulTexte.getElementsByTagName("li");
	
	for (var i=0;i<lesLiImg.length;i++)
	{
		
		var firstImage = lesLiImg[i].getElementsByTagName("img")[0];		
		var titre = lesLiImg[i].getElementsByTagName("a")[0];	
		var texte = lesLiTexte[i].childNodes[2].nodeValue;
		
		leMax = 95;
		
		if (firstImage == undefined)
		{
			firstImage = new Image();
			firstImage.src = "http://www.louloumagazine.com/images/llblog_logo.gif";
		}
		

		if(titre.innerHTML.length < 30)
		{
			leMax = 110;
		}
		
		texte = texte.substring(0,texte.lastIndexOf(" ",leMax));		
		
		if(texte[texte.length-1] != ".")
		{
		texte += "[...]";
		}
		lesLiImg[i].innerHTML = "<div style='overflow:hidden;width:275px;height:95px;float:left; margin-bottom:10px;padding:2px; border:1px solid #535353;'><img src='"+ firstImage.src + "' style='width:275px'/></div><a class='rss-item' href='" + titre + "'>" + titre.innerHTML + "</a><br />" + texte + "<br style='clear:both;' />";
	}
	}
	/*======================================
	======================================*/


	/*===========================================
	============================
	removeExternal
	What it does : Remove all external icon from links which content is an image
	============================
	===========================================*/

	function removeExternal()
	{
		var a = document.getElementsByTagName("a");
		for (var i=0;i<a.length;i++)
		{
		var string = a[i].innerHTML;
		if(string.substring(0,4) == "<img" || string.substring(0,4) == "<IMG")
			{
			a[i].style.background = 'none';
			a[i].style.padding = '0';
			}
		} 
	}

	// ========================================	