function verifQuickBuyChamps(myform){
  var isStyleok = false;
  var isFormatok = false;
  var isImageok = false; 
  var isTexteok = false;
  
  for(i=0;i<myform.style.length;i++){
   if (myform.style[i].checked) { 
        isStyleok = true; 
        var QbStyleTexteId = myform.style[i].id;
        //alert(QbStyleTexteId+" / "+myform.qb_style_texte.value);
	       if(QbStyleTexteId == 1){
	         if(myform.qb_style_texte.value != ""){
	          isTexteok = true; 
	        }    
	       }
      }
    }
    //alert(isTexteok);
    for(i=0;i<myform.format.length;i++){
	    if (myform.format[i].checked) { 
	        isFormatok = true; 
	    }
    }
    if(myform.guide_place_pic.value != ""){
          isImageok = true; 
    }
   
  if((isStyleok == true) && (isFormatok == true) && (isImageok == true) ){
		  if(QbStyleTexteId == 1)
		  {	  
		    if(isTexteok == true){
		      myform.submit();
		    }else{
		        alert("Merci de remplir le champs texte");
		    }
		  }else{
		      myform.submit();
		  }
  }else{
    alert("Merci de remplir tous les champs");
  } 
  
}

function QbDisplayBlocText(block_none){
  var text_td = document.getElementById("qb_bloc_text");
  text_td.style.display=block_none;
}


//////////////----*************************************************** ---------
//////////////----Fonctions de gestion defilement horizontal contenu des etapes
//////////////----*************************************************** ---------
/*



@todo revenir position 0 quand on arrive a la fin du defilement horizontal

*/
//interval pour scroller
var movingScrollableAreaInterval   = 0;
var movingScrollableAreaCurrentWay = '';
var movingScrollableAreaSpeed      = 200;
var movingScrollableAreaDistance   = 50;

//Timer pour commencer scrolling apres mouseover de 1 seconde
var delayToRunCommand              = 0;
//Temp du timer precedent
var mouseOverDelayBeforeAction     = 400;

var containerScrollable            = 'internal';

///Mettre en commentaire pour desactiver
function seeControlFlow( inooo )
{
//$('infobottom_style').innerHTML +=inooo+'<br />';
}

function delayMouseOverArrow( ldirection, lidofscroll )
{
  seeControlFlow( 'start timer mouse on' );
  delayToRunCommand = setTimeout( "moveScrollableArea( '"+ldirection+"', '"+lidofscroll+"' );", mouseOverDelayBeforeAction );
}

function moveScrollableArea( ldirection, lidofscroll )
{ 

  if( movingScrollableAreaInterval == 0 )
  {
    switch( ldirection )
    {
    case 'left' :
    
       movingScrollableAreaInterval   = setInterval( "moveAreaToLeft( '"+lidofscroll+"' )", movingScrollableAreaSpeed );
       movingScrollableAreaCurrentWay = 'left';
    break;
    
    case 'right' :
    
      movingScrollableAreaInterval   = setInterval( "moveAreaToRight( '"+lidofscroll+"' )", movingScrollableAreaSpeed );
      movingScrollableAreaCurrentWay = 'right';
    break;
    }
  }
}

function moveAreaToLeft( larea )
{
  var leftPos = Math.abs( parseInt( $(larea).style.left.replace('px','') ) );
  var totalWidth = $(larea).scrollWidth;
  
  if( leftPos < totalWidth - 750 ) {
    new Effect.MoveBy(larea, 0, 0 - movingScrollableAreaDistance , { duration: 0.2 });
  }
}

function moveAreaToRight( larea )
{
  var leftPos = parseInt( $(larea).style.left.replace('px','') );
  if( leftPos < 0 ) {
    new Effect.MoveBy(larea, 0, movingScrollableAreaDistance , { duration: 0.2 });
  }
}

function stopMovingScrollableArea()
{
  if( movingScrollableAreaInterval != 0 )
  {
  clearInterval( movingScrollableAreaInterval );
  movingScrollableAreaCurrentWay = '';
  movingScrollableAreaInterval   = 0
  seeControlFlow( 'STOP moving' );
  }
  else
  {
  seeControlFlow( 'moving delayed' );
    if( delayToRunCommand != 0 )
    {
    clearTimeout( delayToRunCommand );
    delayToRunCommand = 0;
    }
  }
}



//////////////----*************************************************** ---------
//////////////----Fin fonctions de gestion defilement horizontal contenu des etapes
//////////////----*************************************************** ---------

/*
function openPopupStyleDetail(lstyleid)
{
  
  var lpopup_width  = parseFloat( $('contentPopupStyleDetail').style.width.replace( 'px', '' ) );
  var lpopup_height = parseFloat( $('contentPopupStyleDetail').style.height.replace( 'px', '' ) );
  
    
  var popupManager = new TpGenericPopupManager();
  popupManager.startPlacingPopup( lpopup_width+10, lpopup_height+10 );
  
  popupManager.addPopupItemHorizontal( $('contentPopupStyleDetail'), lpopup_width, lpopup_height );
  popupManager.endPlacingPopup();
  popupManager.setCloseBehavior( true );
  popupManager.customDisplayItemMethod = function( elt ){
        $(elt).style.display = 'block';
  }
  popupManager.customHideItemMethod = function( elt ){
          $(elt).style.display = 'none';
  }
  
  new Ajax.Request(
    '/TpStepManagement/GetPopupStyleDetail',
    {
      method: 'get',
      parameters: {style_id: lstyleid},
      onComplete: function(xhr){

        $('contentPopupStyleDetail').innerHTML = xhr.responseText;
        
        popupManager.showItems();

      }
    }
  );
}*/
