
v=11;if(navigator.userAgent.indexOf("Mozilla/3")!=-1){v=10}var a="http://ads.rediff.com/RealMedia/ads/";var RN=new String(Math.random());var RNS=RN.substring(2,11);function da(c,b,f){var e="www.rediff.com/money-general.htm/1"+RNS+"@"+f;if(v<11){document.write("<A HREF="+a+"click_nx.ads/"+e+"><IMG SRC="+a+"adsTReam_nx.ads/"+e+" BORDER=0 WIDTH="+c+" HEIGHT= "+b+" VSPACE=0 HSPACE=0></A>")}else{document.write("<SCRIPT LANGUAGE=JavaScript1.1 SRC="+a+"adsTReam_jx.ads/"+e+"></SCRIPT>")}}function pop(c,b,f){var e=window.open(c,"nWin","x=0,y=0,toolbar=no,location=no,directories=no,status=no,scrollbars=no, copyhistory=no,width="+b+",height="+f+",screenX=0,screenY=0,left=20,top=20")}function header_menu(){var e="http://www.rediff.com";document.write('<TABLE bgcolor="ffffff"  CELLSPACING="0" CELLPADDING="0" BORDER="0">');document.write(" <TR>");document.write('   <TD WIDTH="160">');document.write('     <A HREF="http://money.rediff.com/"><IMG SRC="http://im.rediff.com/uim/news/moneywiz.gif" WIDTH="153" HEIGHT="23" BORDER="0" HSPACE="0" VSPACE="0" Title="Rediff Moneywiz"/></a>');document.write("   </TD>");document.write('                        <TD WIDTH="80%" HEIGHT="16" >');document.write('                                      <FONT CLASS="fv10">');document.write('                                                            <A HREF="http://www.rediff.com/">Rediff Home</A> | <A HREF="http://www.rediff.com/money/">Business</A>');document.write('                        <span id=hp style="behavior:url(#default#homepage)"></span>');if(navigator.userAgent.indexOf("MSIE")!=-1){var b=window.location.href;var c="Make this your homepage";document.write(" | <a  class=srchlink href=\"#\" onclick=\"style.behavior='url(#default#homepage)';setHomePage('"+b+"');window.location.href=window.location.href;return false;\">"+c+"</a>")}document.write("     </FONT>");document.write("   </TD>");document.write(' </TR></table><table CELLSPACING="0" CELLPADDING="0" BORDER="0">');document.write(" <TR>");document.write('   <TD HEIGHT="25">');document.write('<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0><TR><TD BGCOLOR=#1E2A64 WIDTH=65 ALIGN=CENTER><A HREF=http://money.rediff.com/><FONT CLASS=ft11 COLOR=#FFFFFF><B>Markets</B></FONT></A></TD><TD WIDTH=2></TD><TD CLASS=toptabs width=120 ALIGN=CENTER><FONT CLASS=ft11><B><A HREF="http://moneygame.rediff.com/">Share Bazaar Game</A></B></FONT></TD><TD WIDTH=2></TD> <TD CLASS=toptabs WIDTH=107 ALIGN=CENTER><FONT CLASS=ft11><B><A HREF=http://money.rediff.com/tools/what-if>Investment Tool</A></B></FONT></TD><TD WIDTH=2></TD><TD CLASS=toptabs WIDTH=47 ALIGN=CENTER><FONT CLASS=ft11><B><A HREF=http://money.rediff.com/tools/forex>Forex</A></B></FONT></TD><TD WIDTH=2></TD><TD CLASS=toptabs WIDTH=55 ALIGN=CENTER><FONT CLASS=ft11><B><A HREF=http://money.rediff.com/indices>Indices</A></B></FONT></TD><TD WIDTH=2></TD><TD CLASS=toptabs WIDTH=60 ALIGN=CENTER><FONT CLASS=ft11><B><A HREF=http://money.rediff.com/sectors>Sectors</A></B></FONT></TD><TD WIDTH=2></TD><TD CLASS=toptabs WIDTH=85 ALIGN=CENTER><FONT CLASS=ft11><B><A HREF=http://money.rediff.com/mutual-funds>Mutual Funds</A></B></FONT></TD><TD WIDTH=2></TD><TD CLASS=toptabs WIDTH=88 ALIGN=CENTER><FONT CLASS=ft11><B><A HREF=http://money.rediff.com/indicators>Global Trends</A></B></FONT></TD><TD WIDTH=2></TD><TD CLASS=toptabs WIDTH=72 ALIGN=CENTER HEIGHT=25><FONT CLASS=ft11><B><A HREF=http://money.rediff.com/tips>Stock Tips</A></B></FONT></TD><TD WIDTH=2></TD><TD CLASS=toptabs WIDTH=66 ALIGN=CENTER><FONT CLASS=ft11><B><A HREF=http://money.rediff.com/directory>Directory</A></B></FONT></TD></TR></TABLE>');document.write("   </TD>");document.write(" </TR>");document.write(" <TR>");document.write('   <TD COLSPAN="2" BGCOLOR="#1E2A64" HEIGHT="8"></TD>');document.write(" </TR>");document.write("</TABLE>")}function closeLinks(){document.getElementById("linkspopup").style.display="none"}function openLinks(){document.getElementById("linkspopup").style.display="block"}function bread_crumbs(f,e){var b=window.location.href;document.write('<TABLE WIDTH="100%" CELLSPACING="0" CELLPADDING="0" BORDER="0">');document.write(" <TR>");document.write('   <TD WIDTH="0.1%" BGCOLOR="#B7B7B7"></TD>');document.write('   <TD WIDTH="1.8%"></TD>');document.write('   <TD height="35">');document.write('     <FONT class="f12">You are here:');if(f=="Markets"){document.write('     <A HREF="http://www.rediff.com/money/index.html">');document.write("       <U>Business</U></A>");document.write('     <FONT SIZE="2" FACE="Arial"> &#187; </FONT>');document.write("       Markets Home")}else{document.write('     <A HREF="http://money.rediff.com/">');document.write("       <U>Markets Home</U></A>")}if(e!=""){if(e=="Company"||e=="Mutual Fund"||e=="MfSearch"||e=="Markets"){document.write('     <FONT SIZE="2" FACE="Arial"> &#187; </FONT>');document.write("     "+unescape(f))}else{document.write('     <FONT SIZE="2" FACE="Arial"> &#187; </FONT>');document.write("     "+unescape(f));document.write('     <FONT SIZE="2" FACE="Arial"> &#187; </FONT>');document.write("     "+e)}}document.write("     </FONT>");document.write("     <BR/>");document.write("   </TD>");document.write('   <TD width="20%" align="right">');if(f!="My Portfolio"){document.write('     <FONT CLASS="fv10">');var c="http://www.rediff.com/business/feedback.html?u="+document.URL;document.write('     <a href="'+b+'" title="Update Now"><span class="iconUpdate">&#160;&#160;&#160;</span><U>Update&nbsp;Now!</U></a>&nbsp;|&nbsp;<a href=\'javascript:pop("'+c+'","550","550")\'><b>Feedback</b></A>   ');document.write("         </FONT>")}document.write("  </TD>");document.write(" </TR>");document.write("</TABLE>")}var rbtval=getCookie("RBT");if((rbtval)){var rbtpos=rbtval.indexOf("money");if(rbtpos<0){var newval=rbtval+",money";setCookie("RBT",newval,"45")}}else{setCookie("RBT","money","45")}function getCookie(e){var c=document.cookie;var g=e+"=";var f=c.indexOf("; "+g);if(f==-1){f=c.indexOf(g);if(f!=0){return null}}else{f+=2}var b=document.cookie.indexOf(";",f);if(b==-1){b=c.length}return unescape(c.substring(f+g.length,b))}function setCookie(g,f,e){var c=new Date();var b=new Date();if(e==null||e==0){e=1}b.setTime(c.getTime()+3600000*24*e);document.cookie=g+"="+escape(f)+";expires="+b.toGMTString()+";domain=.rediff.com;path=/;"}var bt_array={service:"moneywiz",category:"Gc"};document.write('<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" SRC="http://im.rediff.com/uim/common/bt.js"></SCRIPT>');function write_chart(e,f,c,b){document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH='+c+" HEIGHT="+b+' id="FusionCharts_1">');document.write('<PARAM NAME="movie" VALUE="http://money.rediff.com/money1/images/FC_2_3_Area2D.swf">');document.write('<PARAM NAME="FlashVars" VALUE="&dataURL='+e+"?companyCode="+f+"&chartWidth="+c+"&chartHeight="+b+'">');document.write('<PARAM NAME="quality" VALUE="high">');document.write('<PARAM NAME="bgcolor" VALUE="#FFFFFF">');document.write('<PARAM NAME="wmode" VALUE="opaque">');document.write('<EMBED src="http://money.rediff.com/money1/images/FC_2_3_Area2D.swf" FlashVars="&dataURL='+e+"?companyCode="+f+"&chartWidth="+c+"&chartHeight="+b+'" quality="high" bgcolor="#FFFFFF"  WIDTH='+c+" HEIGHT="+b+' NAME="FusionCharts_1" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" wmode="opaque"></EMBED>');document.write("</OBJECT>")}function write_chart_compare(e,f,c,b){document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH='+c+" HEIGHT="+b+' id="FusionCharts_1">');document.write('<PARAM NAME="movie" VALUE="http://money.rediff.com/money1/images/FC_2_3_MSLine.swf">');document.write('<PARAM NAME="FlashVars" VALUE="&dataURL='+e+"?companyCode="+f+"&chartWidth="+c+"&chartHeight="+b+'">');document.write('<PARAM NAME="quality" VALUE="high">');document.write('<PARAM NAME="bgcolor" VALUE="#FFFFFF">');document.write('<EMBED src="http://money.rediff.com/money1/images/FC_2_3_MSLine.swf" FlashVars="&dataURL='+e+"?companyCode="+f+"&chartWidth="+c+"&chartHeight="+b+'" quality="high" bgcolor="#FFFFFF"  WIDTH='+c+" HEIGHT="+b+' NAME="FusionCharts_1" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>');document.write("</OBJECT>")}var tempid="";var alertmaxprice="";var alertminprice="";function getPage(b){window.location=b}function addPortfolio(b){getPage("http://portfolio.rediff.com/money/jsp/add_portfolio.jsp?companyCode="+b+"&equity=yes")}function opendropdown(b){closedropdown("addPortfolio");closedropdown("simpleSearch");closedropdown("advanceSearch");document.getElementById(b).style.display="block"}function closedropdown(b){if(document.getElementById(b)){document.getElementById(b).style.display="none"}}function showAddPopup(b){tempid=b;if(document.all){document.getElementById("addportfoliopopup").style.display="block"}else{document.getElementById("addportfoliopopup").style.display="block"}}function closeAddPopup(){document.forms.add_pf_co.reset();document.getElementById("addportfoliopopup").style.display="none"}function doAddPortfolioSubmit(){var h="Please fill up carefully with following details \n\n";var b=0;var e=checkQuantity(document.add_pf_co.quantity);if(e==false){h=h+" * Please enter only integer values for Quantity.\n\n";b=1}var g=checkCost(document.add_pf_co.price);if(g==false){h=h+" * Please enter numeral values for Cost. \n\n";b=1}if(document.add_pf_co.date.value==""){h=h+" * Date shouldn't be blank";b=1}else{var f=document.add_pf_co.date.value;var c=new Date();var k=f.split("/");var j=k[1]+"/"+k[0]+"/"+k[2];dt=new Date(j);if(dt>c){h=h+" * You cannot select future date.";b=1}}if(b==1){alert(h);return false}else{submitPortfolioForm()}}function xshowAddPopup(b){if(tempid!=""){xcloseAddPopup()}tempid=b;document.getElementById(tempid).className="moneypopup";document.getElementById(tempid).innerHTML=document.getElementById("addportfoliopopup").innerHTML;document.getElementById("addportfoliopopup").innerHTML="";document.getElementById(tempid).style.display="block"}function xcloseAddPopup(){resetDiv("co");document.getElementById("addportfoliopopup").innerHTML=document.getElementById(tempid).innerHTML;document.getElementById(tempid).style.display="none";document.getElementById(tempid).innerHTML="";tempid=""}function showPDiv(b){if(b=="portfolio"){document.getElementById("plink").style.display="none";document.getElementById("ppage").style.display="block";document.getElementById("swpage").style.display="none"}else{if(b=="sw"){document.getElementById("ppage").style.display="none";document.getElementById("plink").style.display="none";document.getElementById("swpage").style.display="block"}else{if(b=="sportfolio"){document.getElementById("slink").style.display="none";document.getElementById("spage").style.display="block";document.getElementById("sswpage").style.display="none"}else{if(b=="ssw"){document.getElementById("spage").style.display="none";document.getElementById("slink").style.display="none";document.getElementById("sswpage").style.display="block"}}}}}function resetDiv(b){if(b=="co"){document.getElementById("ppage").style.display="none";document.getElementById("plink").style.display="block";document.getElementById("swpage").style.display="none"}else{if(b=="mf"){document.getElementById("spage").style.display="none";document.getElementById("slink").style.display="block";document.getElementById("sswpage").style.display="none"}}}var tempDateId="";var mftempDateId="";function dateClk(b){document.domain="rediff.com";if(b=="mf"){tempDateId="mf";show_calendar("mf_add_form.date")}else{tempDateId="cm";show_calendar("add_pf_co.date")}}function setDate(c,b){if(tempDateId=="cm"){document.add_pf_co.date.value=c}else{document.mf_add_pf_co.date.value=c}}function mfdateClk(b){if(b=="mf"){tempDateId="mf";show_calendar("mf_add_form.date")}else{tempDateId="cm";show_calendar("add_pf_co.date")}}function mfsetDate(c,b){if(tempDateId=="cm"){document.add_pf_co.date.value=c}else{document.mf_add_pf_co.date.value=c}}function submitPortfolioForm(){var c=document.add_pf_co.price.value;var b=document.add_pf_co.quantity.value;var e=document.add_pf_co.date.value;document.forms.add_pf_co.code.value=tempid;document.forms.add_pf_co.flag.value="cm";document.forms.add_pf_co.transDetails.value="cm|"+tempid+"|"+c+"|"+b+"|"+e;document.add_pf_co.method="post";document.add_pf_co.target="_parent";document.add_pf_co.action="http://portfolio.rediff.com/money/jsp/select_portfolio.jsp";document.add_pf_co.submit()}function checkQuantity(e){var c=e.value;var b;if(c.length==0){return false}else{for(b=0;b<c.length;b++){if(!(c.charAt(b)>="0"&&c.charAt(b)<="9")){return false}}}return true}function checkCost(e){var c=e.value;var b;if(c.length==0){return false}else{if(c.charAt(0)=="."){return false}else{for(b=0;b<c.length;b++){if(!(c.charAt(b)>="0"&&c.charAt(b)<="9")&&c.charAt(b)!="("&&c.charAt(b)!=")"&&c.charAt(b)!="."&&c.charAt(b)!=""){return false}}}}return true}function mfdoAddPortfolioSubmit(b){var l="Please fill up carefully with following details \n\n";var j=0;var c=mfcheckQuantity(document.mf_add_form.quantity);if(c==false){l=l+" * Please enter valid values for Quantity.\n\n";j=1}var f=mfcheckCost(document.mf_add_form.price);if(f==false){l=l+" * Please enter numeral values for Cost. \n\n";j=1}if(document.mf_add_form.date.value==""){l=l+" * Date shouldn't be blank";j=1}if(document.mf_add_form.date.value!=""){var g=document.mf_add_form.date.value;var e=new Date();var h=g.split("/");var k=h[1]+"/"+h[0]+"/"+h[2];dt=new Date(k);if(dt>e){l=l+" * You cannot select future date.";j=1}}if(j==1){alert(l);return false}else{mfsubmitPortfolioForm(b)}}function mfcheckQuantity(f){var e=f.value;var c;var b=e.length;if(b==0){return false}else{if(b==1){if(e.charAt(0)=="0"||e.charAt(0)=="."){return false}}else{if(b==2){if(e.charAt(1)=="."){return false}else{if(e.charAt(0)=="."&&e.charAt(1)=="0"){return false}}}else{if(b==3){if(e.charAt(0)=="0"&&e.charAt(1)=="."&&e.charAt(2)=="0"){return false}}for(c=0;c<b;c++){if(!((e.charAt(c)>="0"&&e.charAt(c)<="9")||(e.charAt(c)=="."))){return false}}}}return true}}function mfcheckCost(e){var c=e.value;var b;if(c.length==0){return false}else{if(c.charAt(0)=="."){return false}else{for(b=0;b<c.length;b++){if(!(c.charAt(b)>="0"&&c.charAt(b)<="9")&&c.charAt(b)!="("&&c.charAt(b)!=")"&&c.charAt(b)!="."&&c.charAt(b)!=""){return false}}}}return true}function mfsubmitPortfolioForm(f){if(f==null||f.length<1){var f=newSchemeId;if(f.indexOf("a")!=-1){f=f.replace("a",",")}}var e=document.mf_add_form.price.value;var c=document.mf_add_form.quantity.value;var b=document.mf_add_form.date.value;document.mf_add_form.transDetails.value="mf|"+f+"|"+e+"|"+c+"|"+b;document.mf_add_form.method="post";document.mf_add_form.target="_parent";document.mf_add_form.action="http://portfolio.rediff.com/money/jsp/select_portfolio.jsp";document.mf_add_form.submit()}var newId="";var newSchemeId="";function mfshowAddPopup(c,b){if(newId!=""){mfcloseAddPopup()}newId=c+b;newSchemeId=c+"a"+b;document.getElementById(newId).className="moneypopup";document.getElementById(newId).innerHTML=document.getElementById("mfaddportfoliopopup").innerHTML;document.getElementById("mfaddportfoliopopup").innerHTML="";document.getElementById(newId).style.display="block"}function mfcloseAddPopup(){resetDiv("mf");document.getElementById("mfaddportfoliopopup").innerHTML=document.getElementById(newId).innerHTML;document.getElementById(newId).style.display="none";document.getElementById(newId).innerHTML="";newId="";newSchemeId=""}function checkalertvalidate(){var g="";var c=0;var f=Trim(document.stockwatch_popup.maxprice.value);var k=f.indexOf(".");var h=0;while(k!=-1){h++;k=f.indexOf(".",k+1)}if(h<2){while(f.indexOf(",")!=-1){f=f.replace(/,/,"")}if(f.length>=1){var e=checkalertPrice(f);if(e==false){g="Please enter numbers only";c=1}}}else{g="Please enter only one decimal";c=1}var b=Trim(document.stockwatch_popup.minprice.value);k=b.indexOf(".");h=0;while(k!=-1){h++;k=b.indexOf(".",k+1)}if(h<2){while(b.indexOf(",")!=-1){b=b.replace(/,/,"")}if(b.length>=1){var j=checkalertPrice(b);if(j==false){g="Please enter numbers only";c=1}}}else{g="Please enter only one decimal";c=1}if(c==1){alert(g);return false}else{alertmaxprice=f;alertminprice=b;submitAlertStockForm("co")}}function checkmfalertvalidate(){var g="";var c=0;var f=Trim(document.mfstockwatch_popup.maxprice.value);var k=f.indexOf(".");var h=0;while(k!=-1){h++;k=f.indexOf(".",k+1)}if(h<2){while(f.indexOf(",")!=-1){f=f.replace(/,/,"")}if(f.length>=1){var e=checkalertPrice(f);if(e==false){g="Please enter numbers only";c=1}}}else{g="Please enter only one decimal";c=1}var b=Trim(document.mfstockwatch_popup.minprice.value);k=b.indexOf(".");h=0;while(k!=-1){h++;k=f.indexOf(".",k+1)}if(h<2){while(b.indexOf(",")!=-1){b=b.replace(/,/,"")}if(b.length>=1){var j=checkalertPrice(b);if(j==false){g="Please enter numbers only";c=1}}}else{g="Please enter only one decimal";c=1}if(c==1){alert(g);return false}else{alertmaxprice=f;alertminprice=b;submitAlertStockForm("mf")}}function checkmfalertvalidate1(){var g="";var c=0;var f=Trim(document.mfstockwatch_popup.maxprice.value);var k=f.indexOf(".");var h=0;while(k!=-1){h++;k=f.indexOf(".",k+1)}if(h<2){while(f.indexOf(",")!=-1){f=f.replace(/,/,"")}if(f.length>=1){var e=checkalertPrice(f);if(e==false){g="Please enter numbers only";c=1}}}else{g="Please enter only one decimal";c=1}var b=Trim(document.mfstockwatch_popup.minprice.value);k=b.indexOf(".");h=0;while(k!=-1){h++;k=f.indexOf(".",k+1)}if(h<2){while(b.indexOf(",")!=-1){b=b.replace(/,/,"")}if(b.length>=1){var j=checkalertPrice(b);if(j==false){g="Please enter numbers only";c=1}}}else{g="Please enter only one decimal";c=1}if(c==1){alert(g);return false}else{alertmaxprice=f;alertminprice=b;submitAlertStockForm("mf1")}}function checkalertPrice(c){c=Trim(c);var b="";if(c.length>0){if(isNaN(c)){return false}}return true}function Trim(b){return b.replace(/^\s*|\s*$/g,"")}function submitAlertStockForm(e){var c=alertmaxprice;var b=alertminprice;if(e=="co"){document.forms.stockwatch_popup.code.value=tempid;document.forms.stockwatch_popup.flag.value="sw_add";document.forms.stockwatch_popup.transDetails.value="sw_edit|1|"+tempid+"|"+c+"|"+b+"|edit|SW";document.stockwatch_popup.method="post";document.stockwatch_popup.target="_parent";document.stockwatch_popup.action="http://portfolio.rediff.com/money/jsp/stockwatch_edit.jsp";document.stockwatch_popup.submit()}else{if(e=="mf"){document.forms.mfstockwatch_popup.code.value=newSchemeId;document.forms.mfstockwatch_popup.flag.value="sw_add";document.forms.mfstockwatch_popup.transDetails.value="sw_edit|1|"+newSchemeId+"|"+c+"|"+b+"|edit|SW";document.mfstockwatch_popup.method="post";document.mfstockwatch_popup.target="_parent";document.mfstockwatch_popup.action="http://portfolio.rediff.com/money/jsp/stockwatch_edit.jsp";document.mfstockwatch_popup.submit()}else{if(e=="mf1"){document.forms.mfstockwatch_popup.flag.value="sw_add";document.forms.mfstockwatch_popup.transDetails.value="sw_edit|1|"+document.forms.mfstockwatch_popup.code.value+"|"+c+"|"+b+"|edit|SW";document.mfstockwatch_popup.method="post";document.mfstockwatch_popup.target="_parent";document.mfstockwatch_popup.action="http://portfolio.rediff.com/money/jsp/stockwatch_edit.jsp";document.mfstockwatch_popup.submit()}}}}function addPortfolioGame(b){getPage("http://moneygame.rediff.com/player_home.php?cid="+tempid+"&do=mw")}function openMfPopup(){document.getElementById("mfAddPortfolio").style.display="block"}function closeMfPopup(){document.forms.mf_add_form.reset();document.getElementById("mfAddPortfolio").style.display="none"}function openMfPopup(b){document.getElementById(b).style.display="block"}function closeMfPopup(b){if(b=="mfAddPortfolio"){document.forms.mf_add_form.reset()}else{if(b=="mfAddStockwatch"){document.forms.mfstockwatch_popup.reset()}}document.getElementById(b).style.display="none"}function openTab(g,b,f){var e;var c=b+f;for(i=1;i<=g;i++){e=b+i;getEl(e+"m").className="";getEl(e).style.display="none"}getEl(c+"m").className="currenttab";getEl(c).style.display="block"}function getEl(b){if(document.getElementById(b)){return document.getElementById(b)}}var level=-1;function callSchemes(){var b=document.MFSearch.Amc.value;document.MFSearch.Class.options.length=0;document.MFSearch.Class.options[0]=new Option("Select One (Optional)",-1);document.MFSearch.Plan.options.length=0;document.MFSearch.Plan.options[0]=new Option("Select One (Optional)",-1);document.MFSearch.Type.options.length=0;document.MFSearch.Type.options[0]=new Option("Select One (Optional)",-1);if(b=="-1"){var c="level=0";getTablepass(c)}else{level=1;var c="amcCode="+b+"&level="+level;getTablepass(c)}}function callClass(){var b=document.MFSearch.Amc.value;if(b=="-1"){var c="level=0";getTablepass(c)}else{document.MFSearch.Class.options.length=0;document.MFSearch.Class.options[0]=new Option("Select One (Optional)",-1);document.MFSearch.Plan.options.length=0;document.MFSearch.Plan.options[0]=new Option("Select One (Optional)",-1);document.MFSearch.Type.options.length=0;document.MFSearch.Type.options[0]=new Option("Select One (Optional)",-1);level=2;var c="amcCode="+b+"&level="+level;getTablepass(c)}}function callPlan(){var c=document.MFSearch.Amc.value;var b=document.MFSearch.Class.value;if(b!="-1"){document.MFSearch.Plan.options.length=0;document.MFSearch.Plan.options[0]=new Option("Select One (Optional)",-1);document.MFSearch.Type.options.length=0;document.MFSearch.Type.options[0]=new Option("Select One (Optional)",-1);level=3;var e="amcCode="+c+"&classCode="+b+"&level="+level;getTablepass(e)}}function callType(){var c=document.MFSearch.Amc.value;var b=document.MFSearch.Class.value;var e=document.MFSearch.Plan.value;if(e!="-1"){document.MFSearch.Type.options.length=0;document.MFSearch.Type.options[0]=new Option("Select One (Optional)",-1);level=4;var f="amcCode="+c+"&classCode="+b+"&planCode="+e+"&level="+level;getTablepass(f)}}function getTablepass(e){var c=e;var b="http://money.rediff.com/money/jsp/createXml.jsp?"+c;if(window.XMLHttpRequest){req=new XMLHttpRequest();req.onreadystatechange=stateHandler;req.open("GET",b,true);req.setRequestHeader("Content-type","application/x-www-form-urlencoded");req.send(null)}else{if(window.ActiveXObject){req=new ActiveXObject("Microsoft.XMLHTTP");req.onreadystatechange=stateHandler;req.open("GET",b,true);req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");req.send()}}}function stateHandler(){if(req.readyState==4){if(req.status==200){var e=req.responseText;var c=setformdata(e);if(c){if(level=="0"){parsexmldropdown(c,"2");parsexmldropdown(c,"3");parsexmldropdown(c,"4")}else{if(level=="1"){parsexmldropdown(c,"2");parsexmldropdown(c,"3");parsexmldropdown(c,"4")}else{if(level=="2"){parsexmldropdown(c,"2");parsexmldropdown(c,"3");parsexmldropdown(c,"4")}else{if(level=="3"){parsexmldropdown(c,"3");parsexmldropdown(c,"4")}else{if(level=="4"){parsexmldropdown(c,level);var b=document.MFSearch.Type.options.length;if(b==2){document.MFSearch.Type.options[1].selected=true}}else{parsexmldropdown(c,level)}}}}}}}else{alert("failed")}}return true}function setformdata(b){if(navigator.appName.indexOf("Microsoft")!=-1){var c=new ActiveXObject("Microsoft.XMLDOM");c.async="false";c.loadXML(b);return c}else{var f=new DOMParser();var e=f.parseFromString(b,"text/xml");var c=e.documentElement;c.async=false;return c}}var ELEMENT_NODE=1;function parsexmldropdown(c,g){var f="";var e;if(g=="2"){f="ClassList";e=document.MFSearch.Class}else{if(g=="3"){f="PlanList";e=document.MFSearch.Plan}else{if(g=="4"){f="TypeList";e=document.MFSearch.Type}}}var b=c.getElementsByTagName(f);if(b[0].childNodes.length>0){for(i=0;i<b[0].childNodes.length;++i){adddetails=b[0].childNodes[i];if(adddetails.nodeType!=ELEMENT_NODE){continue}e.options[i+1]=new Option(adddetails.childNodes[1].childNodes[0].nodeValue,adddetails.childNodes[0].childNodes[0].nodeValue)}}};function simple(){document.MFSearch.searchType.value="simple";document.MFSearch.Amc.value="-1";var b=document.MFSearch.radioBtn.length;var c=false;var e="";for(var f=0;f<b;f++){if(document.MFSearch.radioBtn[f].checked){c=true;e=document.MFSearch.radioBtn[f].value}}if(c==true){document.MFSearch.next.value=25;document.MFSearch.prev.value=1;if(e=="H"){document.MFSearch.action="http://money.rediff.com/mutual-funds/high-risk"}else{if(e=="M"){document.MFSearch.action="http://money.rediff.com/mutual-funds/med-risk"}else{if(e=="L"){document.MFSearch.action="http://money.rediff.com/mutual-funds/low-risk"}}}formSubmit()}else{alert("Select any one of the options")}}function advance(){document.MFSearch.next.value=25;document.MFSearch.prev.value=1;document.MFSearch.searchType.value="advance";if(document.MFSearch.Amc.value=="-1"&&document.MFSearch.Class.value=="-1"&&document.MFSearch.Plan.value=="-1"&&document.MFSearch.Type.value=="-1"){alert("Select any one of the options")}else{document.MFSearch.hdamc.value=document.MFSearch.Amc.options[document.MFSearch.Amc.selectedIndex].text;document.MFSearch.hdclass.value=document.MFSearch.Class.options[document.MFSearch.Class.selectedIndex].text;document.MFSearch.hdplan.value=document.MFSearch.Plan.options[document.MFSearch.Plan.selectedIndex].text;document.MFSearch.hdtype.value=document.MFSearch.Type.options[document.MFSearch.Type.selectedIndex].text;document.MFSearch.message.value=null;formactionname();formSubmit()}}function formactionname(){var j=new Array("amc","class","plan","type");var e=new Boolean(false);var h=0;var c="";var b=new RegExp("\\s\\s+","g");for(var g=0;g<j.length;g++){var f=document.getElementById(j[g]);if(f.value!="-1"){h++;if(h==1){var k=f.options[f.selectedIndex].text;k=replaceAll(k,"-"," ");k=k.replace(b," ");k=replaceAll(k," ","-");k=replaceAll(k,"&","and");k=k.toLowerCase();c=j[g]+"/"+k}}}if(h>1){document.MFSearch.action="http://money.rediff.com/mutual-funds/advanced"}else{if(h==1){document.MFSearch.action="http://money.rediff.com/mutual-funds/"+c}else{document.MFSearch.action="http://money.rediff.com/mutual-funds"}}}function replaceAll(e,c,b){while(e.indexOf(c)!=-1){e=e.replace(c,b)}return e}function formSubmit(){document.MFSearch.method="post";document.MFSearch.submit()}function invisible(){document.getElementById("dd1").style.visibility="hidden";document.getElementById("dd1").style.display="none";document.getElementById("dd2").style.visibility="hidden";document.getElementById("dd2").style.display="none";document.getElementById("dd3").style.visibility="hidden";document.getElementById("dd3").style.display="none"}function showDiv(b){document.getElementById(b).style.visibility="visible";document.getElementById(b).style.display="block"}function perviuosClick(){if(document.MFSearch.searchType.value=="simple"){document.MFSearch.radioBtn.value=document.MFSearch.msgKey.value}else{if(document.MFSearch.searchType.value=="advance"){var temp=document.MFSearch.msgKey.value.split("/");document.MFSearch.Amc.value=temp[0];document.MFSearch.Class.value=temp[1];document.MFSearch.Plan.value=temp[2];document.MFSearch.Type.value=temp[3]}}var nextValue=document.MFSearch.next.value;var prevValue=document.MFSearch.prev.value;nextValue=eval(nextValue)-25;prevValue=eval(prevValue)-25;document.MFSearch.next.value=nextValue;document.MFSearch.prev.value=prevValue;formSubmit()}function nextClick(){if(document.MFSearch.searchType.value=="simple"){document.MFSearch.radioBtn.value=document.MFSearch.msgKey.value}else{if(document.MFSearch.searchType.value=="advance"){var temp=document.MFSearch.msgKey.value.split("/");document.MFSearch.Amc.value=temp[0];document.MFSearch.Class.value=temp[1];document.MFSearch.Plan.value=temp[2];document.MFSearch.Type.value=temp[3]}}var nextValue=document.MFSearch.next.value;var prevValue=document.MFSearch.prev.value;prevValue=eval(prevValue)+25;nextValue=eval(nextValue)+25;document.MFSearch.next.value=nextValue;document.MFSearch.prev.value=prevValue;formSubmit()}function stopRacing(){if(!document.all){getEl("area021_table").innerHTML=getEl("area021").innerHTML;getEl("area021").innerHTML="";getEl("area022_table").innerHTML=getEl("area022").innerHTML;getEl("area022").innerHTML="";getEl("area033_table").innerHTML=getEl("area033").innerHTML;getEl("area033").innerHTML=""}}function getEl(b){if(document.getElementById(b)){return document.getElementById(b)}}var isstop=true;function doOnLoadsFunctions(){if(typeof(right_onload)=="function"){right_onload()}}function article(b,c){window.open("sendmail.jsp?url="+b+"&#38;companyname="+c,"sendmail","width=507,height=420,status=no,resizable=no,location=no,top=200,left=200")}var isstop=true;var target_x=3;var target_y=0;var fm_height=0;var floatHeight=0;var begin_top=10;var initDone=false;var fm_id="scontentsub";var floating_menu=null;var fm_shift_x,fm_shift_y,fm_next_x,fm_next_y;var fm_height=0;var sliderCell=null;var progressbar=null;var sTop=0;var popupOffset=0;var errormsg="";function right_onload(b){if(b){popupOffset=200}setTimeout("floater_init();",50)}function floater_init(){floating_menu=document.getElementById?document.getElementById(fm_id):document.all?document.all[fm_id]:document.layers[fm_id];fm_height=floating_menu.offsetHeight;sliderCell=document.getElementById("slidercell");compute_shifts();if(document.layers){fm_next_x=0;fm_next_y=0}else{fm_next_x=fm_shift_x+target_x;fm_next_y=fm_shift_y+target_y;move_menu()}float_menu()}function move_menu(){}function pageHeight(){return window.innerHeight!=null?window.innerHeight:document.documentElement&&document.documentElement.clientHeight?document.documentElement.clientHeight:document.body!=null?document.body.clientHeight:null}function getScrollXY(){var b=0;if(typeof(window.pageYOffset)=="number"){b=window.pageYOffset}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){b=document.body.scrollTop}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){b=document.documentElement.scrollTop}}}return b}function compute_shifts(){sTop=getScrollXY();if(pageHeight()+sTop-fm_height>=sliderCell.offsetHeight){if(fm_height==0){fm_shift_y=sliderCell.offsetHeight-(sliderCell.offsetHeight-sTop)-begin_top;if(fm_shift_y<0){fm_shift_y=0}}else{fm_shift_y=sliderCell.offsetHeight-fm_height}}else{if(sTop-begin_top>=0){fm_shift_y=(sTop-begin_top+(20+popupOffset))}else{fm_shift_y=0}}if(fm_shift_y>sliderCell.offsetHeight){fm_shift_y=sliderCell.offsetHeight}}function float_menu(){var b,c;compute_shifts();c=(fm_shift_y+target_y-fm_next_y)*0.07;if(Math.abs(c)<0.5){c=fm_shift_y+target_y-fm_next_y}if(Math.abs(fm_next_y)>(sliderCell.offsetHeight-floating_menu.offsetParent.offsetHeight)){if(c<0){fm_next_y+=c;move_menu()}else{move_menu()}}else{if(Math.abs(b)>0||Math.abs(c)>0){fm_next_y+=c;move_menu()}else{}}setTimeout("float_menu()",20)}function show_msg(){}function lTrim(c){for(var b=0;c.charAt(b)==" ";b++){}return c.substring(b,c.length)}function rTrim(c){for(var b=c.length-1;c.charAt(b)==" ";b--){}return c.substring(0,b+1)}function trim(c){var b="";b=lTrim(rTrim(c));return b}function setEncode(b){b=trim(b);b=escape(b);alert(b)}function frmSubmit(){if((document.get_quote.query.value).replace(/^\s+/g,"").replace(/\s+$/g,"")!=""&&(document.get_quote.query.value).replace("Search by company or mutual fund name","")!=""){document.get_quote.submit()}}function showDivPopup(c,b){if(b=="portfolio"){document.getElementById("plink").style.display="none";document.getElementById("ppage").style.display="block";document.getElementById("swpage").style.display="none"}else{if(b=="sw"){document.getElementById("plink").style.display="none";document.getElementById("ppage").style.display="none";document.getElementById("swpage").style.display="block"}else{document.getElementById("plink").style.display="block";document.getElementById("ppage").style.display="none";document.getElementById("swpage").style.display="none"}}xshowAddPopup(c)}function checkCoDate(){if(document.add_pf_co.day.value==-1||document.add_pf_co.month.value==-1||document.add_pf_co.YEAR.value==-1){alert("Please select Date")}else{document.add_pf_co.date.value=document.add_pf_co.day.value+"/"+document.add_pf_co.month.value+"/"+document.add_pf_co.YEAR.value;var b=false;b=isValidDate(document.add_pf_co.month.value+"/"+document.add_pf_co.day.value+"/"+document.add_pf_co.YEAR.value);if(b==true){doAddPortfolioSubmit()}}}function year_fillup(){var e=document.add_pf_co.YEAR;e.options[0]=new Option("YYYY",-1);var c=1;for(var b=curr_year;b>=last_year;b--){e.options[c]=new Option(b,b);c++}}var d=new Date();var curr_date=d.getDate();var curr_month=d.getMonth();curr_month=curr_month+1;var curr_year=d.getFullYear();var last_year=curr_year-30;function isValidDate(b){var f=/^(\d{1,2})(\/|-)(\d{1,2})\2(\d{2}|\d{4})$/;var e=b.match(f);if(e==null){alert("Date is not in a valid format.");return false}month=e[1];day=e[3];year=e[4];if(month<1||month>12){alert("Month must be between 1 and 12.");return false}if(day<1||day>31){alert("Day must be between 1 and 31.");return false}if((month==4||month==6||month==9||month==11)&&day==31){alert("Month "+month+" doesn't have 31 days!");return false}if(month==2){var c=(year%4==0&&(year%100!=0||year%400==0));if(day>29||(day==29&&!c)){alert("February "+year+" doesn't have "+day+" days!");return false}}return true}function placeFocus(){if(document.forms.length>0){var b=document.forms[0];for(i=0;i<b.length;i++){if((b.elements[i].type=="text")||(b.elements[i].type=="textarea")||(b.elements[i].type.toString().charAt(0)=="s")){document.forms[0].elements[i].focus();break}}}}function st2new1(b){for(i=1;i<=14;i++){tabnm=document.getElementById("headTabs"+i);if(b==i){document.getElementById("arrow"+i).style.visibility="visible";tabnm.className="headback1sel";document.getElementById("spo"+i).style.visibility="visible";document.getElementById("spo"+i).style.display="block"}else{tabnm.className="headback1";document.getElementById("arrow"+i).style.visibility="hidden";document.getElementById("spo"+i).style.visibility="hidden";document.getElementById("spo"+i).style.display="none"}}}function hideDiv(b){document.getElementById(b).style.display="none";document.getElementById(b).style.visibility="hidden"}function display_div(c){var b=document.getElementById("headTabs"+c);b.className="headback1sel";document.getElementById("arrow"+c).style.visibility="visible";showDiv("ds"+c);showDiv("spo"+c)}function roundNumber(b,c){var e=Math.round(b*Math.pow(10,c))/Math.pow(10,c);return e}function hide(){document.getElementById("balloon1").style.display="none"}function isInteger(c){var b;if(isEmpty(c)){if(isInteger.arguments.length==1){return 0}else{return(isInteger.arguments[1]==true)}}if(isNaN(c)){return false}else{if(c<0){return false}}return true}function isEmpty(b){return((b==null)||(b.length==0))}function isDigit(b){return((b>="0")&&(b<="9"))}function formatNumCurrency(iNum){var aNum=new Array;var iLen=0;var sFormattedNumber="";if(!isEmpty(iNum)){var sNum=""+iNum+"";iPos=sNum.indexOf(".");if(iPos!=-1){var iNum1=sNum.substring(0,iPos);var iNum2=sNum.substring(iPos+1,sNum.length);}else{var iNum1=sNum;}iLen=iNum1.length-1;var iLoop=0;for(i=iLen;i>=0;i--){iLoop++;if(iLoop==4){sFormattedNumber=iNum1.charAt(i)+","+sFormattedNumber;}else if((iLoop>4)&&(iLoop%2)==0){sFormattedNumber=iNum1.charAt(i)+","+sFormattedNumber;}else{sFormattedNumber=iNum1.charAt(i)+sFormattedNumber;}}if(iNum2>0)sFormattedNumber=sFormattedNumber+"."+iNum2;return sFormattedNumber;}return 0;}function get_result(){var iInvestedAmt=trim(document.getElementById('in_money').value);var sRepStr=/,/g;iInvestedAmt=iInvestedAmt.replace(sRepStr,"");var sRepStr=/ /g;iInvestedAmt=iInvestedAmt.replace(sRepStr,"");if(!isInteger(iInvestedAmt)){if(iInvestedAmt){document.getElementById("balloon1").style.display='block';}return false;}var iSelectedPeriod=document.getElementById("selPer").value;if((aRates[iSelectedPeriod]>0)&&(iInvestedAmt>0)){document.getElementById("balloon1").style.display="none";var iCurrentPrice=aRates[0];var iTotalShares=iInvestedAmt/aRates[iSelectedPeriod];if(aBonus[iSelectedPeriod]!=undefined){var iOldShares=aBonus[iSelectedPeriod][0];var iNewShares=aBonus[iSelectedPeriod][1];iTotalShares=((iTotalShares*iNewShares)/iOldShares)+iTotalShares;}if(aSplit[iSelectedPeriod]!=undefined){var iOldVal=aSplit[iSelectedPeriod][0];var iNewVal=aSplit[iSelectedPeriod][1];iTotalShares=((iTotalShares*iOldVal)/iNewVal)}var iCurrentAmt=roundNumber(iCurrentPrice*iTotalShares,2);var sCurrentAmt=formatNumCurrency(iCurrentAmt);document.getElementById('res_val').innerHTML="Rs "+sCurrentAmt;if(iCurrentAmt<iInvestedAmt){document.getElementById('res_val').className="col_red";}else if(iCurrentAmt>iInvestedAmt){document.getElementById('res_val').className="col_green";}else{document.getElementById('res_val').className="col_white";}}else{document.getElementById('res_val').innerHTML="Rs 0.00";document.getElementById('res_val').className="col_white";}}function clear_field(){document.getElementById('in_money').value="";document.getElementById('res_val').innerHTML="Rs 00,00,00,000.00";document.getElementById('res_val').className="col_white";}function clickLink(){var amtVal=document.getElementById("in_money").value;if(parseFloat(amtVal)<=1.00){amtVal=1;}else{amtVal=amtVal;}var iSelectedPeriod=document.getElementById("selPer").value;var companyCode=document.getElementById("companyCode").value;document.frmStockChart.action="http://money.rediff.com/tools/advanced/"+companyCode;document.frmStockChart.submit();}function openTabSingle(c){document.paging.cTab.value=c;var b=document.paging.pageType.value+".jsp";document.paging.action="/money/jsp/"+b;document.paging.submit()}function openTabIndices(c){document.paging.cTab.value=c;var b=document.paging.pageType.value+".jsp";if(c==1){document.paging.action="http://money.rediff.com/indices/bse"}else{if(c==2){document.paging.action="http://money.rediff.com/sectors"}else{if(c==3){document.paging.action="http://money.rediff.com/indices/bse/dollex"}else{if(c==4){document.paging.action="http://money.rediff.com/indices/world"}else{document.paging.action="http://money.rediff.com/indices/bse"}}}}document.paging.submit()}function openTabGainer(b){document.paging.action="http://money.rediff.com/gainers/"+b;document.paging.submit()}function openTabLoser(b){document.paging.action="http://money.rediff.com/losers/"+b;document.paging.submit()}function frmSubmitFooter(){if((document.get_quote1.query.value).replace(/^\s+/g,"").replace(/\s+$/g,"")!=""&&(document.get_quote1.query.value).replace("","")!=""&&(document.get_quote1.query.value).replace("Search by company or mutual fund name","")!=""){document.get_quote1.submit()}document.get_quote1.focus()}function frmSubmitCompare(){if((document.get_quote_compare.query.value).replace(/^\s+/g,"").replace(/\s+$/g,"")!=""&&(document.get_quote_compare.query.value)!="Company Name Or Symbol"){document.get_quote_compare.submit()}}function disp_banner(c,b,e){if((navigator.appName.indexOf("Microsoft")!=-1)||(navigator.userAgent.toLowerCase().indexOf("firefox"))){OAS_AD(e)}else{da(c,b,e)}}function display_banner_div(b){if(document.getElementById(b)){document.getElementById(b).innerHTML=document.getElementById(b+"_hidden").innerHTML}document.getElementById(b+"_hidden").innerHTML=""}function openTabMarketcap(b){document.paging.action="http://money.rediff.com/companies/market-capitalisation/"+b;document.paging.submit()}function company_chart(c){document.getElementById("tabId").value=c;var e=document.getElementById("companyName").value;var b=document.getElementById("companyCode").value;document.companychart.method="POST";document.companychart.action="http://money.rediff.com/companies/"+e+"/"+b;document.companychart.submit()};
