var XMLHttpRequestObject = false ;
var XMLHttpRequestObject2 = false ;
var moviestring = "" ;
var nowinFlash = false ;
var livegoal = false ; 

if(window.XMLHttpRequest){
	XMLHttpRequestObject = new XMLHttpRequest();
	XMLHttpRequestObject2 = new XMLHttpRequest();
}else if(window.ActiveXObject){
	XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP");
	XMLHttpRequestObject2 = new ActiveXObject("Microsoft.XMLHTTP");
}

function getfDatas(flr,a,b){
	var divID = "sforum" ;
	var srcData = "otherforum" ;

//if(b=='' && a!='' ){
//	document.all.forumovie.innerHTML = '' ;
//	document.all.forumovie.style.visibility = 'hidden'; 
//}else{
//	document.all.forumovie.style.visibility = 'visible'; 
//	if(a=='' && b==''){
//		document.all.forumovie.style.height = '580px' ;	
//	}else{
//		document.all.forumovie.style.height = '280px' ;
//	}
//}


	if(XMLHttpRequestObject){
		srcData += ".php?floor="+flr+"&forum="+a+"&index="+b+"&parm="+new Date().getTime();
		var obj = document.getElementById(divID);
		XMLHttpRequestObject.open("GET",srcData);
		XMLHttpRequestObject.onreadystatechange = function(){
			if(XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200){
				obj.innerHTML = XMLHttpRequestObject.responseText;
			}
		}
		XMLHttpRequestObject.send(null);
	}
	
		nowinFlash = true ;			
	 	getData2('../page/otherforum3a.php?tv='+b ,'forumovie','');

}

function cNews(a,b){

getData2('../sport/hotpost.php?flr='+b+'&t='+a ,'news001','');

if(a==1){
document.all.news002.style.backgroundImage = "url(../soccer/select.png)";
}else if(a==2){
document.all.news002.style.backgroundImage = "url(../soccer/select1.png)";
}else if(a==3){
document.all.news002.style.backgroundImage = "url(../soccer/select2.png)";
}else if(a==4){
document.all.news002.style.backgroundImage = "url(../soccer/select3.png)";
}

}

function showtime(a,b){
	if(nowinFlash){
	 
	setTimeout("getData2('"+a+"' ,'"+b+"','')",2000);
	 
	}
}

function showlivegoal(){
	livegoal = true ;
	document.all.forumovie.innerHTML =  '' ;
	document.all.forulivegoal.innerHTML =  '<iframe src="http://free.8bo8.org/freefj.html" height="500" width="604"  frameborder="0"></iframe>' ;
}

function getstock(){
	livegoal = true ;
	document.all.forumovie.innerHTML =  '' ;
	document.all.forulivegoal.innerHTML =  '<iframe src="../page/stock.php" height="500" width="604"  frameborder="0"></iframe>' ;
}

function WriteTV(a){
	//document.all.forumovie.innerHTML =  a ;
}

function getData2(srcData,divID,flr){
	//var divID = "discuss" ;
	var refreshstr = "" ;
	
	refreshstr = srcData ;
	
	if(XMLHttpRequestObject2){
		srcData += "&parm="+new Date().getTime();
		
		var obj = document.getElementById(divID);
		XMLHttpRequestObject2.open("GET",srcData);
		XMLHttpRequestObject2.onreadystatechange = function(){
			if(XMLHttpRequestObject2.readyState == 4 && XMLHttpRequestObject2.status == 200){
				
				
				
				if(  (XMLHttpRequestObject2.responseText) !='' ){
					 var getinn = (XMLHttpRequestObject2.responseText) ;
					  
					if( getinn.length > 10 ){
					if ( divID =='forumovie'){
						
						
						//if(moviestring !=  XMLHttpRequestObject2.responseText){ 
						
						obj.innerHTML = XMLHttpRequestObject2.responseText;
						moviestring = XMLHttpRequestObject2.responseText ; 
						
						if(flr!=''){
						cNews(1,flr);
						}
					}else{					
						obj.innerHTML = XMLHttpRequestObject2.responseText;
					}
					}
				} 
			}
		}
		XMLHttpRequestObject2.send(null);
	}
	
}

function submitforum(srcData,id){
	
	if(XMLHttpRequestObject){
		srcData += "&parm="+new Date().getTime();
		
		XMLHttpRequestObject.open("GET",srcData);
		XMLHttpRequestObject.onreadystatechange = function(){
			if(XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200){
				var obj = document.getElementById("replybox");
				obj.style.visibility = 'hidden'; 
				
				getData2('../page/otherforum4.php?id2=' + id  ,'discuss','') ;
				
			}
		}
		XMLHttpRequestObject.send(null);
	}
	
}

 

function addnewone(a,flr){
	//if( =='1' ){
	
	getData2('otherforum.php?function=addnew&floor='+ flr +'&forum='+a,'sforum','');
	 
}

 
function replyf(flr,fid,tid){

//var obj2 = document.getElementById('inputforum');

//obj2.style.visibility = "visible" ;

//var obj3 = document.getElementById('inputforum2');

//obj3.innerHTML = '<iframe frameborder="0" src="../page/replyforum.php?fid='+ fid +'" width="450" height="204" allowtransparency  > </iframe>'

//var link = '../page/?fi=reply&floor='+flr+"&forum2=" + fid + "&forum3=" + tid ;
//window.location.href = link ;

//window.open('replyforum.php?fid='+fid , 'popup', 'menubar=no, toolbar=no, location=no, directories=no, status=no, resizable=0, scrollbars=0, width=250, height=114');
document.formre.replycontent.value = '';
 
var obj = document.getElementById("replybox");
obj.style.visibility = 'visible'; 

}

function closed(){
var obj = document.getElementById("replybox");
obj.style.visibility = 'hidden'; 
}

function closereply(){

//var obj2 = document.getElementById('inputforum');
//obj2.style.visibility = "hidden" ;

}

function readimage(a,b){
	window.open('../photo/memberphoto.php?tv='+a+'&page='+b , 'photo', 'menubar=no, toolbar=no, location=no, directories=no, status=no, resizable=0, scrollbars=0, width=800, height=600');

}
 
function changetv(a){

//alert('../page/otherforum3a.php?tv=&tvn=' + document.formttv.select2.value  );

getData2('../page/otherforum3a.php?tv=' + a + '&tvn=' + document.formttv.select2.value  ,'forumovie','');

}
 