function setVisibility(id, type) {
 document.getElementById(id).style.visibility = type;
}


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 onVoteup(filename,id) {
	//alert(filename);
		//var strURL="vote.php?img="+img+"&title="+title+"&desc="+desc+"&link="+links;
		var strURL="/bollywoodbhaskar2010/voteShow.php?flname="+filename+"&id="+id+"&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 = '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);
		}
	}
	function onVotedown(filename,id) {
		//var strURL="vote.php?img="+img+"&title="+title+"&desc="+desc+"&link="+links;
		var strURL="/bollywoodbhaskar2010/voteShow.php?flname="+filename+"&id="+id+"&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 = 'down'+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 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 vote() {
		var req = getXMLHTTP();		
		var tt	=	document.poll.option.length;
		
		var doc = document.poll;
			var check = false;
			for(i=0;i<doc.option.length;i++)
			{
				if(doc.option[i].checked)
				{
				//alert(doc.option[i].value);
				check = true;
				break;
				}
			}
			//alert(check);
			if(check == true)
			{
				var id	=	doc.option[i].value;
				//var q_id	=doc.q_id.value;
				//alert(q_id);
				var strURL="/bollywoodbhaskar2010/photogallery/tvVotestar.php?id="+id;
			//alert(strURL);
			if (req) {
			req.onreadystatechange = function() {
				if (req.readyState == 4) {
					//only if "OK"
					if (req.status == 200) {		
						
						var divId = 'show1';	
						//alert(divId);			
						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);
		}
			//document.poll.submit();
			return false;
			}
			else{
			alert("Please choose an option");
			return false;
			}
			return false;
	}



function swapTab(div_val){
		
	var div_id = div_val+'_DIVID';	
	var li_id = div_val+'_LIID';	
	
	document.getElementById('CELEB_DIVID').style.display = 'none';
	document.getElementById('HOT_VIDEOS_DIVID').style.display = 'none';
	document.getElementById('PROMOS_DIVID').style.display = 'none';
	document.getElementById('TV_DIVID').style.display = 'none';	
	
	document.getElementById(div_id).style.display = 'block';
	
	document.getElementById('CELEB_LIID').className = '';
	document.getElementById('HOT_VIDEOS_LIID').className = '';
	document.getElementById('PROMOS_LIID').className = '';
	document.getElementById('TV_LIID').className = '';
	
	document.getElementById(li_id).className = 'open';	
}


function flickTab(div_val){

	var div_id = 'PHGALLERY_ID'+div_val;	
	var li_id = 'LIID_VAL'+div_val;
	
	for(var i=1; i<=5; i++){	
		var div_val = 'PHGALLERY_ID'+i;		
		document.getElementById(div_val).style.display = 'none';
	}
	document.getElementById(div_id).style.display = 'block';	
	
	for(var i=1; i<=5; i++){	
		var li_val = 'LIID_VAL'+i;		
		document.getElementById(li_val).className = '';
	}	
	document.getElementById(li_id).className = 'open';
}



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';	}




var imagen = 1;
var setIntObj = 0;

function changeimage(id)
{

imagen = id;
clearInterval(setIntObj);
var arv = document.getElementById('featuredRev_new').getElementsByTagName("div");
var arv1 = document.getElementById('featuredRev_new').getElementsByTagName("div");
for(var i=0; i < arv.length; i++)
{
if(arv[i].className=='flkr_new2')
{
arv[i].className='flkr_new1'
}
}

for(var j=0; j < arv1.length; j++)
{
if(arv1[j].style.display=='block')
{
arv1[j].style.display='none';
}
}

document.getElementById('nav-fragmentn-'+id).className="flkr_new2";
document.getElementById('fragmentimg-'+id).style.display='block';
}


function changeImagenew()
{
var arv = document.getElementById('featuredRev_new').getElementsByTagName("div");
var arv1 = document.getElementById('featuredRev_new').getElementsByTagName("div");
imagen++;
if(imagen > 8)
{
imagen = 1;
}

for(var i=0; i < arv.length; i++)
{
if(arv[i].className=='flkr_new2')
{
arv[i].className='flkr_new1'
}
}

for(var j=0; j < arv1.length; j++)
{
if(arv1[j].style.display=='block')
{
arv1[j].style.display='none';
}
}

document.getElementById('nav-fragmentn-'+imagen).className="flkr_new2";
document.getElementById('fragmentimg-'+imagen).style.display='block';
}
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', abc);
function abc()
{
setIntObj = setInterval( "changeImagenew()", 5000 );
}
function abc1()
{
clearInterval(setIntObj);
}

	function showHideDiv_new(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 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=500,height=500,top=200,left=320,status=no,scrollbar=yes,resizable=1');
}
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=400,width=290,scrollbar=no');
}
function pops1()
{

var catg		= document.frm.sel_signs.value;
//var sign		= document.getElementById('sign').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=400,width=290,scrollbar=no');
}
