// JavaScript Document

function getBsProd()
			{
				bsproducts=new Array("BS Epaper","BS Billionaires","BS 1000","Fund Manager","Banking Annual","Awards","Books","BS Hindi","BS Motoring","BS Bazaar");
				bsproducts_lnk=new Array("http://www.bsepaper.com","/special/billion09/billionaire.php","/india/bs1000/","/special/fm2007/fm2007_01.htm","/india/bankannual/bankannual.php","/awards/","http://www.business-standard.com/books","http://hindi.business-standard.com","http://www.bsmotoring.com","http://www.bsbazaar.com");
				var bsPhtm;
				bsPhtm="";
				for(bsi=1;bsi<bsproducts.length;bsi++)
					{
						if(bsi<bsproducts.length-1)
						{
							bsPhtm=bsPhtm+"&nbsp;<a href='"+bsproducts_lnk[bsi]+"'  target='_blank'  class='rdxmenu' >"+bsproducts[bsi]+"</a><span class='rdxmenu'> |</span>";
						}
						else
						{
							bsPhtm=bsPhtm+"&nbsp;<a href='"+bsproducts_lnk[bsi]+"'  target='_blank' class='rdxmenu' >"+bsproducts[bsi]+"</a>";
						}
					}
					document.getElementById("bsProdLnk").innerHTML=bsPhtm;
			}

function mmLoadMenus()
{

}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
  
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

////**** Hide Menu List ******//////




//////////////////// Tabs/////////
function hideAll(){
	document.getElementById("page_1").style.display = 'none';
	document.getElementById("page_2").style.display = 'none';
	document.getElementById("page_3").style.display = 'none';
	document.getElementById("page_4").style.display = 'none';
	}
	
function showN(active_i){
	hideAll();
		document.getElementById(active_i).style.display = "";
	}
	
	
	
////////////// Blogs/////
	function hideAllBlogs(){
	document.getElementById("bssays").style.display = 'none';
	document.getElementById("blogs").style.display = 'none';
	document.getElementById("spnews").style.display = 'none';
		}
	
function showBlogs(active_i){
	hideAllBlogs();
		document.getElementById(active_i).style.display = "";
	}
		
////////////// Comments/////
function hideComAndChat(){
	document.getElementById("comments").style.display = 'none';
	document.getElementById("chat").style.display = 'none';
		}
	function showComAndChat(active_i){
	hideComAndChat();
		document.getElementById(active_i).style.display = "";
	}
	
	
////// Read Emailed Searched //////
function hideread(){
	document.getElementById("read").style.display = 'none';
	document.getElementById("emailed").style.display = 'none';
	document.getElementById("searched").style.display = 'none';
		}
	function showRead(active_i){
	hideread();
		document.getElementById(active_i).style.display = "";
	}
	
	
////// Contest //////
function hidecontest(){
	document.getElementById("vote").style.display = 'none';
	document.getElementById("contest").style.display = 'none';
		}
	function showContest(active_i){
	hidecontest();
		document.getElementById(active_i).style.display = "";
	}	
	
	
	
	////// Specials Select Connect//////
function hidespecials(){
	document.getElementById("specials").style.display = 'none';
	document.getElementById("tab2").style.display = 'none';
	document.getElementById("connect").style.display = 'none';
		}
	function showSpecials(active_i){
	hidespecials();
		document.getElementById(active_i).style.display = "";
	}	
		
/// hide chart tab
function hidechart(){
	document.getElementById("chart").style.display = 'none';
	document.getElementById("market").style.display = 'none';
}
	function showChart(active_i){
	hidechart();
		document.getElementById(active_i).style.display = "";
	}	

// end hide chart tab
		
		////// Top Stories Today's Paper //////
function hidetopstories(){
	document.getElementById("tstories").style.display = 'none';
	document.getElementById("tpaper").style.display = 'none';
}
	function showTstories(active_i){
	hidetopstories();
		document.getElementById(active_i).style.display = "";
	}	
	
	///// Compare Tabs  /////
	
	function hideCompare(){
	document.getElementById("CObj").style.display = 'none';
	document.getElementById("CAMC").style.display = 'none';
}
	function showCompare(active_i){
	hideCompare();
		document.getElementById(active_i).style.display = "";
	}	
	
// my Favourites section open/close js...
	function hideSection() {
	document.getElementById('section_on').style.display = "none";
	document.getElementById('section_off').style.display = "";
	
}
	function showSection() {
	document.getElementById('section_on').style.display = "";
	document.getElementById('section_off').style.display = "none";
}
/// Gizmo Tabs //////

function hidegizmo(){
	document.getElementById("camera").style.display = 'none';
	document.getElementById("cell").style.display = 'none';
	document.getElementById("paudio").style.display = 'none';
	document.getElementById("nbook").style.display = 'none';
	document.getElementById("henter").style.display = 'none';
		}
	function showGizmo(active_i){
	hidegizmo();
		document.getElementById(active_i).style.display = "";
	}	
// to make big or small news font
function large()
{
	document.getElementById('header').style.fontSize="18";
	//alert("hi");
}

function small()

{
	document.getElementById('header').style.fontSize="13";

}
// this js for get_quote.php page
function chkSear(){		
	if(document.frmSearch.search.value=="Company name or BSE code"){
		alert("Please enter the serach text");
		document.frmSearch.search.focus();
		return false;
	}else if(document.frmSearch.search.value==""){
		alert("Please enter the serach text");
		document.frmSearch.search.focus();
		return false;
	}else if(document.frmSearch.search.value.length<3){
		alert("Serach text contain minimum 3 digits");
		document.frmSearch.search.focus();
		return false;
	}else{
		var log = isLoginCheck(document.frmSearch.search);	
		if(log != ""){
			alert("Search text should not contain special characters");
			document.frmSearch.search.focus();
			return false;
		}else{
			document.frmSearch.action="../../stockpage/stock_search.php";
			document.frmSearch.submit();
			return true;
		}
	}
}

function isLoginCheck(objValue){	
     var charpos = objValue.value.search("[^A-Za-z0-9 _]"); 
	 var strError="";
		var At=objValue.value.charAt(0);
		if(isNaN(objValue.value.charAt(0))==0){
			if(!isNaN(objValue.value)){
				strError ="";
			}else{
				strError ="Invalid";
			}
		}else if(objValue.value.length > 0 &&  charpos >= 0){
			if(!strError || strError.length ==0){ 
				strError ="Invalid"; 
			}
		}
		if(strError == ""){
			return ""; 
		}else{
			return strError; 
		}
}
// End get_quote.php page js
/* bookmark link */

 function CreateBookmarkLink(title,url) {

	//title = "Webpage Title"; 
  // Blogger - Replace with <$BlogItemTitle$> 
  // MovableType - Replace with <$MTEntryTitle$>

    //url = "Webpage URL";
  // Blogger - Replace with <$BlogItemPermalinkURL$> 
  // MovableType - Replace with <$MTEntryPermalink$>
  // WordPress - <?php bloginfo('url'); ?>

	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	}
	else if( window.external ) { // IE Favorite
		window.external.AddFavorite( url, title); }
	else if(window.opera && window.print) { // Opera Hotlist
		return true; }
 }
 /* end bookmark */
/* Save Page */
var isReady = false;
function doSaveAs(){
if (document.execCommand){
if (isReady){document.execCommand("SaveAs");}
}else{
    alert('Feature available only in Internet Exlorer 4.0 and later.');
 }
}

function ajaxchi(auto,id,elementid,page)
{
	var chiautono=document.getElementById("chiautono").value;
	
	
var xmlHttp;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Your browser does not support AJAX!");
      return false;
      }
    }
  }
  xmlHttp.onreadystatechange=function()
    {
    if(xmlHttp.readyState==4)
      {
        document.getElementById("chinwhsp").innerHTML=xmlHttp.responseText;
      }
    }

xmlHttp.open("GET","/india/top5_chinwhsp.php?autono="+chiautono,true);
  xmlHttp.send(null);
  }
 
 
function reload_w()
{
var reload_f
reload_f = document.getElementById("captcha_w");
reload_f.src = reload_f.src;
}