
//***************************************************************************************
// main functions
window.onload = function main(){
        createLinks ();  
        adDisplay ();
     
}
	
//***************************************************************************************

function createLinks ()
{
    // create footer/misc links
    var footerLinks = document.getElementById("footer");
    
    footerLinks.getElementsByTagName("a").item(0).onclick = function(){
        new_win("rules.aspx",450,500); return false;
    }
    footerLinks.getElementsByTagName("a").item(1).onclick = function(){
        new_win("https://generalmills.promo.eprize.com/winonegiveone/faq",450,500); return false;
    }
    footerLinks.getElementsByTagName("a").item(2).onclick = function(){
        new_win("http://generalmills.promo.eprize.com/winonegiveone/coppa_faq",450,500); return false;
    }
    footerLinks.getElementsByTagName("a").item(3).onclick = function(){
        new_win("http://www.generalmills.com/corporate/legal/legal.aspx",820,590); return false;
    }
    footerLinks.getElementsByTagName("a").item(4).onclick = function(){
        new_win("privacy.aspx",450,500); return false;
    }
    footerLinks.getElementsByTagName("a").item(5).onclick = function(){
        new_win("http://consumercontacts.generalmills.com/ConsolidatedContact.aspx?page=http://www.generalmills.com/corporate",520,500); return false;
    }
    
   
}


function adDisplay ()
{
    // show-hide add
    document.getElementById("ad-spot").onmouseover = function() {
          document.getElementById("ad-pop").style.display = "inline"
    }
    document.getElementById("ad-spot").onmouseout = function() {
          document.getElementById("ad-pop").style.display = "none"
    }
}


function full_win(url)
{
    window.open(url,"mywin");
}


function new_win(url, width, height)
{
    window.open(url,"mywin","width=" + width + ",height=" + height + "toolbar=no,location=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,screenX=160,left=150,screenY=150,top=150");
}


// Contest Lightbox

//Sweepstakes - called by swf
function WogoSweepStakes(){ //this function called by the swf to launch the Sweepstakes
	$("#wogoSweepstakesLightbox").click(); //force click on hidden link
}

// Spotlight Tags


// Win - Registration Thank You Page
function spotlight_SNK_MEGA_WIN () {
    var axel = Math.random()+"";
    var a = axel * 10000000000000;
    var spotpix = new Image(1,1);
    spotpix.src = 'http://fls.doubleclick.net/activityi;src=1869704;type=betty077;cat=mega02;ord=1;num='+ a + '?';
}


// Drum Circle TAF Thank You Page
function spotlight_SNK_MEGA_DCTAF () {
    var axel = Math.random()+"";
    var a = axel * 10000000000000;
    var spotpix = new Image(1,1);
    spotpix.src = 'http://fls.doubleclick.net/activityi;src=1869704;type=betty077;cat=mega04;ord=1;num='+ a + '?';
}


// Drum Circle (Join In)
function spotlight_SNK_MEGA_GIVE () {
    var axel = Math.random()+"";
    var a = axel * 10000000000000;
    var spotpix = new Image(1,1);
    spotpix.src = 'http://fls.doubleclick.net/activityi;src=1869704;type=betty077;cat=mega03;ord=1;num='+ a + '?';
}


// Landing Page TAF Thank You Page
function spotlight_SNK_MEGA_TAF () {
    var axel = Math.random()+"";
    var a = axel * 10000000000000;
    var spotpix = new Image(1,1);
    spotpix.src = 'http://fls.doubleclick.net/activityi;src=1869704;type=betty077;cat=mega05;ord=1;num='+ a + '?';
}