function populatedv(urlval,divval,id) { try { var xmlhttp=false; var status=0; //CHECKING VALUE OF xmlhttp IS TRUE 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 populatedivleft(urlval,divval) { try { var xmlhttp=false; var status=0; //CHECKING VALUE OF xmlhttp IS TRUE xmlhttp = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP"); if (xmlhttp) {alert('1'); //checking the state of http object xmlhttp.onreadystatechange=function() {alert('2'); if (xmlhttp.readyState==4) {alert('3'); if (xmlhttp.status==200) { alert('dingh'); 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 arc0f(showpg) { document.frmsearch.curpg.value=showpg; document.frmsearch.submit(); } function arc1f(showpg) { document.frm1.curpg.value=showpg; document.frm1.submit(); } function implementsearch_chat() { 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;} } } 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) { //alert('aa'); var strsearch = "http://search.indiatimes.com/websearch.cms?type=0"; document.frmsearch.action=strsearch; document.frmsearch.submit(); } return false ; } function implementsearch2(){implementsearch();return false ;} function implementsearch1(){implementsearch();return false ;} function implementsearchet(){implementsearch();return false ;} function osearch(){ var p=0; var x; for(x=0;x<2;x++) { if (document.frmos.qr[x].checked==1) { p=1; break; } } if(x=='0'){ var strsearch = "http://203.199.70.235/equity/quote.jsp?ticker=" + document.frmos.qr[0].value +"&exchange=b"; document.frmos.action=strsearch; document.frmos.submit(); } if(x=='1'){ var strsearch = "http://203.199.70.235/mfund/search_result.jsp?key=" + document.frmos.qr[1].value + "&domain=mf" document.frmos.action=strsearch; document.frmos.submit(); } return false ; } function changetopchat(fid) { if(fid==1) {populatediv('/formdata.cms','content'); } else { populatediv('/celebdata.cms','content'); } var i; for(i=1;i<=2;i++) { cntrl=document.getElementById('f'+i); if(i==fid) { cntrl.className='headlineon'; document.getElementById('r'+i).src="http://chat.indiatimes.com/photo.cms?msid=303562"; } else { cntrl.className='headlineoff lightborder'; document.getElementById('r'+i).src="http://chat.indiatimes.com/photo.cms?msid=303561"; } } } function populatediv(urlval,divval) { try { var xmlhttp=false; var status=0; //CHECKING VALUE OF xmlhttp IS TRUE 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 newReg(newSurferUrl) { var t1=newSurferUrl; var s_width = screen.width; var s_height = screen.height; if (s_width > 1024){ s_width = 960; s_height = 600; }else{ s_width = parseInt(0.90 * screen.width); s_height = parseInt(0.80 * screen.height); } window.open(t1,'Photogallery','width='+s_width+',height='+s_height+',status=no,toolbar=no,menubar=no,titlebar=no,scrollbars=1,resizable=no,top=0,left=0'); //window.close(); } function ManageGoogleimg(cmbid,divid) { var GetDivId; GetDivId=document.getElementById(divid); if(cmbid.options[cmbid.selectedIndex].text =="Indiatimes" || cmbid.options[cmbid.selectedIndex].text=="Web") { GetDivId.style.visibility="visible"; document.getElementById(divid).style.display="inline"; } else { GetDivId.style.visibility="hidden"; document.getElementById(divid).style.display="none"; document.getElementById(divid + "_td").style.width ="2px"; } } function tabshowhide(id) { if(id=='l3') { document.getElementById('l3').className = 'current'; document.getElementById('l4').className = ''; document.getElementById('tabcontent3').style.display = 'block'; document.getElementById('tabcontent4').style.display = 'none'; }if(id=='l4') { document.getElementById('l4').className = 'current'; document.getElementById('l3').className = ''; document.getElementById('tabcontent4').style.display = 'block'; document.getElementById('tabcontent3').style.display = 'none'; } } function validateFormOnSubmit(theForm) { var reason = ""; reason += validateUsername(theForm.chatname); if (reason != "") { alert(reason); return false; } document.form1.submit(); return false; } function validateUsername(fld) { var error = ""; var illegalChars = /\W/; // allow letters, numbers, and underscores if (fld.value == "") { error = "Please write a nickname to enter the chatroom.\n"; } else if (illegalChars.test(fld.value)) { error = "Special characters are not allowed in a nickname.\n"; } else if ((fld.value.length < 3) || (fld.value.length > 20)) { error = "Nickname should be more than 3 and less than 20 characters.\n It should not have any special characters.\n"; } return error; } function trim(s) { return s.replace(/^\s+|\s+$/, ''); } function validate1() { if (document.loginform.login.value.length < 1) { alert("Please enter your username."); document.loginform.login.focus(); return false; } if (document.loginform.passwd.value.length < 3) { alert("Please enter your password."); document.loginform.passwd.focus(); return false; } return true; } function get_cookie ( cookie_name ) { var results = document.cookie.match ( cookie_name + '=(.*?)(;|$)' ); if ( results ) return ( unescape ( results[1] ) ); else return null; } var xid = get_cookie ( "MSCSAuth" ); function setHomepage(what, url) { //alert("home"); if (navigator.appName == 'Microsoft Internet Explorer' && document.getElementById) setHomepageExplorer(what, url); else if (document.layers || document.getElementById) setHomepageNetscape(what, url); return false; } function setHomepageNetscape(what, url) {var warn = 'Due to Netscapes security handling, making Indiatimes ' + 'your homepage, will show you a dialog with a warning.' + 'If you do not wish to grant this site the access to ' + 'your browser settings, you can manually copy ' + 'http://www.indiatimes.com and paste it in the location field in ' + 'Edit|Preferences|Navigator.'; if (confirm(warn)) { netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite"); navigator.preference('browser.startup.homepage', url);netscape.security.PrivilegeManager.disablePrivilege("UniversalPreferencesWrite"); } } function setHomepageExplorer(what, url) { what.style.behavior = 'url(#default#homepage)'; what.setHomePage(url); }