function viewMerchantXml(url,comId,catId,from,frameset,contentId){
  var lparam="&catId="+catId+"&from="+from+"&frameset="+frameset;
  if(contentId!=""){lparam=lparam+'&contentId='+contentId;}
  viewMerchant(url,comId,lparam);
}

function afficheCommandeXml(pkey,merchantid){
  afficheCommande('/shopbot/go.jsp?pkey='+pkey+'&catId=<%=request.getParameter("catId")%>&merchantId='+merchantid+'&from=shopbot');
}

function viewMPopupXml(url,comId,catId,from,frameset,contentId,width,height) {
		var lparam="&catId="+catId+"&from="+from+"&frameset="+frameset;
		if(contentId!=""){lparam=lparam+'&contentId='+contentId;}
                url="/modules/go.jsp?merchantId="+comId+"&url="+escape(url)+lparam;
                op = 'scrollbars=yes,toolbar=no,location=no,directories=no,menubar=no,resizable=yes,status=no,width='+width+',height='+height;
                merchant=open(url,'',op);
}
 
function viewMPopupXmlT(url,comId,catId,from,frameset,contentId,width,height) {
		var lparam="&catId="+catId+"&from="+from+"&frameset="+frameset;
		if(contentId!=""){lparam=lparam+'&contentId='+contentId;}
                url="/modules/go.jsp?merchantId="+comId+"&url="+escape(url)+lparam;
                op = 'scrollbars=yes,toolbar=yes,location=yes,directories=yes,menubar=yes,resizable=yes,status=yes,width='+width+',height='+height;
                merchant=open(url,'',op);
}


function pubCol(newPubId){

  // Valeur par defaut
  var cid='7306';
  var url_c = 'http://www.cibleclick.com/cibles/clicks/symp.cfm?site_id=243280074&friend_id=765596634&banniere_id=7958';

  // Titre colonne
  if(newPubId=='2472') {
    cid = '7306';
    url_c = 'http://www.cibleclick.com/cibles/clicks/symp.cfm?site_id=243280074&friend_id=765596634&banniere_id=7958';
  }

  // Informatique
  if(newPubId=='2466') {
    cid = '7307';
    url_c = 'http://www.cibleclick.com/cibles/clicks/symp.cfm?site_id=243280074&friend_id=160921285&banniere_id=7958';
  }

  // Voyage
  if(newPubId=='2467') {
    cid='7308';
    url_c = 'http://www.cibleclick.com/cibles/clicks/symp.cfm?site_id=243280074&friend_id=693391310&banniere_id=7958';
  }

  // Hifi Photo Video
  if(newPubId=='2468') {
    cid='7310';
    url_c = 'http://www.cibleclick.com/cibles/clicks/symp.cfm?site_id=243280074&friend_id=152746674&banniere_id=7958';
  }


  // !!!!!!!!!!!!!!! rien pour l'instant en culturel !!!!!!!!!!!!!!!!!!!!!!!!!
  // Culturel
  if(newPubId=='2469') {
    cid='7329';
    url_c = 'http://www.cibleclick.com/cibles/clicks/symp.cfm?site_id=243280074&friend_id=765596634&banniere_id=7958'; //!!!!!!!!!!!!!!! rien pour l'instant en culturel !!!!!!!!!!!!!!!!!!!!!!!!! -> valeur par defaut au cas ou
  }

  // Electro
  if(newPubId=='2470') {
    cid='7311';
    url_c = 'http://www.cibleclick.com/cibles/clicks/symp.cfm?site_id=243280074&friend_id=945598350&banniere_id=7958';
  }

  // Maison et jardin
  if(newPubId=='2471') {
    cid='7330';
    url_c = 'http://www.cibleclick.com/cibles/clicks/symp.cfm?site_id=243280074&friend_id=910710268&banniere_id=7958';
  }

  // !!! new : univers Auto 
  if(newPubId=='2473') {
    cid='7309';
    url_c = 'http://www.cibleclick.com/cibles/clicks/symp.cfm?site_id=243280074&friend_id=647416776&banniere_id=7958';
  }

  
  viewMPopupXmlT(url_c,'3635923','601','content','no',cid,'800','600');


  // document.write('<a href="#" onclick="viewMPopupXml(\'http://s0b.bluestreak.com/ix.e?hy&s='+tdid+'\',\'3711523\',\'601\',\'content\',\'no\',\''+newPubId+'\',\'800\',\'650\')"> <img src="'+cofimg+'" border="0" width="64" height="45"></a>');


  return true;

}


   // Attention : utilisé par plusieurs script !
   function showInfoLayer(layername,evt) { 

       if (document.layers) {

           xpage=evt.pageX ; 
           ypage=evt.pageY;

           xfenetre=xpage ;
           yfenetre=ypage ;		

       } else if (document.all) {

// IE
           xfenetre=evt.x ;
           yfenetre=evt.y ;		

           xpage=xfenetre ; 
           ypage=yfenetre ;
	
           if(document.body.scrollLeft) xpage=xfenetre + document.body.scrollLeft ; 
           if(document.body.scrollTop) ypage=yfenetre + document.body.scrollTop;

       } else if (document.getElementById) {

// Netscape et Mozilla

           xfenetre=evt.clientX ;
           yfenetre=evt.clientY ;

           xpage=xfenetre ; 
           ypage=yfenetre ;
	
           if(evt.pageX) xpage=evt.pageX ;
           if(evt.pageY) ypage=evt.pageY ;

       }

       if (eval(document.getElementById(layername)) != null) {

           document.getElementById(layername).style.left=xpage;
           document.getElementById(layername).style.top=ypage+15;
           document.getElementById(layername).style.visibility='visible';

       } 

   }

   function hideInfoLayer(layername,evt) { 

       if (eval(document.getElementById(layername)) != null) {
           document.getElementById(layername).style.visibility='hidden';
       } 

   }





   function viewInfoLayer2(tdid,newPubId,cofimg,layername,info){


       if (document.getElementById){

           createInfo2(layername, info);

       }

       if (eval(document.getElementById(layername)) != null && info!= '') { 

         document.write('<a href="#" onclick="viewMPopupXml(\'http://s0b.bluestreak.com/ix.e?hy&s='+tdid+'\',\'3711523\',\'601\',\'content\',\'no\',\''+newPubId+'\',\'800\',\'650\')" onMouseOver="showInfoLayer(\''+layername+'\',event)" onMouseOut="hideInfoLayer(\''+layername+'\',event)"> <img src="'+cofimg+'" border="0" width="64" height="45"></a>');

       }else{

         document.write('<a href="#" onclick="viewMPopupXml(\'http://s0b.bluestreak.com/ix.e?hy&s='+tdid+'\',\'3711523\',\'601\',\'content\',\'no\',\''+newPubId+'\',\'800\',\'650\')"> <img src="'+cofimg+'" border="0" width="64" height="45"></a>');

       }

   }


   function createInfo2(layername, info){

     document.write('<div id="'+layername+'" style="position: absolute; visibility: hidden;"><table width="130" border="0" cellspacing="0" cellpadding="2" style="border: solid 1px #cccccc"><tr class="ppr-bg"><td class="normal">'+info+'</td></tr></table></div>');

   }


function prepareParam(text){ 
      if(text!=""){
          regexp=/\S+/g;  
          myArray=text.match(regexp);
          var newText = myArray[0];
          for(ind=1; ind < myArray.length;ind++){
              newText=newText+"%20"+myArray[ind];
          }
          return newText;
      }else{
          return text;
      }
}

function respop(u,n,w,h){
	pop = window.open(u,n,"width=" + h + ",height=" + w + ",location=no,menubar=no,resizable=yes");
	pop.focus; 
}
