﻿function setHomepage(obj, url){
	
	var browser_name = navigator.appName;
	//alert(browser_name);
	
	if(browser_name == 'Microsoft Internet Explorer'){
		obj.style.behavior='url(#default#homepage)';
		obj.setHomePage(url);	
	}else if(browser_name == 'Netscape'){
		var msg = "";
		alert('Due to Netscapes security handling, making www.divyahaskar.co.in 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.divyahaskar.co.in and paste it in the location field in Edit|Preferences|Navigator.');	
	}else{
		//alert('other');
	}
	return true;
}
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 test(id) {
// alert("sad");
		//var strURL="/photoOnMouse.php?img="+img+"&title="+title+"&desc="+desc+"&link="+links;
		var strURL="/divyabhaskar2010/weather/ajax.php?catid="+id;
		//alert(strURL);
		var req = getXMLHTTP();
		
		
		if (req) {
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					//only if "OK"
					if (req.status == 200) {		
						
						//var divId = 'show'+idname;
					  
						document.getElementById('cityDiv').innerHTML=req.responseText;	
						
					} else {
						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
						
					}
				}				
			}			
			req.open("GET", strURL, true);
			req.send(null);
		}
				
	}


/*
function flickTab(div_val){	
	if(div_val == 'SE')
	{
		document.getElementById('b').style.cursor = 'text';
		document.getElementById('a').style.cursor = 'pointer';
		document.getElementById('c').style.cursor = 'pointer';
		document.getElementById('b').className = 'open';
		document.getElementById('a').className = '';
		document.getElementById('c').className = '';
//--

document.getElementById('data2_tdy1').style.display='none';
document.getElementById('data3_last1').style.display='none';

document.getElementById('div3_l').style.display='block';
document.getElementById('div3_l').innerHTML='<div align="center" style="font-family:arial;font-size:13px;height:400px;"><br><br><br><img src="/divyabhaskar2010/images/loading_s.gif" style="margin-bottom:5px"><br>Loading...</div>';

var strURL='/divyabhaskar2010/includes/most_commented_title_daily.html';
var req = getXMLHTTP();
if (req) {
req.onreadystatechange = function() {
if (req.readyState == 4) {
if (req.status == 200) {		
document.getElementById('data2_tdy').innerHTML=req.responseText;	
} else {
alert("There was a problem while using XMLHTTP:\n" + req.statusText);
}
}				
}			
req.open("GET", strURL, true);
req.send(null);
}




var nstrURL='/divyabhaskar2010/includes/most_commented_title_weekly.html';
var nreq = getXMLHTTP();
if (nreq) {
nreq.onreadystatechange = function() {
if (nreq.readyState == 4) {
if (nreq.status == 200) {		
document.getElementById('data3_last').innerHTML=nreq.responseText;	
} else {
alert("There was a problem while using XMLHTTP:\n" + nreq.statusText);
}
}				
}			
nreq.open("GET", nstrURL, true);
nreq.send(null);
}
setTimeout("loadingone()",1000);
		
//-----------		
		
}else if(div_val == 'FI'){
		document.getElementById('a').style.cursor = 'text';
		document.getElementById('b').style.cursor = 'pointer';
		document.getElementById('c').style.cursor = 'pointer';	
		document.getElementById('a').className = 'open';
		document.getElementById('b').className = '';
		document.getElementById('c').className = '';
	}
	
	
	else if(div_val == 'TH'){
		document.getElementById('c').style.cursor = 'text';
		document.getElementById('a').style.cursor = 'pointer';
		document.getElementById('b').style.cursor = 'pointer';
		document.getElementById('c').className = 'open';
		document.getElementById('a').className = '';
		document.getElementById('b').className = '';
//=========		
		
document.getElementById('like_last2').style.display='none';
document.getElementById('like_tdy2').style.display='none';
document.getElementById('div2_loading').style.display='block';

document.getElementById('div2_loading').innerHTML='<div align="center" style="font-family:arial;font-size:13px;height:400px;"><br><br><br><img src="/divyabhaskar2010/images/loading_s.gif" style="margin-bottom:5px"><br>Loading...</div>';
var strURL='/divyabhaskar2010/includes/most_viewed_index_title_daily.html';
var req = getXMLHTTP();
if (req) {
req.onreadystatechange = function() {
if (req.readyState == 4) {
if (req.status == 200) {		
document.getElementById('like_tdy').innerHTML=req.responseText;	
} else {
alert("There was a problem while using XMLHTTP:\n" + req.statusText);
}
}				
}			
req.open("GET", strURL, true);
req.send(null);

}




var nstrURL='/divyabhaskar2010/includes/most_viewed_index_title_weekly.html';
var nreq = getXMLHTTP();
if (nreq) {
nreq.onreadystatechange = function() {
if (nreq.readyState == 4) {
if (nreq.status == 200) {		
document.getElementById('like_last').innerHTML=nreq.responseText;	
} else {
alert("There was a problem while using XMLHTTP:\n" + nreq.statusText);
}
}				
}			
nreq.open("GET", nstrURL, true);
nreq.send(null);
}
setTimeout("loadingone1()",1000);
//document.getElementById('div2_loading').style.display='none';
		
		
		
		
		
		
	}
	var div_id = div_val+'_DIV';
	var li_id = div_val+'_LI_ID';
	document.getElementById('FI_DIV').style.display = 'none';
	document.getElementById('SE_DIV').style.display = 'none';
	document.getElementById('TH_DIV').style.display = 'none';
	document.getElementById(div_id).style.display = 'block';	
	document.getElementById('FI_LI_ID').className = '';
	document.getElementById('SE_LI_ID').className = '';
	document.getElementById('TH_LI_ID').className = '';
	document.getElementById(li_id).className = 'open';	
	
}
*/


function tab1()
{
	document.getElementById('tab1').className='grey_sel fl';
	document.getElementById('tab2').className='db_org fl';
	//document.getElementById('tab3').className='db_yel fl';
	document.getElementById('data1').className='off';
	document.getElementById('data2').className='on';
	//document.getElementById('data3').className='off';
}

function tab2()
{
	document.getElementById('tab1').className='db_grey fl';
	document.getElementById('tab2').className='org_sel fl';
	//document.getElementById('tab3').className='db_yel fl';
	document.getElementById('data1').className='off';
	document.getElementById('data2').className='on';
	//document.getElementById('data3').className='off';
	//document.getElementById('data2_tdy1').style.display='none';
	document.getElementById('content_tab2').style.display='block';	
	document.getElementById('div2_loading').style.display='block';
	document.getElementById('div2_loading').innerHTML='<div align="center" style="font-family:arial;font-size:13px;height:400px;"><br><br><br><img src="/divyabhaskar2010/images/loading_s.gif" style="margin-bottom:5px"><br>Loading...</div>';
	
	var strURL='/divyabhaskar2010/includes/home_shahrukh_contest.php';
	//alert(strURL);
	var req = getXMLHTTP();
	if (req) 
	{
		req.onreadystatechange = function() {
			if (req.readyState == 4) 
			{
				//alert('4');	
				if (req.status == 200) 
				{		
					//alert('200');
					//alert(req.responseText);
					
					document.getElementById('data2_tdy').style.display='block';
					document.getElementById('data2_tdy').innerHTML=req.responseText;	
					//
				} else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
			}				
		}			
		req.open("GET", strURL, true);
		req.send(null);
	}
setTimeout("loadingone()",1000);
}


function loadingone()
{
	document.getElementById('div2_loading').style.display='none';
	document.getElementById('content_tab2').style.display='block';
}


function loadingone1()
{
//document.getElementById('like_last2').style.display='block';
document.getElementById('like_tdy2').style.display='block';
document.getElementById('div2_loading').style.display='none';
}
//-----------------


function loadingone3()
{
	document.getElementById('content_tab3').style.display='block';
	document.getElementById('data3_tdy').style.display='block';		
	document.getElementById('div3_loading').style.display='none';

}

function tab3()
{
	document.getElementById('tab1').className='db_grey fl';
	document.getElementById('tab2').className='db_org fl';
	document.getElementById('tab3').className='yel_sel fl';
	document.getElementById('data1').className='off';
	document.getElementById('data2').className='off';
	document.getElementById('data3').className='on';
	document.getElementById('data1').style.display='none';
	document.getElementById('data2').style.display='none';
	document.getElementById('data3').style.display='block';
	//document.getElementById('like_last2').style.display='none';
	document.getElementById('div3_loading').style.display='block';
	document.getElementById('content_tab3').style.display='none';
	
	document.getElementById('div3_loading').innerHTML='<div align="center" style="font-family:arial;font-size:13px;height:400px;"><br><br><br><img src="/divyabhaskar2010/images/loading_s.gif" style="margin-bottom:5px"><br>Loading...</div>';
	
	var strURL='/divyabhaskar2010/includes/bhawri_home_widget.php';
	//alert(strURL);
	var req = getXMLHTTP();
	if (req) {
		req.onreadystatechange = function() {
		if (req.readyState == 4) {
					if (req.status == 200) {	
					//document.getElementById('div3_loading').style.display='none';	
					document.getElementById('data3_tdy').style.display='block';			
					document.getElementById('data3_tdy').innerHTML=req.responseText;				
					} else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
					}
			}				
	}			
	req.open("GET", strURL, true);
	req.send(null);
	setTimeout("loadingone3()",1000);
	}
}


















/* 
function showHideDiv(shDiv, hiDiv,dID){
	if(dID == 'M')
	{
		document.getElementById('a').style.cursor = 'text';
		document.getElementById('b').style.cursor = 'pointer';
		document.getElementById('a').className = 'open';
		document.getElementById('b').className = '';		
	}else if(dID == 'J'){
		document.getElementById('b').style.cursor = 'text';
		document.getElementById('a').style.cursor = 'pointer';
		document.getElementById('b').className = 'open';
		document.getElementById('a').className = '';
	}
	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 swapTab(div_val){	
	var div_id = div_val+'_SH_DIV';
	var li_id = div_val+'_SHLI_ID';	
	document.getElementById('FI_SH_DIV').style.display = 'none';
	document.getElementById('SE_SH_DIV').style.display = 'none';
	document.getElementById('TH_SH_DIV').style.display = 'none';	
	document.getElementById(div_id).style.display = 'block';	
	document.getElementById('FI_SHLI_ID').className = '';
	document.getElementById('SE_SHLI_ID').className = '';
	document.getElementById('TH_SHLI_ID').className = '';	
	document.getElementById(li_id).className = 'open';	
}	



function loadingone()
{
document.getElementById('data2_tdy1').style.display='block';
document.getElementById('data3_last1').style.display='block';
document.getElementById('div3_l').style.display='none';
}


function loadingone1()
{
document.getElementById('like_last2').style.display='block';
document.getElementById('like_tdy2').style.display='block';
document.getElementById('div2_loading').style.display='none';
}
*/

function setVisibility(id, type) {
 document.getElementById(id).style.visibility = type;
}

function popitup(url) {
newwindow=window.open(url,'name','height=300,width=350');
if (window.focus) {newwindow.focus()}
return false;
}


function show_city()
{
document.getElementById('city1').style.display="none";
document.getElementById('city').style.display="inline";

if(document.getElementById('city1_new'))
{
document.getElementById('city1_new').style.display="none";
document.getElementById('city_new').style.display="inline";
}

}
 
 
function addEvent( obj, type, fn ){ 
   if (obj.addEventListener){ 
	  obj.addEventListener( type, fn, false );
   }
   else if (obj.attachEvent){ 
	  obj["e"+type+fn] = fn; 
	  obj[type+fn] = function(){ obj["e"+type+fn]( window.event ); } 
	  obj.attachEvent( "on"+type, obj[type+fn] ); 
   } 
 
}
 
addEvent(window, 'load', show_city);


function Divyabhaskar1()
			{
			var doc = document.Divyabhaskar;
			var check = false;
			for(i=0;i<doc.options.length;i++)
			{
				if(doc.options[i].checked)
				{
				check = true;
				break;
				}
			}
			if(check)
			{
window.open("http://polls.indiainfo.com/polls.php?submit=submit&channel="+doc.channel.value+"&catid="+doc.catid.value+"&question="+doc.question.value+"&options="+doc.options[i].value,"poll","width=450,height=300,scrollbars=1;")
			return false;
			}
			else{
			alert("Please choose an option");
			return false;
			}
			return false;
			}


			function lifeRSS(val){
window.location=val;
}
function opennewwin()
{
if(document.sign.signtype.selectedIndex==0)
{
alert("Please select an signtype.");
document.sign.signtype.focus();
return false;
}
var type = document.sign.horotype.options[document.sign.horotype.selectedIndex].value;
var sign = document.sign.signtype.options[document.sign.signtype.selectedIndex].value;
var filename = '/astrology/display.php?type='+type+'&signid='+sign;
window.open(filename,'hor','width=450,height=300,top=200,left=320,status=yes,scrollbars=yes,resizable=1');
}
function pops()
{
var catg	= document.getElementById('sel').value;
var num		= document.getElementById('num').value;
var url =  "http://religion.divyabhaskar.co.in/religiondivya2010/admin/num_desc.php?catg="+catg+"&num="+num;
newwindow=window.open(url,'name','height=360,width=280');
}
function pops1()
{
var catg		= document.getElementById('sel_signs').value;
var sign		= document.getElementById('sign').value;
var url =  "http://religion.divyabhaskar.co.in/religiondivya2010/admin/sign_desc.php?catg="+catg+"&sign="+sign;
 
newwindow=window.open(url,'name','height=360,width=280');
}




onerror	= handleErr;
//Handle error on script
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 changeOreally(val){
	
	//alert(val);
	var hidVal = document.getElementById('oreallyHidId').value;
	hidVal = parseInt(hidVal);
		
	if(val == 'N'){		
		if(hidVal == 10){
			document.getElementById('oreallyHidId').value = 1;	
		}else{			
			hidVal = hidVal + 1;			
			document.getElementById('oreallyHidId').value = hidVal;
		}		
	}else{		
		if(hidVal == 1){
			document.getElementById('oreallyHidId').value = 10;	
		}else{			
			hidVal = hidVal - 1;			
			document.getElementById('oreallyHidId').value = hidVal;
		}
	}
	
	hidPassVal = document.getElementById('oreallyHidId').value;
	
	
	$.ajax({
		type: "POST",
		url: "/divyabhaskar2010/ajax.php",
		data: "curVal="+hidPassVal,
		
		success: function(msg){			
			//alert( "Data Saved: " + msg );return false;			
			$('#orDivId').html(msg);						
		},		
		error: function(){
			//alert('some error has occured...');	
		},		
		start: function(){
			//alert('ajax has been started...');	
		}		
	});	
	
}

// for quotation
function changeCategory(val){
	
	//alert(val);
	
	var hidVal = document.getElementById('CategoryHidId').value;
	hidVal = parseInt(hidVal);
		
	if(val == 'N'){		
		if(hidVal == 10){
			document.getElementById('CategoryHidId').value = 1;
		}else{			
			hidVal = hidVal + 1;			
			document.getElementById('CategoryHidId').value = hidVal;
		}		
	}else{		
		if(hidVal == 1){
			document.getElementById('CategoryHidId').value = 10;	
		}else{			
			hidVal = hidVal - 1;			
			document.getElementById('CategoryHidId').value = hidVal;
		}
	}
	
	hidPassVal = document.getElementById('CategoryHidId').value;
	
	
	$.ajax({
		type: "POST",
		url: "/divyabhaskar2010/ajaxquote.php",
		data: "curVal="+hidPassVal,
		
		success: function(msg){			
			//alert( "Data Saved: " + msg );return false;			
			$('#QuotDivId').html(msg);						
		},		
		error: function(){
			//alert('some error has occured...');	
		},		
		start: function(){
			//alert('ajax has been started...');	
		}		
	});	
	
}

// for agriculture
function changeAgriculture(val){
	
	//alert(val);
	
	var hidVal = document.getElementById('AgricultureHidId').value;
	hidVal = parseInt(hidVal);
		
	if(val == 'N'){		
		if(hidVal == 10){
			document.getElementById('AgricultureHidId').value = 1;
		}else{			
			hidVal = hidVal + 2;			
			document.getElementById('AgricultureHidId').value = hidVal;
			//alert(hidVal);
		}		
	}else{		
		if(hidVal == 1){
			document.getElementById('AgricultureHidId').value = 10;	
		}else{			
			hidVal = hidVal - 2;			
			document.getElementById('AgricultureHidId').value = hidVal;
		}
	}
	
	hidPassVal = document.getElementById('AgricultureHidId').value;
	
	
	$.ajax({
		type: "POST",
		url: "/divyabhaskar2010/ajaxagriculture.php",
		data: "curVal="+hidPassVal,
		
		success: function(msg){			
			//alert( "Data Saved: " + msg );return false;			
			$('#AgriDivId').html(msg);						
		},		
		error: function(){
			//alert('some error has occured...');	
		},		
		start: function(){
			//alert('ajax has been started...');	
		}		
	});	
	
}


// JavaScript Document
//+++++++++	This function return the left and top position of div
function GetLeftTopPosition(obj)
{	
    var topValue= 0,leftValue= 0;
    while(obj){
		leftValue+= obj.offsetLeft;
		topValue+= obj.offsetTop;
		obj= obj.offsetParent;
    }
	finalvalue = leftValue+"::"+topValue;
    return finalvalue;
}
//+++++++++++++++++++++++++++++++++++++++++++



//+++++++++  This function return the page height and width start here ++++++++++++++++++++//
function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}
	
	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}
	
	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}
//+++++++++  This function return the page height and width end here ++++++++++++++++++++//

/*===============================================================*/
//=== 		This code for float the div		======================

var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function JSFX_FloatDiv(id, sx, sy)
{
	var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
	var px = document.layers ? "" : "px";
	window[id + "_obj"] = el;
	if(d.layers)el.style=el;
	el.cx = el.sx = sx;el.cy = el.sy = sy;
	el.sP=function(x,y){this.style.left=x+px;this.style.top=y+px;};

	el.floatIt=function()
	{
		var pX, pY;
		pX = (this.sx >= 0) ? 0 : ns ? innerWidth : 
		document.documentElement && document.documentElement.clientWidth ? 
		document.documentElement.clientWidth : document.body.clientWidth;
		pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? 
		document.documentElement.scrollTop : document.body.scrollTop;
		if(this.sy<0) 
		pY += ns ? innerHeight : document.documentElement && document.documentElement.clientHeight ? 
		document.documentElement.clientHeight : document.body.clientHeight;
		this.cx += (pX + this.sx - this.cx)/8;this.cy += (pY + this.sy - this.cy)/8;
		this.sP(this.cx, this.cy);
		setTimeout(this.id + "_obj.floatIt()", 40);
	}
	return el;
}
/*===============================================================*/



function submitUrEntry(divId){
		
	//alert(divId);	
	var divIdVal = '#'+divId;
	
	var pageDet = getPageSize();	
		
	var pagWid = pageDet[0];
	var pagHei = pageDet[1];
	var winWid = pageDet[2];
	var winHei = pageDet[3];
	
	var win_width = $(window).width();   // returns width of browser viewport
	var doc_width = $(document).width(); // returns width of HTML document	
	var win_height = $(window).height();   // returns height of browser viewport
	var doc_height = $(document).height(); // returns height of HTML document
	
	$('#maskDivMedia').width(pagWid);
	$('#maskDivMedia').height(pagHei);
	
	$('#div_loading').show();
	//alert(win_height);
	//alert(doc_height);
	
	
	$.ajax({
		type: "POST",
		url: "ajax.php",
		data: "page=vday",
		
		success: function(msg){
			//alert( "Data Saved:"+ msg );
			
			$('#cntDivId').html(msg);
		},
		
		error: function(){
			//alert('some error has occured...');	
		},
		
		start: function(){
			//alert('ajax has been started...');	
		}
		
	});	
		
	var popUpWidth = $(divIdVal).width();
	var popUpHeight	= $(divIdVal).height();
	
	//alert(popUpWidth);
	//alert(popUpHeight);
	
	var topposition 	= (win_height / 3) - (popUpHeight / 2);
	var leftposition 	= (win_width / 2) - (popUpWidth / 2);
	
	document.getElementById(divId).style.top = topposition+'px';
	document.getElementById(divId).style.left = leftposition+'px';
		
	//$(divIdVal).scrollTop  = topposition+'px';
	//$(divIdVal).scrollLeft = leftposition+'px';
	document.getElementById('ifrmId').style.display = 'block';
	$(divIdVal).show('slow');
	
	//JSFX_FloatDiv(divId, leftposition, topposition).floatIt();
	JSFX_FloatDiv(divId, leftposition, 5).floatIt();
}




function PostDrLove(divId){
		document.getElementById('content').style.display="block";
	
	//alert(divId);	
	var divIdVal = '#'+divId;
	
	var pageDet = getPageSize();	
		
	var pagWid = pageDet[0];
	var pagHei = pageDet[1];
	var winWid = pageDet[2];
	var winHei = pageDet[3];
	
	var win_width = $(window).width();   // returns width of browser viewport
	var doc_width = $(document).width(); // returns width of HTML document	
	var win_height = $(window).height();   // returns height of browser viewport
	var doc_height = $(document).height(); // returns height of HTML document
	
	$('#maskDivMedia').width(pagWid);
	$('#maskDivMedia').height(pagHei);
	
	$('#div_loading').show();
	
	var popUpWidth = $(divIdVal).width();
	var popUpHeight	= $(divIdVal).height();
	document.getElementById('setifrm').innerHTML='<iframe id="drIfrmId" src="http://www.divyabhaskar.co.in/divyabhaskar2010/post_bhaskar_feedback.php" allowtransparency="true" frameborder="0" marginheight="0" vspace="0" height="550" width="440" scrolling="no"></iframe>';
	var topposition 	= (win_height / 3) - (popUpHeight / 2);
	var leftposition 	= (win_width / 2) - (popUpWidth / 2)+(250);
	document.getElementById(divId).style.top = topposition+'px';
	document.getElementById(divId).style.left = leftposition+'px';
	document.getElementById('drIfrmId').style.display = 'block';
	$(divIdVal).show('slow');
	JSFX_FloatDiv(divId, leftposition, 50).floatIt();


}



function closeDiv(divId){
	
	var divIdVal = '#'+divId;	
	$(divIdVal).hide('slow');
	
	$('#div_loading').hide();
}

// JavaScript Document
var setIntObj = 0;

function changeImage(slideType, defVal){	
	
	if(defVal != 'D'){
		clearInterval(setIntObj);
		document.getElementById('pauseDivId').style.display = 'none';
		document.getElementById('playDivId').style.display = 'block';
	}
	
	var cnt_val = document.getElementById('hidCntVal').value;
	cnt_val = parseInt(cnt_val);

	var noOfImage = document.getElementById('noOfPhotos').value;
	noOfImage = parseInt(noOfImage);
	
	for(var i=1; i<=noOfImage; i++){

		var div_val = 'flickPanel'+i;
		document.getElementById(div_val).style.display = 'none';				
	}
	
	if(slideType == 'N'){
		
		if(cnt_val == noOfImage){
			cnt_val = 0;		
		}
		
		cnt_val = cnt_val+1;
		
		var div_id = 'flickPanel'+cnt_val;
		//alert(div_id);
		document.getElementById(div_id).style.display = 'block';
		
		document.getElementById('hidCntVal').value = cnt_val;
	}else{
		
		if(cnt_val == 1){
			cnt_val = noOfImage+1;
		}
		
		cnt_val = cnt_val-1;
		
		var div_id = 'flickPanel'+cnt_val;
		document.getElementById(div_id).style.display = 'block';
		
		document.getElementById('hidCntVal').value = cnt_val;
		
	}	
	document.getElementById('stDivId').innerHTML = cnt_val;
	
}

setIntObj = setInterval( "changeImage('N', 'D')", 7000 );

function stopImageSlide(shDiv, hiDiv){
	
	document.getElementById(hiDiv).style.display = 'none';
	document.getElementById(shDiv).style.display = 'block';
	
	clearInterval(setIntObj);
}

function startImageSlide(shDiv, hiDiv){
	document.getElementById(hiDiv).style.display = 'none';
	document.getElementById(shDiv).style.display = 'block';
	
	setIntObj = setInterval( "changeImage('N', 'D')", 7000 );	
}

function setImage(divVal){
	
	clearInterval(setIntObj);
	document.getElementById('pauseDivId').style.display = 'none';
	document.getElementById('playDivId').style.display = 'block';	
	
	var cnt_val = document.getElementById('hidCntVal').value;
	cnt_val = parseInt(cnt_val);

	var noOfImage = document.getElementById('noOfPhotos').value;
	noOfImage = parseInt(noOfImage);
	
	for(var i=1; i<=noOfImage; i++){

		var div_val = 'flickPanel'+i;
		document.getElementById(div_val).style.display = 'none';				
	}
		
	cnt_val = divVal;
	
	var div_id = 'flickPanel'+cnt_val;
	document.getElementById(div_id).style.display = 'block';
	
	document.getElementById('hidCntVal').value = cnt_val;	
	document.getElementById('stDivId').innerHTML = cnt_val;	
}






function getCookie(c_name)
{
var i,x,y,ARRcookies=document.cookie.split(";");
for (i=0;i<ARRcookies.length;i++)
{
  x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
  y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
  x=x.replace(/^\s+|\s+$/g,"");
  if (x==c_name)
    {
    return unescape(y);
    }
  }
}



function setCookie(c_name,value,exdays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
document.cookie=c_name + "=" + c_value;
}


function preload(images) {
    if (document.images) {
        var i = 0;
        var imageArray = new Array();
        imageArray = images.split(',');
        var imageObj = new Image();
        for(i=0; i<=imageArray.length-1; i++) {
            imageObj.src=images[i];
        }
    }
}


function swapBusinessTab(val){

//clearInterval(setIntObj_city);
	
for(var i=1; i<9; i++){
var tab_id = 'BU_DIVID_'+i;
//document.getElementById(tab_id).style.display = 'none';
var tab_li_id = 'BU_LIID_'+i;
document.getElementById(tab_li_id).className = '';
}

var sh_li_id = 'BU_LIID_'+val;	
document.getElementById(sh_li_id).className = 'open';

var sh_tab_id = 'BU_DIVID_'+val;	
document.getElementById('BU_DIVID_1').innerHTML = '<div align="center" style="font-family:arial;font-size:13px;height:165px;"><br><img src="/divyabhaskar2010/images/loading_s.gif" style="margin-bottom:5px"><br>Loading...</div>';	
document.getElementById('BU_DIVID_1').style.display = 'block';	

var strURL= '/divyabhaskar2010/scripts/city_news_new.php?id='+val;
var req = getXMLHTTP();
if (req) {
req.onreadystatechange = function() {
if (req.readyState == 4) {
if (req.status == 200) {		
document.getElementById('BU_DIVID_1').innerHTML=req.responseText;	
setCookie("city_tab",sh_tab_id,365);
} else {
alert("There was a problem while using XMLHTTP:\n" + req.statusText);
}
}				
}			
req.open("GET", strURL, true);
req.send(null);
}
}


function checkCookie()
{
var city_tab=getCookie("city_tab");
if (city_tab!=null && city_tab!="")
  {
var city_tab1 = city_tab.replace("BU_DIVID_", "");
swapBusinessTab(city_tab1);
  }
}


function checkCookie1()
{
var state_tab=getCookie("state_tab");

if (state_tab!=null && state_tab!="")
  {
var state_tab1 = state_tab.replace("SBU_DIVID_", "");
swapBusinessTabn(state_tab1);
  }
}


function swapBusinessTabn(val){
for(var i=1; i<11; i++){
var tab_id = 'SBU_DIVID_'+i;
document.getElementById(tab_id).style.display = 'none';
var tab_li_id = 'SBU_LIID_'+i;
document.getElementById(tab_li_id).className = '';
}

var sh_li_id = 'SBU_LIID_'+val;	
document.getElementById(sh_li_id).className = 'open';

var sh_tab_id = 'SBU_DIVID_'+val;	
document.getElementById(sh_tab_id).innerHTML = '<div align="center" style="font-family:arial;font-size:13px;height:300px;"><br><img src="/divyabhaskar2010/images/loading_s.gif" style="margin-bottom:5px"><br>Loading...</div>';	
document.getElementById(sh_tab_id).style.display = 'block';	

var strURL= '/divyabhaskar2010/scripts/state_news_new.php?id='+val;
var req = getXMLHTTP();
if (req) {
req.onreadystatechange = function() {
if (req.readyState == 4) {
if (req.status == 200) {		
document.getElementById(sh_tab_id).innerHTML=req.responseText;	
setCookie("state_tab",sh_tab_id,365);
} else {
alert("There was a problem while using XMLHTTP:\n" + req.statusText);
}
}				
}			
req.open("GET", strURL, true);
req.send(null);
}
}


function ctabnew(obj)
{

var ar = document.getElementById('citymain').getElementsByTagName("div");

 
for(var i=0; i<ar.length; i++){
//alert(ar[i].className);

if(ar[i].className=="city_tb1") 
{
ar[i].className = "city_tb";
}

if(ar[i].className == "dv_on") 
{
ar[i].className = "dv_of";
}
}
	//alert(obj);
document.getElementById('tabrite'+obj).className= "city_tb1";
document.getElementById('cnt_'+obj).className="dv_on";

}



function changehoroscop()
{
if(document.getElementById('horos').value=='1')
	{
document.getElementById('jyotish1').style.display='';
document.getElementById('jyotish2').style.display='none';
	}

if(document.getElementById('horos').value=='2')
	{
document.getElementById('jyotish1').style.display='none';
document.getElementById('jyotish2').style.display='';
	}


}


//---CITY FLICKER

var setIntObj_city = 0;

function changeImage_city(slideType, defVal){	
	
	if(defVal != 'D'){
		clearInterval(setIntObj_city);
		document.getElementById('pauseDivId_city').style.display = 'none';
		document.getElementById('playDivId_city').style.display = 'block';
	}
	
	var cnt_val = document.getElementById('hidCntVal_city').value;
	cnt_val = parseInt(cnt_val);

	var noOfImage = document.getElementById('noOfPhotos_city').value;
	noOfImage = parseInt(noOfImage);
	
	for(var i=1; i<=noOfImage; i++){

		var div_val = 'flickPanel_city'+i;
		document.getElementById(div_val).style.display = 'none';				
	}
	
	if(slideType == 'N'){
		
		if(cnt_val == noOfImage){
			cnt_val = 0;		
		}
		
		cnt_val = cnt_val+1;
		
		var div_id = 'flickPanel_city'+cnt_val;
		//alert(div_id);
		document.getElementById(div_id).style.display = 'block';
		
		document.getElementById('hidCntVal_city').value = cnt_val;
	}else{
		
		if(cnt_val == 1){
			cnt_val = noOfImage+1;
		}
		
		cnt_val = cnt_val-1;
		
		var div_id = 'flickPanel_city'+cnt_val;
		document.getElementById(div_id).style.display = 'block';
		
		document.getElementById('hidCntVal_city').value = cnt_val;
		
	}	
	document.getElementById('stDivId_city').innerHTML = cnt_val;
	
}

//setIntObj_city = setInterval( "changeImage_city('N', 'D')", 7000 );

function stopImageSlide_city(shDiv, hiDiv){
	
	document.getElementById(hiDiv).style.display = 'none';
	document.getElementById(shDiv).style.display = 'block';
	
	clearInterval(setIntObj_city);
}

function startImageSlide_city(shDiv, hiDiv){
	document.getElementById(hiDiv).style.display = 'none';
	document.getElementById(shDiv).style.display = 'block';
	
	setIntObj_city = setInterval( "changeImage_city('N', 'D')", 7000 );	
}

function setImage_city(divVal){
	
	clearInterval(setIntObj_city);
	document.getElementById('pauseDivId_city').style.display = 'none';
	document.getElementById('playDivId_city').style.display = 'block';	
	
	var cnt_val = document.getElementById('hidCntVal_city').value;
	cnt_val = parseInt(cnt_val);

	var noOfImage = document.getElementById('noOfPhotos_city').value;
	noOfImage = parseInt(noOfImage);
	
	for(var i=1; i<=noOfImage; i++){

		var div_val = 'flickPanel_city'+i;
		document.getElementById(div_val).style.display = 'none';				
	}
		
	cnt_val = divVal;
	
	var div_id = 'flickPanel_city'+cnt_val;
	document.getElementById(div_id).style.display = 'block';
	
	document.getElementById('hidCntVal_city').value = cnt_val;	
	document.getElementById('stDivId_city').innerHTML = cnt_val;	
}



function newswapBusinessTab(val){
	//alert(val);
	for(var i=1; i<3; i++){
		var tab_id = 'newBU_DIVID_'+i;
		document.getElementById(tab_id).style.display = 'none';
		var tab_li_id = 'newBU_LIID_'+i;
		document.getElementById(tab_li_id).className = '';
	}
	
	var sh_tab_id = 'newBU_DIVID_'+val;	
	document.getElementById(sh_tab_id).style.display = 'block';	
	var sh_li_id = 'newBU_LIID_'+val;	
	document.getElementById(sh_li_id).className = 'open';
}


//---CRICKET FLICKER

var setIntObj_cricket = 0;

function changeImage_cricket(slideType, defVal){	
	
	if(defVal != 'D'){
		clearInterval(setIntObj_cricket);
		document.getElementById('pauseDivId_cricket').style.display = 'none';
		document.getElementById('playDivId_cricket').style.display = 'block';
	}
	
	var cnt_val = document.getElementById('hidCntVal_cricket').value;
	cnt_val = parseInt(cnt_val);

	var noOfImage = document.getElementById('noOfPhotos_cricket').value;
	noOfImage = parseInt(noOfImage);
	
	for(var i=1; i<=noOfImage; i++){

		var div_val = 'flickPanel_cricket'+i;
		document.getElementById(div_val).style.display = 'none';				
	}
	
	if(slideType == 'N'){
		
		if(cnt_val == noOfImage){
			cnt_val = 0;		
		}
		
		cnt_val = cnt_val+1;
		
		var div_id = 'flickPanel_cricket'+cnt_val;
		//alert(div_id);
		document.getElementById(div_id).style.display = 'block';
		
		document.getElementById('hidCntVal_cricket').value = cnt_val;
	}else{
		
		if(cnt_val == 1){
			cnt_val = noOfImage+1;
		}
		
		cnt_val = cnt_val-1;
		
		var div_id = 'flickPanel_cricket'+cnt_val;
		document.getElementById(div_id).style.display = 'block';
		
		document.getElementById('hidCntVal_cricket').value = cnt_val;
		
	}	
	document.getElementById('stDivId_cricket').innerHTML = cnt_val;
	
}

//setIntObj_cricket = setInterval( "changeImage_cricket('N', 'D')", 7000 );

function stopImageSlide_cricket(shDiv, hiDiv){
	
	document.getElementById(hiDiv).style.display = 'none';
	document.getElementById(shDiv).style.display = 'block';
	
	clearInterval(setIntObj_cricket);
}

function startImageSlide_cricket(shDiv, hiDiv){
	document.getElementById(hiDiv).style.display = 'none';
	document.getElementById(shDiv).style.display = 'block';
	
	setIntObj_cricket = setInterval( "changeImage_cricket('N', 'D')", 7000 );	
}

function setImage_cricket(divVal){
	
	clearInterval(setIntObj_cricket);
	document.getElementById('pauseDivId_cricket').style.display = 'none';
	document.getElementById('playDivId_cricket').style.display = 'block';	
	
	var cnt_val = document.getElementById('hidCntVal_cricket').value;
	cnt_val = parseInt(cnt_val);

	var noOfImage = document.getElementById('noOfPhotos_cricket').value;
	noOfImage = parseInt(noOfImage);
	
	for(var i=1; i<=noOfImage; i++){

		var div_val = 'flickPanel_cricket'+i;
		document.getElementById(div_val).style.display = 'none';				
	}
		
	cnt_val = divVal;
	
	var div_id = 'flickPanel_cricket'+cnt_val;
	document.getElementById(div_id).style.display = 'block';
	
	document.getElementById('hidCntVal_cricket').value = cnt_val;	
	document.getElementById('stDivId_cricket').innerHTML = cnt_val;	
}




//---Religion FLICKER

var setIntObj_rel = 0;

function changeImage_rel(slideType, defVal){	
	
	if(defVal != 'D'){
		clearInterval(setIntObj_rel);
		document.getElementById('pauseDivId_rel').style.display = 'none';
		document.getElementById('playDivId_rel').style.display = 'block';
	}
	
	var cnt_val = document.getElementById('hidCntVal_rel').value;
	cnt_val = parseInt(cnt_val);

	var noOfImage = document.getElementById('noOfPhotos_rel').value;
	noOfImage = parseInt(noOfImage);
	
	for(var i=1; i<=noOfImage; i++){

		var div_val = 'flickPanel_rel'+i;
		document.getElementById(div_val).style.display = 'none';				
	}
	
	if(slideType == 'N'){
		
		if(cnt_val == noOfImage){
			cnt_val = 0;		
		}
		
		cnt_val = cnt_val+1;
		
		var div_id = 'flickPanel_rel'+cnt_val;
		//alert(div_id);
		document.getElementById(div_id).style.display = 'block';
		
		document.getElementById('hidCntVal_rel').value = cnt_val;
	}else{
		
		if(cnt_val == 1){
			cnt_val = noOfImage+1;
		}
		
		cnt_val = cnt_val-1;
		
		var div_id = 'flickPanel_rel'+cnt_val;
		document.getElementById(div_id).style.display = 'block';
		
		document.getElementById('hidCntVal_rel').value = cnt_val;
		
	}	
	document.getElementById('stDivId_rel').innerHTML = cnt_val;
	
}

//setIntObj_rel = setInterval( "changeImage_rel('N', 'D')", 7000 );

function stopImageSlide_rel(shDiv, hiDiv){
	
	document.getElementById(hiDiv).style.display = 'none';
	document.getElementById(shDiv).style.display = 'block';
	
	clearInterval(setIntObj_rel);
}

function startImageSlide_rel(shDiv, hiDiv){
	document.getElementById(hiDiv).style.display = 'none';
	document.getElementById(shDiv).style.display = 'block';
	
	setIntObj_rel = setInterval( "changeImage_rel('N', 'D')", 7000 );	
}

function setImage_rel(divVal){
	
	clearInterval(setIntObj_rel);
	document.getElementById('pauseDivId_rel').style.display = 'none';
	document.getElementById('playDivId_rel').style.display = 'block';	
	
	var cnt_val = document.getElementById('hidCntVal_rel').value;
	cnt_val = parseInt(cnt_val);

	var noOfImage = document.getElementById('noOfPhotos_rel').value;
	noOfImage = parseInt(noOfImage);
	
	for(var i=1; i<=noOfImage; i++){

		var div_val = 'flickPanel_rel'+i;
		document.getElementById(div_val).style.display = 'none';				
	}
		
	cnt_val = divVal;
	
	var div_id = 'flickPanel_rel'+cnt_val;
	document.getElementById(div_id).style.display = 'block';
	
	document.getElementById('hidCntVal_rel').value = cnt_val;	
	document.getElementById('stDivId_rel').innerHTML = cnt_val;	
}


function openscop(url)
{
//var catg		= document.getElementById('sel_signs').value;
//alert(catg);
//var sign		= document.getElementById('sign').value;
//var sign		= document.form.sign.value;
//alert(sign); 
var url =  url;

newwindow=window.open(url,'name','height=400,width=360');
}




function gethdata()
{
document.getElementById('hscop_data').innerHTML='<div align="center" style="font-family:arial;font-size:13px;color:#768ea4"><img src="/divyabhaskar2010/images/loading_s.gif" style="margin-bottom:5px"><br>Loading...</div>';


var catg = document.getElementById('sel_signs').value;
var sign = document.getElementById('sign').value;
var strURL = "/divyabhaskar2010/sign_desc_new.php?catg="+catg+"&sign="+sign;

var req = getXMLHTTP();
if (req) {
req.onreadystatechange = function() {
if (req.readyState == 4) {
if (req.status == 200) {		
document.getElementById('hscop_data').innerHTML=req.responseText;	
} else {
//alert("There was a problem while using XMLHTTP:\n" + req.statusText);
}
}				
}			
req.open("GET", strURL, true);
req.send(null);
}
}




function gethdata1()
{
document.getElementById('hscop_data').innerHTML='<div align="center" style="font-family:arial;font-size:13px;color:#768ea4"><img src="/divyabhaskar2010/images/loading_s.gif" style="margin-bottom:5px"><br>Loading...</div>';

var catg	= document.getElementById('sel').value;
var num		= document.getElementById('num').value;
var strURL = "/divyabhaskar2010/num_desc_new.php?catg="+catg+"&num="+num;
var req = getXMLHTTP();
if (req) {
req.onreadystatechange = function() {
if (req.readyState == 4) {
if (req.status == 200) {		
document.getElementById('hscop_data').innerHTML=req.responseText;	
} else {
alert("There was a problem while using XMLHTTP:\n" + req.statusText);
}
}				
}			
req.open("GET", strURL, true);
req.send(null);
}
}


function flickerautoplay()
{
setIntObj_cricket = setInterval( "changeImage_cricket('N', 'D')", 5000 );
setIntObj_rel = setInterval( "changeImage_rel('N', 'D')", 5000 );
setIntObj_city = setInterval( "changeImage_city('N', 'D')", 5000 );
//setIntObj_state = setInterval( "changeImage_state('N', 'D')", 5000 );
}
/*function onVoteup_eod(filename,slno) {
  $('#up'+slno).html('<p><img src="/divyabhaskar2010/images/eodloader.gif" width="10" height="10" /></p>');
  $('#up'+slno).load("/divyabhaskar2010/scripts/voteShow_eod.php?flname="+filename+"&up=up");
}*/

/*******************************************************************************
Author					:  SATYA PRAKASH
Date Created/Modified	:  8th Nov 2011 (copy from www.bhaskar.com)
Purpose					:  Ajax request for pushing thumb up count into database
*******************************************************************************/
function onVoteup_eod(filename,id) {
	var strURL="/divyabhaskar2010/scripts/voteShow_eod.php?flname="+filename+"&up=up";
	var req = getXMLHTTP();
	if (req) {
		req.onreadystatechange = function() {
			if (req.readyState == 4) {
				//only if "OK"
				if (req.status == 200) {		
					
					var divId = 'up'+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);
	}
}

/*---------------- Global login JS Start---------------------------*/

function check_login_global(logId) {	
checklogId=isNaN(logId);	
if(checklogId){		
		bhw_js_global() ;
		return false;
		}
}


function bhw_js_global() {	
//alert('bhw_js');
var post_comment_1 = '';
if(document.getElementById('slno_id') && document.getElementById('post_comment'))
{
post_comment_1=document.getElementById('post_comment').value;
var slno_id = document.getElementById('slno_id').value;

if ((post_comment_1 != '') && (post_comment_1 != 'अपना कमेंट यहां लिखें'))
{	

post_comment_1 = '&comnt='+post_comment_1+'&slno_id='+slno_id;
} else {

post_comment_1 = '';
}

}

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;
  }

var h = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;
var browserName=navigator.appName;
if (browserName=="Microsoft Internet Explorer")
{
var hne = document.getElementsByTagName('body')[0].scrollHeight;
}
else
{
var hne = document.getElementsByTagName('html')[0].scrollHeight;
}

var hne = hne+30;

var aboveheight = myHeight-338;
var aboveheight1 = aboveheight/2+h;
var iewidth = myWidth-595;
var iewidth1 = iewidth/2;
document.getElementById('message2_global').style.top=aboveheight1+'px';
document.getElementById('message2_global').style.left=iewidth1+'px';
document.getElementById('message2_global').style.display='block';

var d = new Date();
var epoch_time =(d.getTime()-d.getMilliseconds())/1000;
var randomnumber=Math.floor(Math.random()*9999);
var randomnumber1=Math.floor(Math.random()*9999);
var ran_num=randomnumber+"."+epoch_time+"."+randomnumber1;
var changurl='?no='+ran_num;

document.getElementById('message3_global').innerHTML='<iframe src="http://www.divyabhaskar.co.in/divyabhaskar2010/contest/bawardslogin.php'+changurl+post_comment_1+'" id="drIfrmId" width="575" frameborder="0" height="330" scrolling="auto"></iframe>';

<!--document.getElementById('message3').innerHTML='<iframe src="http://www7.divyabhaskar.co.in/divyabhaskar2010/contest/bawardslogin.php'+post_comment_1+'" id="drIfrmId" width="575" frameborder="0" height="330" scrolling="auto"></iframe>';-->


document.getElementById('mailblack_global').style.display='block';
document.getElementById('mailblack_global').style.height=hne+'px';

}

function bhw_js_close_global() 
{
document.getElementById('mailblack_global').style.display='none';
document.getElementById('message2_global').style.display='none';
document.getElementById('message3_global').innerHTML='';
}
/*---------------- Global login JS End---------------------------*/
