	// main functions
    window.onload = function main(){  
        initFlash ();
        createLinks ();  
        adDisplay ();
     

    }
	
	









//***************************************************************************************


function createLinks ()
{
    // create footer/misc links
    var footerLinks = document.getElementById("footer");
    

    footerLinks.getElementsByTagName("a").item(0).onclick = function(){
        new_win("http://www.generalmills.com/corporate/legal/legal.aspx","850","450"); 
        dcsMultiTrack("DCS.dcssip","www.nutsabouthoney.millsberry.com","DCS.dcsuri","page_terms","WT.ti","Terms of Use");
        return false;
    }
    footerLinks.getElementsByTagName("a").item(1).onclick = function(){
        new_win("http://www.generalmills.com/corporate/privacy/privacy.aspx","850","450"); 
        dcsMultiTrack("DCS.dcssip","www.nutsabouthoney.millsberry.com","DCS.dcsuri","page_privacy","WT.ti","Privacy Policy");
        return false;
    }
    
    
    if (!(swfobject.hasFlashPlayerVersion("9.0.0")))
    {   
        // only exists on selected pages, catches error on promotion page where selector doesn't exist
        try{
            document.getElementById("rules").onclick = function(){
            new_win("rules.aspx","467","450"); return false;
            }
        }
        catch(err) {}
    }
   
}


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","width=" + +screen.width + ",height=" + +screen.height );
}

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");
}

function new_win_standard(url)
{
    window.open(url,"mywin","width=" + screen.width + ",height=" + screen.height + "toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes");
}






