//
//   
//    Copyright     :   Confidential and Proprietary. 
//                      Copyright RISI, 2007
//                                      
//    File name     :   home.js
//   
//    Description   :   Javascript used in Home page 
//   
//    Author        :   Cognizant
//   
//    Date          :   Sep 25, 2007
//    
//    Modification History      
//   
//    Revision No.      Author              Date                Comments
//      
//   
//
var isIE = navigator.userAgent.toLowerCase().indexOf("msie") > -1;
var isMoz = document.implementation && document.implementation.createDocument;
function priceIndex(){
            var comboValue;
            var rad_val;
            var priceindex = document.getElementById("priceindex");
            var selIndex = document.home.category.selectedIndex;
            var contxtPath=document.home.contextPath.value;
            comboValue = document.home.category.options[selIndex].value;
            for (var i=0; i < document.home.price.length; i++){
               if (document.home.price[i].checked){
                    rad_val = document.home.price[i].value;
              }
            }
            document.home.price[1].disabled=false;
          document.home.price[2].disabled=false;            
            if (comboValue=="Pulp & Paper - Graphic Paper" && rad_val=="NORTH AMERICA"){
                        priceindex.setAttribute("src", "/images/news_commentary/priceindex/Risi-North-America-Graphic-Paper-Price-Index.jpg");
                        
            } 
            else if(comboValue=="Pulp & Paper - Graphic Paper" && rad_val=="ASIA"){
                        priceindex.setAttribute("src", "/images/news_commentary/priceindex/Risi-Asia-Graphic-Paper-Price-Index.jpg");
            }
            else if(comboValue=="Pulp & Paper - Graphic Paper" && rad_val=="EUROPE"){
                        priceindex.setAttribute("src", "/images/news_commentary/priceindex/Risi-Europe-Graphic-Paper-Price-Index.jpg");
            }
            else if(comboValue=="Pulp & Paper - Recovered Paper" && rad_val=="NORTH AMERICA"){
                        priceindex.setAttribute("src", "/images/news_commentary/priceindex/Risi-North-America-Recovered-Paper-Price-Index.jpg");
            }
            else if(comboValue=="Pulp & Paper - Recovered Paper" && rad_val=="ASIA"){
                        priceindex.setAttribute("src", "/images/news_commentary/priceindex/Risi-Asia-Recovered-Paper-Price-Index.jpg");
            }
            else if(comboValue=="Pulp & Paper - Recovered Paper" && rad_val=="EUROPE"){
                        priceindex.setAttribute("src", "/images/news_commentary/priceindex/Risi-Europe-Recovered-Paper-Price-Index.jpg");
            }
            else if(comboValue=="Pulp & Paper - Paper Packaging" && rad_val=="NORTH AMERICA"){
                        priceindex.setAttribute("src", "/images/news_commentary/priceindex/Risi-North-America-Packaging-Paper-Price-Index.jpg");
            }
            else if(comboValue=="Pulp & Paper - Paper Packaging" && rad_val=="ASIA"){
                        priceindex.setAttribute("src", "/images/news_commentary/priceindex/Risi-Asia-Packaging-Paper-Price-Index.jpg");
            }
            else if(comboValue=="Pulp & Paper - Paper Packaging" && rad_val=="EUROPE"){
                        priceindex.setAttribute("src", "/images/news_commentary/priceindex/Risi-Europe-Packaging-Paper-Price-Index.jpg");
            }
            else if(comboValue=="Pulp & Paper - Pulp" && rad_val=="NORTH AMERICA"){
                     
                     priceindex.setAttribute("src", "/images/news_commentary/priceindex/Risi-North-America-Pulp-Price-Index.jpg");
            }
            else if(comboValue=="Pulp & Paper - Pulp" && rad_val=="ASIA"){
                        priceindex.setAttribute("src","/images/news_commentary/priceindex/Risi-Asia-Pulp-Price-Index.jpg");
            }
            else if(comboValue=="Pulp & Paper - Pulp" && rad_val=="EUROPE"){
                        priceindex.setAttribute("src", "/images/news_commentary/priceindex/Risi-Europe-Pulp-Price-Index.jpg");
            }else if(comboValue=="Crow's Lumber and Structural Panel Composite" && rad_val=="NORTH AMERICA"){
                        priceindex.setAttribute("src", "/images/news_commentary/priceindex/home_lumber.jpg");
                        document.home.price[1].disabled=true;
                        document.home.price[2].disabled=true;
            }
            else if(comboValue=="Crow's Lumber and Structural Panel Composite" && rad_val=="ASIA"){
                        priceindex.setAttribute("src", "/images/news_commentary/priceindex/home_lumber.jpg");
                        document.home.price[0].checked=true;
                        document.home.price[1].disabled=true;
                        document.home.price[2].disabled=true;
            }
            else if(comboValue=="Crow's Lumber and Structural Panel Composite" && rad_val=="EUROPE"){
                        priceindex.setAttribute("src", "/images/news_commentary/priceindex/home_lumber.jpg");
                      document.home.price[0].checked=true;
                        document.home.price[1].disabled=true;
                        document.home.price[2].disabled=true;
            }else if(comboValue=="Southern Pine Stumpage" && rad_val=="NORTH AMERICA"){
                        priceindex.setAttribute("src", "/images/news_commentary/priceindex/home_pine.jpg");
                        document.home.price[1].disabled=true;
                        document.home.price[2].disabled=true;
            }
            else if(comboValue=="Southern Pine Stumpage" && rad_val=="ASIA"){
                        priceindex.setAttribute("src", "/images/news_commentary/priceindex/home_pine.jpg");
                      document.home.price[0].checked=true;
                        document.home.price[1].disabled=true;
                        document.home.price[2].disabled=true;
            }
            else if(comboValue=="Southern Pine Stumpage" && rad_val=="EUROPE"){
                        priceindex.setAttribute("src", "/images/news_commentary/priceindex/home_pine.jpg");
                      document.home.price[0].checked=true;
                        document.home.price[1].disabled=true;
                        document.home.price[2].disabled=true;
            }
      }
      
      
      
      
      function getdata(val,ulId)
      {
            
            document.getElementById("pulptitle").innerHTML="";
            
            var contxtPath=document.home.contextPath.value;
            document.getElementById("woodtitle").innerHTML="";
            document.getElementById("latestPrices").style.visibility='hidden';
            //document.getElementById("latestPrices").innerHTML="";
            var breakValue;
            if(isMoz)
            {
                  document.getElementById("strdate").textContent="";
                  document.getElementById("wtdate").textContent="";
                  breakValue="<br/>";
            }
            else
            {
                  document.getElementById("strdate").innerText="";
                  document.getElementById("wtdate").innerText="";
                  breakValue="";
            }
            if(val=="Prices & Market Reports")
            {     alert("inside second Prices & Market Reports");
                  val="Prices & Markets";
                  document.getElementById("toptitle").innerHTML="<h2>Markets & Prices<h2>";
                  
                  document.getElementById("pulp0").innerHTML="<span><p>To give you an objective view of market activity, RISI reports market price data. The economists and editors who gather prices are experts in price discovery, using a variety of methods best suited for each particular commodity.</p></span>";
                  
                  document.getElementById("pulp1").innerHTML=breakValue+"<span><p>In many markets, RISI prices are considered essential tools of the trade for conducting transactions</p></span>";
                  document.getElementById("pulp2").innerHTML=breakValue+"<span><p class=globalnav><img src=/community/images/organge_arrow.jpg><a href='http://www.risiinfo.com/risi-store/do/product/list?pcId=29&rootId=13'>&nbsp;&nbsp;See all price products</p></a></span>";
                  
                  document.getElementById("pulp3").innerHTML=breakValue+"<span><p class=globalnav><a href='/pages/abo/methodology/price/'>Details on our price reporting methodology</p></a></span>";
                  document.getElementById("pulp4").innerHTML=breakValue+"<span><p><b>RISI covers prices for the following industries:</b></p></span><br/>"+
                  "<ul class=default_ul><li><p><img src=/community/images/organge_arrow.jpg><a href='http://www.risiinfo.com/pages/product/pulp-paper/market-prices.jsp'>&nbsp;&nbsp;Pulp and Paper</a></p></li>"+
                  "<li><p><img src=/community/images/organge_arrow.jpg><a href='http://www.risiinfo.com/pages/product/wood/market-prices.jsp'>&nbsp;&nbsp;Wood Products</a></p></li>"+
                  "<li><p><img src=/community/images/organge_arrow.jpg><a href='http://www.risiinfo.com/pages/product/timber/market-prices.jsp'>&nbsp;&nbsp;Timber</a></p></li>"+
                  "<li><p><img src=/community/images/organge_arrow.jpg><a href='http://www.risiinfo.com/product/tissue/breaking-news'>&nbsp;&nbsp;Tissue</a></p></li>"+
                  "<li><p><img src=/community/images/organge_arrow.jpg><a href='http://www.nonwovens.com/newsletter'>&nbsp;&nbsp;Nonwovens</a></p></li></ul>";
            
                  for(i=5;i<5;i++)
                  {
                        document.getElementById("pulp"+i).innerHTML="";
                  }
            }
            if(val=="Forecast Analysis")
            {
                  val="Forecasts & Analysis";
                  document.getElementById("toptitle").innerHTML="<h2>"+val+"<h2>";
                  document.getElementById("pulp0").innerHTML="<span><p>RISI economists produce forecasts and analysis that are widely trusted to support critical business decisions, from investment and resource allocation to when to buy or sell. Here are several reasons why RISI forecasts are well-respected throughout the industry:</p></span>";
                  document.getElementById("pulp1").innerHTML=breakValue+"<span><p><B class=normaltxtbold>Experience:</B> RISI has more than 25 years of experience in analysis and forecasting for the global forest products industry.</p></span>"; 
                  
                  document.getElementById("pulp2").innerHTML=breakValue+"<span><p><B class=normaltxtbold>Transparency:</B> We clearly outline our assumptions so you can thoroughly understand our forecasts and evaluate risk factors involved.<p></span>";
                  
                  document.getElementById("pulp3").innerHTML=breakValue+"<span><p><B class=normaltxtbold>Sophisticated models:</B> Our forecasts capture complex interactions and substitution effects across the industry in response to shifts in technology, government regulations, economic growth and consumer preferences.<p></span>";
                  document.getElementById("pulp4").innerHTML=breakValue+"<span><p><B class=normaltxtbold>Integration:</B> Each RISI forecast focuses on a particular grade and region but is dynamically linked with all other forecasts so it reflects the effects of developments in all related markets.</p><br/><p><B class=normaltxtbold>Independence:</B> Our forecasts are not subject to conflicts of interest inherent in forecasts from other sources that have a stake in the outcome of the analysis.</p><br/>"+
                  "<p class=globalnav><img src=/community/images/organge_arrow.jpg><a href='http://www.risiinfo.com/risi-store/do/product/list?pcId=30&rootId=13'>&nbsp;&nbsp;See all forecast and analysis products<a></p><br/><p class=globalnav><a href='/pages/abo/methodology/forecasting/'>Details on our forecasting methodology</a></p></span><br/><span><p><b>RISI produces forecasts and analysis for the following industries:</b></p></span><br/>"+
                  "<ul class='homecontent_ul'><li><p><img src=/community/images/organge_arrow.jpg><a href='http://www.risiinfo.com/pages/product/pulppaper/forecast-analysis.jsp'>&nbsp;&nbsp;Pulp and Paper</a></p></li>"+
                  "<li><p><img src=/community/images/organge_arrow.jpg><a href='http://www.risiinfo.com/pages/product/wood/forecast-analysis.jsp'>&nbsp;&nbsp;Wood Products</a></p></li>"+
                  "<li><p><img src=/community/images/organge_arrow.jpg><a href='http://www.risiinfo.com/pages/product/timber/forecast-analysis.jsp'>&nbsp;&nbsp;Timber</a></p></li>"+
                  "<li><p><img src=/community/images/organge_arrow.jpg><a href='http://www.risiinfo.com/risi-store/do/product/list?pcId=25&rootId=12&filterCat_13=30'>&nbsp;&nbsp;Tissue</a></p></li>";
                  
            
            }
            if(val=="Historical Data")
            {
                  val="Historical Data";
                  document.getElementById("toptitle").innerHTML="<h2>"+val+"<h2>";
                  document.getElementById("pulp0").innerHTML=breakValue+"<span><p>RISI compiles and edits an enormous quantity of historical data that can be used to support your own analysis. Concepts covered include consumption, production, capacity, prices, production costs, imports, exports and inventories.</p>";
                  document.getElementById("pulp1").innerHTML=breakValue+"<span><p>We collect data from governments and associations. We also offer value-added data, which is data that is balanced, cross-checked and standardized by RISI economists. You get harmonized data that is consistent, easily comparable and reliable.</p></span>";
                  document.getElementById("pulp2").innerHTML=breakValue+"<span class=globalnav><img src=/community/images/organge_arrow.jpg><a href='http://www.risiinfo.com/risi-store/do/product/list?pcId=31&rootId=13'>&nbsp;&nbsp;See all historical data products</a><span>";
                  document.getElementById("pulp3").innerHTML="<br><span><p><b>Market data are available for these industries:</b></p></span><br/>"+
                        "<ul><li><p><img src=/community/images/organge_arrow.jpg><a href='http://www.risiinfo.com/risi-store/do/product/list?pcId=21&rootId=12&filterCat_13=31'>&nbsp;&nbsp;Pulp and Paper</a></p></li>"+
                        "<li><p><img src=/community/images/organge_arrow.jpg><a href='http://www.risiinfo.com/pages/product/wood/historical-data.jsp'>&nbsp;&nbsp;Wood Products</a></p></li>"+
                        "<li><p><img src=/community/images/organge_arrow.jpg><a href='http://www.risiinfo.com/pages/product/timber/historical-data.jsp'>&nbsp;&nbsp;Timber</a></p></li>"+
                        "<li><p><img src=/community/images/organge_arrow.jpg><a href='http://www.risiinfo.com/risi-store/do/product/list?pcId=25&rootId=12&filterCat_13=31'>&nbsp;&nbsp;Tissue</a></p></li></ul>";
                  for(i=4;i<5;i++)
                  {
                        document.getElementById("pulp"+i).innerHTML="";
                  }
            }
            if(val=="Mill Intelligence")
            {
                  val="Mill Intelligence";
                  document.getElementById("toptitle").innerHTML="<h2>"+val+"<h2>";
                  
                  document.getElementById("pulp0").innerHTML="<span>From quick reference to in-depth cost benchmarking studies, RISI offers a full range of mill information. For producers, RISI mill intelligence products offer a reliable source of competitive intelligence. For suppliers to the industry, RISI mill intelligence products are a map of prospective customers and their needs.</span>";
                  document.getElementById("pulp1").innerHTML="<br><span><p class=normaltxtbold><img src=/community/images/organge_arrow.jpg><B>&nbsp;&nbsp;<a href='/pages/benchmarking/'>Cost Benchmarking</a></B></p>"+
                    "<p>Product manufacturing cost data for more than 1,100 paper mills worldwide and all major grades. Available in"+"grade-specific studies or in the powerful Analytical Cornerstone?? database.</p>"+ 
                     "<span>";
                  document.getElementById("pulp2").innerHTML=breakValue+"<span><p class=normaltxtbold><img src=/community/images/organge_arrow.jpg>&nbsp;&nbsp;<a href='/pages/lp/'><B>Lockwood-Post Directories</B></a></p>"+
                        "<p>For more than a century, the indispensable guide to pulp and paper mills and companies???providing an accurate,"+ "comprehensive reference to personnel, mill equipment, capacity, furnish and more.</p>"+ 
                        "<span>";
                  document.getElementById("pulp3").innerHTML=breakValue+"<p class=normaltxtbold><img src=/community/images/organge_arrow.jpg><B>&nbsp;&nbsp;<a href='http://www.risiinfo.com/risi-store/do/product/list?pcId=48&parentId=32&rootId=13'>Capacity Reports</a></B></p>"+
                        "<p>These annual reports provide historical, planned and assumed capacity by mill.</p>"; 
                        
                  
                  document.getElementById("pulp4").innerHTML=breakValue+"<p class=normaltxtbold><img src=/community/images/organge_arrow.jpg><B>&nbsp;&nbsp;<a href='http://www.risiinfo.com/risi-store/do/product/detail?id=8923&pcId=47&parentId=32&rootId=13'>Global Mill Projects Database</a></B></p>"+
                        "This web-based tool has information on thousands of projects worldwide and is continuously updated.</p><br/><span><p>"+breakValue+"<b>RISI produces mill intelligence products for the following industries:</b></p></span><br/>"+
                        "<ul><li><p><img src=/community/images/organge_arrow.jpg><a href='http://www.risiinfo.com/risi-store/do/product/list?pcId=21&rootId=12&filterCat_13=32'>&nbsp;&nbsp;Pulp and Paper</a></p></li>"+
                        "<li><p><img src=/community/images/organge_arrow.jpg><a href='http://www.risiinfo.com/pages/product/wood/mill-cost-benchmarking.jsp'>&nbsp;&nbsp;Wood Products</a></p></li>"+
                        "<li><p><img src=/community/images/organge_arrow.jpg><a href='http://www.risiinfo.com/pages/product/tissue/mill-intelligence.jsp'>&nbsp;&nbsp;Tissue</a></p></li></ul>";
                         
            }
            
            
            /*for(i=1;i<5;i++)
            {
                  document.getElementById("pulp"+i).innerHTML="";
            }*/
            for(j=0;j<3;j++)
            {
                  document.getElementById("wood"+j).innerHTML="";
            }
      }
      
  function getSelect(e,ulId)
  { 
            var isIE = navigator.userAgent.toLowerCase().indexOf("msie") > -1;
          var isMoz = document.implementation && document.implementation.createDocument;
            var contxtPath=document.home.contextPath.value;
            
            if(e=="news")
            {
                  
                  var url=document.home.URL.value;
                  document.getElementById(ulId).childNodes[0].className = "active";
                  document.getElementById(ulId).childNodes[0].innerHTML = "News";               
                  document.getElementById(ulId).childNodes[1].className = "";
                  document.getElementById(ulId).childNodes[2].className = "";
                  document.getElementById(ulId).childNodes[3].className = "";
                  document.getElementById(ulId).childNodes[4].className = "";
                  //document.getElementById("news").className="active";
                  //document.getElementById("news").innerHTML="News";
                  //document.getElementById("Prices").className="";
                  //document.getElementById("Forecast").className="";
                  //document.getElementById("Historical").className="";
                  //document.getElementById("Mill").className="";
                  //document.getElementById("tableft").className="tableftactiveSub";
                  //document.getElementById("tabright").className="tabrightSubInactive";
                  document.getElementById("ppnews").className="homecontent_innerdivleft";
                  document.getElementById("arrow").className="homecontent_ul";
                  document.getElementById("priceindex").src="/images/news_commentary/priceindex/Risi-North-America-Graphic-Paper-Price-Index.jpg";
                  
                  priceIndexRand("home");

                  document.getElementById(ulId).childNodes[1].innerHTML="<a href=javascript:getdata('Prices&MarketReports',ulId)>Markets&nbsp;&amp;&nbsp;Prices</a>";
                  document.getElementById(ulId).childNodes[2].innerHTML="<a href=javascript:getdata('ForecastAnalysis',ulId)>Forecasts&nbsp;&amp;&nbsp;Analysis</a>";
                  document.getElementById(ulId).childNodes[3].innerHTML="<a href=javascript:getdata('HistoricalData',ulId)>Historical Data</a>";
                  //Bug Id 62039 Starts
                  document.getElementById(ulId).childNodes[4].innerHTML="<a  style=' line-height: 13px;  margin: 0;'  href=javascript:getdata('MillIntelligence',ulId)>Mill Intelligence<br/>Cost Benchmarking</a>";
                  //Bug Id 62039 Ends
                  document.getElementById("toptitle").innerHTML="<p class='padleft1'>Top News<span class='headingHomeRight'>Latest Price Indices</span></p>";
                  document.getElementById("woodtitle").innerHTML="Wood &amp; Timber News";
                  document.getElementById("pulptitle").innerHTML="Pulp & Paper News";
                  document.getElementById("tarilId").innerHTML="<a href='http://www.risiinfo.com/registration/do/freetrial?source=3MHOMGK' target='_blank'><img src='/community/images/Free-Trial_1C.jpg' align='absmiddle' border='0'/></a>";
                  document.getElementById("tarilId1").innerHTML="<a href='https://www.pubservice.com/Subnew.aspx?PC=WT&PK=MHOMGK&OL=1' target='_blank'><img src='/community/images/Free-Trial_1C.jpg' align='absmiddle' border='0'/></a>";
                  document.getElementById("latestPrices").style.visibility='visible';
                        for(i=0;i < 5;i++)
                        {
                              ww='ppValue'+i;
                            object1=document.getElementsByName(ww);
                            ppTitle=object1[0].value;
                        
                              uu='ppUrl'+i;
                            object2=document.getElementsByName(uu);
                            ppUrl=object2[0].value;
                              if(url.length == 0)
                              {
                                    document.getElementById("pulp"+i).innerHTML="<a href="+ppUrl+">"+ppTitle+"</a>";
                              }
                              else
                              {
                                    document.getElementById("pulp"+i).innerHTML="<a href="+ppUrl+">"+ppTitle+"</a>";
                              }
                        }
                        for(j=0;j < 3;j++)
                        {
                              ww='wtValue'+j;
                            object1=document.getElementsByName(ww);
                            wtTitle=object1[0].value;
                        
                              uu='wtUrl'+j;
                            object2=document.getElementsByName(uu);
                            wtUrl=object2[0].value;
                              if(url.length == 0)
                              {
                                    document.getElementById("wood"+j).innerHTML="<a href="+wtUrl+">"+wtTitle+"</a>";
                              }
                              else
                              {                             
                                    document.getElementById("wood"+j).innerHTML="<a href="+wtUrl+">"+wtTitle+"</a>";
                              }
                        }
                  
            }
            if(e=="Prices & Market Reports")
            {
                  alert("inside Prices & Market Reports");
                  document.getElementById(ulId).childNodes[0].className = "";
                  document.getElementById(ulId).childNodes[1].innerHTML = "Markets&nbsp;&amp;&nbsp;Prices";         
                  document.getElementById(ulId).childNodes[1].className = "active";
                  document.getElementById(ulId).childNodes[2].className = "";
                  document.getElementById(ulId).childNodes[3].className = "";
                  document.getElementById(ulId).childNodes[4].className = "";
                  //document.getElementById("news").className="";
                  //document.getElementById("Prices").className="active";
                  //document.getElementById("Prices").innerHTML="Markets&nbsp;&amp;&nbsp;Prices";
                  //document.getElementById("Forecast").className="";
                  //document.getElementById("Historical").className="";
                  //document.getElementById("Mill").className="";
                  //document.getElementById("tableft").className="tableftInactiveSub";
                  //document.getElementById("tabright").className="tabrightSubInactive";
                  document.getElementById("ppnews").className="homecontent_innerdivleftBig";
                  document.getElementById("tarilId").innerHTML="";
                  document.getElementById("tarilId1").innerHTML="";
                  document.getElementById("priceindex").src="";
                  alert("before"+document.getElementById("homecontent_innerdivright_border"));
                  document.getElementById("homecontent_innerdivright_border").innerHTML="";
                  alert("after");
                  document.getElementById("arrow").className="homecontent_ulBlank";
                  document.getElementById(ulId).childNodes[0].innerHTML="<a href=javascript:getSelect('news',ulId)>News</a>";
                  document.getElementById(ulId).childNodes[2].innerHTML="<a href=javascript:getdata('ForecastAnalysis',ulId)>Forecasts&nbsp;&amp;&nbsp;Analysis</a>";
                  document.getElementById(ulId).childNodes[3].innerHTML="<a href=javascript:getdata('HistoricalData',ulId)>Historical Data</a>";
                  //Bug Id 62039 Starts
                  document.getElementById(ulId).childNodes[4].innerHTML="<a  href=javascript:getdata('MillIntelligence',ulId)>Mill Intelligence<br/>Cost Benchmarking</a>";
                  //Bug Id 62039 Ends
                  getdata(e,ulId);
            }
            if(e=="Forecast Analysis")
            {
            
                  document.getElementById(ulId).childNodes[0].className = ""; 
                  document.getElementById(ulId).childNodes[1].className = "active";
                  document.getElementById(ulId).childNodes[2].className = "active";
                  document.getElementById(ulId).childNodes[2].innerHTML = "Forecasts&nbsp;&amp;&nbsp;Analysis";     
                  document.getElementById(ulId).childNodes[3].className = "";
                  document.getElementById(ulId).childNodes[4].className = "";
                  //document.getElementById("news").className="";
                  //document.getElementById("Prices").className="";
                  //document.getElementById("Forecast").className="active";
                  //document.getElementById("Historical").className="";
                  //document.getElementById("Mill").className="";
                  //document.getElementById("tableft").className="tableftInactiveSub";
                  //document.getElementById("tabright").className="tabrightSubInactive";
                  document.getElementById("ppnews").className="homecontent_innerdivleftBig";
                  document.getElementById("arrow").className="homecontent_ulBlank";
                  document.getElementById("tarilId").innerHTML="";
                  document.getElementById("tarilId1").innerHTML="";
                  document.getElementById("homecontent_innerdivright_border").innerHTML="";
                  document.getElementById("priceindex").src="";
                  alert("before");
                  alert(document.getElementById(ulId).childNodes[2].innerHTML);                 
                  alert("after");
                  document.getElementById(ulId).childNodes[0].innerHTML="<a href=javascript:getSelect('news',ulId)>News</a>";
                  document.getElementById(ulId).childNodes[1].innerHTML="<a href=javascript:getdata('Prices&MarketReports',ulId)>Markets&nbsp;&amp;&nbsp;Prices</a>";
                  document.getElementById(ulId).childNodes[3].innerHTML="<a href=javascript:getdata('HistoricalData',ulId)>Historical Data</a>";
                  //Bug Id 62039 Starts
                  document.getElementById(ulId).childNodes[4].innerHTML="<a  style=' line-height: 13px;  margin: 0;' href=javascript:getdata('MillIntelligence',ulId)>Mill Intelligence<br/>Cost Benchmarking</a>";
                  //Bug Id 62039 Ends
                  getdata(e,ulId);
                  
            }
            if(e=="Historical Data")
            {
                  document.getElementById(ulId).childNodes[0].className="";
                  document.getElementById(ulId).childNodes[1].className="";
                  document.getElementById(ulId).childNodes[2].className="";
                  document.getElementById(ulId).childNodes[3].className="active";
                  document.getElementById(ulId).childNodes[4].className="";
                  //document.getElementById("tableft").className="tableftInactiveSub";
                  //document.getElementById("tabright").className="tabrightSubInactive";
                  document.getElementById("ppnews").className="homecontent_innerdivleftBig";
                  document.getElementById("tarilId").innerHTML="";
                  document.getElementById("tarilId1").innerHTML="";
                  document.getElementById("arrow").className="homecontent_ulBlank";
                  document.getElementById("homecontent_innerdivright_border").innerHTML="";
                  document.getElementById("priceindex").src="";
                  
                  document.getElementById(ulId).childNodes[3].innerHTML="Historical Data";
                  document.getElementById(ulId).childNodes[0].innerHTML="<a href=javascript:getSelect('news',ulId)>News</a>";
                  document.getElementById(ulId).childNodes[1].innerHTML="<a href=javascript:getdata('Prices&MarketReports',ulId)>Markets&nbsp;&amp;&nbsp;Prices</a>";
                  document.getElementById(ulId).childNodes[2].innerHTML="<a href=javascript:getdata('ForecastAnalysis',ulId)>Forecasts&nbsp;&amp;&nbsp;Analysis</a>";
                  //Bug Id 62039 Starts
                  document.getElementById(ulId).childNodes[4].innerHTML="<a  style=' line-height: 13px;  margin: 0;' href=javascript:getdata('MillIntelligence',ulId)>Mill Intelligence<br/>Cost Benchmarking</a>";
                  //Bug Id 62039 Ends
                  getdata(e,ulId);
                  
            }
            if(e=="Mill Intelligence")
            {
                  document.getElementById(ulId).childNodes[0].className="";
                  document.getElementById(ulId).childNodes[1].className="";
                  document.getElementById(ulId).childNodes[2].className="";
                  document.getElementById(ulId).childNodes[3].className="";
                  document.getElementById(ulId).childNodes[4].className="active";
                  //document.getElementById("tableft").className="tableftInactiveSub";
                  //document.getElementById("tabright").className="tabrightSubactive";
                  document.getElementById("ppnews").className="homecontent_innerdivleftBig";
                  document.getElementById("tarilId").innerHTML="";
                  document.getElementById("tarilId1").innerHTML="";
                  document.getElementById("arrow").className="homecontent_ulBlank";
                  document.getElementById("homecontent_innerdivright_border").innerHTML="";
                  document.getElementById("priceindex").src="";
                  //Bug Id 62039 Starts
                  document.getElementById(ulId).childNodes[4].innerHTML="Mill Intelligence<br/>Cost Benchmarking";
                  //Bug Id 62039 Ends
                  document.getElementById(ulId).childNodes[0].innerHTML="<a href=javascript:getSelect('news',ulId)>News</a>";
                  document.getElementById(ulId).childNodes[1].innerHTML="<a href=javascript:getdata('Prices&MarketReports',ulId)>Markets&nbsp;&amp;&nbsp;Prices</a>";
                  document.getElementById(ulId).childNodes[2].innerHTML="<a href=javascript:getdata('ForecastAnalysis',ulId)>Forecasts&nbsp;&amp;&nbsp;Analysis</a>";
                  document.getElementById(ulId).childNodes[3].innerHTML="<a href=javascript:getdata('HistoricalData',ulId)>Historical Data</a>";
                  getdata(e,ulId);
            }
  }

function dropsetter(listobj, listvalue){

      for( i=0; i< listobj.length; i++){
      if ( listobj.options[i].value == listvalue){
            document.home.category.options[i].selected="true";
            
}

}
}


function priceIndexRand(flag){

            var comboValue;
            var rad_val;
            var priceindex = document.getElementById("priceindex");
            var catlist= document.home.category;
            var selIndex = document.home.category.selectedIndex;
            var contxtPath=document.home.contextPath.value;
                  
            if (flag =="home"){
                  var randomnumber=Math.floor(Math.random()*17)
                  
                  if(randomnumber=="0"){
                  
                        comboValue="Pulp & Paper - Graphic Paper"; 
                        rad_val="NORTH AMERICA";
                   dropsetter(catlist, comboValue);
                  
                  }else if(randomnumber=="1"){
                        comboValue="Pulp & Paper - Graphic Paper";
                        rad_val="ASIA";
                   dropsetter(catlist, comboValue);
                        
                  }else if(randomnumber=="2"){
                  
                        comboValue="Pulp & Paper - Graphic Paper";
                        rad_val="EUROPE";
                   dropsetter(catlist, comboValue);
                  
                  }else if(randomnumber=="3"){
                        comboValue="Pulp & Paper - Recovered Paper";
                        rad_val="NORTH AMERICA";
                   dropsetter(catlist, comboValue);
                        
                  }else if(randomnumber=="4"){
                  
                        comboValue="Pulp & Paper - Recovered Paper";
                        rad_val="ASIA";
                   dropsetter(catlist, comboValue);
                  
                  }else if(randomnumber=="5"){
                        comboValue="Pulp & Paper - Recovered Paper";
                        rad_val="EUROPE";
                   dropsetter(catlist, comboValue);
                  
                  }else if(randomnumber=="6"){
                  
                        comboValue="Pulp & Paper - Paper Packaging";
                        rad_val="NORTH AMERICA";
                   dropsetter(catlist, comboValue);
                  
                  }else if(randomnumber=="7"){
                  
                        comboValue="Pulp & Paper - Paper Packaging";
                        rad_val="ASIA";
                        dropsetter(catlist, comboValue);
                  
                  }else if(randomnumber=="8"){
                  
                        comboValue="Pulp & Paper - Paper Packaging";
                        rad_val="EUROPE"
                   dropsetter(catlist, comboValue);

                  
                  }else if(randomnumber=="9"){
                        comboValue="Pulp & Paper - Pulp";
                        rad_val="NORTH AMERICA";
                   dropsetter(catlist, comboValue);
                        
                  }else if(randomnumber=="10"){
                        comboValue="Pulp & Paper - Pulp";
                        rad_val="ASIA";
                   dropsetter(catlist, comboValue);
                        
                  }else if(randomnumber=="11"){
                        comboValue="Pulp & Paper - Pulp";
                        ad_val="EUROPE";
                   dropsetter(catlist, comboValue);
                        
                  }else if(randomnumber=="12"){
                        comboValue="Crow's Lumber and Structural Panel Composite";
                        rad_val="NORTH AMERICA";
                   dropsetter(catlist, comboValue);
                  
                  }else if(randomnumber=="13"){
                        comboValue="Crow's Lumber and Structural Panel Composite";
                        rad_val="ASIA";
                   dropsetter(catlist, comboValue);
                  
                  }else if(randomnumber=="14"){
                        comboValue="Crow's Lumber and Structural Panel Composite";
                        rad_val="EUROPE";
                   dropsetter(catlist, comboValue);
                  
                  }else if(randomnumber=="15"){
                        comboValue="Southern Pine Stumpage";
                        rad_val="NORTH AMERICA";
                   dropsetter(catlist, comboValue);
                  
                  }else if(randomnumber=="16"){
                        comboValue="Southern Pine Stumpage";
                        rad_val="ASIA";
                   dropsetter(catlist, comboValue);
                        
                  }else if(randomnumber=="17"){
                        comboValue="Southern Pine Stumpage";
                        rad_val=="EUROPE";
                        dropsetter(catlist, comboValue);
                  
                  }     
            
            
            }else{            

                  
                  comboValue = document.home.category.options[selIndex].value;
                  for (var i=0; i < document.home.price.length; i++){
                     if (document.home.price[i].checked){
                          rad_val = document.home.price[i].value;
                        }
                    }
            }
            document.home.price[1].disabled=false;
          document.home.price[2].disabled=false;            
            if (comboValue=="Pulp & Paper - Graphic Paper" && rad_val=="NORTH AMERICA"){
                        priceindex.setAttribute("src", "/images/news_commentary/priceindex/Risi-North-America-Graphic-Paper-Price-Index.jpg");
                        document.home.price[0].checked=true;
                        
            } 
            else if(comboValue=="Pulp & Paper - Graphic Paper" && rad_val=="ASIA"){
                        priceindex.setAttribute("src", "/images/news_commentary/priceindex/Risi-Asia-Graphic-Paper-Price-Index.jpg");
                        document.home.price[1].checked=true;
            }
            else if(comboValue=="Pulp & Paper - Graphic Paper" && rad_val=="EUROPE"){
                        priceindex.setAttribute("src", "/images/news_commentary/priceindex/Risi-Europe-Graphic-Paper-Price-Index.jpg");
                        document.home.price[2].checked=true;
            }
            else if(comboValue=="Pulp & Paper - Recovered Paper" && rad_val=="NORTH AMERICA"){
                        priceindex.setAttribute("src", "/images/news_commentary/priceindex/Risi-North-America-Recovered-Paper-Price-Index.jpg");
                        document.home.price[0].checked=true;
            }
            else if(comboValue=="Pulp & Paper - Recovered Paper" && rad_val=="ASIA"){
                        priceindex.setAttribute("src", "/images/news_commentary/priceindex/Risi-Asia-Recovered-Paper-Price-Index.jpg");
                        document.home.price[1].checked=true;
            }
            else if(comboValue=="Pulp & Paper - Recovered Paper" && rad_val=="EUROPE"){
                        priceindex.setAttribute("src", "/images/news_commentary/priceindex/Risi-Europe-Recovered-Paper-Price-Index.jpg");
                        document.home.price[2].checked=true;
            }
            else if(comboValue=="Pulp & Paper - Paper Packaging" && rad_val=="NORTH AMERICA"){
                        priceindex.setAttribute("src", "/images/news_commentary/priceindex/Risi-North-America-Packaging-Paper-Price-Index.jpg");
                        document.home.price[0].checked=true;
            }
            else if(comboValue=="Pulp & Paper - Paper Packaging" && rad_val=="ASIA"){
                        priceindex.setAttribute("src", "/images/news_commentary/priceindex/Risi-Asia-Packaging-Paper-Price-Index.jpg");
                        document.home.price[1].checked=true;
            }
            else if(comboValue=="Pulp & Paper - Paper Packaging" && rad_val=="EUROPE"){
                        priceindex.setAttribute("src", "/images/news_commentary/priceindex/Risi-Europe-Packaging-Paper-Price-Index.jpg");
                        document.home.price[2].checked=true;
            }
            else if(comboValue=="Pulp & Paper - Pulp" && rad_val=="NORTH AMERICA"){
                     
                     priceindex.setAttribute("src", "/images/news_commentary/priceindex/Risi-North-America-Pulp-Price-Index.jpg");
                     document.home.price[0].checked=true;
            }
            else if(comboValue=="Pulp & Paper - Pulp" && rad_val=="ASIA"){
                        priceindex.setAttribute("src","/images/news_commentary/priceindex/Risi-Asia-Pulp-Price-Index.jpg");
                        document.home.price[1].checked=true;
            }
            else if(comboValue=="Pulp & Paper - Pulp" && rad_val=="EUROPE"){
                        priceindex.setAttribute("src", "/images/news_commentary/priceindex/Risi-Europe-Pulp-Price-Index.jpg");
                        document.home.price[2].checked=true;
            }else if(comboValue=="Crow's Lumber and Structural Panel Composite" && rad_val=="NORTH AMERICA"){
                        priceindex.setAttribute("src", "/images/news_commentary/priceindex/home_lumber.jpg");
                        document.home.price[0].checked=true;
                        document.home.price[1].disabled=true;
                        document.home.price[2].disabled=true;
            }
            else if(comboValue=="Crow's Lumber and Structural Panel Composite" && rad_val=="ASIA"){
                        priceindex.setAttribute("src", "/images/news_commentary/priceindex/home_lumber.jpg");
                        document.home.price[0].checked=true;
                        document.home.price[1].disabled=true;
                        document.home.price[2].disabled=true;
            }
            else if(comboValue=="Crow's Lumber and Structural Panel Composite" && rad_val=="EUROPE"){
                        priceindex.setAttribute("src", "/images/news_commentary/priceindex/home_lumber.jpg");
                      document.home.price[0].checked=true;
                        document.home.price[1].disabled=true;
                        document.home.price[2].disabled=true;
            }else if(comboValue=="Southern Pine Stumpage" && rad_val=="NORTH AMERICA"){
                        priceindex.setAttribute("src", "/images/news_commentary/priceindex/home_pine.jpg");
                        document.home.price[0].checked=true;
                        document.home.price[1].disabled=true;
                        document.home.price[2].disabled=true;
            }
            else if(comboValue=="Southern Pine Stumpage" && rad_val=="ASIA"){
                        priceindex.setAttribute("src", "/images/news_commentary/priceindex/home_pine.jpg");
                      document.home.price[0].checked=true;
                        document.home.price[1].disabled=true;
                        document.home.price[2].disabled=true;
            }
            else if(comboValue=="Southern Pine Stumpage" && rad_val=="EUROPE"){
                        priceindex.setAttribute("src", "/images/news_commentary/priceindex/home_pine.jpg");
                      document.home.price[0].checked=true;
                        document.home.price[1].disabled=true;
                        document.home.price[2].disabled=true;
            }
      }     

