// JavaScript Document
function createObject()
{
var objXmlHttp=null 

if (navigator.userAgent.indexOf("Opera")>=0) 
   { 
       objXmlHttp=new XMLHttpRequest() 
   return objXmlHttp 
   } 
if (navigator.userAgent.indexOf("MSIE")>=0) 
   { 
   var strName="Msxml2.XMLHTTP" 
   if (navigator.appVersion.indexOf("MSIE 5.5")>=0) 
      { 
      strName="Microsoft.XMLHTTP" 
      } 
   try 
      { 
      objXmlHttp=new ActiveXObject(strName) 
      return objXmlHttp 
      } 
   catch(e) 
      { 
      alert("Error. Scripting for ActiveX might be disabled") 
      return 
      } 
    } 
if (navigator.userAgent.indexOf("Mozilla")>=0) 
   { 
   objXmlHttp=new XMLHttpRequest() 
   return objXmlHttp 
   } 
}

var httpobj1=createObject();


function changeNewTab(val)
{
                if(document.getElementById('toptab_'+val).innerHTML=='')
                {
                                url="/tab/homepage/newTab.php?id="+val;
                                httpobj1.open("get",url);
                                httpobj1.onreadystatechange=handleResponseNewTopTab;
                                httpobj1.send(null);
                }
                else
                {
                                show_selected_topNewdiv(val);
                }              
}
function handleResponseNewTopTab(){
                var text;
                var temp;
                if(httpobj1.readyState==4)
                {
                                text=httpobj1.responseText;
                                temp= text.split('*****');
                                var id= temp[0];
                                var value=temp[1];
                                document.getElementById('toptab_'+id).innerHTML = value;
                                show_selected_topNewdiv(id);
                }                              
}
function show_selected_topNewdiv(val)
{
     for (var i=1;i<=3;i++)
          {
               if(i==val){
                    document.getElementById('toptab_'+i).style.display="block";
                    document.getElementById('TopClass'+i).className="active";
                    document.getElementById('TopSelectedClass'+i).className="btxt11";
                         }
               else{
                    document.getElementById('toptab_'+i).style.display="none";
                    document.getElementById('TopClass'+i).className="";
                    document.getElementById('TopSelectedClass'+i).className="gtxt11";
                    }
                 }
}


function htab_netwotk(a, b, c, d){
		for(var i=1; i<=b; i++){
			if(i == a){
				document.getElementById(c+i).className = "hother_tact";
				document.getElementById(d+i).style.display = "block"
			}else{
				document.getElementById(c+i).className = "hother_tnact";
				document.getElementById(d+i).style.display = "none"
			}
		}
	}

function get_cookie(Name) 
	{
		
		var search = Name+"="	
		var returnvalue = "";
		if (document.cookie.length > 0) {
			offset = document.cookie.indexOf(search)
			if (offset != -1) {
				offset += search.length
				end = document.cookie.indexOf(";", offset);
				if (end == -1) end = document.cookie.length;
				returnvalue=unescape(document.cookie.substring(offset, end));
				
					var a 	=returnvalue.length;
					for(i=0;i<a;i++)
					{
						returnvalue=replace_plus(returnvalue);
					}
			}
		}
		
		return returnvalue;
	}
			
function set_cookie ( name, value, exp_y, exp_m, exp_d, path, domain, secure )
{
  var cookie_string = name + "=" + escape ( value );

  if ( exp_y )
  {
    var expires = new Date ( exp_y, exp_m, exp_d );
    cookie_string += "; expires=" + expires.toGMTString();
  }

  if ( path )
        cookie_string += "; path=" + escape ( path );

  if ( domain )
        cookie_string += "; domain=" + escape ( domain );
  
  if ( secure )
        cookie_string += "; secure";
  
  document.cookie = cookie_string;
}
function Delete_Cookie( name, path, domain ) {
if ( Get_Cookie1( name ) ) document.cookie = name + "=" +
( ( path ) ? ";path=" + path : "") +
( ( domain ) ? ";domain=" + domain : "" ) +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}
function Get_Cookie1( 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 get_cookie_variable(str,pos)
{
	var arr_cookie=str.split("**");
	var name=arr_cookie[pos];
	return name;
}
 function replace_plus(text)
	{
        return text.replace('+',' ');
	}	

////  tooltip.js

////


/////

//swfobject.js
/**
 * SWFObject v1.4.1: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for
 *   legal reasons.
 */
if(typeof deconcept == "undefined") var deconcept = new Object();
if(typeof deconcept.util == "undefined") deconcept.util = new Object();
if(typeof deconcept.SWFObjectUtil == "undefined") deconcept.SWFObjectUtil = new Object();
//deconcept.SWFObject = function(swf, id, w, h, ver, c, useExpressInstall, quality, xiRedirectUrl, redirectUrl, detectKey){
	deconcept.SWFObject = function(swf, id, w, h, ver, c){
	if (!document.createElement || !document.getElementById) { return; }
//	this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
//	this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
	this.params = new Object();
	this.variables = new Object();
	this.attributes = new Array();
	if(swf) { this.setAttribute('swf', swf); }
	if(id) { this.setAttribute('id', id); }
	if(w) { this.setAttribute('width', w); }
	if(h) { this.setAttribute('height', h); }
	if(ver) { this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split("."))); }
//	this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion(this.getAttribute('version'), useExpressInstall);
	if(c) { this.addParam('bgcolor', c); }
//	var q = quality ? quality : 'high';
//	this.addParam('quality', q);
//	this.setAttribute('useExpressInstall', useExpressInstall);
//	this.setAttribute('doExpressInstall', false);
//	var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
//	this.setAttribute('xiRedirectUrl', xir);
//	this.setAttribute('redirectUrl', '');
//	if(redirectUrl) { this.setAttribute('redirectUrl', redirectUrl); }
}
deconcept.SWFObject.prototype = {
	setAttribute: function(name, value){
		this.attributes[name] = value;
	},
	getAttribute: function(name){
		return this.attributes[name];
	},
	addParam: function(name, value){
		this.params[name] = value;
	},
	getParams: function(){
		return this.params;
	},
	addVariable: function(name, value){
		this.variables[name] = value;
	},
	getVariable: function(name){
		return this.variables[name];
	},
	getVariables: function(){
		return this.variables;
	},
	getVariablePairs: function(){
		var variablePairs = new Array();
		var key;
		var variables = this.getVariables();
		for(key in variables){
			variablePairs.push(key +"="+ variables[key]);
		}
		return variablePairs;
	},
	getSWFHTML: function() {
		var swfNode = "";
		if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture
//			if (this.getAttribute("doExpressInstall")) this.addVariable("MMplayerType", "PlugIn");
			swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'"';
			swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
			var params = this.getParams();
			 for(var key in params){ swfNode += [key] +'="'+ params[key] +'" '; }
			var pairs = this.getVariablePairs().join("&");
//			var pairs = "flv=http://static.ibnlive.com/data/videos/flv/devils_mush1.flv"
			 if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }
			swfNode += '/>';
		} else { // PC IE
			if (this.getAttribute("doExpressInstall")) this.addVariable("MMplayerType", "ActiveX");
			swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'">';
			swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';
			var params = this.getParams();
			for(var key in params) {
			 swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
			}
			var pairs = this.getVariablePairs().join("&");
//alert(pairs);
//var pairs = "flv=http://static.ibnlive.com/data/videos/flv/devils_mush1.flv"
			if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}
			swfNode += "</object>";
			//alert(swfNode)
		}
		return swfNode;
	},
	write: function(elementId){
		
//		if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){
			var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
			n.innerHTML = this.getSWFHTML();
			return true;
//		}else{
//			if(this.getAttribute('redirectUrl') != "") {
//				document.location.replace(this.getAttribute('redirectUrl'));
//			}
//		}
		//return false;
	}
}

/* ---- detection functions ---- */
deconcept.SWFObjectUtil.getPlayerVersion = function(reqVer, xiInstall){
	var PlayerVersion = new deconcept.PlayerVersion([0,0,0]);
	if(navigator.plugins && navigator.mimeTypes.length){
		var x = navigator.plugins["Shockwave Flash"];
		if(x && x.description) {
			PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
		}
	}else{
		try{
			var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			for (var i=3; axo!=null; i++) {
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);
				PlayerVersion = new deconcept.PlayerVersion([i,0,0]);
			}
		}catch(e){}
		if (reqVer && PlayerVersion.major > reqVer.major) return PlayerVersion; // version is ok, skip minor detection
		// this only does the minor rev lookup if the user's major version 
		// is not 6 or we are checking for a specific minor or revision number
		// see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
		if (!reqVer || ((reqVer.minor != 0 || reqVer.rev != 0) && PlayerVersion.major == reqVer.major) || PlayerVersion.major >= 8 || xiInstall) {
			try{
				PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
			}catch(e){}
		}
	}
	return PlayerVersion;
}
deconcept.PlayerVersion = function(arrVersion){
	this.major = parseInt(arrVersion[0]) != null ? parseInt(arrVersion[0]) : 0;
	this.minor = parseInt(arrVersion[1]) || 0;
	this.rev = parseInt(arrVersion[2]) || 0;
}
deconcept.PlayerVersion.prototype.versionIsValid = function(fv){
	if(this.major < fv.major) return false;
	if(this.major > fv.major) return true;
	if(this.minor < fv.minor) return false;
	if(this.minor > fv.minor) return true;
	if(this.rev < fv.rev) return false;
	return true;
}
/* ---- get value of query string param ---- */
deconcept.util = {
	getRequestParameter: function(param){
		var q = document.location.search || document.location.hash;
		if(q){
			var startIndex = q.indexOf(param +"=");
			var endIndex = (q.indexOf("&", startIndex) > -1) ? q.indexOf("&", startIndex) : q.length;
			if (q.length > 1 && startIndex > -1) {
				return q.substring(q.indexOf("=", startIndex)+1, endIndex);
			}
		}
		return "";
	}
}
/* fix for video streaming bug */
deconcept.SWFObjectUtil.cleanupSWFs = function() {
	var objects = document.getElementsByTagName("OBJECT");
	for (var i=0; i < objects.length; i++) {
		for (var x in objects[i]) {
			if (typeof objects[i][x] == 'function') {
				objects[i][x] = null;
			}
		}
	}
}
if (typeof window.onunload == 'function') {
	var oldunload = window.onunload;
		window.onunload = function() {
		deconcept.SWFObjectUtil.cleanupSWFs();
		oldunload();
	}
} else {
	window.onunload = deconcept.SWFObjectUtil.cleanupSWFs;
}
/* add Array.push if needed (ie5) */
if (Array.prototype.push == null) { Array.prototype.push = function(item) { this[this.length] = item; return this.length; }}

/* add some aliases for ease of use/backwards compatibility */
var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject; // for legacy support
var SWFObject = deconcept.SWFObject;

  
function collapse(stg)
{

document.getElementById("flash_big").style.display="none";
document.getElementById("flash_big").style.visibility="hidden";
document.getElementById("flash_big").style.zIndex = "999999";

}
function expand()
{
	
	document.getElementById("flash_big").style.display="block";
	document.getElementById("flash_big").style.visibility="visible";
	
}

function flashResizer_big_DoFSCommand(command, args) { 
	if (command == "collapse") { 
		collapse();
	}
}

////////////////////////////////////////////////////////////////////



/*****************************SEARCH.JS****************************************/
function tab_search(search)
{
if(search==1)
{
document.getElementById("search_in").value="News";
	path="/searcher/index.php";
document.getElementById("searchp").innerHTML="<a href='#' class='selected'  style='text-decoration:none'><input name='tempp' type='radio' value='' checked />News</a> <a href='#' onclick='javascript:tab_search(2);' style='text-decoration:none'><input name='tempp' type='radio' value='' />Videos</a>  <a href='#'  onclick='javascript:tab_search(3);' style='text-decoration:none'><input name='tempp' type='radio' value='' />Blogs</a> ";
document.getElementById("fornews").innerHTML="<input type='hidden' name='domains' value='http://www.ibnlive.in.com'></input><input type='hidden' name='client' value='pub-2140165247056050'></input><input type='hidden' name='forid' value='1'></input><input type='hidden' name='channel' value='4422786151'></input><input type='hidden' name='ie' value='ISO-8859-1'></input><input type='hidden' name='oe' value='ISO-8859-1'></input>	<input type='hidden' name='safe' value='active'></input><input type='hidden' name='cof' value='GALT:#006699;GL:1;DIV:#FFFFFF;VLC:7E3939;AH:center;BGC:FFFFFF;LBGC:FF3333;ALC:003366;LC:003366;T:000000;GFNT:6C82B5;GIMP:6C82B5;LH:49;LW:432;L:/pix/common/ibnlogo_google.jpg;S:http://www.ibnlive.in.com/;FORID:11'></input><input type='hidden' name='hl' value='en'></input><input type='hidden' name='domains' value='http://www.ibnlive.in.com'></input><input type='hidden' name='sitesearch' value='http://www.ibnlive.in.com' checked='checked' class='radiobut' align='middle' />";

}
else if (search==2)
{
document.getElementById("search_in").value="Videos";
	path="/searcher/index.php";
document.getElementById("searchp").innerHTML="<a href='#' onclick='javascript:tab_search(1);' style='text-decoration:none'><input name='tempp' type='radio' value='' />News</a> <a href='#' onclick='javascript:tab_search(2);'  class='selected'  style='text-decoration:none'><input name='tempp' type='radio' value=''  checked />Videos</a>  <a href='#'  onclick='javascript:tab_search(3);' style='text-decoration:none'><input name='tempp' type='radio' value='' />Blogs</a> ";
document.getElementById("fornews").innerHTML=" ";
}
else if(search==3)
{
document.getElementById("search_in").value="Blogs";
	path="/searcher/index.php";
document.getElementById("searchp").innerHTML="<a href='#' onclick='javascript:tab_search(1);' style='text-decoration:none'><input name='tempp' type='radio' value='' />News</a> <a href='#' onclick='javascript:tab_search(2);' style='text-decoration:none'><input name='tempp' type='radio' value='' />Videos</a> <a href='#'  onclick='javascript:tab_search(3);' class='selected'  style='text-decoration:none'><input name='tempp' type='radio' value='' checked />Blogs</a> ";
document.getElementById("fornews").innerHTML=" ";
}
document.getElementById("searcher1").action=path;
}

/*****************************END SEARCH.JS******************************************/


/*****************************DYNAMIC WRITE.JS************************************************/
<!--
var xmlhttp =createObject();
var xmlhttp2 =createObject();
function includefile(pURL) {
  
      xmlhttp.onreadystatechange=postFileReady;
      xmlhttp.open("GET", pURL, true);
      xmlhttp.send();
  
}
// function to handle asynchronous call
function postFileReady() {
   if (xmlhttp.readyState==4) {
      if (xmlhttp.status==200) {
         document.getElementById('theDivToLoad').innerHTML=xmlhttp.responseText;
      }
   }
}
function includefile2(pURL2) {
 
      xmlhttp2.onreadystatechange=postFileReady2;
      xmlhttp2.open("GET", pURL2, true);
      xmlhttp2.send();
}

// function to handle asynchronous call
function postFileReady2() {
   if (xmlhttp2.readyState==4) {
      if (xmlhttp2.status==200) {
         document.getElementById('theDivToLoad2').innerHTML=xmlhttp2.responseText;
      }
   }
}
//-->
/*****************************END DYNAMIC WRITE.JS************************************************/


/*****************************TOOL TIPS.JS************************************************/
function enableTooltips(id)
{

	var links,i,h;
	if(!document.getElementById || !document.getElementsByTagName) return;
	AddCss();
	h=document.createElement("span");
	h.id="btc";
	h.setAttribute("id","btc");
	h.style.position="absolute";
	document.getElementsByTagName("body")[0].appendChild(h);
	if(id==null) links=document.getElementsByTagName("a");
	else links=document.getElementById(id).getElementsByTagName("a");
	for(i=0;i<links.length;i++)
	{
		Prepare(links[i]);
	}
}

function Prepare(el)
{
	var tooltip,t,b,s,l, img;

	t=el.getAttribute("title");
	link=el.getAttribute("link");
	width = el.getAttribute("rel");
	height =el.getAttribute("rev");


	if(t==null || t.length==0) t="link:";

	el.removeAttribute("title");

	img=el.getAttribute("name");
	var newimg = document.createElement('img');
	newimg.src = img;
	newimg.alt = t;
	newimg.width = width;
	newimg.height = height;

	if(img==null || img.length==0)
	{
		img = "";
		el.removeAttribute("name");
	}
	else
	{
		tooltip=CreateEl("span","tooltip");

		imgdisplay=CreateEl("span", "top");
		imgdisplay.appendChild(newimg);
		tooltip.appendChild(imgdisplay);

		b=CreateEl("b","bottom");
		tooltip.appendChild(b);
		setOpacity(tooltip);
		el.tooltip=tooltip;
		el.onmouseover=showTooltip;
		el.onmouseout=hideTooltip;
		el.onmousemove=Locate;
	}
}

function showTooltip(e){
document.getElementById("btc").appendChild(this.tooltip);
Locate(e);
}

function hideTooltip(e){
var d=document.getElementById("btc");
if(d.childNodes.length>0) d.removeChild(d.firstChild);
}

function setOpacity(el){
el.style.filter="alpha(opacity:95)";
el.style.KHTMLOpacity="0.95";
el.style.MozOpacity="0.95";
el.style.opacity="0.95";
}

function CreateEl(t,c){
var x=document.createElement(t);
x.className=c;
x.style.display="block";
return(x);
}

function AddCss(){
var l=CreateEl("link");
l.setAttribute("type","text/css");
l.setAttribute("rel","stylesheet");
l.setAttribute("href","/css/web2/tooltips1.css");
l.setAttribute("media","screen");
document.getElementsByTagName("head")[0].appendChild(l);
}

function Locate(e){
var posx=0,posy=0;
if(e==null) e=window.event;
if(e.pageX || e.pageY){
    posx=e.pageX; posy=e.pageY;
    }
else if(e.clientX || e.clientY){
    if(document.documentElement.scrollTop){
        posx=e.clientX+document.documentElement.scrollLeft;
        posy=e.clientY+document.documentElement.scrollTop;
        }
    else{
        posx=e.clientX+document.body.scrollLeft;
        posy=e.clientY+document.body.scrollTop;
        }
    }
document.getElementById("btc").style.top=(posy+5)+"px";
document.getElementById("btc").style.left=(posx-50)+"px";
}
/*****************************END TOOL TIPS.JS************************************************/


/****************************MAIN.JS**********************************************/
var xmlHttp

function LTrim( value ) {
	
	var re = /\s*((\S+\s*)*)/;
	return value.replace(re, "$1");
	
}

// Removes ending whitespaces
function RTrim( value ) {
	
	var re = /((\s*\S+)*)\s*/;
	return value.replace(re, "$1");
	
}


function getVote(int,int2)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
//var url="/poll/"+int+"/"+int2+"/"+Math.random()+".html";
var url="/poll/poll_vote.php?cod="+int+"&id="+int2;
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function getVote_politics(int,int2)
{
xmlHttp1=GetXmlHttpObject()
if (xmlHttp1==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 } 
//var url="/poll/"+int+"/"+int2+"/"+Math.random()+".html";
var url="/poll/poll_vote_politics.php?cod="+int+"&id="+int2;
xmlHttp1.onreadystatechange=stateChanged_politics 
xmlHttp1.open("GET",url,true)
xmlHttp1.send(null)
} 

function stateChanged_politics() 
{ 
	var text;
	if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete")
 	{ 
		text=xmlHttp1.responseText;
		//alert(text);
		arr= text.split('***---***');
		var id=LTrim(RTrim(arr[0]));
		var content= unescape(arr[1]);
		//alert(id);
		document.getElementById('poll' + id).innerHTML=content;
    } 
} 


function stateChanged() 
{ 
	var text;
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 	{ 
		text=xmlHttp.responseText;
		//alert(text);
		arr= text.split('***---***');
		var id=LTrim(RTrim(arr[0]));
		var content= unescape(arr[1]);
		//alert(id);
		document.getElementById('poll' + id).innerHTML=content;
    } 
} 

function GetXmlHttpObject()
{ 
var objXMLHttp=null
if (window.XMLHttpRequest)
 {
 objXMLHttp=new XMLHttpRequest()
 }
else if (window.ActiveXObject)
 {
 objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
 }
return objXMLHttp
}


if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
 try {
  xmlhttp = new XMLHttpRequest();
 } catch (e) {
  xmlhttp=false
 }
}
function myXMLHttpRequest() {
  var xmlhttplocal;
  try {
    xmlhttplocal= new ActiveXObject("Msxml2.XMLHTTP")
 } catch (e) {
  try {
    xmlhttplocal= new ActiveXObject("Microsoft.XMLHTTP")
  } catch (E) {
    xmlhttplocal=false;
  }
 }

if (!xmlhttplocal && typeof XMLHttpRequest!='undefined') {
 try {
  var xmlhttplocal = new XMLHttpRequest();
 } catch (e) {
  var xmlhttplocal=false;
  alert('couldn\'t create xmlhttp object');
 }
}
return(xmlhttplocal);
}


function sndReq(vote,id_num,ip_num) {
	
	var element = document.getElementById('unit_long'+id_num);
	//new Effect.Fade(element);
    element.innerHTML = '<div style="height: 30px;"><em>Loading ...</em></div>';
	
    xmlhttp.open('get', '/rate_this_web2.php?j='+vote+'&q='+id_num+'&t='+ip_num);
    xmlhttp.onreadystatechange = handleResponse;
    xmlhttp.send(null);
	
}

function handleResponse() {
    if(xmlhttp.readyState == 4){
		if (xmlhttp.status == 200){
       	
        var response = xmlhttp.responseText;
        var update = new Array();

        if(response.indexOf('|') != -1) {
            update = response.split('|');
            changeText(update[0], update[1]);
        }
		}
    }
}

function changeText( div2show, text ) {
    // Detect Browser
    var IE = (document.all) ? 1 : 0;
    var DOM = 0; 
    if (parseInt(navigator.appVersion) >=5) {DOM=1};

    // Grab the content from the requested "div" and show it in the "container"

    if (DOM) {
        var viewer = document.getElementById(div2show)
        viewer.innerHTML=text
    }
    else if(IE) {
        document.all[div2show].innerHTML=text
    }
}

// JavaScript Document

function textsize(inc)
{
	var tbdy=document.getElementById("font_text").style.fontSize;
	// alert(tbdy);
	var newSize = parseInt(tbdy.substring(0, tbdy.indexOf("px")));
	 //alert(newSize);
	 newSize+=inc;
	document.getElementById("font_text").style.fontSize = newSize+"px";
	//alert(newSize);
	//alert(tbdy);

}

function setFont()
{
  document.getElementById("font_text").style.fontSize="14px";
}


function gallery(sid,id){
//alert("oops")
var fs=window.open("/swf/slideshow/slideshow.html?sid="+sid+"&id="+id,"SlideShow","toolbar=no,width=990,height=600,status=no,resizable=no,fullscreen=yes,scrollbars=no");
	  fs.focus();
}






/****************************END MAIN.JS*********************************************/
/******************************COMMON.JS**************************************************/
// JavaScript Document
//open new window
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//for link on layer
function reload(form){
var val=document.sel.cat.options[form.cat.options.selectedIndex].value;
self.location='section_select.php?sec_id=' + val ;
}
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

//auto jump to new location on select
function surfto(s)
{
	var url=s.options[s.selectedIndex].value;
	window.location.href=url;
}

function textCounter(textfield,countfield) {
countfield.value = textfield.value.length;
}

function doClear(field)
{
	if (field.value == field.defaultValue) 
	{
		field.value = ""
	}
}

function removevalue(theSel)
{
	var selIndex = theSel.selectedIndex;
	if (selIndex != -1) {
		for(i=theSel.length-1; i>=0; i--)
		{
			if(theSel.options[i].selected)
			{
				theSel.options[i] = null;
			}
		}
		if (theSel.length > 0) {
			theSel.selectedIndex = selIndex == 0 ? 0 : selIndex - 1;
		}
	}
}

//function blockError(){return true;} 
//window.onerror = blockError; 
/////////////////////////Login Status End ////
function openNewWindow(URLtoOpen, windowName, windowFeatures) {
        newWindow=window.open(URLtoOpen, windowName, windowFeatures);
    }



function tracking()
{
   var a=document.URL;
   var b=a.split(".",3);
   var c="(.)+/news/([\\w\\d-]+)/(.)+";
   var f="com/?(index)?";
    myregexp = new RegExp(c)
	myregexp1 = new RegExp(f)
   var d=myregexp.test(b[2]);
    var e=myregexp1.test(b[2]);
   if(d)
   {
     var x="smart_search_article";
   }
   else if(e)
   {
     var x="smart_search_home";
   }
   else
   {
     var x="smart_search_rest";
   }
  urchinTracker("/outgoing/"+x);
}
/*****************************END COMMON.JS************************************************/


// MC Flash Container //
    var plus_img = "http://im.in.com/active18/homenewin/images/feed_min.gif";
    var minus_img = "http://im.in.com/active18/homenewin/images/feed_max.gif";
    function bsensedata_mc(passid){
        if(passid==1){
            if(document.getElementById("bsegraph").style.display=='block'){
                $("#bsegraph").slideUp(1,'');
                $("#nsegraph").slideDown(500,'');
                $("#pmnse").attr("src",plus_img,'gif');
                $("#pmbse").attr("src",minus_img,'gif');                
            }else{
                $("#nsegraph").slideUp(1,'');
                $("#bsegraph").slideDown(500,'');
                $("#pmbse").attr("src",plus_img,'gif');
                $("#pmnse").attr("src",minus_img,'gif');
            }
        }else{
            if(document.getElementById("nsegraph").style.display=='block'){
                $("#nsegraph").slideUp(1,'');
                $("#bsegraph").slideDown(500,'');
                $("#pmbse").attr("src",plus_img,'gif');
                $("#pmnse").attr("src",minus_img,'gif');                
            }else{
                $("#bsegraph").slideUp(1,'');
                $("#nsegraph").slideDown(500,'');
                $("#pmnse").attr("src",plus_img,'gif');
                $("#pmbse").attr("src",minus_img,'gif');
            }    
        }
    }

