onerror = handleErr;
function handleErr(msg,url,l){
 
 txt  = "There was an error on this page.\n\n";
 txt += "Error: " + msg + "\n";
 txt += "URL: " + url + "\n";
 txt += "Line: " + l + "\n\n";
 txt += "Click OK to continue.\n\n";
 
 return true; 
}



function showHideDiv(shDiv, hiDiv){

	var sh_li = shDiv+'_LI';
	var hi_li = hiDiv+'_LI';
	
	document.getElementById(hi_li).className = '';	
	document.getElementById(sh_li).className = 'open';
	
	
	var sh_div = shDiv+'_DIV';
	var hi_div = hiDiv+'_DIV';
	
	document.getElementById(hi_div).style.display = 'none';
	document.getElementById(sh_div).style.display = 'block';	
}
function showHideDivComments(shcDiv, hicDiv){

	var shc_li = shcDiv+'_LI';
	var hic_li = hicDiv+'_LI';
	
	document.getElementById(hic_li).className = '';	
	document.getElementById(shc_li).className = 'open';
	
	
	var shc_div = shcDiv+'_DIV';
	var hic_div = hicDiv+'_DIV';
	
if (hic_div == 'ABHIABHIC_DIV')
	{
document.getElementById('PATHKONC_DIV').style.display = 'block';
	}
else
	{
document.getElementById('PATHKONC_DIV').style.display = 'none';

	}

	//document.getElementById(hic_div).style.display = 'none';
	//document.getElementById(shc_div).style.display = 'block';	
}





function getXMLHTTP() { //fuction to return the xml http object
var xmlhttp=false;	
try{
xmlhttp=new XMLHttpRequest();
}
catch(e)
{		
try{xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");}catch(e){
				try{
				req = new ActiveXObject("Msxml2.XMLHTTP");
				}
				catch(e1){
					xmlhttp=false;
				}
			}
		}
		 	
		return xmlhttp;
    }
	
	function onAbouse(id) {
			//var strURL="vote.php?img="+img+"&title="+title+"&desc="+desc+"&link="+links;
		var strURL="/bollywoodbhaskar2010/scripts/article_comment_abuse.php?id="+id;
		//alert(strURL);
		var req = getXMLHTTP();
		if (req) {
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					//only if "OK"
					if (req.status == 200) {		
						
						var divIda = 'abuse'+id;
						document.getElementById(divIda).innerHTML=req.responseText;	
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}
	}
	function onVoteup1(filename,id) {
	//alert(filename);
		//var strURL="vote.php?img="+img+"&title="+title+"&desc="+desc+"&link="+links;
		var strURL="/bollywoodbhaskar2010/scripts/badges_article_vote_rate_Show.php?flname="+filename+"&up=up";
		//alert(strURL);
		var req = getXMLHTTP();
		if (req) {
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					//only if "OK"
					if (req.status == 200) {		
						
						var divId = 'up1'+id;
						document.getElementById(divId).innerHTML=req.responseText;	
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}
	}
	function onVotedown1(filename,id) {
		//var strURL="vote.php?img="+img+"&title="+title+"&desc="+desc+"&link="+links;
		var strURL="/bollywoodbhaskar2010/article_vote_rate_Show.php?flname="+filename+"&down=down";
		//alert(strURL);
		var req = getXMLHTTP();
		if (req) {
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					//only if "OK"
					if (req.status == 200) {		
						
						var divId = 'down1'+id;
						document.getElementById(divId).innerHTML=req.responseText;	
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}
	}
	
	function onAbouse1(id) {
			//var strURL="vote.php?img="+img+"&title="+title+"&desc="+desc+"&link="+links;
		var strURL="/bollywoodbhaskar2010/scripts/article_comment_abuse.php?id="+id;
		//alert(strURL);
		var req = getXMLHTTP();
		if (req) {
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					//only if "OK"
					if (req.status == 200) {		
						
						var divIda = 'abuse1'+id;
						document.getElementById(divIda).innerHTML=req.responseText;	
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}
	}
	
// AJAX Function for Report Abuse Profile.somesh
/*function report_abuse_profile (url, id) {
	alert(url);
		alert(id);
	var strURL = url;
	//alert(strURL);
	var req = getXMLHTTP();
	
	if (id) {
		
		var id = '_'+id;
	}
	
	if (req) {
		
		req.onreadystatechange = function() {
			
			if (req.readyState == 4) {
				
				if (req.status == 200) {		
				
					var divIda = 'report_abuse_profile'+id;
					
					document.getElementById(divIda).innerHTML=req.responseText;	
				
				}
				else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
	
		req.open("GET", strURL, true);
		req.send(null);
	
	}
}

*/
var isIE = document.all?true:false;
var myimg = new Image();
var sPos = 0;
var isTh = false;
var isNg = false;
var kbmode = "roman";
var pkbmode = "roman";
var SplKeys = new Array();

SplKeys["ZR"] = 0;
SplKeys["BS"] = 8;
SplKeys["CR"] = 13;

function incfont(fontname, fontfile)
{
if(isIE)
	document.write("<STY"+"LE TYPE='text/css'>\n<!--\n@font-face {\n"
				+ "font-family: "+fontname+";\nsrc:url("+fontfile+".eot);\n"
				+ "}\n-->\n</ST"+"YLE>")
}


function showMap()
{
PositionX = 100;
PositionY = 100;
defaultWidth  = 500;
defaultHeight = 500;
var AutoClose = true;

var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;

if (isIE){imgWin=window.open('about:blank','',optIE);}
else {imgWin=window.open('about:blank','',optNN);}

with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');
writeln('window.innerWidth=document.images["KeyMap"].width;');writeln('window.innerHeight=document.images["KeyMap"].height;}}');
writeln('function doTitle(){document.title="Keypad Map";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('</body></html>');
close();
}}

function convertThis(e,numchar)
{
	
    if (!isIE)
	    Key = e.which;
    else
		Key = e.keyCode;

	Char = String.fromCharCode(Key);
	if(typeof numchar == "undefined")
		numchar = 4;
	if( isIE )
	{
		myField = e.srcElement;
		myField.caretPos = document.selection.createRange().duplicate();
		prevChar = myField.caretPos.text;
		diff = 0;
		cpos = getCursorPosition(myField);
		if(prevChar.length != 0)
			document.selection.clear();
		if(myField.value.length != 0 && cpos != "1,1" )
		{
			myField.caretPos.moveStart('character',-1);
			prevChar = myField.caretPos.text;
			diff ++;
		}
		if(prevChar == chnbin)
		{
			myField.caretPos.moveStart('character',-1);
			prevChar = myField.caretPos.text;
			diff ++;
		}

		if(cpos[1] > numchar )
		{
			myField.caretPos.moveStart('character', diff - numchar);
			prevChar = myField.caretPos.text;
		}
		if(prevChar == "" && cpos != "1,1")
			prevChar =  "\u000A";
		if(Key == 13)
			Char = "\u000A";
		myField.caretPos.text = getLang(prevChar,Char, 0)
		e.cancelBubble = true;
		e.returnValue = false;

	}
	else
	{
		myField = e.target;
		if( myField.selectionStart >= 0)
		{
			if(isSplKey(Key) ||  e.ctrlKey )
				return true;
			var startPos = myField.selectionStart;
			var endPos = myField.selectionEnd;
			txtTop = myField.scrollTop;
			if(myField.value.length == 0)
			{
				prevChar = "";
				myField.value = getLang(prevChar,Char, startPos)
			}
			else
			{
				prevChar = myField.value.substring(startPos - 1,startPos);
				prevStr =  myField.value.substring(0,startPos - 1);
				if(prevChar == chnbin)
				{
					prevChar = myField.value.substring(startPos - 2,startPos);
					prevStr =  myField.value.substring(0,startPos - 2);
				}
				cpos = getCursorPosition(myField);
				if(cpos[1] >= numchar)
				{
					prevChar = myField.value.substring(startPos - numchar,startPos);
					prevStr =  myField.value.substring(0,startPos - numchar);
				}
				myField.value = prevStr + getLang(prevChar,Char, myField.selectionStart)
						  + myField.value.substring(endPos, myField.value.length);
			}
			myField.selectionStart = sPos ;
			myField.selectionEnd = sPos;
			if((myField.scrollHeight+4)+"px" != myField.style.height)
				myField.scrollTop = txtTop;
			e.stopPropagation();
			e.preventDefault();
		}
	}
}

function toggleT(obj)
{
	isTh = obj.checked;
	if(isTh)
		ta['t'] = "\u0BA4\u0BCD";
	else
		ta['t'] = "\u0B9F\u0BCD";
}

function toggleG(obj)
{
	isNg = obj.checked;
	if(isNg)
		ta['g'] = "\u0B99\u0BCD";
	else
		ta['g'] = "\u0B95\u0BCD"
}

function toggleKBMode(e,obj)
{
	if(obj != null)
	{
		pkbmode = kbmode;
		kbmode = obj.value;
		if(kbmode == "typewriter")
			myimg.src = "http://www.bhaskar.com/images/"+lang+"tw.png";
		else
			myimg.src = "http://www.bhaskar.com/images/"+lang+".png";
	}
	else
	{
		if (!isIE)
	        key = e.which;
	    else
			key = e.keyCode;
		if (key == 123)
		{
			if(kbmode != "english")
			{
				pkbmode = kbmode;
				kbmode = "english";
			}
			else
			{
				kbmode = pkbmode;
				pkbmode = "english";
			}
		}

	}
}

function isSplKey(keynum)
{
	retVal = false;
	for(i in SplKeys)
	{
		if(keynum == SplKeys[i])
			retVal = true;
	}
	return retVal;
}

function getLang(prv, txt, sP)
{
	sPos = sP;
	if(kbmode == "english")
	{
		retTxt = prv+txt;
		sPos ++;
	}
	else if(kbmode == "typewriter")
	{
		if(prv == ugar && mapLang(txt,sP,"tw") == uugar)
			retTxt = mapLang(prv+txt,sP,"tw");
		else
			retTxt = prv+mapLang(txt,sP,"tw");
	}
	else
	{
		if(pkbmode == "english")
		{
			retTxt = prv+mapLang(txt);
			pkbmode = "roman";
		}
		else
			retTxt = mapLang(prv+txt);
	}
	return retTxt;
}


function mapLang(txt,sP,mod)
{
	if(sP != null)
		sPos = sP;
	prvlen = txt.length;
	txtarr = eval(lang.substring(0,2));
	if(mod != null && mod == "tw")
		txtarr = eval(lang.substring(0,2)+"tw")
	retTxt = "";
	for(itm in txtarr)
	{
		rexp = new RegExp(itm,"g");
		txt = txt.replace(rexp, txtarr[itm]);
	}
	sPos += (txt.length -prvlen +1);
	return txt;
}


function getCursorPosition(textarea)
{
	var txt = textarea.value;
	var len = txt.length;
	var erg = txt.split("\n");
	var pos = -1;
	if(typeof document.selection != "undefined")
	{ // FOR MSIE
	range_sel = document.selection.createRange();
	range_obj = textarea.createTextRange();
	range_obj.moveToBookmark(range_sel.getBookmark());
	range_obj.moveEnd('character',textarea.value.length);
	pos = len - range_obj.text.length;
	}
	else if(typeof textarea.selectionStart != "undefined")
	{ // FOR MOZILLA
	pos = textarea.selectionStart;
	}
	if(pos != -1)
	{
		for(ind = 0;ind<erg.length;ind++)
		{
			len = erg[ind].length + 1;
			if(pos < len)
				break;
			pos -= len;
		}
		ind++; pos++;
		return [ind, pos]; // ind = LINE, pos = COLUMN
	}
}






function print_doc(){
  var content=document.getElementById('print_div').innerHTML;
  var pwin=window.open('','print_content','width=100,height=100');
  pwin.document.open();
  pwin.document.write('<html><head><link href="/dainikbhaskar2010/style/main.css" rel="stylesheet" type="text/css"></head><body onload="window.print()">'+content+'</body></html>');
  pwin.document.close();
 
 setTimeout(function(){pwin.close();},1000);

}

function setVisibility(id, type) {
 document.getElementById(id).style.visibility = type;
}


 function fun1(x)
	{
	
		
		var vv = document.getElementById('txtComments').value;
		//alert(vv);
		//alert(document.getElementById('tb').innerHTML);
		//alert(x.value);
		if (x.value=="english")
		{	
		document.getElementById('tb').innerHTML ="<textarea  name='txtComments' id='txtComments' class='"+document.getElementById('txtComments').className+"' style='width:600px; height:100px' value=''>"+vv+"</textarea>";
			
		}
		else
		{
		document.getElementById('tb').innerHTML ="<textarea  name='txtComments' id='txtComments'   charset='utf-8' style='width:600px; height:100px' class='"+document.getElementById('txtComments').className+"' onKeyPress='javascript:convertThis(event)'  onKeyDown='toggleKBMode(event)' value=''>"+vv+"</textarea>";

		}
		
	}


	//Gets the browser specific XmlHttpRequest Object 
function getXmlHttpRequestObject() {
 if (window.XMLHttpRequest) {
    return new XMLHttpRequest(); //Mozilla, Safari ...
 } else if (window.ActiveXObject) {
    return new ActiveXObject("Microsoft.XMLHTTP"); //IE
 } else {
    //Display our error message
    alert("Your browser doesn't support the XmlHttpRequest object.");
 }
}

//Our XmlHttpRequest object
var receiveReq = getXmlHttpRequestObject();

//Initiate the AJAX request
function makeRequest(url, param) {
//If our readystate is either not started or finished, initiate a new request
 if (receiveReq.readyState == 4 || receiveReq.readyState == 0) {
   //Set up the connection to captcha_test.html. True sets the request to asyncronous(default) 
   receiveReq.open("POST", url, true);
   //Set the function that will be called when the XmlHttpRequest objects state changes
   receiveReq.onreadystatechange = updatePage; 

   //Add HTTP headers to the request
   receiveReq.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
   receiveReq.setRequestHeader("Content-length", param.length);
   receiveReq.setRequestHeader("Connection", "close");

   //Make the request
   receiveReq.send(param);
 }   
}

function makeRequest_login(url, param) {
//If our readystate is either not started or finished, initiate a new request
 if (receiveReq.readyState == 4 || receiveReq.readyState == 0) {
   //Set up the connection to captcha_test.html. True sets the request to asyncronous(default) 
   receiveReq.open("POST", url, true);
   //Set the function that will be called when the XmlHttpRequest objects state changes
   receiveReq.onreadystatechange = updatePage_login; 

   //Add HTTP headers to the request
   receiveReq.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
   receiveReq.setRequestHeader("Content-length", param.length);
   receiveReq.setRequestHeader("Connection", "close");

   //Make the request
   receiveReq.send(param);
 }   
}
function updatePage() {
	//alert(document.URL);
 //Check if our response is ready
 if (receiveReq.readyState == 4) {
   //Set the content of the DIV element with the response text
   document.getElementById('result').innerHTML = receiveReq.responseText;
  var t = receiveReq.responseText;
  if (t == 1)
   {
   	document.getElementById('result').innerHTML = 'Thanks for your feedback';
   	document.getElementById('txtName').value = '';
	document.getElementById('txtEmail').value = '';
	document.getElementById('txtCity').value = '';
	document.getElementById('txtComments').value = '';
	document.getElementById('txtCaptcha').value = '';
   }
    }
}
function updatePage_login() {
	//alert(document.URL);
	//alert('nitin');
 //Check if our response is ready
 if (receiveReq.readyState == 4) {
   //Set the content of the DIV element with the response text
   document.getElementById('result').innerHTML = receiveReq.responseText;
   document.getElementById('result_loading').innerHTML ='';
  var t = receiveReq.responseText;
  if (t == 1)
   {
	//alert('IN');
   	document.getElementById('result').innerHTML = 'Thanks for your comment. We have sent you a mail, next time you have to login for posting comment';	
   	document.getElementById('txtName').value = '';
	document.getElementById('txtEmail').value = '';
	document.getElementById('txtCity').value = '';
	document.getElementById('txtComments').value = '';
	document.getElementById('txtCaptcha').value = '';
   }
   if (t == 2)
   {
	//alert('IN nitin');   	
	document.getElementById('result').innerHTML = 'Thanks for your comment.';
   	document.getElementById('txtName').value = '';
	document.getElementById('txtEmail').value = '';
	document.getElementById('txtCity').value = '';
	document.getElementById('txtComments').value = '';
	document.getElementById('txtCaptcha').value = '';
   }
   
   
    }
}
//Called every time our XmlHttpRequest objects state changes

//Called every time when form is perfomed
function getParam(theForm) {

 //Set the URL
 //alert(theForm);
 var url = '/bollywoodbhaskar2010/scripts/article_captcha.php';
 //Set up the parameters of our AJAX call
 var postStr = theForm.txtCity.name + "=" + encodeURIComponent( theForm.txtCity.value ) + "&" + theForm.txtName.name + "=" + encodeURIComponent( theForm.txtName.value ) + "&" + theForm.txtEmail.name + "=" + encodeURIComponent( theForm.txtEmail.value )+ "&" + theForm.txtComments.name + "=" + encodeURIComponent( theForm.txtComments.value )
 + "&" + theForm.txtCaptcha.name + "=" + encodeURIComponent( theForm.txtCaptcha.value )
 + "&" + theForm.totalval.name + "=" + encodeURIComponent( theForm.totalval.value )
 
 + "&jurl=" + encodeURIComponent(document.URL) ;
 //Call the function that initiate the AJAX request
 //alert(postStr);
 makeRequest(url, postStr);
}

function swap(pId)
{
var	valueD = document.getElementById('pId').value = pId;
}

function getParam_login(theForm) {
/* For validation of Feedback form */
	 var filter=/^.+@.+\..{2,3}$/ 
	document.getElementById('txtComments').className = '';
	document.getElementById('txtName').className = '';
	document.getElementById('txtEmail').className = '';
	document.getElementById('txtCity').className = '';
	document.getElementById('txtCaptcha').className = '';
	document.getElementById('txtComments_error').style.display = 'none';
	document.getElementById('txtName_error').style.display = 'none';
	document.getElementById('txtEmail_error').style.display = 'none';
	document.getElementById('txtCity_error').style.display = 'none';
	document.getElementById('txtCaptcha_error').style.display = 'none';
	//alert(document.frmCaptcha.txtComments.value);
	if (document.frmCaptcha.txtComments.value==''){
	document.getElementById('txtComments').className = 'comment_border';
	document.getElementById('txtComments_error').style.display = 'block';
	}
	
	if (document.frmCaptcha.txtName.value=='' || document.frmCaptcha.txtName.value=='नाम'){
	document.getElementById('txtName').className = 'comment_border';
	document.getElementById('txtName_error').style.display = 'block';
	}
	
	if (document.frmCaptcha.txtCity.value=='' || document.frmCaptcha.txtCity.value=='शहर/देश'){
	document.getElementById('txtCity').className = 'comment_border';
	document.getElementById('txtCity_error').style.display = 'block';
	}
	
if (document.frmCaptcha.txtEmail.value=='' || document.frmCaptcha.txtEmail.value=='ई-मेल' ||  filter.test(document.frmCaptcha.txtEmail.value)==false){
	document.getElementById('txtEmail').className = 'comment_border';
	document.getElementById('txtEmail_error').style.display = 'block';
	}
	
	if (document.frmCaptcha.txtCaptcha.value==''){
	document.getElementById('txtCaptcha').className = 'comment_border';
	document.getElementById('txtCaptcha_error').style.display = 'block';
	}

 //Set the URL
	document.getElementById('result_loading').innerHTML = '<img src="http://www.bhaskar.com/dainikbhaskar2010/images/spinner.gif"  alt="Loading"/>';
 var url = '/bollywoodbhaskar2010/scripts/article_captcha_login_log.php';
 //Set up the parameters of our AJAX call
 var postStr = theForm.txtCity.name + "=" + encodeURIComponent( theForm.txtCity.value ) + "&" + theForm.txtName.name + "=" + encodeURIComponent( theForm.txtName.value ) + "&" + theForm.txtEmail.name + "=" + encodeURIComponent( theForm.txtEmail.value )+ "&" + theForm.txtComments.name + "=" + encodeURIComponent( theForm.txtComments.value )
 + "&" + theForm.txtCaptcha.name + "=" + encodeURIComponent( theForm.txtCaptcha.value )
 + "&" + theForm.totalval.name + "=" + encodeURIComponent( theForm.totalval.value ) + "&jurl=" + encodeURIComponent(document.URL) + "&pId=" + encodeURIComponent( theForm.pId.value)+ "&slogId=" + encodeURIComponent( theForm.slogId.value);
 //Call the function that initiate the AJAX request
 //alert(postStr);
 makeRequest_login(url, postStr);
}

function getParamss(theForm) {
 //Set the URL
 var url = '/bollywoodbhaskar2010/scripts/article_captchas.php';
 //Set up the parameters of our AJAX call
 var postStr = theForm.txtCity.name + "=" + encodeURIComponent( theForm.txtCity.value ) + "&" + theForm.txtName.name + "=" + encodeURIComponent( theForm.txtName.value ) + "&" + theForm.txtEmail.name + "=" + encodeURIComponent( theForm.txtEmail.value )+ "&" + theForm.txtComments.name + "=" + encodeURIComponent( theForm.txtComments.value )
 + "&" + theForm.txtCaptcha.name + "=" + encodeURIComponent( theForm.txtCaptcha.value )
 + "&" + theForm.totalval.name + "=" + encodeURIComponent( theForm.totalval.value )
 
 + "&jurl=" + encodeURIComponent(document.URL) ;
 //Call the function that initiate the AJAX request
 alert(postStr);
 makeRequest(url, postStr);
}


var lang = "hindi";
var chnbin = "\u094D";
var ugar = "\u0941";
var uugar = "\u0942";
myimg.src = "http://www.bhaskar.com/"+lang+".png";

var hi	= new Array();
var hitw = new Array

hitw['\\!'] = "\u090D";
hitw['\\@'] = "\u0945";
hitw['\\#'] = "\u094D\u0930";
hitw['\\$'] = "\u0930\u094D";
hitw['\\%'] = "\u091C\u094D\u091E";
hitw['\\^'] = "\u0924\u094D\u0930";
hitw['\\&'] = "\u0915\u094D\u0937";
hitw['\\*'] = "\u0936\u094D\u0930";
hitw['_'] = "\u0903";
hitw['\\+'] = "\u090B";
hitw['\\='] = "\u0943";
hitw['q'] = "\u094C";
hitw['w'] = "\u0948";
hitw['e'] = "\u093E";
hitw['r'] = "\u0940";
hitw['t'] = "\u0942";
hitw['y'] = "\u092C";
hitw['u'] = "\u0939";
hitw['i'] = "\u0917";
hitw['o'] = "\u0926";
hitw['p'] = "\u091C";
hitw['\\['] = "\u0921";
hitw['\\]'] = "\u093C";
hitw['Q'] = "\u0914";
hitw['W'] = "\u0910";
hitw['E'] = "\u0906";
hitw['R'] = "\u0908";
hitw['T'] = "\u090A";
hitw['Y'] = "\u092D";
hitw['U'] = "\u0919";
hitw['I'] = "\u0918";
hitw['O'] = "\u0927";
hitw['P'] = "\u091D";
hitw['\\{'] = "\u0922";
hitw['\\}'] = "\u091E";

hitw['a'] = "\u094B";
hitw['s'] = "\u0947";
hitw['d'] = "\u094D";
hitw['f'] = "\u093F";
hitw['g'] = "\u0941";
hitw['h'] = "\u092A";
hitw['j'] = "\u0930";
hitw['k'] = "\u0915";
hitw['l'] = "\u0924";
hitw[';'] = "\u091A";
hitw['\\\''] = "\u091F";
hitw['\\\\'] = "\u0949";
hitw['A'] = "\u0913";
hitw['S'] = "\u090F";
hitw['D'] = "\u0905";
hitw['F'] = "\u0907";
hitw['G'] = "\u0909";
hitw['H'] = "\u092B";
hitw['J'] = "\u0931";
hitw['K'] = "\u0916";
hitw['L'] = "\u0925";
hitw[':'] = "\u091B";
hitw['"'] = "\u0920";
hitw['\\|'] = "\u0911";

hitw['z'] = "";
hitw['x'] = "\u0902";
hitw['c'] = "\u092E";
hitw['v'] = "\u0928";
hitw['b'] = "\u0935";
hitw['n'] = "\u0932";
hitw['m'] = "\u0938";
hitw['/'] = "\u092F";
hitw['Z'] = "";
hitw['X'] = "\u0901";
hitw['C'] = "\u0923";
hitw['V'] = "";
hitw['B'] = "";
hitw['N'] = "\u0933";
hitw['M'] = "\u0936";
hitw['<'] = "\u0937";
hitw['>'] = "\u0964";
hitw['\\?'] = "\u095F";

//Phonetic
hi['B'] = "b";
hi['C'] = "c";
hi['F'] = "ph";
hi['f'] = "ph";
hi['G'] = "g";
hi['J'] = "j";
hi['K'] = "k";
hi['M'] = "m";
hi['P'] = "p";
hi['Q'] = "q";
hi['V'] = "v";
hi['W'] = "v";
hi['w'] = "v";
hi['X'] = "x";
hi['Y'] = "y";
hi['Z'] = "z";
//Cons
hi['k'] = "\u0915\u094D";
hi['c'] = "\u091A\u094D";
hi['T'] = "\u091F\u094D";
hi['D'] = "\u0921\u094D";
hi['N'] = "\u0923\u094D";
hi['t'] = "\u0924\u094D";
hi['d'] = "\u0926\u094D";
hi['p'] = "\u092A\u094D";
hi['b'] = "\u092C\u094D";


hi['y'] = "\u092F\u094D";
hi['R'] = "\u0931\u094D";
hi['L'] = "\u0933\u094D";
hi['v'] = "\u0935\u094D";
hi['s'] = "\u0938\u094D";
hi['S'] = "\u0937\u094D";
hi['H'] = "\u0939\u094D";
hi['x'] = "\u0915\u094D\u0936\u094D";

hi['\u200Dn'] = "\u0901";
hi['\u200Dm'] = "\u0902";
hi['m'] = "\u092E\u094D";
hi['n'] = "\u0928\u094D";
hi[':h'] = "\u0903";

hi['\u0928\u094D\\.'] = "\u0929\u094D";
hi['\u0930\u094D\\.'] = "\u0931\u094D";
hi['q'] = "\u0958\u094D";
hi['\u0915\u094D\\.'] = "\u0958\u094D";
hi['\u0916\u094D\\.'] = "\u0959\u094D";
hi['\u0917\u094D\\.'] = "\u095A\u094D";
hi['z'] = "\u095B\u094D";
hi['\u0921\u094D\\.'] = "\u095C\u094D";
hi['\u0922\u094D\\.'] = "\u095D\u094D";
hi['\u092B\u094D\\.'] = "\u095E\u094D";
hi['\u092F\u094D\\.'] = "\u095F\u094D";

hi['\u0915\u094Dh'] = "\u0916\u094D";
hi['\u0917\u094Dh'] = "\u0918\u094D";
hi['\u0928\u094Dg'] = "\u0919\u094D";
hi['\u091A\u094Dh'] = "\u091B\u094D";
hi['\u091C\u094Dh'] = "\u091D\u094D";
hi['\u0928\u094Dj'] = "\u091E\u094D";
hi['\u091F\u094Dh'] = "\u0920\u094D";
hi['\u0921\u094Dh'] = "\u0922\u094D";
hi['\u0924\u094Dh'] = "\u0925\u094D";
hi['\u0926\u094Dh'] = "\u0927\u094D";
hi['\u092A\u094Dh'] = "\u092B\u094D";
hi['\u092C\u094Dh'] = "\u092D\u094D";
hi['\u0938\u094Dh'] = "\u0936\u094D";
hi['\u0931\u094Dr'] = "\u090B";
hi['\u0933\u094Dl'] = "\u090C";
hi['\u094D\u090B'] = "\u0943";
hi['\u0913\u092E\u094D'] = "\u0950";
hi['r'] = "\u0930\u094D";
hi['l'] = "\u0932\u094D";
hi['h'] = "\u0939\u094D";
hi['g'] = "\u0917\u094D";
hi['j'] = "\u091C\u094D";
//VowSml
hi['\u094Da'] = "\u200C";
hi['\u094Di'] = "\u093F";
hi['\u094Du'] = "\u0941";
hi['\u094De'] = "\u0946";
hi['\u094Do'] = "\u094A";
hi['\u200Ci'] = "\u0948";
hi['\u200Cu'] = "\u094C";
hi['\u200C-'] = "\u200D";
hi['\u200C:'] = ":";
hi['-'] = "\u200D";
//VowBig
hi['\u200Ca'] = "\u093E";
hi['\u093Fi'] = "\u0940";
hi['\u0941u'] = "\u0942";
hi['\u0946e'] = "\u0947";
hi['\u094Ao'] = "\u094B";
hi['\u094DA'] = "\u093E";
hi['\u094DI'] = "\u0940";
hi['\u094DU'] = "\u0942";
hi['\u094DE'] = "\u0947";
hi['\u094DO'] = "\u094B";
//Vows
hi['\u0905i'] = "\u0910";
hi['\u0905u'] = "\u0914";
hi['\u0905a'] = "\u0906";
hi['\u0907i'] = "\u0908";
hi['\u0909u'] = "\u090A";
hi['\u090Ee'] = "\u090F";
hi['\u0912o'] = "\u0913";
hi['\u0913m'] = "\u0950";

hi['a'] = "\u0905";
hi['A'] = "\u0906";
hi['i'] = "\u0907";
hi['I'] = "\u0908";
hi['u'] = "\u0909";
hi['U'] = "\u090A";
hi['e'] = "\u090E";
hi['E'] = "\u090F";
hi['o'] = "\u0912";
hi['O'] = "\u0913";
//Nums
hi['\u200D1'] = "\u0967";
hi['\u200D2'] = "\u0968";
hi['\u200D3'] = "\u0969";
hi['\u200D4'] = "\u096A";
hi['\u200D5'] = "\u096B";
hi['\u200D6'] = "\u096C";
hi['\u200D7'] = "\u096D";
hi['\u200D8'] = "\u096E";
hi['\u200D9'] = "\u096F";
hi['\u200D0'] = "\u0966";
hi['(.+)\u200C(.+)'] = "$1$2";


// Strip leading and trailing white-space
String.prototype.trim = function() { return this.replace(/^\s*|\s*$/g, ''); }

// Check if string is empty
String.prototype.empty = function() {
    if (this.length == 0)
        return true;
    else if (this.length > 0)
        return /^\s*$/.test(this);
}

// Breaks cookie into an object of keypair cookie values
function crumbleCookie(c)
{
    var cookie_array = document.cookie.split(';');
    var keyvaluepair = {};
    for (var cookie = 0; cookie < cookie_array.length; cookie++)
    {
        var key = cookie_array[cookie].substring(0, cookie_array[cookie].indexOf('=')).trim();
        var value = cookie_array[cookie].substring(cookie_array[cookie].indexOf('=')+1, cookie_array[cookie].length).trim();
        keyvaluepair[key] = value;
    }

    if (c)
        return keyvaluepair[c] ? keyvaluepair[c] : null;

    return keyvaluepair;
}

/**
 *  For GA cookie explanation, see http://services.google.com/analytics/breeze/en/ga_cookies/index.html.
 *
 *  @return             -   <void>
 *
 *  @pre-condition      -   pageTracker initialised properly
 *  @post-condition     -   provides 'get' methods to access specific values in the Google Analytics cookies
 */
function gaCookies()
{
    // Cookie syntax: domain-hash.unique-id.ftime.ltime.stime.session-counter
    var utma = function() {
        var utma_array;

        if (crumbleCookie('__utma'))
            utma_array =  crumbleCookie('__utma').split('.');
        else
            return null;

        var domainhash = utma_array[0];
        var uniqueid = utma_array[1];
        var ftime = utma_array[2];
        var ltime = utma_array[3];
        var stime = utma_array[4];
        var sessions = utma_array[5];

        return {
            'cookie': utma_array,
            'domainhash': domainhash,
            'uniqueid': uniqueid,
            'ftime': ftime,
            'ltime': ltime,
            'stime': stime,
            'sessions': sessions
        };
    };

    // Cookie syntax: domain-hash.gif-requests.10.stime
    var utmb = function() {
        var utmb_array;

        if (crumbleCookie('__utmb'))
            utmb_array = crumbleCookie('__utmb').split('.');
        else
            return null;
        var gifrequest = utmb_array[1];

        return {
            'cookie': utmb_array,
            'gifrequest': gifrequest
        };
    };

    // Cookie syntax: domain-hash.value
    var utmv = function() {
        var utmv_array;

        if (crumbleCookie('__utmv'))
            utmv_array = crumbleCookie('__utmv').split('.');
        else
            return null;

        var value = utmv_array[1];

        return {
            'cookie': utmv_array,
            'value': value
        };
    };

    // Cookie syntax: domain-hash.ftime.?.?.utmcsr=X|utmccn=X|utmcmd=X|utmctr=X
    var utmz = function() {
        var utmz_array, source, medium, name, term, content, gclid;

        if (crumbleCookie('__utmz'))
            utmz_array = crumbleCookie('__utmz').split('.');
        else
            return null;

        var utms = utmz_array[4].split('|');
        for (var i = 0; i < utms.length; i++) {
            var key = utms[i].substring(0, utms[i].indexOf('='));
            var val = decodeURIComponent(utms[i].substring(utms[i].indexOf('=')+1, utms[i].length));
            val = val.replace(/^\(|\)$/g, '');  // strip () brackets
            switch(key)
            {
                case 'utmcsr':
                    source = val;
                    break;
                case 'utmcmd':
                    medium = val;
                    break;
                case 'utmccn':
                    name = val;
                    break;
                case 'utmctr':
                    term = val;
                    break;
                case 'utmcct':
                    content = val;
                    break;
                case 'utmgclid':
                    gclid = val;
                    break;
            }
        }

        return {
            'cookie': utmz_array,
            'source': source,
            'medium': medium,
            'name': name,
            'term': term,
            'content': content,
            'gclid': gclid
        };
    };

    // Establish public methods

    // utma cookies
    this.getDomainHash = function() { return (utma() && utma().domainhash) ? utma().domainhash : null };
    this.getUniqueId = function() { return (utma() && utma().uniqueid) ? utma().uniqueid : null };

    this.getInitialVisitTime = function() { return (utma() && utma().ftime) ? utma().ftime : null };
    this.getPreviousVisitTime = function() { return (utma() && utma().ltime) ? utma().ltime : null };
    this.getCurrentVisitTime = function() { return (utma() && utma().stime) ? utma().stime : null };
    this.getSessionCounter = function() { return (utma() && utma().sessions) ? utma().sessions : null };

    // utmb cookies
    this.getGifRequests = function() { return (utmb() && utmb().gifrequest) ? utmb().gifrequest : null };

    // utmv cookies
    this.getUserDefinedValue = function () { return (utmv() && utmv().value) ? decodeURIComponent(utmv().value) : null };

    // utmz cookies
    this.getCampaignSource = function () { return (utmz() && utmz().source) ? utmz().source : null };
    this.getCampaignMedium = function () { return (utmz() && utmz().medium) ? utmz().medium : null };
    this.getCampaignName = function () { return (utmz() && utmz().name) ? utmz().name : null };
    this.getCampaignTerm = function () { return (utmz() && utmz().term) ? utmz().term : null};
    this.getCampaignContent = function () { return (utmz() && utmz().content) ? utmz().content : null };
    this.getGclid = function () { return (utmz() && utmz().gclid) ? utmz().gclid : null };
}


function gaCookieRead()
{
	var gac = new gaCookies();

	var val = gac.getUniqueId();
	if (val != null)
	{
		_gaq.push(['_setCustomVar',
			5,				// This custom var is set to slot #1.  Required parameter.
			'VisitorID',	// The top-level name for your online content categories.  Required parameter.
			gac.getUniqueId(),		// Sets the value of "Section" to "Life & Style" for this particular aricle.  Required parameter.
			1				// Sets the scope to page-level.  Optional parameter.
		]);
		_gaq.push(['_trackEvent','Visitor', // category of activity
				   'Sample' // Action
				   ]);
		//alert(gac.getUniqueId());
		clearTimeout(mytime);
	}
	else
	{
		mytime = setTimeout('gaCookieRead()', 2000);
	}

}

mytime = setTimeout('gaCookieRead()', 10000);

var position = 0;
	var posX=0;
	var myHeight=0;
	var url;

function scrollingDetector(){

	if( typeof( window.innerWidth ) == 'number' )
	{
		myWidth = window.innerWidth; myHeight = window.innerHeight;
	} else if( document.documentElement && (document.documentElement.clientWidth ||document.documentElement.clientHeight ) ) {
					myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight;
				} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
					myWidth = document.body.clientWidth; myHeight = document.body.clientHeight;
				}
				if (navigator.appName == "Microsoft Internet Explorer"){
	//alert("You've scrolled to " + document.body.scrollTop + " pixels.");
					posX=document.body.scrollTop;
					position=posX/myHeight;
					position=position*100;
					//alert(position);
					url=location.href;
					//alert(myHeight);
					//alert(url);
					//pageTracker._trackEvent('Scroll%',''+url,'Browser Height '+myHeight , parseInt(position));
					_gaq.push(['_trackEvent', 'Scroll%', url, 'Browser Height '+myHeight , parseInt(position)]);
				}
				else
				{//alert ("You've scrolled to " + window.pageYOffset + " pixels.");
					posX=window.pageYOffset;
					position=posX/myHeight;
					position=position*100;
					url=location.href;
					//alert(url);
					//alert(position);
					//alert(myHeight);
					//pageTracker._trackEvent('Scroll%',''+url,'Browser Height' +myHeight , parseInt(position));
					_gaq.push(['_trackEvent', 'Scroll%', url, 'Browser Height '+myHeight , parseInt(position)]);
				}

	}
	window.onclick=scrollingDetector;


function pops()
{
var catg	= document.getElementById('sel').value;
var num		= document.getElementById('num').value;
var url =  "http://religion.bhaskar.com/religionbhaskar2010/admin/num_desc.php?catg="+catg+"&num="+num;
newwindow=window.open(url,'name','height=300,width=250');
}
function pops1()
{

var catg		= document.frm.sel_signs.value;
var sign		= document.frm.sign.value;
var url =  "http://religion.bhaskar.com/religionbhaskar2010/admin/sign_desc.php?catg="+catg+"&sign="+sign;
newwindow=window.open(url,'name','height=300,width=250');
}


function onFans(filename,id,vars) {
  $('#log'+id).html('<p><img src="http://ezone.bhaskar.com/indicator.gif" width="20" height="19" /></p>');
  $('#log'+id).load("/OZ_story_count.php?flname="+filename+"&var=storycount");
}

function onVoteup(filename,logid,slno) {
	 $('#up'+slno).html('<p><img src="http://www.bhaskar.com/dainikbhaskar2010/images/ajax-loader.gif" width="12" height="12" /></p>');
			$.ajax
                    ({
                        type: "POST",
                        url: "/bollywoodbhaskar2010/scripts/badges_article_vote_rate_Show.php?flname="+filename,
                        data: "logid="+logid+"&slno="+slno+"&up=up",
                        success: function(msg)
                        {
                            $("#up"+slno).ajaxComplete(function(event, request, settings)
                            {
							   $("#up"+slno).html(msg);
                            });
                        }
                    });
}

function onVotedown(filename,logid,slno) {

  $('#down'+slno).html('<p><img src="http://www.bhaskar.com/dainikbhaskar2010/images/ajax-loader.gif" width="12" height="12" /></p>');
			$.ajax
                    ({
                        type: "POST",
                        url: "/bollywoodbhaskar2010/scripts/badges_article_vote_rate_Show.php?flname="+filename,
                        data: "logid="+logid+"&slno="+slno+"&down=down",
                        success: function(msg)
                        {
                            $("#down"+slno).ajaxComplete(function(event, request, settings)
                            {
							   $("#down"+slno).html(msg);
                            });
                        }
                    });
 
}

function becomeFan(pId,logid) {

  $('#fan'+pId).html('<p><img src="http://www.bhaskar.com/dainikbhaskar2010/images/ajax-loader.gif" width="5" height="5" /></p>');
			$.ajax
                    ({
                        type: "POST",
                        url: "/bollywoodbhaskar2010/scripts/badges_article_vote_rate_Show.php?flname="+pId,
                        data: "pId="+pId+"&logid="+logid+"&fan=fan",
                        success: function(msg)
                        {
                            $("#fan"+pId).ajaxComplete(function(event, request, settings)
                            {
							   $("#fan"+pId).html(msg);
							   window.location.href=document.URL;
                            });
                        }
                    });
				

}
function userLikes(pId,logid) {

  $('#like'+pId).html('<p><img src="http://www.bhaskar.com/dainikbhaskar2010/images/ajax-loader.gif" width="12" height="12" /></p>');
			$.ajax
                    ({
                        type: "POST",
                        url: "/bollywoodbhaskar2010/scripts/badges_article_vote_rate_Show.php?flname="+pId,
                        data: "pId="+pId+"&logid="+logid+"&like=like",
                        success: function(msg)
                        {
                            $("#like"+pId).ajaxComplete(function(event, request, settings)
                            {
							   $("#like"+pId).html(msg);
                            });
                        }
                    });

}

function report_abuse_profile(url,id) {
  $('#report_abuse_profile_'+id).html('<p><img src="http://www.bhaskar.com/dainikbhaskar2010/images/ajax-loader.gif" width="12" height="12" /></p>');
			$.ajax
                    ({
                        type: "POST",
                        url: url,
                       // data: "pId="+pId+"&logid="+logid+"&like=like",
                        success: function(msg)
                        {
                            $("#report_abuse_profile_"+id).ajaxComplete(function(event, request, settings)
                            {
							   $("#report_abuse_profile_"+id).html(msg);
                            });
                        }
                    });

}


/*function report_abuse_profile (url, id) {
	alert(url);
		alert(id);
	var strURL = url;
	//alert(strURL);
	var req = getXMLHTTP();
	
	if (id) {
		
		var id = '_'+id;
	}
	
	if (req) {
		
		req.onreadystatechange = function() {
			
			if (req.readyState == 4) {
				
				if (req.status == 200) {		
				
					var divIda = 'report_abuse_profile'+id;
					
					document.getElementById(divIda).innerHTML=req.responseText;	
				
				}
				else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
	
		req.open("GET", strURL, true);
		req.send(null);
	
	}
}
*/

