var play_2;
var play_3;
var play_4;
var play_5;
var play_1second;
var play_firstrotation;
$(document).ready(function () {

    $('#Hpnews1').hide();
    $('#HPnews2').hide();
    $('#hpnews3').hide();
    $('#hpEvent1').hide();
    $('#hpEvent2').hide();
    $('#hpEvent3').hide();
    $('#ThirdEvent1').hide();
    $('#thirdEvent2').hide();
    $('#thirdhpEvent3').hide();
    startHomepagePanelProcess();


});
function startHomepagePanelProcess() {
    $('#hpnews3').hide();
    $('#hpEvent3').hide();
    $('#thirdhpEvent3').hide();
    $('#Hpnews1').show();
    $('#Hpnews1').animate({ opacity: 1 });
    $('#hpEvent1').show();
    $('#hpEvent1').animate({ opacity: 1 });
    $('#ThirdEvent1').show();
    $('#ThirdEvent1').animate({ opacity: 1 });
    play_2 = setTimeout("playNews1()", 5000);
}
function playNews1() {

    //$('#Hpnews1').animate({ opacity: 0 });
    //$('#hpEvent1').animate({ opacity: 0 });
    //$('#ThirdEvent1').animate({ opacity: 0 });

    play_firstrotation = setTimeout("playNews2()", 1000);
}
function playNewsSecondRotation() {
  
    $('#HPnews2').hide();
    $('#hpEvent2').hide();
    $('#thirdEvent2').hide();
    $('#Hpnews1').fadeIn();
    //$('#Hpnews1').animate({ opacity: 1 });
    $('#hpEvent1').fadeIn();
    //$('#hpEvent1').animate({ opacity: 1 });
    $('#ThirdEvent1').fadeIn();
    //$('#ThirdEvent1').animate({ opacity: 1 });

    play_1second = setTimeout("playNews2()", 5000);
}
function playNews2() {
    $('#Hpnews1').hide();
    $('#hpEvent1').hide();
    $('#ThirdEvent1').hide();
    $('#HPnews2').fadeIn();
   // $('#HPnews2').animate({ opacity: 1 });
    $('#hpEvent2').fadeIn();
  //  $('#hpEvent2').animate({ opacity: 1 });
    $('#thirdEvent2').fadeIn();
   // $('#thirdEvent2').animate({ opacity: 1 });

    play_3 = setTimeout("playNewsSecondRotation()", 5000);
}
function playNews3() {
    $('#HPnews2').animate({ opacity: 0 });
    $('#hpEvent2').animate({ opacity: 0 });
    $('#thirdEvent2').animate({ opacity: 0 });
    playNews4();

}

function playNews4() {
    $('#HPnews2').hide();
    $('#hpEvent2').hide();
    $('#thirdEvent2').hide();
    $('#hpEvent3').show();
    $('#hpEvent3').animate({ opacity: 1 });
    $('#hpnews3').show();
    $('#hpnews3').animate({ opacity: 1 });
    $('#thirdhpEvent3').show();
    $('#thirdhpEvent3').animate({ opacity: 1 });
    //HEREHERE
    play_5 = setTimeout("playNews5()", 5000);
}

/*function playNews4() {
    $('#HPnews2').hide();
    $('#hpEvent2').hide();
    $('#thirdEvent2').hide();
    $('#hpEvent3').show();
    $('#hpEvent3').animate({ opacity: 1 });
    $('#hpnews3').show();
    $('#hpnews3').animate({ opacity: 1 });
    $('#thirdhpEvent3').show();
    $('#thirdhpEvent3').animate({ opacity: 1 });
    //HEREHERE
    play_5 = setTimeout("playNews5()", 5000);
}*/

function playNews5() {

    $('#HPnews2').animate({ opacity: 0 });
    $('#hpEvent2').animate({ opacity: 0 });
    $('#thirdEvent2').animate({ opacity: 0 });

    startHomepagePanelProcess();
}
