';
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 ='';
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){}
}