/*
This file is Copyright (c) 2010 Bankrate, Inc.

No part of this file may be modified in any way without expressed written permission from an authorized representative from Bankrate Inc.
*/

document.writeln("<html xmlns=\"http://www.w3.org/1999/xhtml\" >");
document.writeln("<head>");
document.writeln("    <title></title>");
document.writeln("    <script type=\"text/javascript\" >");
document.writeln("      var storyFontValue = \"\";");
document.writeln("      var storywidgetWidth = \"\";");
document.writeln("      var lengthOfStories=\"\";");
document.writeln("      var storyselectedTab=\"\";");
document.writeln("      var storyselectedColor=\"\";");
document.writeln("      var storyRssName=\"\";");
document.writeln("      var storySelectedOption =\"\";");
document.writeln("      storySelectedOption = document.getElementById('storyVal').value;");
document.writeln("      function storyInit(){");
document.writeln("          storySelectedOption = storySelectedOption.split(',');");
document.writeln("          storyselectedColor = storySelectedOption[0];");
document.writeln("          storyFontValue= storySelectedOption[1];");
document.writeln("          lengthOfStories= storySelectedOption[2];");
document.writeln("          storywidgetWidth = storySelectedOption[3];");
document.writeln("          storyRssName= storySelectedOption[4];");
document.writeln("          storyselectedTab = storySelectedOption[5];");
document.writeln("");
document.writeln("          storySetWidth();");
document.writeln("          setStoryColor(storyselectedColor);");
document.writeln("          storyShowTabs(storyRssName);");
document.writeln("          var tablen= storyRssName.split(':');");
document.writeln("          var i = 0;");
document.writeln("          for (i = 0; i < tablen.length; i++) {");
document.writeln("             document.getElementById('storyTitle' + tablen[i]).style.fontFamily = storyFontValue");
document.writeln("          }");
document.writeln("          var ie = (typeof window.ActiveXObject != 'undefined');");
document.writeln("          if(ie){");
document.writeln("            checkCookie();");
document.writeln("          }");
document.writeln("      }");
document.writeln("");
document.writeln("      StoryClient = function() {");
document.writeln("      this._id = new String('instance_' + new Date().getTime());");
document.writeln("      StoryClient[this._id] = this;");
document.writeln("      };");
document.writeln("      StoryClient.prototype = {");
document.writeln("");
document.writeln("      proxy: 'http://www.bankrate.com/system/util/proxy.ashx',");
document.writeln("");
document.writeln("      addEvent: function(el, type, fn, useCapture) {");
document.writeln("      if (el.addEventListener) {");
document.writeln("      el.addEventListener(type, fn, useCapture);");
document.writeln("      } else if (el.attachEvent) {");
document.writeln("      el.attachEvent('on' + type, fn);");
document.writeln("      } else {");
document.writeln("      el['on' + type] = fn;");
document.writeln("      }");
document.writeln("      },");
document.writeln("");
document.writeln("      addScript: function(src) {");
document.writeln("      var head = document.getElementsByTagName('head')[0];");
document.writeln("      var script = document.createElement('script');");
document.writeln("      script.type = 'text/javascript';");
document.writeln("      script.src = src;");
document.writeln("      head.appendChild(script);");
document.writeln("      },");
document.writeln("");
document.writeln("      storyTextToXML: function(strXML) {");
document.writeln("      var xmlDoc = null;");
document.writeln("      try {");
document.writeln("      xmlDoc = (document.all) ? new ActiveXObject(\"Microsoft.XMLDOM\") : new DOMParser();");
document.writeln("      xmlDoc.async = false;");
document.writeln("      } catch (e) { throw new Error(\"XML Parser could not be instantiated\"); }");
document.writeln("      var out;");
document.writeln("      try {");
document.writeln("      if (document.all) {");
document.writeln("      out = (xmlDoc.loadXML(strXML)) ? xmlDoc : false;");
document.writeln("      } else {");
document.writeln("      out = xmlDoc.parseFromString(strXML, \"text/xml\");");
document.writeln("      }");
document.writeln("      } catch (e) { throw new Error(\"Error parsing XML string\"); }");
document.writeln("      return out;");
document.writeln("      },");
document.writeln("");
document.writeln("      getStoriesRSS: function(url, callback) {");
document.writeln("      var self = this;");
document.writeln("      self._callback = callback;");
document.writeln("      self.callback = function(str) {");
document.writeln("      var xml = self.storyTextToXML(str);");
document.writeln("      self._callback(xml);");
document.writeln("      };");
document.writeln("      var proxy = this.proxy + '?url=' + encodeURIComponent(url) + '&callback=StoryClient.' + this._id + '.callback';");
document.writeln("      this.addScript(proxy);");
document.writeln("      },");
document.writeln("");
document.writeln("      onload: function(fn) {");
document.writeln("      this.addEvent(window, 'load', fn);");
document.writeln("      }");
document.writeln("      }");
document.writeln("      var client1 = \"\";");
document.writeln("      function fetchStoryRSS(divID) {");
document.writeln("          setStoryTabSelected(divID);");
document.writeln("          var rssFeed= getStoryRssNameById(divID);");
document.writeln("          storyselectedTab=divID;");
document.writeln("          var itemlength = storySelectedOption[2];");
document.writeln("          var url = 'http://www.bankrate.com/syndication/' + rssFeed + '.xml';");
document.writeln("          client1 = new StoryClient();");
document.writeln("          client1.getStoriesRSS(url, function(xml) {");
document.writeln("          var channel=\"\";");
document.writeln("          try {");
document.writeln("            channel = xml.getElementsByTagName('channel')[0];");
document.writeln("          }");
document.writeln("          catch (e) {");
document.writeln("          }");
document.writeln("          try {");
document.writeln("              document.getElementById(\"storyItems\").innerHTML = \"\";");
document.writeln("              var items = channel.getElementsByTagName('item');");
document.writeln("              if (itemlength > items.length)");
document.writeln("                  itemlength = items.length;");
document.writeln("              var j =  itemlength;");
document.writeln("              var i = 0;");
document.writeln("              while (j > 0) {");
document.writeln("                  var title = items[i].getElementsByTagName('title')[0].firstChild.nodeValue;");
document.writeln("                  var link = items[i].getElementsByTagName('link')[0].firstChild.nodeValue;");
document.writeln("                  var li = document.createElement('li');");
document.writeln("                  var a = document.createElement('a');");
document.writeln("                  a.setAttribute('href', link);");
document.writeln("                 a.className = \"BankrateFCC_a\";");
document.writeln("                  a.innerHTML = title;");
document.writeln("                  a.setAttribute('target', '_blank');");
document.writeln("                  a.style.fontFamily = storySelectedOption[1];");
document.writeln("                  li.appendChild(a);");
document.writeln("                  document.getElementById('storyItems').appendChild(li);");
document.writeln("                  j--;");
document.writeln("                  i++;");
document.writeln("              }");
document.writeln("          }");
document.writeln("          catch (e) { }");
document.writeln("          })");
document.writeln("      }");
document.writeln("");
document.writeln("      function getStoryRssNameById(tabId){");
document.writeln("          var strRSS=\"\";");
document.writeln("          switch(tabId){");
document.writeln("              case 'storytab1':");
document.writeln("                  strRSS=\"bankrate-cd-rates\";");
document.writeln("                  break;");
document.writeln("              case 'storytab2':");
document.writeln("                  strRSS=\"bankrate_mortgages\";");
document.writeln("                  break;");
document.writeln("              case 'storytab3':");
document.writeln("                  strRSS=\"credit-cards\";");
document.writeln("                  break;");
document.writeln("              case 'storytab4':");
document.writeln("                  strRSS=\"bankrate-refinance\";");
document.writeln("                  break;");
document.writeln("          }");
document.writeln("");
document.writeln("             return strRSS;");
document.writeln("      }");
document.writeln("");
document.writeln("      function storySetWidth() {");
document.writeln("          var tablen= storyRssName.split(':');");
document.writeln("          var i=1;");
document.writeln("        for (i = 0; i < tablen.length; i++) {");
document.writeln("          document.getElementById(\"divStory\" + tablen[i]).style.width = storywidgetWidth + \"px\";");
document.writeln("        }");
document.writeln("          document.getElementById(\"storyTabDiv\").style.width = storywidgetWidth + \"px\";");
document.writeln("          document.getElementById(\"storybodyConteiner\").style.width = storywidgetWidth + \"px\";");
document.writeln("          var i=4;");
document.writeln("        var moz = (typeof document.implementation != 'undefined') && (typeof document.implementation.createDocument != 'undefined');");
document.writeln("        var ie = (typeof window.ActiveXObject != 'undefined');");
document.writeln("            if (moz) {");
document.writeln("              for (i = 0; i < tablen.length; i++) {");
document.writeln("                 document.getElementById(\"storyfooterDiv\" + tablen[i]).style.width = parseInt(storywidgetWidth) + parseInt(2) + \"px\";");
document.writeln("              }");
document.writeln("            } else if (ie) {");
document.write("                if(Checkfun())");
document.writeln("              {");
document.writeln("                for (i = 0; i < tablen.length; i++) {");
document.writeln("                  document.getElementById(\"storyfooterDiv\" + tablen[i]).style.width = parseInt(storywidgetWidth) + parseInt(2) + \"px\";");
document.writeln("                }");
document.writeln("              }");
document.writeln("              else");
document.writeln("              {");
document.writeln("                for (i = 0; i < tablen.length; i++) {");
document.writeln("                  document.getElementById(\"storyfooterDiv\" + tablen[i]).style.width = parseInt(storywidgetWidth) + \"px\";");
document.writeln("                }");
document.writeln("              }");
document.writeln("            }");
document.writeln("      }");
document.writeln("");
document.writeln("      function clearStoryTabs(tabID) {");
document.writeln("         document.getElementById(tabID).style.display = \"none\";");
document.writeln("      }");
document.writeln("");
document.writeln("");
document.writeln("");
document.writeln("      function visibleStoryTabs(tabid){");
document.writeln("        document.getElementById(tabid).style.display = \"\";");
document.writeln("      }");
document.writeln("");
document.writeln("      function setStoryTabSelected(tabId){");
document.writeln("          var i=1;");
document.writeln("          var tablen= storyRssName.split(':');");
document.writeln("           for (i = 0; i < tablen.length; i++) {");
document.writeln("              if(('storytab' + tablen[i]) == tabId)");
document.writeln("              {");
document.writeln("                 document.getElementById(tabId).className = \"BankrateFCC_tab BankrateFCC_selected\";");
document.writeln("                  visibleStoryTabs('divStory' + tablen[i]);");
document.writeln("                  visibleStoryTabs('storyfooterDiv' + tablen[i]);");
document.writeln("              }");
document.writeln("              else");
document.writeln("              {");
document.writeln("                 document.getElementById('storytab' + tablen[i]).className = \"BankrateFCC_tab\";");
document.writeln("                 clearStoryTabs('divStory' + tablen[i]);");
document.writeln("                 clearStoryTabs('storyfooterDiv' + tablen[i]);");
document.writeln("              }");
//document.writeln("              i--;");
document.writeln("          }");
document.writeln("      }");
document.writeln("");
document.writeln("      function storyShowTabs(values){");
document.writeln("          var tablen= values.split(':');");
document.writeln("          var i=0;");
document.writeln("          if(tablen.length > 1){");
document.writeln("              document.getElementById(\"storyTabDiv\").style.display =\"\";");
document.writeln("              var i = tablen.length - 1;");
document.writeln("              while(i >= 0){");
document.writeln("                  visibleStoryTabs('storytab' + tablen[i]);");
document.writeln("                  i--;");
document.writeln("              }");
document.writeln("          }");
document.writeln("          else if(tablen.length == 1){");
document.writeln("              clearStoryTabs('storytab' + tablen[0]);");
document.writeln("              document.getElementById(\"storyTabDiv\").style.display =\"none\";");
document.writeln("          }");
document.writeln("          fetchStoryRSS('storytab' + storyselectedTab);");
document.writeln("      }");
document.writeln("");
document.writeln("");
document.writeln("      function setStoryColor(imgID) {");
document.writeln("          var tablen= storyRssName.split(':');");
document.writeln("          var i=1;");
document.writeln("          if (imgID == \"1\") {");
document.writeln("              for (i = 0; i < tablen.length; i++) {");
document.writeln("                document.getElementById(\"divStory\" + tablen[i]).className  = \"BankrateFCC_story-boxhead-container-small\" + \" BankrateFCC_story-blue-border\";");
document.writeln("                document.getElementById(\"storyfooterDiv\" + tablen[i]).className  = \"BankrateFCC_story-footer-container-small\" + \" BankrateFCC_story-dkblue\";");
document.writeln("              }");
document.writeln("              document.getElementById(\"storybodyConteiner\").className  =\"BankrateFCC_story-body-container-small\" + \" BankrateFCC_story-blue-border\";");
document.writeln("              document.getElementById(\"storyTabDiv\").className  =\"BankrateFCC_story-tabs-container-small\" + \" BankrateFCC_story-blue-border\";");
document.writeln("              document.getElementById(\"storylistbody\").className  =\"BankrateFCC_list-body\" + \" BankrateFCC_story-blue\";");
document.writeln("              document.getElementById(\"storyulDiv\").className  = \"BankrateFCC_story-tabstyle1\";");
document.writeln("          }");
document.writeln("          if (imgID == \"2\") {");
document.writeln("              for (i = 0; i < tablen.length; i++) {");
document.writeln("                document.getElementById(\"divStory\" + tablen[i]).className  = \"BankrateFCC_story-boxhead-container-small\" + \" BankrateFCC_story-orange-border\";");
document.writeln("                document.getElementById(\"storyfooterDiv\" + tablen[i]).className  = \"BankrateFCC_story-footer-container-small\" + \" BankrateFCC_story-dkorange\";");
document.writeln("              }");
document.writeln("              document.getElementById(\"storybodyConteiner\").className  =\"BankrateFCC_story-body-container-small\" + \" BankrateFCC_story-orange-border\";");
document.writeln("              document.getElementById(\"storyTabDiv\").className  =\"BankrateFCC_story-tabs-container-small\" + \" BankrateFCC_story-orange-border\";");
document.writeln("              document.getElementById(\"storylistbody\").className  =\"BankrateFCC_list-body\" + \" BankrateFCC_story-orange\";");
document.writeln("              document.getElementById(\"storyulDiv\").className  = \"BankrateFCC_story-orange-tabstyle1\";");
document.writeln("          }");
document.writeln("          if (imgID == \"3\") {");
document.writeln("              for (i = 0; i < tablen.length; i++) {");
document.writeln("                document.getElementById(\"divStory\" + tablen[i]).className  = \"BankrateFCC_story-boxhead-container-small\" + \" BankrateFCC_story-gray-border\";");
document.writeln("                document.getElementById(\"storyfooterDiv\" + tablen[i]).className  = \"BankrateFCC_story-footer-container-small\" + \" BankrateFCC_story-dkgray\";");
document.writeln("              }");
document.writeln("              document.getElementById(\"storybodyConteiner\").className  =\"BankrateFCC_story-body-container-small\" + \" BankrateFCC_story-gray-border\";");
document.writeln("              document.getElementById(\"storyTabDiv\").className  =\"BankrateFCC_story-tabs-container-small\" + \" BankrateFCC_story-gray-border\";");
document.writeln("              document.getElementById(\"storylistbody\").className  =\"BankrateFCC_list-body\" + \" BankrateFCC_story-gray\";");
document.writeln("              document.getElementById(\"storyulDiv\").className  = \"BankrateFCC_story-gray-tabstyle1\";");
document.writeln("          }");
document.writeln("          if (imgID == \"4\") {");
document.writeln("              for (i = 0; i < tablen.length; i++) {");
document.writeln("                 document.getElementById(\"divStory\" + tablen[i]).className  = \"BankrateFCC_story-boxhead-container-small\" + \" BankrateFCC_story-green-border\";");
document.writeln("                 document.getElementById(\"storyfooterDiv\" + tablen[i]).className  = \"BankrateFCC_story-footer-container-small\" + \" BankrateFCC_story-dkgreen\";");
document.writeln("              }");
document.writeln("              document.getElementById(\"storybodyConteiner\").className  =\"BankrateFCC_story-body-container-small\" + \" BankrateFCC_story-green-border\";");
document.writeln("              document.getElementById(\"storyTabDiv\").className  =\"BankrateFCC_story-tabs-container-small\" + \" BankrateFCC_story-green-border\";");
document.writeln("              document.getElementById(\"storylistbody\").className  =\"BankrateFCC_list-body\" + \" BankrateFCC_story-green\";");
document.writeln("              document.getElementById(\"storyulDiv\").className  = \"BankrateFCC_story-green-tabstyle1\";");
document.writeln("          }");
document.writeln("      }");
document.writeln("");
document.writeln("");
document.writeln("    function getCookie(c_name)");
document.writeln("    {");
document.writeln("        if (document.cookie.length>0)");
document.writeln("          {");
document.writeln("          c_start=document.cookie.indexOf(c_name + \"=\");");
document.writeln("          if (c_start!=-1)");
document.writeln("            {");
document.writeln("            c_start=c_start + c_name.length+1;");
document.writeln("            c_end=document.cookie.indexOf(\";\",c_start);");
document.writeln("            if (c_end==-1) c_end=document.cookie.length;");
document.writeln("            return unescape(document.cookie.substring(c_start,c_end));");
document.writeln("            }");
document.writeln("          }");
document.writeln("        return \"\";");
document.writeln("    }");
document.writeln("");
document.writeln("    function setCookie(c_name,value)");
document.writeln("    {");
document.writeln("        document.cookie=c_name+ \"=\" +escape(value);");
document.writeln("    }");
document.writeln("");
document.writeln("    function checkCookie()");
document.writeln("    {");
document.writeln("    username=getCookie('username');");
document.writeln("    if (username!=null && username == \"br\")");
document.writeln("      {");
document.writeln("      username=\"brc\";");
document.writeln("      setCookie('username',username);");
document.writeln("      }");
document.writeln("    else");
document.writeln("      {");
document.writeln("      username=\"br\";");
document.writeln("      if (username!=null && username!=\"\")");
document.writeln("        {");
document.writeln("        setCookie('username',username);");
document.writeln("        location.reload(true);");
document.writeln("        }");
document.writeln("      }");
document.writeln("    }");
document.writeln("      function Checkfun(){");
document.writeln("        var i=0;");
document.writeln("        var strToFind =\/DOCTYPE\/;");
document.writeln("        var docCount = 0;");
document.writeln("        var docChekStatus = false;");
document.writeln("        var flagt_comment = false;");
document.writeln("        var loopexec = true;");
document.writeln("        for(i=0; i< document.all.length; i++)");
document.writeln("        {");
document.writeln("          if(loopexec){");
document.writeln("            if(document.all[i].text != null)");
document.writeln("            {");
document.writeln("                var nVal = document.all[i].text;");
document.writeln("                var substr = nVal.substring('1', '4');");
document.writeln("                  if(substr != \"\" && substr == '!--')");
document.writeln("                    flagt_comment =true;");
document.writeln("");
document.writeln("                if(findPos != -1)");
document.writeln("                {");
document.writeln("                  var substr1 = nVal.substring('1', '4');");
document.writeln("                  if(substr1 != \"\" && substr1 != '!--'){");
document.writeln("                    var findPos = nVal.search(strToFind);");
document.writeln("                    var posd = nVal.substring(parseInt(findPos - 1), findPos);");
document.writeln("                    if(posd == '!')");
document.writeln("                    {");
document.writeln("                      docCount = parseInt(docCount) + 1;");
document.writeln("                      loopexec = false;");
document.writeln("                    }");
document.writeln("                  }");
document.writeln("                }");
document.writeln("            }");
document.writeln("          }");
document.writeln("        }");
document.writeln("        if(docCount >= 1 && !flagt_comment)");
document.writeln("           docChekStatus = true;");
document.writeln("        return docChekStatus;");
document.writeln("      }");
document.writeln("</script>");
document.writeln("</head>");
document.writeln("<body>");
document.writeln("    <div id=\"storyTabDiv\" class=\"BankrateFCC_story-tabs-container-small\" style=\"display:none\">");
document.writeln("      <ul id=\"storyulDiv\"  class=\"BankrateFCC_story-tabstyle1\">");
document.writeln("");
document.writeln("        <li style=\"DISPLAY: none\" id=\"storytab1\" class=\"BankrateFCC_tab\" >");
document.writeln("          <a href=\"javascript: onclick=fetchStoryRSS('storytab1')\">CD </a>");
document.writeln("        </li>");
document.writeln("");
document.writeln("        <li style=\"DISPLAY: none\" id=\"storytab2\" class=\"BankrateFCC_tab\">");
document.writeln("          <a href=\"javascript: onclick=fetchStoryRSS('storytab2')\">Mortgages</a>");
document.writeln("        </li>");
document.writeln("");
document.writeln("        <li style=\"DISPLAY: none\" id=\"storytab3\" class=\"BankrateFCC_tab\">");
document.writeln("          <a href=\"javascript: onclick=fetchStoryRSS('storytab3')\">Credit Cards</a>");
document.writeln("        </li>");
document.writeln("");
document.writeln("        <li style=\"DISPLAY: none\" id=\"storytab4\" class=\"BankrateFCC_tab\">");
document.writeln("          <a href=\"javascript: onclick=fetchStoryRSS('storytab4')\">Refinance</a>");
document.writeln("        </li>");
document.writeln("      </ul>");
document.writeln("    </div>");
document.writeln("    <div id=\"storybodyConteiner\" class=\"BankrateFCC_story-body-container-small\" style=\"background-color:White\">");
document.writeln("      <div id=\"storylistbody\" class=\"BankrateFCC_list-body\">");
document.writeln("        <ul id=\"storyItems\">");
document.writeln("");
document.writeln("        </ul>");
document.writeln("      </div>");
document.writeln("    </div>");
document.writeln("");
document.writeln("</body>");
document.writeln("</html>");
document.writeln("");
