var obj = null;

function bookmark(){
	var url 	= "http://www.groupegratuitpros.fr/";
	var title 	= "Groupe Gratuit Pros";
	if (navigator.appName != 'Microsoft Internet Explorer') { 
		window.sidebar.addPanel(title,url,""); 
	}else{ 
		window.external.AddFavorite(url,title); 
	}
}

 function checkHover() {
 	if (obj) {
		obj.find('a:eq(0) img').removeAttr( 'style' );
    	obj.find('ul').hide();
    	obj.parent().find('li.selected ul.sous_menu').show();
    } //if
 } //checkHover
 
/*Fonctions pour les news défilantes*/
function callback() {

  var firstElement = $("#infos_defilantes li:first-child");
  
  firstElement.removeAttr('style').next().removeAttr('style');
  //firstElement.next().removeAttr('style');
  firstElement.clone().insertAfter( $("#infos_defilantes li:last-child") );
  firstElement.remove();
  
}

function defil() {

  $("#infos_defilantes li:first-child").animate({
  
    top:'-=28px'
  
  },900 );
  
  $("#infos_defilantes li:first-child").next().animate({
  
    top:'-=28px'
  
  },900, function() { callback(); } );
  
}

$(document).ready(function() {
/*Fonctions pour les sous menus*/

$('#menu_sup > li:not(.selected):not(:first-child)').hover( function() {
											
	if ( obj ) {
		obj.find('a:eq(0) img').removeAttr( 'style' );
		obj.find('ul').hide();
		obj = null;
	} //if
	
	
	$(this).find('ul').show();//montre le sous menu
	$(this).find('a:eq(0) img').attr( {style :'margin-top:-26px'} );//passe l'image du lien survolé en etat hover
  $(this).parent().find('li.selected ul.sous_menu').hide();
		
	}, function() {
		obj = $(this);
		setTimeout(
		"checkHover()",
		100);
});
  
  if( $('#flash_content').length ) {
  
  	var so = new SWFObject('flash/HAUTGGP.swf', 'GROUPE GRATUIT PRO', '990', '294', '8', '#ffffff'); 
  	so.addParam('wmode', 'transparent');
  	so.addParam("quality", "best");
  	so.addParam("showmenu", "false");
  	so.write( 'flash_content' );
  	
  }
  
  if( $('#flash_nostitres_auto').length ) {
  
  	var so = new SWFObject('../flash/bandeau_nos_titres_vers_bati.swf', 'GROUPE GRATUIT PRO', '990', '294', '8', '#ffffff'); 
  	so.addParam('wmode', 'transparent');
  	so.addParam("quality", "best");
  	so.write( 'flash_nostitres_auto' );
  	
  }
  
  if( $('#flash_nostitres_bati').length ) {
  
  	var so = new SWFObject('../flash/bandeau_nos_titres_vers_auto.swf', 'GROUPE GRATUIT PRO', '990', '294', '8', '#ffffff'); 
  	so.addParam('wmode', 'transparent');
  	so.addParam("quality", "best");
  	so.write( 'flash_nostitres_bati' );
  	
  }
  
  if( $('#timeline_flash').length ) {
  
  	var so = new SWFObject('../flash/frise.swf', 'GROUPE GRATUIT PRO', '942', '440', '8', '#ffffff'); 
  	so.addParam('wmode', 'transparent');
  	so.addParam("quality", "best");
  	so.write( 'timeline_flash' );
  	
  }  

  var int = setInterval(defil, 5000);
  
});