﻿var intervalID;
var counter = 0;
var arrayQuote = new Array();
    //arrayQuote[] = ["", "", ""];
    arrayQuote[0] = ["Chatrooms are an efficient way to communicate with friends and meet new ones but the downside is that you never know who you are talking to.", "Source: wikiHow", "http://wikihow.com/Stay-Safe-On-A-Chatroom"];
    arrayQuote[1] = ["...who took his own life in February after being bullied online. Almost 80 per cent of kids who get cyberbullying messages or porn pop-ups don’t report them.", "Source: Stuff Technology- Keep tabs on your kids online", "http://www.stuff.co.nz/technology/2328072/Keep-tabs-on-your-kids-online"];
    arrayQuote[2] = ["We have to get it through to mums and dads that letting kids go online with no rules is almost as irresponsible as dropping kids off at the red-light district in Amsterdam and then walking away.", "Source: Stuff Technology – Keep tabs on your kids online", "http://www.stuff.co.nz/technology/2328072/Keep-tabs-on-your-kids-online"];
    arrayQuote[3] = ["Identity theft and scams on social networking sites, though, are not uncommon occurrences.", "Source: Stuff Technology - Keep your Facebook safe", "http://www.stuff.co.nz/technology/2333125/Keep-your-Facebook-safe"];
    arrayQuote[4] = ["The director of safety for MySpace Australia, David Batch, has a similar acknowledgement: \"ID theft has existed in both the online and physical world for some time.\"", "Source: Stuff Technology - Keep your Facebook safe", "http://www.stuff.co.nz/technology/2333125/Keep-your-Facebook-safe"];
    arrayQuote[5] = ["The threats to users on social networking sites arrive through a variety of avenues.", "Source: Stuff Technology – Keep your Facebook safe", "http://www.stuff.co.nz/technology/2333125/Keep-your-Facebook-safe"];
    arrayQuote[6] = ["A study by the anti-virus software company Sophos found 41 per cent of people accepted friend requests from Freddi Stuar, an identity the company created for its research...", "Source: Stuff Technology – Keep your Facebook safe", "http://stuff.co.nz/technology/2333125/Keep-your-Facebook-safe"];
    arrayQuote[7] = ["…Freddi was the name given to a plastic frog. Once listed as a friend, Freddi the Frog had access to a goldmine of personal information.", "Source: Stuff Technology - Keep your Facebook safe", "http://www.stuff.co.nz/technology/2333125/Keep-your-Facebook-safe"];
    arrayQuote[8] = ["Netsafe executive director Martin Cocker said cyber criminals were cashing in on the popularity of social networking sites, often frequented by children or teens, in order to steal confidential information.", "Source: Stuff Technology – Online criminals target children", "http://www.stuff.co.nz/technology/2364677/Online-criminals-target-children"];
    arrayQuote[9] = ["People continued to let their guard down on the internet compared to other locations.", "Source: Stuff Technology – Online criminals target children", "http://www.stuff.co.nz/technology/2364677/Online-criminals-target-children"];
    arrayQuote[10] = ["\"We should understand that’s the easiest place to trick us, the easiest place to falsify information. But for some reason that hasn’t caught on.\"", "Source: Stuff Technology – Online criminals target children", "http://www.stuff.co.nz/technology/2364677/Online-criminals-target-children"];
    arrayQuote[11] = ["FalseFlesh is a revolutionary graphic design program that creates REALISTIC nude approximations from existing photographs. In minutes transform any digital camera image, Facebook, or Myspace picture into full frontal nudity!", "Source: False Flesh", "http://www.falseflesh.com"];
    arrayQuote[12] = ["A NEW police unit is being launched to protect kids from online sexual predators and the dangers of social networking sites.", "Source: Sunday Star Times – Police target web predators", "http://www.stuff.co.nz/sunday-star-times/1753373"];
    arrayQuote[13] = ["Predators are using social networking sites like Facebook to \"groom\" children, with some offenders organising to meet the children for sex.", "Source: Sunday Star Times – Police target web predators", "http://www.stuff.co.nz/sunday-star-times/1753373"];
    arrayQuote[14] = ["There will be so many ways that children can access inappropriate material or perhaps get into conversations with people they should not be talking to.", "Source: Sunday Star Times – Police target web predators", "http://www.stuff.co.nz/sunday-star-times/1753373"];
    arrayQuote[15] = ["<strong>March, 2007:</strong> 42-year-old Jason Wales was sentenced in the Christchurch District Court to three years and nine months’ jail for unlawful sexual connection with a 15-year-old girl he met online. He admitted grooming the girl for sex and having objectionable material.", "Source: Sunday Star Times – Police target web predators", "http://www.stuff.co.nz/sunday-star-times/1753373"];
    arrayQuote[16] = ["<strong>July, 2006:</strong> A distraught Christchurch father contacted media after finding his teenage daughter had invited strangers home for sex after meeting them on Bebo.", "Source: Sunday Star Times – Police target web predators", "http://www.stuff.co.nz/sunday-star-times/1753373"];
    arrayQuote[17] = ["<strong>July, 2005:</strong> A Christchurch mother kicked her daughter out of the family home after she found the 18-year-old had set up a webcam peep show in her bedroom and was posing naked for online photos.", "Source: Sunday Star Times – Police target web predators", "http://www.stuff.co.nz/sunday-star-times/1753373"];
    arrayQuote[18] = ["\"…Websites like Twitter or Facebook are “meant for social purposes and not for trusted information,” Mitnick said. “It’s a bombshell waiting to explode.\"", "Source: Stuff Technology News – Twitter – the new police tool", "http://www.stuff.co.nz/technology/2333177/Twitter-the-new-police-tool"];
    arrayQuote[19] = ["You may think that you’re taking all the right precautions to keep your bank details safe, but ID theft scams are becoming more elaborate and harder to spot.", "Source: Directgov – Young People – Identity Theft", "http://www.direct.gov.uk/en"];
    arrayQuote[20] = ["Identity theft is a growing problem, with more than one in four people claiming that they have either been a victim of crime or know someone who has.", "Source: Directgov – Young People – Identity Theft", "http://www.direct.gov.uk/en"];
    arrayQuote[21] = ["Internet safety has not been well addressed in many New Zealand primary schools. Nor is it a simple matter to obtain information about this internet safety in primary schools.", "Hope, John: Internet – Issues for New Zealand Primary Schools", ""];
    arrayQuote[22] = ["Most children now begin using the Internet while they are at Kindergarten age or even younger.", "Survey of Internet and At-risk Behaviors – Published 2008", ""];
    arrayQuote[23] = ["Cyber abuse and offending by and among youth includes posting or sending indiscrete or nude photos or other personal data about themselves or other people online.", "Survey of Internet and At-risk Behaviors – Published 2008", ""];
    arrayQuote[24] = ["Cyber abuse and offending by and among youth includes sending sexual messages or solicitations for sex that are unwanted by recipients.", "Survey of Internet and At-risk Behaviors – Published 2008", ""];
    arrayQuote[25] = ["…66% of high school students reported that parents provide no supervision of their Internet activities, only 7% of parents reported that they provide no supervision.", "Survey of Internet and At-risk Behaviors – Published 2008", ""];
    arrayQuote[26] = ["48% of students at this grade level (Year 2) interact with people on Web sites, while only 50% indicate that their parents watch them while they use a computer, leaving the possibility of their being exposed to predation…", "Survey of Internet and At-risk Behaviors – Published 2008", ""];
    arrayQuote[27] = ["48% of students at this grade level (Year 2) reported viewing online content that made them feel uncomfortable, yet only 72% reported the experience to a grownup, meaning that one in four children did not.", "Survey of Internet and At-risk Behaviors – Published 2008", ""];
    arrayQuote[28] = ["Of 12 to14 year olds, 39% have posted photos of themselves, 36% have posted their real names, and 14% have posted their schedules and personal contact information.", "Survey of Internet and At-risk Behaviors – Published 2008", ""];
    arrayQuote[29] = ["Of 12 to 14 year olds, 9% have accepted an online invitation to meet someone in person, and 10% have asked someone online to meet them in person.", "Survey of Internet and At-risk Behaviors – Published 2008", ""];
    arrayQuote[30] = ["Of 12 to 14 year olds, 14% reported that they had communicated online about sexual things… 7% were asked for nude pictures of themselves.", "Survey of Internet and At-risk Behaviors – Published 2008", ""];
    arrayQuote[31] = ["61% of parents surveyed indicated their children access the Internet from a private place in the home.", "Survey of Internet and At-risk Behaviors – Published 2008", ""];
    arrayQuote[32] = ["Relatively few teachers believe they are currently prepared to teach students in areas of Internet safety, information security, or cyber ethics, although a majority believe these are important subjects for students to know.", "Survey of Internet and At-risk Behaviors – Published 2008", ""];
    arrayQuote[33] = ["Sexting involves taking or sending an explicit photo of oneself and forwarding it to friends or potential suitors…", "Source: Stuff Technology – Sexting – fears as teens targeted", "http://www.stuff.co.nz/technology/digital-living/528950"];
    arrayQuote[34] = ["Any image that depicts a minor in a sexual activity or indecent manner is considered child pornography, and anyone who passes on or receives those images is liable to face criminal charges.", "Source: Stuff Technology – Sexting – fears as teens targeted", "http://www.stuff.co.nz/technology/digital-living/528950"];
    arrayQuote[35] = ["Job candidates who maintain personal sites on Facebook or MySpace are learning – sometimes the hard way – that the image they present to their friends on the Internet may not be best suited for landing the position they’re seeking.", "Source: MSNBC – Job candidates getting tripped up by Facebook", "http://www.msnbc.msn.com/id/20202935/"];
    arrayQuote[36] = ["35 percent of hiring managers use Google to do online background checks on job candidates, and 23 percent look people up on social networking sites. About one-third of those Web searches lead to rejections.", "Source: MSNBC – Job candidates getting tripped up by Facebook", "http://www.msn.com/id/20202935/"];
function runfader()
{
    fadein();
    intervalID = setInterval("fadein()", 12000);
}

function fadein()
{
    document.getElementById("quote").innerHTML = arrayQuote[counter][0];
    document.getElementById("source").innerHTML = "<a href=\"" + arrayQuote[counter][2] + "\" target=\"_blank\">" + arrayQuote[counter][1] + "</a>";
    opacity("quotewrap", 0, 100, 1000);
    setTimeout("fadeout()", 10000);
    counter +=1;
    if(counter==arrayQuote.length)
        {
        counter = 0;
        }
}

function fadeout()
{
    opacity("quotewrap", 100, 0, 1000);
}

function opacity(id, opacStart, opacEnd, millisec) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
} 
