﻿// JScript File
// <![CDATA[
function getMWArgs(){
  var args = new Object(); //object for storing param=value pairs
  var query = location.search.substring(1); //grab the text after the '?'
  var pairs = query.split("&"); //create an array of param=value pairs
  var newstring = ""; //string we return via the function
  for(var i = 0; i < pairs.length; i++){ //loop through the array
    var pos = pairs[i].indexOf('='); //check for an '='
    if (pos == -1) continue; //no '=', skip this array dimention
    var argname = pairs[i].substring(0,pos); //extract parameter name
    //skip parameters that are hard coded in the calling script block
    if(argname.toLowerCase() != "siteid" && argname.toLowerCase() != "urlpull" && argname.toLowerCase() != "exstyle"){
      newstring += pairs[i] + "&" //concatenate the new string
    }
  }
  return newstring;
}

if(!document.layers){
  //document.writeln ("<" + "script language=\"JavaScript\" src=\"http://custom.marketwatch.com/custom/alliance/ii/scroller.asp?siteid=3C8217C5-BCD1-4FA8-A176-CE09C204C0ED&exstyle=t&" + getMWArgs() + "\">" );
  document.writeln("<script src=\"http://custom.marketwatch.com/custom/alliance/ii/scroller.asp?siteid=3C8217C5-BCD1-4FA8-A176-CE09C204C0ED\"></script>");
//  document.write("</");
  //document.writeln("script></td></tr></table>");
  //document.writeln("script>");
}
// ]]>
