var iPage=0;
var iImage=0;
$(document).ready(function() {
  var oShout=document.createElement("div");
  oShout.setAttribute("id","shout");
  var oShoutCont=document.createElement("div");
  oShoutCont.setAttribute("id","shoutContainer");
  var oContent=document.getElementById("contentHorz");
  oContent.insertBefore(oShout,oContent.firstChild);
  oContent.insertBefore(oShoutCont,oContent.firstChild);
  if(aPages.length>0) $.get(aPages[iPage],{},function(html){
    var aDiv=html.split(/<div\s+id\=\"inter\">|<\/div>/);
    $("#shout").html(aDiv[1]);
    window.setTimeout(shoNext,7000);
   }); 
}); 
function shoNext() {
  $("#shout").fadeOut("slow", function() {
    if(iPage < aPages.length - 1) {
      iPage++;
    } else {
      iPage=0;
    }
  $.get(aPages[iPage],{},function(html){
    var aDiv=html.split(/<div\s+id\=\"inter\">|<\/div>/);
    $("#shout").html(aDiv[1]);
    $("#shout").fadeIn("slow");
    window.setTimeout(shoNext,7000);
   });
  });
  $("#inter > img").fadeOut("slow", function() {
    if(iImage < aImages.length - 1) {
      iImage++;
    } else {
      iImage=0;
    }
    $("#inter > img").attr("src",aImages[iImage]).fadeIn("slow");
   });
}
