var featureimgtitle=new Array();
var featureimg=new Array();
var featurelink=new Array();
var featuretrackpos=new Array();
var exclude=new Array(0,0,0,0,0,0,0,0,0,0,0);
var getcookieval1=new Array();
var alreadyvisit=new Array(0,0,0,0,0,0,0,0,0,0,0);
var excludelist=new Array();
var cokkiealready=0;
var imagecnt=0;
var loppvar=1;
var cokkiedefine=0;
var exmsid="";
function populatediv(urlval,divval){
try
{
var xmlhttp=false;
var status=0;
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;
}
else if (xmlhttp.status==404) status=0
else status=0
}}
xmlhttp.open("GET",urlval,true);
xmlhttp.send(null);
}}
catch (e)
{
xmlhttp = false;
}}
function ManageGoogleimg(cmbid,divid){
var GetDivId;
GetDivId=document.getElementById(divid);
if(cmbid == 3 || cmbid == 1 || cmbid == 0)
GetDivId.style.display="inline";
else
GetDivId.style.display="none";
}
function make_blank1(){document.frmsearch.query.value ="";
}
function implementsearch(){
try{
var searchtext=document.frmsearch.query.value;
searchtext=searchtext.replace(/ /g,"-");
var x=document.frmsearch.srchcmb.selectedIndex;
if (searchtext==''){alert('Please insert text to search');document.frmsearch.query.focus();return false;}
if(x==0)
{
var strsearch = "http://timesofindia.indiatimes.com/topic/"+searchtext+"/photos";
document.frmsearch.action=strsearch;
document.frmsearch.submit();
}
else if(x==1)
{
var strsearch = "http://timesofindia.indiatimes.com/topic/"+searchtext;
document.frmsearch.action=strsearch;
document.frmsearch.submit();}
else if(x==4){var strsearch = "http://timesofindia.indiatimes.com/topic/"+searchtext+"/videos";
document.frmsearch.action=strsearch;
document.frmsearch.submit();}
else if(x==3){var strsearch = "http://search.indiatimes.com/websearch.cms?type=0";document.frmsearch.type.value=0;}
else if(x==2){var strsearch = "http://search.indiatimes.com/websearch.cms?type=1";document.frmsearch.type.value=1;}
document.frmsearch.action=strsearch;document.frmsearch.submit();return true;
}
catch(ex){}
}
function implementsearch1(){
try{
var searchtext=document.frmsearch1.query.value;
var x=document.frmsearch1.srchcmb1.selectedIndex;
if (searchtext==''){alert('Please insert text to search');document.frmsearch1.query.focus();return false;}
if(x==0){
var strsearch = "http://timesofindia.indiatimes.com/topic/"+searchtext+"/photos";
document.frmsearch1.action=strsearch;
document.frmsearch1.submit();}
else if(x==1){
var strsearch = "http://timesofindia.indiatimes.com/topic/"+searchtext;
document.frmsearch1.action=strsearch;
document.frmsearch1.submit(); }
else if(x==4){var strsearch = "http://timesofindia.indiatimes.com/topic/"+searchtext+"/videos";
document.frmsearch1.action=strsearch;
document.frmsearch1.submit();}
else if(x==3){var strsearch = "http://search.indiatimes.com/websearch.cms?type=0";document.frmsearch1.type.value=0;}
else if(x==2){var strsearch = "http://search.indiatimes.com/websearch.cms?type=1";document.frmsearch1.type.value=1;}
document.frmsearch1.action=strsearch;document.frmsearch1.submit();return false;
}
catch(ex){}
}
function setHomepage(what, url){
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.timesofindia.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);}
function broadbandpopup(url, hgt, wdt){
var tvmarg = screen.width;
var ttvmarg = 100;
var tvs_width = 0;
var tvs_height = 0;
tvs_width = wdt;
tvs_height = hgt;
tvmarg = tvmarg -(tvs_width+50);
if (navigator.appName=='Netscape'){
tvow=eval("window.open('"+url+"','so','toolbar=0,scrollbars=0,location=0,status=0,menubars=0,resizable=0,width="+tvs_width+",height="+tvs_height+",top="+ttvmarg+",left="+tvmarg+",maximize=null')")}
else{
tvow=eval("window.open('"+url+"','so','toolbar=0,scrollbars=0,location=0,status=0,menubars=0,resizable=0,width="+tvs_width+",height="+tvs_height+",top="+ttvmarg+",left="+tvmarg+",maximize=null')")}
if (tvow.opener == null) tvow.opener = self; tvow.focus();
}
function shoppingpopup(url, hgt, wdt){
var tvmarg = screen.width;
var ttvmarg = 100;
var tvs_width = 0;
var tvs_height = 0;
tvs_width = wdt;
tvs_height = hgt;
tvmarg = tvmarg -(tvs_width+50);
if (navigator.appName=='Netscape')
{tvow=eval("window.open('"+url+"','shop','toolbar=0,scrollbars=1,location=0,status=0,menubars=0,resizable=0,width="+tvs_width+",height="+tvs_height+",top="+ttvmarg+",left="+tvmarg+",maximize=null')")}
else{tvow=eval("window.open('"+url+"','shop','toolbar=0,scrollbars=1,location=0,status=0,menubars=0,resizable=0,width="+tvs_width+",height="+tvs_height+",top="+ttvmarg+",left="+tvmarg+",maximize=null')")}
if (tvow.opener == null) tvow.opener = self;
tvow.focus();
}
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;
}
}
function showCmtCount(){
document.getElementById("usvg").innerHTML = document.getElementById("second").innerHTML;
document.getElementById("second").innerHTML = "";
}
function mvshowhide(id){
if(id=='addmv'){
document.getElementById('submv').className = 'shw';
document.getElementById('addmv').className = 'hd';
document.getElementById('mvall').className = 'shw';
}else if(id=='submv'){
document.getElementById('submv').className = 'hd';
document.getElementById('addmv').className = 'shw';
document.getElementById('mvall').className = 'hd';
}if(id==''){ //addmv1
document.getElementById('submv1').className = 'shw';
document.getElementById('addmv1').className = 'hd';
}else if(id=='submv1'){
document.getElementById('submv1').className = 'hd';
document.getElementById('addmv1').className = 'shw';
}if(id=='addmv2'){
document.getElementById('submv2').className = 'shw';
document.getElementById('addmv2').className = 'hd';
}else if(id=='submv2'){
document.getElementById('submv2').className = 'hd';
document.getElementById('addmv2').className = 'shw';
}}
var idy, idx, opened = false, move_left = true;
function findPosY(obj){
var curtop = 0;
if (obj.offsetParent){
while (obj.offsetParent){
curtop += obj.offsetTop
obj = obj.offsetParent;
}
}else if (obj.y)
curtop += obj.y;
return curtop;
}
function findPosX(obj){
var curleft = 0;
if (obj.offsetParent){
while (obj.offsetParent){
curleft += obj.offsetLeft
obj = obj.offsetParent;
}
}else if (obj.x)
curleft += obj.x;
return curleft;
}
function moveleft(){
if(move_left){
var dd_obj = document.getElementById("dd");
var left_p = findPosX(dd_obj);
var top_p = findPosY(dd_obj);
dd_obj.style.left = left_p - 296;
dd_obj.style.top = top_p + 23;
dd_obj.style.width = "115";
var inText = '';
dd_obj.innerHTML = inText;
move_left = false;
}
}
function spanDiv(){
if(opened == true){
srinkDiv();
return false;
}
var div_height = document.getElementById("dd").style.height;
div_height = div_height.replace("px","");
var div_h = parseInt(div_height) + 16;
document.getElementById("dd").style.height = div_h;
idy = setTimeout("spanDiv()",10);
if(div_h >= 114){
opened = true;
clearTimeout(idy);
}
}
function srinkDiv(){
var div_height = document.getElementById("dd").style.height;
div_height = div_height.replace("px","");
var div_h = parseInt(div_height) - 16;
if(div_h > 0){
document.getElementById("dd").style.height = div_h;
}
idx = setTimeout("srinkDiv()", 10);
if(div_h <= 1){
opened = false;
div_height = 1;
clearTimeout(idx);
return ;
}
}
function evtCap(ee){
if (window.event && window.event.srcElement){
if(window.event.srcElement.id != "dd"){
srinkDiv();
}
}else if (ee && ee.stopPropagation && !window.opera){
if(ee.target.id != "dd"){
srinkDiv();
}
}
}
try{
document.onclick = evtCap
document.addEventListener("click", evtCap, true)
}catch(ee){}
function switchtabcomm1(act,type){
var arrayofTab = act.split('#');
var arrlen = arrayofTab.length-1;
for(i=arrlen;i>=0;i--){
if(i == 0){
if(type==1){
document.getElementById(arrayofTab[i]+"Data").style.visibility='visible';
document.getElementById(arrayofTab[i]+"Data").style.display='inline';}
document.getElementById(arrayofTab[i]).className="current";
}else {
if(type==1){document.getElementById(arrayofTab[i]+"Data").style.visibility='hidden';
document.getElementById(arrayofTab[i]+"Data").style.display='none';}
document.getElementById(arrayofTab[i]).className="";
}}}
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 featuredtoday()
{
if(cokkiedefine!=0)
{ getcookieval=Get_Ckie("featuremsid");
if(getcookieval!=null)
{
getcookieval1=getcookieval.split('#');
for(iv=0;iv<=getcookieval1.length-1;iv++)
{
for(ivv=0;ivv<=10;ivv++)
{
if(getcookieval1[iv]==exclude[ivv]){cokkiealready=1;}
}
}
}
if(cokkiealready==0){Set_Ckie("featuremsid",exmsid,'',"/",".indiatimes.com","");}
}
for(i=1;i<=10;i++)
{
getcookieval=Get_Ckie("featuremsid");
if (getcookieval != null)
{
getcookieval1=getcookieval.split('#');
for(ii=0;ii<=getcookieval1.length-1;ii++)
{
if(getcookieval1[ii]==excludelist[i]){alreadyvisit[i]=1;}
}
}
if(exclude[i]==0 && imagecnt <=3 && alreadyvisit[i]==0)
{
imagecnt=imagecnt+1;
var structwrite="";
document.getElementById("feature"+imagecnt).innerHTML =structwrite;
}
}
if(imagecnt==0)
{
for(i=1;i<=3;i++)
{
imagecnt=imagecnt+1;
var structwrite="";
document.getElementById("feature"+imagecnt).innerHTML =structwrite;
}
}
else
{
for(i=imagecnt+1;i<=3;i++)
{
imagecnt=imagecnt+1;
var structwrite="";
document.getElementById("feature"+imagecnt).innerHTML =structwrite;
loppvar=loppvar+1;
}
}
}
function getCookievaluenew(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));
}
else
return "";
}
function getCookievalueTitle(strcookie){
var cookiestring = document.cookie;
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));
}
else
return "";
}
function signOut(){
Delete_Ckie("FBOOK_ID","/",".indiatimes.com");
Delete_Ckie("FBOOK_NAME","/",".indiatimes.com");
Delete_Ckie("FBOOK_EMAIL","/",".indiatimes.com");
Delete_Ckie("FBOOK_LOCATION","/",".indiatimes.com");
Delete_Ckie("FBOOK_IMAGE","/",".indiatimes.com");
Delete_Ckie("TWEET_ID","/",".indiatimes.com");
Delete_Ckie("TWEET_NAME","/",".indiatimes.com");
Delete_Ckie("TWEET_LOCATION","/",".indiatimes.com");
Delete_Ckie("TWEET_IMAGE","/",".indiatimes.com");
Delete_Ckie("articleid","/",".indiatimes.com");
Delete_Ckie("txtmsg","/",".indiatimes.com");
Delete_Ckie("tflocation","/",".indiatimes.com");
Delete_Ckie("tfemail","/",".indiatimes.com");
Delete_Ckie("setfocus","/",".indiatimes.com");
Delete_Ckie("fbcheck","/",".indiatimes.com");
Delete_Ckie("twtcheck","/",".indiatimes.com");
Delete_Ckie("usercomt","/",".indiatimes.com");
Delete_Ckie("ifrmval","/",".indiatimes.com");
Delete_Ckie("frmbtm","/",".indiatimes.com");
FB.logout(function(response) {
});
var tmpvar="http://www.facebook.com/logout.php?app_key=6b01f688a268fc70a489a8b444b7d021&session_key="+usersessionkey+"&next="+document.location.href;
if(usersessionkey!="")
document.getElementById('imgLogout').src=tmpvar;
setTimeout('meLogOut()',2000);
}
function meLogOut(){
document.location.href="http://www1.timesofindia.indiatimes.com/logout.cms?tfrout="+document.location.href;
}
function clipWindow1(params){
var isLogged1 = getCookievaluetwitt('MSCSAuth');
var username1=getCookievaluetwitt('MSCSAuthDetails').split('=')[1];
if(isLogged1 == "" || isLogged1 == null){
window.open('/login.cms?newlook=1&TferURL=/showclips.cms','','');
}
else{
if(params=='5' || params=='6'){
loadPopup('6');
}
else{
loadPopup('5');
}
}
}
function openSigninNew(paramChk){
try {
var fbtwtUrl="";
Set_Ckie("frmbtm","1",1,"/",".indiatimes.com","");
if(paramChk=="1"){
//fbtwtUrl="http://socialappsintegrator.indiatimes.com/socialsite/OAuth";
fbtwtUrl="http://socialappsintegrator.indiatimes.com/socialsite/OAuth?channel=nbt";
sigintwtfb = window.open (fbtwtUrl,"sigintwtfb","location=1,status=1,scrollbars=1,width=670,height=380");
setTimeout(function() {
sigintwtfb.moveTo(315,250);
}, 4/*ms*/);
}
else {
fbtwtUrl="http://socialappsintegrator.indiatimes.com/socialsite/OAuth/twitterrequest?channel=nbt";
sigintwtfb = window.open (fbtwtUrl,"sigintwtfb","location=1,status=1,scrollbars=0,width=755,height=350");
sigintwtfb.moveTo(275,200);
}
}
catch(ex){
}
}
var username="";
var newUsername="";
function tpbar(){
try {
var isLogged = getCookievaluetwitt('MSCSAuth');
var tmpUfNVal1="";
var tmpUfN1="";
var tmpUlN1="";
var tmpUFullN1="";
tmpUfNVal1=getCookievaluetwitt('MSCSAuthDetail');
if(getCookievaluetwitt('MSCSAuthDetail')!=null){
tmpUfNVal1=tmpUfNVal1.split("~");
if(tmpUfNVal1[4].split('=')[1]!=null){
tmpUfN1=tmpUfNVal1[4].split('=')[1];
if(tmpUfN1=="null" || tmpUfN1=="undefined"){
tmpUfN1="";
}
}
else {
tmpUfN1="";
}
if(tmpUfNVal1[5].split('=')[1]!=null){
tmpUlN1=tmpUfNVal1[5].split('=')[1];
if(tmpUlN1=="null" || tmpUlN1=="undefined") {
tmpUlN1="";
}
}
else {
tmpUlN1="";
}
tmpUFullN1=tmpUfN1+tmpUlN1;
if(tmpUFullN1!="")
{
var tmplower=tmpUfN1.toLowerCase();
var tmplower1=tmpUlN1.toLowerCase();
if (tmplower.indexOf(tmplower1) !=-1) {username=tmpUfN1;}
else if (tmpUfN1.indexOf(tmpUlN1) !=-1) {username=tmpUfN1;}
else {username=tmpUfN1+" "+tmpUlN1;}
}
else
{
if(getCookievaluetwitt('MSCSAuthDetails')!=null){
username=getCookievaluetwitt('MSCSAuthDetails').split('=')[1];
}
}
username=username.replace("+"," ");
newUsername=username;
}
var tmpstr="";
if(isLogged!=null) {
// Case of SSO
tmpstr='';
tmpstr+='Hi,'
if(username.indexOf('@') == -1) {
//tmpstr=tmpstr+'@indiatimes.com';
}
//tmpstr=tmpstr+"|My Page|";
tmpstr=tmpstr+"|
My Times|";
tmpstr=tmpstr+'Log Out|';
document.getElementById("topbardiv").innerHTML = tmpstr;
}
else {
tmpstr+="
|";
tmpstr+="Log In|";
tmpstr+="Join|";
document.getElementById("topbardiv").innerHTML = tmpstr;
}
}
catch(ex){
}
}
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){
try{
if(Get_Ckie(name)){
document.cookie=name+"="+((path)? ";path="+path : "")+((domain)? ";domain="+domain : "")+";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}
}
catch(ex){
}
}
function deleteReload(a){
//alert("deleting cookies");
try{
//document.ifrmfb.document.getElementById('ifrmfb').submit();
//alert(window.frames['ifrmfb'].document.getElementById('fbpost'));
//window.frames['ifrmfb'].document.getElementById('fbpost').submit();
Delete_Ckie("FBOOK_ID","/",".indiatimes.com");
Delete_Ckie("FBOOK_NAME","/",".indiatimes.com");
Delete_Ckie("FBOOK_EMAIL","/",".indiatimes.com");
Delete_Ckie("FBOOK_LOCATION","/",".indiatimes.com");
Delete_Ckie("FBOOK_IMAGE","/",".indiatimes.com");
Delete_Ckie("TWEET_ID","/",".indiatimes.com");
Delete_Ckie("TWEET_NAME","/",".indiatimes.com");
Delete_Ckie("TWEET_LOCATION","/",".indiatimes.com");
Delete_Ckie("TWEET_IMAGE","/",".indiatimes.com");
Delete_Ckie("articleid","/",".indiatimes.com");
Delete_Ckie("txtmsg","/",".indiatimes.com");
Delete_Ckie("tflocation","/",".indiatimes.com");
Delete_Ckie("tfemail","/",".indiatimes.com");
Delete_Ckie("setfocus","/",".indiatimes.com");
Delete_Ckie("fbcheck","/",".indiatimes.com");
Delete_Ckie("twtcheck","/",".indiatimes.com");
Delete_Ckie("usercomt","/",".indiatimes.com");
//var tmpvar="http://www.facebook.com/logout.php?app_key=121244657904400&session_key="+usersessionkey+"&next="+facebooklink;
var tmpvar="http://www.facebook.com/logout.php?app_key=47255beefd20a79f1f2e244087a0dcc7&session_key="+usersessionkey+"&next=http://twitterapi.indiatimes.com/weboauth/Logout?redirecturl="+facebooklink;
//FB.logout(function(response) {
//});
document.location.href=tmpvar;
//window.location.reload();
}
catch(ex){
//alert(ex);
}
}
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 saveMsg(objid){
var objForm = document.getElementById(objid);
var msgtrunc=objForm.message.value;
if(msgtrunc!=""){
msgtrunc=msgtrunc.replace("&", "%26");
Set_Ckie("txtmsg"+a,msgtrunc,1,"/",".indiatimes.com","");
Set_Ckie("articleid",a,1,"/",".indiatimes.com","");
}
}
function getCookievaluetwitt(strcookie){
var cookiestring = document.cookie;
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));
}
else
return null;
}
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 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 chkDiv(e){
var targ;
if (!e) var e = window.event;
if (e.target) targ = e.target;
else if (e.srcElement) targ = e.srcElement;
var objDiv=document.getElementById("srchcmb2");
var arrimg=document.getElementById("mnuarr");
if (targ.nodeName != "HTML")
{
while (targ.nodeName != "BODY")
{
if (targ.id && targ.id == 'srchcmb2')
{
if(objDiv.style.display=="none")
{objDiv.style.display="block";
}
else
{
objDiv.style.display="none";}
return;
}
else
{
if ((targ.id && targ.id == 'srchsel2') || targ.id=='secdiv')
{
if(objDiv.style.display=="none")
{
objDiv.style.display="block";
arrimg.className='rotimg2';
document.getElementById("glbldata").src="http://timesofindia.indiatimes.com/glbldata.cms";
}
else
{
objDiv.style.display="none";
arrimg.className='rotimg1';
}
return;
}
else
targ = targ.parentNode;
}
}
}
objDiv.style.display="none";arrimg.className='rotimg1';
closeSel(e)
}
function meLogOut(){
document.location.href="http://www1.navbharattimes.indiatimes.com/logout.cms?tfrout="+document.location.href;
}
function getElementSso(aID){
return (document.getElementById) ?
document.getElementById(aID) : document.all[aID];
}
function getIFrameDocumentSso(aID){
var rv = null;
var frame=getElementSso(aID);
if (frame.contentDocument)
rv = frame.contentDocument;
else // bad IE ;)
rv = document.frames[aID].document;
return rv;
}
function adjustMySsoHeight(elemId,ht){
try{
var frame = getElementSso(elemId);
var frameDoc = getIFrameDocumentSso(elemId);
if(ht=="X"){
frame.height =frameDoc.body.scrollHeight;
}
else {
ht=ht+180;
frame.height=ht;
}
}
catch(ex){}
}
function adjustMySsoHeightNew(elemId){
try{
var frame1 = getElementSso(elemId);
var frameDoc1 = getIFrameDocumentSso(elemId);
frame1.height = frameDoc1.body.scrollHeight;
}
catch(ex){}
}
function adjustMySsoHeightNewX(elemId,hxT){
try{
hxT=hxT+20;
window.frames['signupsso'].document.getElementById('shwclip').height=hxT;
}
catch(ex){}
}
function adjusthgt(hgt){
try{
if(hgt=='3'){
document.getElementById("signupsso").height=510;
document.getElementById("signupsso").width=580;
document.getElementById("clsimg").style.display="inline";
}
else if(hgt=='5'){
document.getElementById("signupsso").height=510;
document.getElementById("signupsso").width=528;
document.getElementById("clsimg").style.display="inline";
}
else if(hgt=='1'){
document.getElementById("signupsso").height=570;
document.getElementById("signupsso").width=554;
document.getElementById("clsimg").style.display="inline";
}
else if(hgt=='6'){
document.getElementById("signupsso").height=535;
document.getElementById("clsimg").style.display="inline";
}
else if(hgt=='4'){
document.getElementById("signupsso").height=280;
document.getElementById("clsimg").style.display="inline";
}
else if(hgt=='7'){
document.getElementById("signupsso").height=480;
document.getElementById("clsimg").style.display="inline";
}
else if(hgt=='8'){
document.getElementById("mainblkdiv").style.width="580px";
document.getElementById("signupsso").width=554;
document.getElementById("clsimg").style.display="inline";
}
else if(hgt=='9'){
//document.getElementById("signupsso").height=555;
document.getElementById("clsimg").style.display="inline";
}
else if(hgt=='10'){
document.getElementById("signupsso").height=460;
document.getElementById("clsimg").style.display="inline";
}
else if(hgt=='12'){
document.getElementById("signupsso").height=105;
document.getElementById("signupsso").width=430;
document.getElementById("mainblkdiv").style.width="430px";
document.getElementById("clsimg").style.display="none";
}
else if(hgt=='13'){
document.getElementById("signupsso").height=145;
document.getElementById("signupsso").width=560;
document.getElementById("mainblkdiv").style.width="560px";
document.getElementById("clsimg").style.display="none";
}
else if(hgt=='14'){
document.getElementById("signupsso").height=172;
document.getElementById("clsimg").style.display="none";
}
else if(hgt=='15'){
document.getElementById("signupsso").height=496;
}
else if(hgt=='16'){
document.getElementById("signupsso").height=530;
}
else{
document.getElementById("signupsso").height=200;
document.getElementById("clsimg").style.display="inline";
}
}
catch(ex){}
}