// JavaScript Document

var comment_displayed = 0;

function display_comment(id) { 
	
	if(comment_displayed!=0 && comment_displayed!=id && $('comments-'+comment_displayed).style.height!='0px'){
		hide_comments = new fx.Height('comments-'+comment_displayed, {duration: 600});
		hide_comments.toggle();
	}

	
	display_comments = new fx.Height('comments-'+id, {duration: 600});
	$('comments-'+id).style.display="block";
	display_comments.toggle();
	
	comment_displayed = id;
	
	
}


window.onload = function() {
	heighter = new fx.Height('login_div', {duration: 400});
	heighter.hide();
	document.getElementById( 'login_div' ).style.display = "block";
	var div_comments = document.getElementsByClassName('comments');
	div_comments.each(function(item){
		display_comments = new fx.Height(item, {duration: 600});
		display_comments.hide();
	});
	/*var div_envoyer = document.getElementsByClassName('envoyer');
	div_envoyer.each(function(item){
		div_envoyer = new fx.Height(item, {duration: 600});
		div_envoyer.hide();
	});*/
	
	/*function checkHash(){
		var hash = String(window.location.hash);
		var type = hash.substr(1,1);
		if(type=='c'){
			var ancre = 'comments-'+hash.substr(2,hash.length);
		}else if(type=='e'){
			var ancre = 'envoyer-'+hash.substr(2,hash.length);
		}
		
		
		$(ancre).style.display="block";
		display_comments = new fx.Height(ancre, {duration: 600});
		display_comments.toggle();
		
		//window.location = window.location + ancre;

	}

	checkHash()*/
	
	/*var script = document.createElement('script');
	script.src = 'http://pub.mybloglog.com/comm2.php?mblID=2007010911425115&c_width=300&c_sn_opt=n&c_rows=3&c_img_size=h&c_heading_text=MyBlogLog&c_color_heading_bg=ebe8da&c_color_heading=CC0000&c_color_link_bg=ebe8da&c_color_link=CC0000&c_color_bottom_bg=ebe8da';
	$('connected').appendChild(script); */
	


}
