function twAller(_url,_cadre,_target) {
  if (_cadre) {
    parent._cadre.location.href = _url;
  } else if (_target) {
    _target = window.open(_url,_target);
  } else {
    window.location.href = _url;
  }
}

function getLength(texte)
{
var root = document.form;
if (resume_news.length > 255)
{
resume_news = resume_news.substring(0,254);
document.form.resume_news.value = resume_news;
}
}



var max=190;  		

function compter(target, max, nomchamp) 
{ 
strlen = target.value.length 
if (strlen > max ) 
{ 
target.value = target.value.substring(0,max); 
charsleft = max; 
} 
else 
{ 
charsleft = strlen; 
} 
nomchamp.value = max - charsleft; 
} 

function clck(id, r_heading)
{
	$.post(post_click,
            { uid: id, heading:r_heading},
            function(data){
            }
          );
}


function checkTaille(zone, max) {

	var taille = zone.value.length ;

	var reste = max - taille;
	document.form.compteur.value = reste ;
	if (reste = max)
	zone.value=zone.value.substring(0,max);
}

function timer() {
	compter(document.forms["form"]);
	setTimeout("timer()",100);
}

function ouvre(id){
document.location.href= 'go.php?id='+id;
}


function smileyMessage(emoticon) {
	document.form.message.value += emoticon+" ";
	}

function smileyTopic(emoticon) {
	document.form.topic.value += emoticon+" ";
	}
	
function submitForm(my_form)
{
	var input_new = document.createElement('input');
	input_new.setAttribute('type', 'hidden');
	input_new.setAttribute('name', 'allow_submit');
	input_new.setAttribute('id', 'allow_submit');
	input_new.setAttribute('value', 'go');
	document.forms[my_form].appendChild(input_new);
	
	document.forms[my_form].submit();

}

$(function()
		{
			$('input, textarea, select, radio, checkbox').focus(function(){
			$(this).parent('div').addClass("over");
			}).blur(function(){
			$(this).parent('div').removeClass("over");
			});
			$('#oubah_fav').jFav();
			$('.resource_fav').jFav();
			$('.tooltip').each(function() {
				$(this).tipsy();	
				
			});

		});
