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 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 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 = '
';
}else{
populatedivnoL('/topbar.cms','topbardiv');
}
}
function showGraph(exch){
var gpObj = document.getElementById("exchgraph");
if(exch=="bse"){
gpObj.src="http://graphing.indiatimes.com/TILCharts/GenerateChart.aspx?data=graph_bse_240_58_et_homepage";
document.getElementById("bse").style.fontWeight="bold";
document.getElementById("nse").style.fontWeight="normal";
}else if(exch=="nse"){
gpObj.src="http://graphing.indiatimes.com/TILCharts/GenerateChart.aspx?data=graph_nse_240_58_et_homepage";
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/cms.dll/login?TferURL=' + addr;
}
}
function getUserID(){
sUser = getCookievalue('commlogu');
vmstatus=getCookievalue('cmssso');
if( (sUser != "" || sUser != "undefined") && (vmstatus == 'true')){
return sUser;
}else{
sUser="";
}return sUser;
}
function pfoliosumarydispurl(){
if (getUserID() == ""){
return "/myportfolio.cms?type=2";
}else{
return "/myportfolio.cms?type=1";
}
}
function watchlistdiaplay(){
populatediv(watchlistdisplayurl(),'watch_list');
}
function watchlistdisplayurl(){
if (!getUserID() == ""){
return "/mywatchlist.cms?userid="+getUserID();
}else{
return "/topgainerlooser_wlst_opt.cms?group=&exchange=n&type=gainer&page=0&msgshow=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";
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]='Legal Services'
menu3[9]='Tenders'
menu3[10]='Projects'
menu3[11]='Remit2India'
menu3[12]='Wallet365'
menu3[13]='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-'+msid+',random-'+ inRandom +'.cms';
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/cms.dll/login?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/msid-' + findpos+',random-'+ inRandom + '.cms';
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,');
}