function random_text()
{};
var text_desc1 = new Array();
var text_desc2 = new Array();

var number = 0;
//Add lines here to update the first carousel.
//Be sure to match the ordering of the short fact list with the long description list below
//For the short fact list, all lines should be finished with a comma EXCEPT for the last line of the list.
//Make sure to change double quotes to single quotes. 
var firstcarousel_itemList = [
{text: "<span style='font-size:28px;'>Kindergarten Info Events! </span><span style='font-size:20px;'><br/><br/> Click here </span>"},
{text: "<span style='font-size:28px;'>Our Report to Our Community </span>"},
{text: "<span style='font-size:32px;'>Register<br/> with us! </span>"},
{text: "<span style='font-size:22px;'>New<br/> Pre-Kindergarten and Full Day Kindergarten Programs!</span>"},
{text: "<span style='font-size:30px;'>Willowgrove Public School</span>"},
{text: "<span style='font-size:24px;'>Our Newcomer Student Centre</span>"},
{text: "<span style='font-size:22px;'>Thank you PotashCorp for donating $1 million to the SPS Foundation!</span>"}


]

text_desc1[number++] = "<b>Choose the kindergarten program that's best for your child. Attend a kindergarten information event in January.<br/><br/> Get dates and times <a href='files/events/KindergartenRegistrationJanuary2012.pdf'> here. </a><br/><br/><span style='font-size:16px;'><img src='images/close.png' style='float:left; margin-top:2px; margin-right:4px;'/> Close</span>";
text_desc1[number++] = "<b>Our 2010-2011 Report to the Community is hot off the press! <br/><br/><b> Find out how we inspire learning every day by reading the report <a href='files/public/ReportToTheCommunity2010_2011.pdf'> here. </a><br/><br/><span style='font-size:16px;'><img src='images/close.png' style='float:left; margin-top:2px; margin-right:4px;'/> Close</span>";
text_desc1[number++] = "<b>Welcome to Saskatoon Public Schools! We look forward to meeting you and your children.<br/><br/><b> Information about elementary registration is available <a href='files/events/RegisterElementary.pdf'> here. </a><br/><br/><b> Information about secondary registration is available <a href='files/events/RegisterSecondary.pdf'> here. </a><br/><br/><span style='font-size:16px;'><img src='images/close.png' style='float:left; margin-top:2px; margin-right:4px;'/> Close</span>";
text_desc1[number++] = "<b>We are offering four new Pre-Kindergarten programs (at Fairhaven, Howard Coad, Lester B. Pearson and W.P. Bate Schools) and four new Full Day Every Day Literacy Enhanced Kindergarten programs (at Caswell, Fairhaven, Westmount, and W.P. Bate Schools) in the 2011/2012 school year!<br/><br/><b> More information is available <a href='files/events/NewKPreKPrograms_2011_2012.pdf'> here. </a><br/><br/><span style='font-size:16px;'><img src='images/close.png' style='float:left; margin-top:2px; margin-right:4px;'/> Close</span>";
text_desc1[number++] = "<b>Willowgrove School is the official name of the new public school to be built in the Willowgrove Community.<br/><br/><b> For information about our principal-designate, Mr. Shane Armstrong click <a href='files/events/WillowgroveSchool.pdf'> here. </a><br/><br/><span style='font-size:16px;'><img src='images/close.png' style='float:left; margin-top:2px; margin-right:4px;'/> Close</span>";
text_desc1[number++] = "<b>Our Newcomer Student Centre located in our education centre in downtown Saskatoon (310 21st Street E.) is one of the first points of contact between our school division and newcomer students and their families. Learn more about the centre<a href='files/newtocanada/Brochure_Newcomer_Student_Centre.pdf'> here. </a><br/><br/><span style='font-size:16px;'><img src='images/close.png' style='float:left; margin-top:2px; margin-right:4px;'/> Close</span>";
text_desc1[number++] = "<b>On March 31, 2011, PotashCorp announced a $1,000,000 donation to the Saskatoon Public Schools Foundation to construct the PotashCorp Eco-Science Centre.<br/><br/><b>THANK YOU POTASHCORP, FOR YOUR CONSIDERABLE GENEROSITY, AND FOR YOUR COMMITMENT TO FURTHER ENHANCING THE EDUCATIONAL EXPERIENCE OF STUDENTS AT SASKATOON PUBLIC SCHOOLS!<br/><br/><b> For more details on this gift announcement click <a href='files/events/PotashCorpNewsRelease.pdf'> here. </a><br/><br/><span style='font-size:16px;'><img src='images/close.png' style='float:left; margin-top:2px; margin-right:4px;'/> Close</span>"

number = 0;
//Add lines here to update the second carousel.
//Be sure to match the ordering of the short fact list with the long description list below
//For the short fact list, all lines should be finished with a comma EXCEPT for the last line of the list.
//Make sure to change double quotes to single quotes.
var secondcarousel_itemList = [
{text: "<span style='font-size:26px;'>High School open houses!</span><span style='font-size:20px;'><br/><br/> Click here</span>"},
{text: "<span style='font-size:26px;'>Our Continuous Improvement Report</span>"},
{text: "<span style='font-size:22px;'>Natty (the toy) Smart Car: Assembly instructions!</span>"},
{text: "<span style='font-size:30px;'>2011-2012 school calendar</span>"},
{text: "<span style='font-size:28px;'>Our two learning priorities</span>"}
]
text_desc2[number++] = "<b>Choose the high school that's best for you. Attend a high school open house in February.<br/><br/> Get dates and times <a href='files/events/OpenHousesFeb2012.pdf'> here. </a><br/><br/><span style='font-size:16px;'><img src='images/close.png' style='float:left; margin-top:2px; margin-right:4px;'/> Close</span>";
text_desc2[number++] = "<b>Learn about our strategic direction, Board priorities, and how our students are performing by reading our 2011-2012 Continuous Improvement Report available <a href='files/public/ContinuousImprovementReport2011_2012.pdf'> here. </a><br/><br/><span style='font-size:16px;'><img src='images/close.png' style='float:left; margin-top:2px; margin-right:4px;'/> Close</span>";
text_desc2[number++] = "<b>Natty, the Saskatoon Public Schools' talking smart car has published his Kindergarten Activity Book! The book includes a toy pop-out version of Natty that you can assemble.  Instructions are available <A HREF='http://www.youtube.com/watch?v=8S5q7l48YcI'> here!</A><br/><br/> Pick up a copy of the activity book at your local public elementary school or our education centre down town.<br/><br/><span style='font-size:16px;'><img src='images/close.png' style='float:left; margin-top:2px; margin-right:4px;'/> Close</span>";
text_desc2[number++] = "<b>View the 2011-2012 school calendar<a href='files/events/2011_2012Calendar.pdf'> here. </a><br/><br/><span style='font-size:16px;'><img src='images/close.png' style='float:left; margin-top:2px; margin-right:4px;'/> Close</span>";
text_desc2[number++] = "<b>The Saskatoon Board of Education has refreshed its strategic learning priorities.<br/><br/><b> View the news release<a href='files/events/StrategicDirectionRefreshed.pdf'> here. </a><br/><br/><span style='font-size:16px;'><img src='images/close.png' style='float:left; margin-top:2px; margin-right:4px;'/> Close</span>";

function show_text1(n1) {document.getElementById('text_desc1').innerHTML=text_desc1[n1];}
function show_text2(n2) {document.getElementById('text_desc2').innerHTML=text_desc2[n2];}

$(document).ready(function(){
    $("#first-carousel").click(function(){
      $("#text_desc1").animate( {opacity:"show"}, {queue:false, duration:600})
         .animate( { width:"645px" }, { queue:false, duration:600 } )
         .animate( { top:"5px" }, { queue:false, duration:600 } )
         .animate( { left:"130px" }, { queue:false, duration:600 } )
         .animate( { height:"330px" }, 600);
      $("#text_desc1").corner();
    });

    $("#text_desc1").click(function(){
      $("#text_desc1").animate( {height:"134px"}, {queue:false, duration:400})
         .animate( { width:"183px" }, { queue:false, duration:400 } )
         .animate( { top:"8px" }, { queue:false, duration:400 } )
         .animate( { left:"144px" }, { queue:false, duration:400 } )
         .animate( {opacity:"hide"}, 400);
    });

    $("#second-carousel").click(function(){
      $("#text_desc2").animate( {opacity:"show"}, {queue:false, duration:600})
         .animate( { width:"645px" }, { queue:false, duration:600 } )
         .animate( { top:"5px" }, { queue:false, duration:600 } )
         .animate( { left:"130px" }, { queue:false, duration:600 } )
         .animate( { height:"330px" }, 600);
      $("#text_desc2").corner();
    });

    $("#text_desc2").click(function(){
      $("#text_desc2").animate( {height:"134px"}, {queue:false, duration:400})
         .animate( { width:"183px" }, { queue:false, duration:400 } )
         .animate( { top:"163px" }, { queue:false, duration:400 } )
         .animate( { left:"144px" }, { queue:false, duration:400 } )
         .animate( {opacity:"hide"}, 400);
    });
    
    $("#scrollingMarquee").click(function(){
      $("#marquee_desc").animate( {opacity:"show"}, {queue:false, duration:600})
         .animate( { width:"645px" }, { queue:false, duration:600 } )
         .animate( { top:"5px" }, { queue:false, duration:600 } )
         .animate( { left:"130px" }, { queue:false, duration:600 } )
         .animate( { height:"362px" }, 600);
      $("#marquee_desc").corner();
    });

    $("#marquee_desc").click(function(){
      $("#marquee_desc").animate( {height:"134px"}, {queue:false, duration:400})
         .animate( { width:"183px" }, { queue:false, duration:400 } )
         .animate( { top:"243px" }, { queue:false, duration:400 } )
         .animate( { left:"304px" }, { queue:false, duration:400 } )
         .animate( {opacity:"hide"}, 400);
    });
  });

function mycarousel_itemVisibleInCallback(carousel, item, i, state, evt)
{
    // The index() method calculates the index from a
    // given index who is out of the actual item range.
    var idx = carousel.index(i, firstcarousel_itemList.length);
    carousel.add(i, mycarousel_getItemHTML1(firstcarousel_itemList[idx - 1]));
               show_text1(idx - 1);
};

function mycarousel_itemVisibleOutCallback(carousel, item, i, state, evt){carousel.remove(i);};
function mycarousel_getItemHTML1(item){
    return '<li><center><span style="font-family:Geneva, Arial, Helvetica, sans-serif; font-weight:bold; font-size:26px; color:#9ccc3c;">' + item.text + '</span></center></li>';
};

function mycarousel_itemVisibleInCallback2(carousel, item, i, state, evt){
    var idx = carousel.index(i, secondcarousel_itemList.length);
    carousel.add(i, mycarousel_getItemHTML2(secondcarousel_itemList[idx - 1]));
               show_text2(idx - 1);
};

function mycarousel_itemVisibleOutCallback2(carousel, item, i, state, evt){carousel.remove(i);};
function mycarousel_getItemHTML2(item){
    return '<li><center><span style="font-family:Geneva, Arial, Helvetica, sans-serif; font-weight:bold; font-size:34px; color:#9ccc3c;">' + item.text + '</span></center></li>';
};

function mycarousel_initCallback(carousel) {
    jQuery('.jcarousel-control a').bind('click', function() {
        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
        return false;
    });
    jQuery('#mycarousel-next').bind('click', function() {                                                                                                                                                                  
        carousel.next();
        return false;
    });
    jQuery('#mycarousel-prev').bind('click', function() {
        carousel.prev();
        return false;
    });
};

function mycarousel_initCallback2(carousel) {
    jQuery('.jcarousel-control a').bind('click', function() {
        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
        return false;
    });
    jQuery('#mycarousel-next2').bind('click', function() {
        carousel.next();
        return false;
    });
    jQuery('#mycarousel-prev2').bind('click', function() {
        carousel.prev();
        return false;
    });
};

jQuery(document).ready(function() {
    jQuery("#first-carousel").jcarousel({
        scroll: 1,
        initCallback: mycarousel_initCallback,
        // This tells jCarousel NOT to autobuild prev/next buttons
        buttonNextHTML: null,
        buttonPrevHTML: null,
                              wrap: 'circular',
        itemVisibleInCallback: {onBeforeAnimation: mycarousel_itemVisibleInCallback},
        itemVisibleOutCallback: {onAfterAnimation: mycarousel_itemVisibleOutCallback}
    });
    jQuery("#second-carousel").jcarousel({
        scroll: 1,
        initCallback: mycarousel_initCallback2,
        // This tells jCarousel NOT to autobuild prev/next buttons
        buttonNextHTML: null,
        buttonPrevHTML: null,
                              wrap: 'circular',
        itemVisibleInCallback: {onBeforeAnimation: mycarousel_itemVisibleInCallback2},
        itemVisibleOutCallback: {onAfterAnimation: mycarousel_itemVisibleOutCallback2}
    });
});


