function strtrim(mvalue) { var temp1 = mvalue; var obj = /^(\s*)([\W\w]*)(\b\s*$)/; if (obj.test(temp1)) { temp1 = temp1.replace(obj, '$2'); } var obj = / /g; while (temp1.match(obj)) { temp1 = temp1.replace(obj, " "); } return temp1; } function arc0f(showpg) { document.frmsearch.curpg.value=showpg; document.frmsearch.submit(); } function arc1f(showpg) { document.frm1.curpg.value=showpg; document.frm1.submit(); } function implementsearch() { 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;} } } if(strtrim(document.frmsearch.query.value)==false) { alert('Please insert text to search'); document.frmsearch.query.focus(); 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/action1.cms?sitesearch=indiatimes.com"; document.frmsearch.action=strsearch; document.frmsearch.submit(); } if(x==2) { var strsearch = "http://search.indiatimes.com/action.cms"; document.frmsearch.action=strsearch; document.frmsearch.submit(); } return false ; } var cookiestring,sUser,sUserLength, mstatus1,addr,findpos,findposLength,findrate,findrateLength,inrRandom; function getCookievaluer(strcookie) { 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)); } } try { cookiestring= document.cookie; cookiestring = cookiestring.toLowerCase(); sUser = getCookievaluer('commlogu'); sUserLength = sUser.length; mstatus1 = getCookievaluer('cmssso'); numero= 999999.9999 inrRandom = Math.round((Math.random() * numero+ 0.5)); } catch(er) { cookiestring=' '; sUserLength=0; } addr = escape(document.URL+'&random='+inrRandom); function ratepopup(msid,vote) { if ((cookiestring.indexOf('commlogp') != -1) && (sUserLength > 0) && (mstatus1 == 'true')) { var popupurlrate='http://www1.timesofindia.indiatimes.com/rating.cms?msid='+msid+'&voteid='+msid+'&vote='+vote+'&random='+inrRandom; window.open(popupurlrate,'Rating','toolbar=0,scrollbars=0,location=0,status=0,menubars=0,resizable=0,width=350,height=150,top="0",left="0",maximize=null'); } else { try { findpos = getCookievaluer('artid'); findposLength = findpos.length; findrate = getCookievaluer('rating'); } catch(er) { findposLength =0; } if((findpos != '0') && (findposLength > 1) && (findrate != '0')) { document.cookie = 'artid=0'; document.cookie = 'rating=0'; } else { document.cookie = 'artid=' + escape(msid); document.cookie = 'rating=' + escape(vote); } var addrcon = 'http://timesofindia.indiatimes.com/articleshow/' + msid + '.cms'; document.location.href = 'http://timesofindia.indiatimes.com/login.cms?TferURL=' + addrcon; } } if ((cookiestring.indexOf('commlogp') != -1) && (sUserLength > 0) && (mstatus1 == 'true') ) { try { findpos = getCookievaluer('artid'); findposLength = findpos.length; findrate = getCookievaluer('rating'); } catch(er) { findposLength =0; } if((findpos != '0') && (findposLength > 1) && (findrate != '0') ) { var popupurlrate1='http://www1.timesofindia.indiatimes.com/rating.cms?msid=' + findpos+'&voteid='+findpos+'&vote='+findrate+'&random='+inrRandom; window.open(popupurlrate1,'Rating','toolbar=0,scrollbars=0,location=0,status=0,menubars=0,resizable=0,width=350,height=150,top="0",left="0",maximize=null'); } document.cookie = 'artid=0'; document.cookie = 'rating=0'; }