
     
     var time = new Date();
     randnum= (time.getTime());

     CompletePath = location.pathname;
     BreakPoint = CompletePath.indexOf ('.htm');
	 IsMSN = CompletePath.indexOf ('msn.');

     if (BreakPoint != -1)  {
     // i.e a .htm or .html extension was found,
      CorrectedPath = CompletePath.substring (0, BreakPoint);
     } else {
      CorrectedPath = CompletePath;
     }

     if (document.domain == "msn.skysports.com") {
      thispage = 'msn.skysports.com' + CorrectedPath;
     } else {
      thispage = 'www.skysports.co.uk' + CorrectedPath;
     }		
	 

     var adserverurl = 'ad.uk.doubleclick.net';

     function GetAdServerHREF (action, width, height, tile)
     {
     if (width == 468 && height == 60 && tile == 1) {
      interstitial = "dcopt=ist;abr=!webtv;";
     } else {
      interstitial = "";
     }
      href = "http://" +  adserverurl + "/" +
         action + "/" + thispage + ";" +
         categories + ";" + interstitial + "sz=" + width + "x" +
         height + ";tile=" + tile + ";ord=" +
         randnum + "?";
         return (href);
     }

     function InsertDoubleClickAd(width, height, tile)
     {
      //ADJ
         var adjlink = GetAdServerHREF ("adj", width, height, tile);
      var adjlink2="<SCRIPT language='JavaScript' SRC=" + adjlink + ">";
      document.write(adjlink2);
     //JUMP
         var link = GetAdServerHREF ("jump", width, height, tile);
      var nlink="<a target=_blank href=" + link + ">";
      document.write(nlink);
     //AD
         var width2=width;
         var height2=height;
         document.write('<IMG WIDTH=' + width2 + ' HEIGHT=' +
             height2 + ' BORDER=0 SRC=' +
             GetAdServerHREF ("ad",width,height,tile) + '>');
         document.write('</A>');
      document.write('</SCRIPT>');
     }


