I wanted to make it change div everytime it refresh but it seems like it doesn't work. It is not random, it follow by sequence, after variable country == 1 is shown, it should country == 2.
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 />
<meta http-equiv="refresh" content="10" >
<script type="text/javascript">
function checkRefresh()
{
if(document.refreshForm.visited.value == "" )
{
var visited = document.refreshForm.visited.value = "1";
var country = document.refreshForm.country.value = "1";
}
else if (country == 1 && visited == 1)
{
$( "boxau" ).hide( "slow" );
$('#boxae').load('test.html').fadeIn("slow");
country = 2;
}
else if (country == 2 && visited == 1)
{
$('#boxau').load('test.html').fadeIn("slow");
$( "boxae" ).hide( "slow" );
country = 1;
}
</script>
</head>
<body onLoad="JavaScript:checkRefresh();">
<form name="refreshForm">
<input type="hidden" name="visited" value="" />
<input type="hidden" name="country" value="" />
</form>
<div id="boxae">
<img src='SOMEURL'>
</div>
<div id="boxau">
<img src='SOMEURL'>
</div>
</body>
</html>