var xmlHttp;
var xmlHttp_2;
var xmlHttp_3;
var xmlHttp_4;
var xmlHttp_5;
var xmlHttp_6;
var xmlHttp_7;
var xmlHttp_8;

var xmlHttp_11;
var xmlHttp_12;
var xmlHttp_13;
var xmlHttp_14;
var randomnumber;

function update_promobanner_top(page)
{	
var x = page;
	try
	{
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
				alert("Your browser does not support AJAX!"); return false;
			}
		}
	}
	xmlHttp.onreadystatechange=function()
	{
		if (xmlHttp.readyState==4)
		{
			if(strlen(xmlHttp.responseText) > 10){
			document.getElementById("televizor_10").innerHTML=xmlHttp.responseText;
			}
			setTimeout("update_promobanner('"+x+"')",110000);
		}
	}
	page2=str.page;
	randomnumber=Math.random()*100;
	//xmlHttp.open("GET","./banner.php?page="+randomnumber,true);
	xmlHttp.open("GET","./televizor4.php?page="+x+"&rand="+randomnumber,true);
	xmlHttp.send(null);	
}
function update_quotes_testov()
{	
	try
	{
		xmlHttp_4=new XMLHttpRequest();
	}
	catch (e)
	{
		try
		{
			xmlHttp_4=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try { xmlHttp_4=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
				alert("Your browser does not support AJAX!"); return false;
			}
		}
	}
	xmlHttp_4.onreadystatechange=function()
	{
		if (xmlHttp_4.readyState==4)
		{
			if(strlen(xmlHttp_4.responseText) > 10){
				if(document.getElementById("quote_div")){
			document.getElementById("quote_div").innerHTML=xmlHttp_4.responseText;
				}
			}
			setTimeout("update_quotes_testov()",5000);	
		}
	}
	randomnumber=Math.random()*100;
	xmlHttp_4.open("GET","./quotes.htm?rand="+randomnumber,true);
	xmlHttp_4.send(null);	
}

function update_quotes() {
	var quotes = load("./quotes.htm?rand="+randomnumber);
	if (strlen(quotes)>10) {
		$("#quote_div").load("./quotes.htm?rand="+randomnumber);
	}
		var refreshId = setInterval(function() {
			if (strlen(quotes)>10) {
				$("#quote_div").load("./quotes.htm?rand="+randomnumber);
			}
		}, 5000);
}

function update_clocks()
{	
	try
	{
		xmlHttp_5=new XMLHttpRequest();
	}
	catch (e)
	{
		try
		{
			xmlHttp_5=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try { xmlHttp_5=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
				alert("Your browser does not support AJAX!"); return false;
			}
		}
	}
	xmlHttp_5.onreadystatechange=function()
	{
		if (xmlHttp_5.readyState==4)
		{
			if(strlen(xmlHttp_5.responseText) > 10){
			document.getElementById("clocks").innerHTML=xmlHttp_5.responseText;
			}
			setTimeout("update_clocks()",10000);			
		}
	}
	randomnumber=Math.random()*100;
	xmlHttp_5.open("GET","./clocks-reload.php?rand="+randomnumber,true);
	xmlHttp_5.send(null);	
}

function update_banner()
{	
	try
	{
		xmlHttp_6=new XMLHttpRequest();
	}
	catch (e)
	{
		try
		{
			xmlHttp_6=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try { xmlHttp_6=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
				alert("Your browser does not support AJAX!"); return false;
			}
		}
	}
	xmlHttp_6.onreadystatechange=function()
	{
		if (xmlHttp_6.readyState==4)
		{
			if(strlen(xmlHttp_6.responseText) > 10){
			document.getElementById("baner_top").innerHTML=xmlHttp_6.responseText;
			}
			setTimeout("update_banner()",600000);
		}
	}
	randomnumber=Math.random()*100;
	//xmlHttp_6.open("GET","./banner.php?page="+randomnumber,true);
	xmlHttp_6.open("GET","./top_banner.php?rand="+randomnumber,true);
	xmlHttp_6.send(null);	
}

function update_ajaxbanner()
{	
	try
	{
		xmlHttp_7=new XMLHttpRequest();
	}
	catch (e)
	{
		try
		{
			xmlHttp_7=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try { xmlHttp_7=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
				alert("Your browser does not support AJAX!"); return false;
			}
		}
	}
	xmlHttp_7.onreadystatechange=function()
	{
		if (xmlHttp_7.readyState==4)
		{
			document.getElementById("baner_top").innerHTML=xmlHttp_7.responseText;
			setTimeout("update_ajaxbanner()",100000);
		}
	}
	randomnumber=Math.random()*100;
	xmlHttp_7.open("GET","./ajax_banner.php?rand="+randomnumber,true);
	xmlHttp_7.send(null);	
}

function update_promobanner(page)
{	
var x = page;
	try
	{
		xmlHttp_8=new XMLHttpRequest();
	}
	catch (e)
	{
		try
		{
			xmlHttp_8=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try { xmlHttp_8=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
				alert("Your browser does not support AJAX!"); return false;
			}
		}
	}
	xmlHttp_8.onreadystatechange=function()
	{
		if (xmlHttp_8.readyState==4)
		{
		  if(strlen(xmlHttp_8.responseText) > 10){
			document.getElementById("televizor").innerHTML=xmlHttp_8.responseText;
            }
			setTimeout("update_promobanner('"+x+"')",110000);
		}
	}
	page2=str.page;
	randomnumber=Math.random()*100;
	xmlHttp_8.open("GET","./televizor3.php?page="+x+"&rand="+randomnumber,true);
	xmlHttp_8.send(null);	
}

function update_daily_research()
{	
	res = (res==null) ? '' : res;	
	try
	{
		xmlHttp_2=new XMLHttpRequest();
	}
	catch (e)
	{
		try
		{
			xmlHttp_2=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try { xmlHttp_2=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
				alert("Your browser does not support AJAX!"); return false;
			}
		}
	}
	xmlHttp_2.onreadystatechange=function()
	{
		if (xmlHttp_2.readyState==4)
		{			
		   if(strlen(xmlHttp_2.responseText) > 10){
			   if(document.getElementById("content_page")){
			document.getElementById("content_page").innerHTML=xmlHttp_2.responseText;
			   }
			}
			setTimeout("update_daily_research()",120000);			
			//alert("updated");
			//document.getElementById("announcecontent").innerHTML=xmlHttp_2.responseText;
			//setTimeout("update_daily_research()",120000);			
			//alert("updated");
		}
	}	
	xmlHttp_2.open("GET","http://www.varchevbrokers.com/research_new.php"+res,true);
	xmlHttp_2.send(null);	
}
function update_daily_research_slow()
{	
	res = (res==null) ? '' : res;	
	try
	{
		xmlHttp_14=new XMLHttpRequest();
	}
	catch (e)
	{
		try
		{
			xmlHttp_14=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try { xmlHttp_14=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
				alert("Your browser does not support AJAX!"); return false;
			}
		}
	}
	xmlHttp_14.onreadystatechange=function()
	{
		if (xmlHttp_14.readyState==4)
		{			
		   if(strlen(xmlHttp_14.responseText) > 10){
			   if(document.getElementById("content_page")){
			document.getElementById("content_page").innerHTML=xmlHttp_14.responseText;
			   }
			}
			setTimeout("update_daily_research_slow()",900000);			
			//alert("updated");
			//document.getElementById("announcecontent").innerHTML=xmlHttp_2.responseText;
			//setTimeout("update_daily_research()",120000);			
			//alert("updated");
		}
	}	
	xmlHttp_14.open("GET","http://www.varchevbrokers.com/research_new.php"+res,true);
	xmlHttp_14.send(null);	
}
function update_daily_announcecontent()
{	
	res = (res==null) ? '' : res;	
	try
	{
		xmlHttp_3=new XMLHttpRequest();
	}
	catch (e)
	{
		try
		{
			xmlHttp_3=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try { xmlHttp_3=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
				alert("Your browser does not support AJAX!"); return false;
			}
		}
	}
	xmlHttp_3.onreadystatechange=function()
	{
		if (xmlHttp_3.readyState==4)
		{			
			if(strlen(xmlHttp_3.responseText) > 10){
			document.getElementById("announcecontent").innerHTML=xmlHttp_3.responseText;
			}
			setTimeout("update_daily_announcecontent()",120000);			
			//alert("updated");			
		}
	}	
	xmlHttp_3.open("GET","http://www.varchevbrokers.com/announcecontent.php"+res,true);
	xmlHttp_3.send(null);	
}
function update_daily_announcecontent_sub()
{	
	res = (res==null) ? '' : res;	
	try
	{
		xmlHttp_11=new XMLHttpRequest();
	}
	catch (e)
	{
		try
		{
			xmlHttp_11=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try { xmlHttp_11=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
				alert("Your browser does not support AJAX!"); return false;
			}
		}
	}
	xmlHttp_11.onreadystatechange=function()
	{
		if (xmlHttp_11.readyState==4)
		{			
			if(strlen(xmlHttp_11.responseText) > 10){
			document.getElementById("announcecontent_sub").innerHTML=xmlHttp_11.responseText;
			}
			setTimeout("update_daily_announcecontent_sub()",120000);			
			//alert("updated");			
		}
	}	
	xmlHttp_11.open("GET","http://www.varchevbrokers.com/announcecontent_sub.php"+res,true);
	xmlHttp_11.send(null);	
}
function update_top_ticker()
{	
	try
	{
		xmlHttp_12=new XMLHttpRequest();
	}
	catch (e)
	{
		try
		{
			xmlHttp_12=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try { xmlHttp_12=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
				alert("Your browser does not support AJAX!"); return false;
			}
		}
	}
	xmlHttp_12.onreadystatechange=function()
	{
		if (xmlHttp_12.readyState==4)
		{
			document.getElementById("top-ticker").innerHTML=xmlHttp_12.responseText;
			setTimeout("update_top_ticker()",120000);
		}
	}
	randomnumber=Math.random()*100;
	xmlHttp_12.open("GET","./top_ticker.php?rand="+randomnumber,true);
	xmlHttp_12.send(null);	
}
function update_bottom_ticker()
{	
	try
	{
		xmlHttp_13=new XMLHttpRequest();
	}
	catch (e)
	{
		try
		{
			xmlHttp_13=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try { xmlHttp_13=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
				alert("Your browser does not support AJAX!"); return false;
			}
		}
	}
	xmlHttp_13.onreadystatechange=function()
	{
		if (xmlHttp_13.readyState==4)
		{
			document.getElementById("bottom-ticker").innerHTML=xmlHttp_13.responseText;
			setTimeout("update_bottom_ticker()",120000);
		}
	}
	randomnumber=Math.random()*100;
	xmlHttp_13.open("GET","./bottom_ticker.php?rand="+randomnumber,true);
	xmlHttp_13.send(null);	
}