// JavaScript Document

var doc = null;

function ajax() {
	// Make a new XMLHttp object
	if (typeof window.ActiveXObject != 'undefined' ) doc = new ActiveXObject("Microsoft.XMLHTTP");
	else doc = new XMLHttpRequest();
}

function View_Image(id_region){

   	ajax();
		// Load the result from the response page
		// ** As far a I know firefox will only load a document on the SAME domain!!	
	   if (doc){
	       doc.open("GET", "./user_function.php?section=view_image&id_region=" + id_region, false);
	       doc.send(null);
	    	// Write the response to the div
			ret = doc.responseText;
			ret1 =  ret.split('<break>');

			parent.document.getElementById('image_div').innerHTML = ret1[0];
			parent.document.getElementById('credit_div').innerHTML = ret1[1];
     	
	}	
}

function member_balance()
	{
		ajax();
		// Load the result from the response page
		// ** As far a I know firefox will only load a document on the SAME domain!!	
	   if (doc){
	       doc.open("GET", "./user_function.php?Response=member_balance", false);   
	       doc.send(null);

		   parent.document.getElementById('member_update_balance_div').innerHTML = doc.responseText;
			}
		setTimeout('member_balance();',5000);		
	}

function View_Video(id_region){
	
   	ajax();
		// Load the result from the response page
		// ** As far a I know firefox will only load a document on the SAME domain!!	
	   if (doc){
	       doc.open("GET", "./user_function.php?section=view_video&id_region=" + id_region, false);
	       doc.send(null);
	    	// Write the response to the div
			ret = doc.responseText;
			ret1 =  ret.split('<break>');

			parent.document.getElementById('video_div').innerHTML = ret1[0];
			parent.document.getElementById('vid_credit_div').innerHTML = ret1[1];
     	
	}	
}

function Show_advert()
	{
		ajax();
		// Load the result from the response page
		// ** As far a I know firefox will only load a document on the SAME domain!!	
	   if (doc){
	       doc.open("GET", "./user_function.php?Response=show_advert", false);   
	       doc.send(null);
		    document.getElementById('advert_div').innerHTML = doc.responseText;
			}
		//setTimeout('Show_advert();',10000);		
	}
	
pvt_chat_time_update();	
function pvt_chat_time_update()
	{
		ajax();
		// Load the result from the response page
		// ** As far a I know firefox will only load a document on the SAME domain!!	
	   if (doc){
	       doc.open("GET", "./user_function.php?Response=pvt_chat_time_update", false);   
	       doc.send(null);
			}
		setTimeout('pvt_chat_time_update();',5000);		
	}	
	
	
	
	

		
