var cookiestring,sUser,sUserLength, mstatus,addr,findpos,findposLength; addr = document.URL; try { cookiestring= document.cookie; cookiestring = cookiestring.toLowerCase(); sUser = getCookievalue('commlogu'); sUserLength = sUser.length; mstatus = getCookievalue('cmssso'); numero= 999999.9999 inRandom = Math.round((Math.random() * numero+ 0.5)); }catch(er){ cookiestring=' '; sUserLength=0; } function hide(){ document.getElementById('newsbrk').innerHTML = "" document.getElementById('newsbrk').style.visibility = "none"; } var is_chrome=/chrome/.test(navigator.userAgent.toLowerCase()); var _stpos = 0; var _imgwt = 0; var moving = false; var stop = false; function move(){ if(stop){ _stpos = 0; } document.getElementById('bnewstickerplaceholder').style.left=(_stpos - 2)+'px'; if(document.getElementById('bnewstickerplaceholder').style.left == (_imgwt*-1)+"px"){ _stpos = 348; } _stpos = _stpos - 1; if(!stop){ if(is_chrome) { setTimeout('move()',10); } else { setTimeout('move()',5); } } } function bnews(refreshtime){ try{ var breakhttp=false; breakhttp = window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP"); if (breakhttp){ breakhttp.onreadystatechange=function(){ if (breakhttp.readyState==4){ if (breakhttp.status==200){ var bstr = breakhttp.responseText; if(bstr == ""){ if(document.getElementById("newsbrk").style.display == "inline"){ document.getElementById("newsbrk").style.display = "none"; } }else{ document.getElementById('bnewstickerplaceholder').innerHTML=bstr; document.getElementById("newsbrk").style.display="inline"; _imgwt = document.getElementById("bnewstickerplaceholder").offsetWidth; if(_imgwt >= 345 && moving == false){ moving = true; stop = false; move(); }else if(_imgwt < 345 && moving == true){ stop = true; moving = false; } } } } } breakhttp.open("GET",'/etbreakingnews/bnews.htm',true); breakhttp.send(null); } }catch (e){breakhttp = false;} setTimeout("bnews("+refreshtime+")",refreshtime); } function watchlistdiaplay(){ populatediv(watchlistdisplayurl(),'watch_list'); } function watchlistdisplayurl(){ if (!getUserID() == ""){ return "/mywatchlist.cms?userid="+getUserID(); }else{ return "/topgainerlooser_wlst_opt.cms?statstype=gainers&exchangeid=50&exchangegroup=&pagesize=10&pagenumber=1&msgshow=1"; } } function openPopup(url, h, w){ var x = (screen.width - w) / 2; var y = (screen.height - h) / 2 timespopup=window.open(url,'timespopup','toolbar=0,scrollbars=0,location=0,status=0,menubars=0,resizable=0,width='+w+',height='+h+',top='+y+',left='+x+',maximize=null'); timespopup.focus(); } function openWindowmail1(url,h,w){ so = window.open(url,'Indiatimes','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=0,height='+h+',width='+w); } function openpopup_indice_1(url){ so = window.open(url,'ET','height=550,width=350,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=0'); } function broadbandpopup(url,h,w){openPopup(url,h,w);} function getCookievalue(strcookie){ var cookiestring = document.cookie; cookiestring = cookiestring.toLowerCase(); var ipos = cookiestring.indexOf(strcookie); var ipos2 = cookiestring.indexOf(';',ipos); if (ipos != -1){ if (ipos2 == -1) ipos2 = cookiestring.length; return unescape(cookiestring.substring((ipos+strcookie.length+1),ipos2)); } } function tpbar(){ var username = getCookievalue('commlogu'); if(username == "" || username == null){ document.getElementById("topbardiv").innerHTML = '

Hi Guest, Sign Up | Sign In

'; }else{ populatedivnoL('/topbar.cms','topbardiv'); } } function showGraph(exch){ var gpObj = document.getElementById("exchgraph"); if(exch=="bse"){ gpObj.src="http://marketgraphs.economictimes.indiatimes.com/charting/PriceSummary.aspx?indexid=2365&page=home&width=240&height=58"; document.getElementById("bse").style.fontWeight="bold"; document.getElementById("nse").style.fontWeight="normal"; }else if(exch=="nse"){ gpObj.src="http://marketgraphs.economictimes.indiatimes.com/charting/PriceSummary.aspx?indexid=2369&page=home&width=240&height=58"; document.getElementById("bse").style.fontWeight="normal"; document.getElementById("nse").style.fontWeight="bold"; } else if(exch=="b"){ gpObj.src="http://marketgraphs.economictimes.indiatimes.com/charting/PriceSummary.aspx?indexid=2365&page=home&width=165&height=58"; document.getElementById("bse").style.fontWeight="bold"; document.getElementById("nse").style.fontWeight="normal"; }else if(exch=="n"){ gpObj.src="http://marketgraphs.economictimes.indiatimes.com/charting/PriceSummary.aspx?indexid=2369&page=home&width=165&height=58"; document.getElementById("bse").style.fontWeight="normal"; document.getElementById("nse").style.fontWeight="bold"; } } function changetab(obj,divid){ var iCtr=0; var divObj=document.getElementById(divid); if (window.ActiveXObject){ for(iCtr=0;iCtr 0) && (mstatus == 'true')){ var popupurl1='http://economictimes.indiatimes.com/insertclipping/msid-'+msid+',random-'+ inRandom +'.cms'; window.open(popupurl1,'Clippings','toolbar=0,scrollbars=0,location=0,status=0,menubars=0,resizable=0,width=350,height=160,top="0",left="0",maximize=null'); document.location.href = addr; }else{ try{ findpos = getCookievalue('arc'); findposLength = findpos.length; }catch(er){ findposLength =0; } if((findpos != '0') && (findposLength > 1)){ document.cookie = 'arc=0'; }else{ document.cookie = 'arc=' + escape(msid); } document.location.href = 'http://economictimes.indiatimes.com/login.cms?TferURL=' + addr; } } function getUserID(){ sUser = getCookievalue('commlogu'); vmstatus=getCookievalue('cmssso'); if( (sUser != "" || sUser != "undefined") && (vmstatus == 'true')){ // alert(sUser); return sUser; }else{ sUser=""; }return sUser; } function pfoliosumarydispurl(){ if (getUserID() == ""){ return "/myportfolio.cms?type=2"; }else{ return "/myportfolio.cms?type=1"; } } function submitmyformp(f){ var ch=0; for(i=0;i -1){ qString = qString.substr(qString.indexOf('?'+ key)) ; }else if (qString.indexOf('&'+ key) > -1){ qString = qString.substr(qString.indexOf('&'+ key)) ; }else{ return ""; } qString = qString.split('=')[1]; qString = qString.split('&')[0]; return unescape(qString); } function implementsearch(){ var googlesearchstring="http://www.google.com/custom?cof=S%3Ahttp%3A%2F%2Fwww.indiatimes.com%3BAH%3Aleft%3BLH%3A25%3BL%3Ahttp%3A%2F%2Fsearch.indiatimes.com%2Fit_logo.gif%3BLW%3A137%3BAWFID%3A9d13d66159b93c36%3B&domains=indiatimes.com&sa=Google+Search"; var searchtext=document.frmsearch.query.value; var x=-1; try{ if(document.frmsearch.search.selectedIndex > -1){ x=document.frmsearch.search.selectedIndex; } }catch(err){} if (x < 0){ for(x=0;x < 3;x++){ if (document.frmsearch.search[x].checked==1){ break; } } } var b = checkHTMLTag(); if(b==false){ return false; } if(x==0){ var strsearch = "/search.cms"; document.frmsearch.action=strsearch; document.frmsearch.submit(); } if(x==1){ var strsearch ="http://search.indiatimes.com/websearch.cms?type=1&sitesearch=indiatimes.com"; document.frmsearch.action=strsearch; document.frmsearch.submit(); } if(x==2){ var strsearch = "http://search.indiatimes.com/websearch.cms?type=0"; document.frmsearch.action=strsearch; document.frmsearch.submit(); } } function checkHTMLTag(){ var actualText = document.frmsearch.query.value; var tempText = trim(actualText) if((tempText.indexOf(String.fromCharCode(60)+"script") != -1) || (tempText.indexOf(String.fromCharCode(60)+"/script"+String.fromCharCode(62))!= -1)){ alert("Please enter a valid text in search field"); return false; }else if((tempText.indexOf(String.fromCharCode(60)+"/") != -1)){ alert("Please enter a valid text in search field"); return false; }else{ var stTagIndex = tempText.indexOf(String.fromCharCode(60)); if(stTagIndex != -1){ var tmp = tempText.substr(stTagIndex,tempText.length) if(tmp.indexOf(String.fromCharCode(62)) != -1){ alert("Please enter a valid text in search field"); return false; } } }return true; } function trim (str){ var tmp = ''; for(i=0; i < str.length; i++){ if(str.charAt(i) != ' '){ tmp = tmp + "" + str.charAt(i); } }return tmp; } function populate(urlval,divval,loading){ try{ var xmlhttp=false; var status=0; //CHECKING VALUE OF xmlhttp IS TRUE if(loading != 'no'){ var str_temp = ''; str_temp = str_temp + '
Loading'; str_temp = str_temp + '
'; document.getElementById(divval).innerHTML = str_temp; } xmlhttp = window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP"); if (xmlhttp){ //checking the state of http object xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4){ if (xmlhttp.status==200){ document.getElementById(divval).innerHTML=xmlhttp.responseText; } else if (xmlhttp.status==404) status=0 else status=0 } } xmlhttp.open("GET",urlval,true); xmlhttp.send(null); } }catch (e){xmlhttp = false;} } function populatedivnoL(urlval,divval){ populate(urlval,divval,'no'); } function populatediv(urlval,divval){ populate(urlval,divval,'yes'); } var menu2=new Array() menu2[0]='Jobs' menu2[1]='Matrimonial' menu2[2]='Real Estate' menu2[3]='Tenders' menu2[4]='Book Print Ads' var menu3=new Array() menu3[0]='Domains' menu3[1]='MeraMail' menu3[2]='WebSites' menu3[3]='SEO' menu3[4]='Hosting' menu3[5]='My E-Biz' menu3[6]='Sales CRM' menu3[7]='B2B Market Place' menu3[8]='Tenders' menu3[9]='Projects' menu3[10]='Remit2India' menu3[11]='Wallet365' menu3[12]='Investment in Mutual Fund' var menuwidth='165px' //default menu width var menubgcolor='ffffff' //menu bgcolor //var disappeardelay=250 //menu disappear speed onMouseout (in miliseconds) var hidemenu_onclick="yes" //hide menu when user clicks within menu? var ie4=document.all var ns6=document.getElementById&&!document.all if (ie4||ns6) document.write('') function getposOffset(what, offsettype){ var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop; var parentEl=what.offsetParent; while (parentEl!=null){ totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop; parentEl=parentEl.offsetParent; } return totaloffset; } function showhide(obj, e, visible, hidden, menuwidth){ if (ie4||ns6) dropmenuobj.style.left=dropmenuobj.style.top="-500px" if (menuwidth!=""){ dropmenuobj.widthobj=dropmenuobj.style dropmenuobj.widthobj.width=menuwidth } if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover") obj.visibility=visible else if (e.type=="click") obj.visibility=hidden } function iecompattest(){ return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body } function clearbrowseredge(obj, whichedge){ var edgeoffset=0 if (whichedge=="rightedge"){ var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15 dropmenuobj.contentmeasure=dropmenuobj.offsetWidth if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure) edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth } else{ var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18 dropmenuobj.contentmeasure=dropmenuobj.offsetHeight if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight if ((dropmenuobj.y-topedge) 0) && (mstatus == 'true')) { var popupurl1='/insertclipping/'+msid+'.cms?random='+ inRandom; rendorDiv(popupurl1,divid); }else{ try{ findpos = getCookievalue1('arc'); findposLength = findpos.length; }catch(er){ findposLength =0; } if((findpos != '0') && (findposLength > 1)) { document.cookie = 'arc=0'; }else{ document.cookie = 'arc=' + escape(msid); } document.location.href = 'http://economictimes.indiatimes.com/login.cms?TferURL=' + addr; } } function getinRandom(){ numero= 999999.9999; inRandom = Math.round((Math.random() * numero+ 0.5)); return inRandom; } function rendorDiv(url,divid){ populatediv(url,divid); if(divid == 'botdiv'){ document.getElementById('botdiv').style.display="inline"; document.getElementById('topdiv').style.display="none"; }else{ document.getElementById('topdiv').style.display="inline"; document.getElementById('botdiv').style.display="none"; } } function defltLoad(){ var popupurl2,tab; if ((cookiestring.indexOf('commlogp') != -1) && (sUserLength > 0) && (mstatus == 'true')){ try{ findpos = getCookievalue('arc'); findposLength = findpos.length; }catch(er){ findposLength =0; } if((findpos != '0') && (findposLength > 1)){ tab = getC("tabs") if(typeof inRandom == 'undefined'){ inRandom = getinRandom(); } var popupurl2='/insertclipping/' + findpos+'.cms?random='+ inRandom; rendorDiv(popupurl2,tab) } document.cookie = 'arc=0'; } } function setC(sName,sValue){ document.cookie = sName + "=" + escape(sValue); } function getC(sName){ var aCookie = document.cookie.split("; "); for (var i=0; i < aCookie.length; i++){ var aCrumb = aCookie[i].split("="); if (sName == aCrumb[0]) return unescape(aCrumb[1]); } return null; } function closem(){ document.getElementById('botdiv').innerHTML = ""; document.getElementById('topdiv').innerHTML = ""; document.getElementById('botdiv').style.display="none"; document.getElementById('topdiv').style.display="none"; } function clipWindow1(){ window.open('http://economictimes.indiatimes.com/showclips.cms','Clippings','height=400,width=565,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=auto,resizable=0'); } function openpop1(url,iheight,iwidth){ so = window.open(url,'Indiatimes','height='+iheight+',width='+iwidth+',toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,title=test,'); } var tota; function submitpg(t) { var searchpgno = document.getElementById("paging").value; if(searchpgno > t) { alert("Number entered is more than total number of pages."); }else{ if(searchpgno==0){alert("Please enter valid page number.");} else { link='/articlelist/msid-'+ urlid +',curpg-'+ searchpgno +'.cms'; window.location.href=link; } } return true; } function printPagination(curpg,totalpg,msid){ var tmp=0; var stpoint = curpg; var pgno = 5; tota=totalpg; var noofpage = 4; var str= '' if(totalpg > 1){ str += '' } str += '
' str += ''; if(!stpoint <= 1){ if(totalpg > 1){ str += ''; } } for(i=stpoint; i <= stpoint + noofpage && i <= totalpg; i++){ if(i == curpg){ str += ''; } if(stpoint <=(totalpg - 5)){ str += '' str += '' } if(curpg >' } str += '' str += '
' str += i }else{ str += '' str += '' + i + '' } if(i < stpoint + noofpage && i < totalpg){ str += ' | '; } str += ''+ totalpg +'
' str += '' str += '' str += '' str += '' str += '
' str += '
' str += '
' //document.write(str); document.getElementById("divpaging").innerHTML=str; return true; } var zoomarry = new Array(7); zoomarry[0] = "storydiv_2"; zoomarry[1] = "storydiv_1"; zoomarry[2] = "storydiv"; zoomarry[3] = "storydiv1"; zoomarry[4] = "storydiv2"; zoomarry[5] = "storydiv3"; zoomarry[6] = "storydiv4"; var currentid = 2; var nextid=0; function fontsize(xx){ if(currentid >=6){currentid=6;nextid=6} if(xx == 'zoomin' && currentid < 6){nextid = currentid+1;} if(xx == 'zoomout' && currentid > 0){nextid = currentid-1;} if(currentid != nextid){ document.getElementById(""+zoomarry[currentid]).id=zoomarry[nextid]; document.cookie = "storydivid=" + nextid + ";expires="; currentid = nextid; } } function getPreZoom(){ var pvzoom = getZoom('storydivid'); if(pvzoom != ""){ currentid = parseInt(pvzoom); document.getElementById(""+zoomarry[2]).id=zoomarry[currentid]; } } function getZoom (cookieName){ cookieValue = "" if (document.cookie.indexOf(cookieName) == -1){return cookieValue;} else{ cookieStart = document.cookie.indexOf(cookieName); cookieValStart = (document.cookie.indexOf("=", cookieStart) + 1); cookieValEnd = document.cookie.indexOf(";", cookieStart); if (cookieValEnd == -1){cookieValEnd = document.cookie.length} cookieValue = document.cookie.substring(cookieValStart,cookieValEnd); return cookieValue; } } function redirect(res,divid,redirecturl){ if(redirecturl.indexOf('mostemail')!= -1){ if(res == ''){ if(redirecturl.indexOf('day=5')!= -1){ //alert("A"); populate_wtf(redirecturl,'divetupdatemostr','yes','redirect(\'mostemailedtabchnl.cms?redirected=1\')',''); }else{ //alert(redirecturl); populatediv(redirecturl,divid); } } } else{ if(res == ''){ //alert(redirecturl); populatediv(redirecturl,divid); } } } function populate_wtf(urlval,divval,loading,fncname1,fncname2){ try{ var xmlhttp=false; var status=0; if(urlval.lastIndexOf("/")+3 >= urlval.lastIndexOf(".")){ if(urlval.indexOf("mostreadsec") != -1){ urlval='/mostviewedtab.cms'; }else if(urlval.indexOf("mostemailedtabsec") != -1){ urlval='/mostemailedtab.cms'; }else if(urlval.indexOf("mostcommentedtabsec") != -1){ urlval='/mostcommentedtab.cms'; } } if(loading != 'no'){ var str_temp = ''; str_temp = str_temp + '
Loading'; str_temp = str_temp + '
'; document.getElementById(divval).innerHTML = str_temp; } xmlhttp = window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP"); if (xmlhttp){ xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4){ if (xmlhttp.status==200){ var response = xmlhttp.responseText; if(response == ""){ if(fncname1 != ''){ var fn=null; var fn1 = fncname1.substring(0,fncname1.indexOf('(')+1); fn = fn1 + "response,'" + divval + "'," + fncname1.substring(fncname1.indexOf('(')+1,fncname1.length-1)+")"; eval(fn); } }else{ document.getElementById(divval).innerHTML = response; } if(fncname2 != ''){eval(fncname2);} } else if (xmlhttp.status==404) status=0 else status=0 } } xmlhttp.open("GET",urlval,true); xmlhttp.send(null); } }catch (e){xmlhttp = false;} } function tabshowhide1(id){ if(id=='11'){ document.getElementById('section11').className = 'current'; document.getElementById('section12').className = ''; document.getElementById('section').style.display = 'block'; document.getElementById('EntWebsite').style.display = 'none'; }else if(id=='12'){ document.getElementById('section12').className = 'current'; document.getElementById('section11').className = ''; document.getElementById('EntWebsite').style.display = 'block'; document.getElementById('section').style.display = 'none'; } } //audio var curidad=null; function showaudio(audio_id){ var limStr1 =''; limStr1+=' '; limStr1+=''; limStr1+=''; limStr1+=''; limStr1+=''; limStr1+=''; document.getElementById(audio_id).style.display="none"; document.getElementById("player"+audio_id).innerHTML=limStr1; document.getElementById("player"+audio_id).style.display="inline"; if(curidad == null || curidad == audio_id){ curidad = audio_id; }else{ document.getElementById(curidad).style.display="inline"; document.getElementById("player"+curidad).innerHTML=""; document.getElementById("player"+curidad).style.display="none"; curidad = audio_id; } } function hideaudioplayer(){ document.getElementById(curidad).style.display="inline"; if(!/chrome/.test(navigator.userAgent.toLowerCase())){ document.getElementById("player"+curidad).innerHTML=""; } document.getElementById("player"+curidad).style.display="none"; } function audio_hide(hide_id){ document.getElementById(hide_id).style.display='none'; document.getElementById('img').style.display='none'; } function openslideshow(url){ so = window.open(url,'Indiatimes','height=526,width=541,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,'); } function showCmtCount(){ document.getElementById("totalcomment").innerHTML = document.getElementById("cmtcnt").innerHTML; document.getElementById("cmtcnt").innerHTML = ""; } function populate_wf(urlval,divval,loading,fncname){ try{ var xmlhttp=false; var status=0; if(loading != 'no'){ var str_temp = ''; str_temp = str_temp + '
Loading'; str_temp = str_temp + '
'; document.getElementById(divval).innerHTML = str_temp; } xmlhttp = window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP"); if (xmlhttp){ xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4){ if (xmlhttp.status==200){ document.getElementById(divval).innerHTML=xmlhttp.responseText; if(fncname != ''){eval(fncname);} } else if (xmlhttp.status==404) status=0 else status=0 } } xmlhttp.open("GET",urlval,true); xmlhttp.send(null); } }catch (e){ xmlhttp = false; } } // for the forex function validatefx(){ var amount = document.getElementById("amount").value if(amount==""){alert("Please enter the amount.");return false;} if(isNaN(amount)){alert("Please enter correct amount.");return false;} document.getElementById("tocur").value=document.getElementById("tocur1").options[document.getElementById("tocur1").selectedIndex].value; document.getElementById("fromconvert").value=document.getElementById("tocur1").options[document.getElementById("tocur1").selectedIndex].text; document.fxconverter.submit(); } var domain=".indiatimes.com" function decidenew(id) { if(id=='1') { document.getElementById('divind').style.display='block'; document.getElementById('divitimes').style.display='none'; document.loginfrm.idtype[0].checked=true; document.loginfrm.login.value=document.loginfrm1.login.value; document.loginfrm.passwd.value=document.loginfrm1.passwd.value; } if(id=='2') {document.getElementById('divind').style.display='none'; document.getElementById('divitimes').style.display='block';} document.loginfrm1.idtype[1].checked=true; document.loginfrm1.login.value=document.loginfrm.login.value; document.loginfrm1.passwd.value=document.loginfrm.passwd.value; } function checkVal(theForm){ if (theForm.login.value==""){ alert("Please enter a value for the \"Indiatimes or Itimes ID\" field."); theForm.login.focus(); return (false); } var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_."; var checkOK1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_."; var checkStr = theForm.login.value; if (checkStr.length > 50){ alert("Please enter upto 50 characters in the \"Indiatimes ID or Itimes ID\" field.");theForm.login.focus();theForm.login.value=""; return (false); } var allValid = true; for (i = 0; i < checkStr.length; i++){ ch = checkStr.charAt(i); ch1 = checkStr.charAt(0); for (k=0; k < checkOK1.length; k++) if (ch1 == checkOK1.charAt(k)) break; if (k == checkOK.length){ allValid = false; break; } for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length){ allValid = false; break; } } if (!allValid){ alert("Please enter a valid Indiatimes ID or Itimes ID only letters (a-z), numbers (0-9), underscore (_) and dot(.) without any space in between. Indiatimes ID must start with a letter. "); theForm.login.focus(); return (false); } if (theForm.passwd.value == ""){ alert("Please enter a value for the \"Password\" field."); theForm.passwd.focus(); return (false); } theForm.submit(); return(true); } function Set_Ckie(name,value,expires,path,domain,secure){ var today=new Date() today.setTime(today.getTime()) if(expires){expires=expires*1000*60*60*24} var expires_date=new Date(today.getTime()+(expires)) document.cookie=name+"="+escape(value)+((expires)? ";expires="+expires_date.toGMTString(): "")+((path)? ";path="+path : "")+((domain)? ";domain="+domain : "")+((secure)? ";secure" : "") } function Get_Ckie(name){ var start=document.cookie.indexOf(name+"=") var len=start+name.length+1 if((!start)&&(name !=document.cookie.substring(0,name.length))){ return null } if(start==-1)return null; var end=document.cookie.indexOf(";",len) if(end==-1)end=document.cookie.length return unescape(document.cookie.substring(len,end)) } function Delete_Ckie(name,path,domain){ if(Get_Ckie(name))document.cookie=name+"="+((path)? ";path="+path : "")+((domain)? ";domain="+domain : "")+";expires=Thu, 01-Jan-1970 00:00:01 GMT"; } function remIDPASS(){ if(document.getElementById("rememberpassword").checked){ var userid=document.getElementById("login").value var pass=document.getElementById("passwd").value Set_Ckie("commlogu",userid,100,"/",".indiatimes.com","") Set_Ckie("commlogp",pass,100,"/",".indiatimes.com","") document.loginfrm.submit() }else{ Delete_Ckie("commlogu","/",".indiatimes.com") Delete_Ckie("commlogp","/",".indiatimes.com") } } function strtrim(str){ if(!str || typeof str !='string') return null; return str.replace(/^[\s]+/,'').replace(/[\s]+$/,'').replace(/[\s]{2,}/,' '); } function loadIDPass(){ var pass=Get_Ckie("commlogp"); var userid=Get_Ckie("commlogu"); pass=strtrim(pass); userid=strtrim(userid); if(pass=="" || pass==null){} else{ document.getElementById("passwd").value=pass document.getElementById("rememberpassword").checked=true; } if(userid=="" || userid==null){} else{ document.getElementById("login").value=userid; } } function inlineDiv(){ try{ for(cnti=1;cnti<=3;cnti++){ var divobj1 = document.getElementById("cmtdivt"+cnti); var divobj2 = document.getElementById("cmtdiv"+cnti); //alert(divobj1.offsetWidth + "--" + divobj2.offsetWidth); if(divobj2.offsetWidth <= 400){divobj1.style.width=divobj2.offsetWidth+"px";} }}catch(e){} }