<!-- Pixel project : Load all pixels as Ajax component. -->

document.write ( '<iframe id=pixelsIframe style=\'width:0px; height:0px; border: 0px\' ></iframe>') ;

var ifrm = document.getElementById('pixelsIframe');
ifrm = (ifrm.contentWindow) ? ifrm.contentWindow : (ifrm.contentDocument.document) ? ifrm.contentDocument.document : ifrm.contentDocument;

function ajaxFunction(affn, campn, arean) {
 var url = '/getPixel.html';
 var s = window.location.search ;

 params = '&affiliate_name=' + affn + '&campaign_name=' + campn + '&area=' + arean ;
 if(typeof(cart_order_confirmation) == 'undefined' ) { cart_order_confirmation = -1 ; }
 if(typeof(pixel_order_id) == "undefined") { pixel_order_id  = "000" ; }

 new Ajax.Request(url, {
  method: 'post',
  parameters: { affiliate_name: affn, campaign_name: campn, area: arean, cart_order_confirmation: cart_order_confirmation, order_id: pixel_order_id },
  onSuccess: function(request){
    ifrm.document.open();
    ifrm.document.write(request.responseText) ;
    ifrm.document.close();
  },
  onFailure: function(request){
    dummy = 1;
   }
 });

}

if ( affl_str != '' ) {
  ac = affl_str.split ( '_' ) ;
  affiliate_name = ac[0] ;
  campaign_name = ac[1] ;
  ajaxFunction ( affiliate_name , campaign_name , area_name ) ;
} else {
  ifrm.document.open();
  ifrm.document.write('No Affiliate and Campaign name') ;
  ifrm.document.close();
}
