﻿ //Function to load the configurable OAS parameters for different pages. 
function LoadOASVariables(OAS_URL,Platts_domain,sitepage,listpos)
      {
         OAS_url = OAS_URL;
         OAS_sitepage = Platts_domain + '/' + sitepage;
         OAS_listpos =listpos;   //Refers to the list of positions in which the banners are going to be displayed.
         OAS_query = '';
         OAS_target = '_top';
                
         OAS_rn = new String (Math.random()); 
         OAS_rns = OAS_rn.substring (2, 11);
           
         OAS_version = 11;
       
        if ((navigator.userAgent.indexOf('Mozilla/3') != -1) || 
        (navigator.userAgent.indexOf('Mozilla/4.0 webTV') != -1))   //Condition is for the non-javascript compliant Firefox browsers.
            OAS_version = 10;

       //To create the OAS_RICH(pos) function based on the parameters.
        if (OAS_version >= 11)
           {
            document.write('<SCR' + 'IPT LANGUAGE=JavaScript1.1 SRC="' + OAS_url + 'adstream_mjx.ads/' + OAS_sitepage + '/1' + OAS_rns + '@' + OAS_listpos + '?' + OAS_query + '"><\/SCRIPT>');
           }   
      }

function OAS_NORMAL(pos)
        {
           document.write('<A HREF="' + OAS_url + 'click_nx.ads/' + OAS_sitepage + '/1' + OAS_rns + '@' + OAS_listpos + '!' + pos + '?' + OAS_query + '" TARGET=' + OAS_target + '>'); 
           document.write('<IMG SRC="' + OAS_url + 'adstream_nx.ads/' + OAS_sitepage + '/1' + OAS_rns + '@' + OAS_listpos + '!' + pos + '?' + OAS_query + '" BORDER=0></A>'); 
        }
        
//Function to call the specific OAS function.
function OAS_AD(pos) 
          {
               if (OAS_version >= 11)
               {
                    OAS_RICH(pos);
                    document.write('<br/>');
               }
               else
               
               OAS_NORMAL(pos);
               document.write('<br/>');
               
          }
          
//Function to display the Banner in the page.
function ShowOAS_Banner(obj)
        {
        for (i = 0; i < obj.length; i++)
            {
            OAS_AD(obj[i]);
            }
        }