﻿/*
2009 Codebase
*/
function setVote(whichVote, petName) {

    //$$(".voteButton").each(function(b) { b.src = "../images/dmfp/2009/checkbox.jpg"; });
    $$(".overlayvoteButton").each(function(b) { b.src = "../images/dmfp/2009/checkbox.jpg"; });
    $$(".submitbutton", ".overlaysubmitbutton").each(function(b) { b.hide(); });
    $("overlayvote" + whichVote).src = "../images/dmfp/2009/checkbox_on.jpg";

    // Grab the value of the hidden text field.
    var myVote = $("myVote");
    myVote.value = whichVote;

    var myVoteName = $("myVoteName");
    myVoteName.value = petName;


//    if (myVote.value == whichVote) { myVote.value = ""; }
//    else {
//        $("vote" + whichVote).src = "../images/contest/vote_check.jpg";
//        $("vote" + whichVote + "submit").show();
//        $("overlayvote" + whichVote).src = "../images/contest/overlay_vote_checked.jpg";
//        $("overlayvote" + whichVote + "submit").show();

//        myVote.value = whichVote;
//    }
}


/*2008 Codebase
var lastOverlay = ""; // so we know which overlay to close, if another "MORE" link has been clicked without first clicking the "close" button

function showOverlay(whichOverlay)
{
    if(lastOverlay.length > 0) { $(lastOverlay).hide(); }
    $("overlay" + whichOverlay).show();
    lastOverlay = "overlay" + whichOverlay;
    
    var wSize = windowSize( 750, 1250 ); // minimum width and minimum height                
    $("overlay" + whichOverlay).style.top = $("holder" + whichOverlay).offsetTop + 300;
    $("overlay" + whichOverlay).style.left = (wSize[0]/2)-300; // centering horizontally

    if (wSize[1] < $("overlay" + whichOverlay).offsetTop + 400)
    {
        $("overlay" + whichOverlay).style.top = $("overlay" + whichOverlay).offsetTop - 350;
    }
}

function hideOverlay(whichOverlay)  // Used for "close" button on the overlay
{
    stopVideo(whichOverlay);
    $("overlay" + whichOverlay).hide();
    lastOverlay = "";
}

function stopVideo(id)
{
    $("video" + id).up("div").innerHTML = '<div id="video' + id + '"></div>';
}

function showVideo(id, name)
{
    var container = "video" + id;
    var flvFile = "../flash/" + name;
    var skinFile = "../flash/" + "ClearOverPlaySeekMute.swf";
    var flashvars = {flvPath: flvFile, skinPath: skinFile};
    var params = {bgcolor: "#FFFFFF"};
    swfobject.embedSWF("../flash/flv_player.swf", container, "231", "208", "8", false, flashvars, params);
}

function setVote(whichVote)
{

    $$(".voteButton").each( function(b) { b.src = "../images/contest/vote_noncheck.jpg"; });
    $$(".overlayvoteButton").each( function(b) { b.src = "../images/contest/overlay_vote_non_checked.jpg"; });
    $$(".submitbutton", ".overlaysubmitbutton").each( function(b) { b.hide(); });

    // Grab the value of the hidden text field.
    var myVote = $("myVote");

    if (myVote.value == whichVote) { myVote.value = ""; }
    else
    {
        $("vote" + whichVote).src = "../images/contest/vote_check.jpg";
        $("vote" + whichVote + "submit").show();
        $("overlayvote" + whichVote).src = "../images/contest/overlay_vote_checked.jpg";
        $("overlayvote" + whichVote + "submit").show();

        myVote.value = whichVote;
    }
}

function toggleAgree()
{
    var myAgree = $('chkAgree');
    if (myAgree.value == "") { myAgree.value = "false"; }
    
    if (myAgree.value == "true")
    {
        $("imgAgree").src = "../images/contest/check_off.gif";
        myAgree.value = "";
    }
    else
    {
        $("imgAgree").src = "../images/contest/check_on.gif";
        myAgree.value = "true";
    }
    
}

function toggleWinner()
{
	if ($("divWinner").style.display == "none")
	{
		$("divWinner").style.display = "block";
		$("divAllEntries").style.display = "none";
	} else {
		$("divWinner").style.display = "none";
		$("divAllEntries").style.display = "block";
	}
}

function toggleEntries() // Shows/Hides the full story page.
{
    if ($("divVoting").style.display)
    {
        if ($("divVoting").style.display == "none")
        {
            turnOn();
        }
        else
        {
            turnOff();
        }
    }
    else
    {
        turnOff();
    }
}

function turnOn()
{
    $("divVoting").style.display = "block";
    $("divAllEntries").style.display = "none";
    $("divWinner").style.display = "none";
}
function turnOff()
{
    $("divVoting").style.display = "none";
    $("divAllEntries").style.display = "block";
    $("divWinner").style.display = "none";
}

function windowSize( minW, minH ) {
    // andr3a [ www.3site.it ] 07/07/2004
    var objSize = Array( minW, minH );
    if( typeof( window.innerWidth ) == 'number' ) {
        //Non-IE
        objSize[0] = window.innerWidth;
        objSize[1] = window.innerHeight;
    }
    else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
        //IE 6+ in 'standards compliant mode'
        objSize[0] = document.documentElement.clientWidth;
        objSize[1] = document.documentElement.clientHeight;
    }
    else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        objSize[0] = document.body.clientWidth;
        objSize[1] = document.body.clientHeight;
    }
    return objSize;
}

var checkVote = $("myVote");
var checkAgree = $("chkAgree");


if (checkVote != null)
{
    if (checkVote.value != "") 
    {
        $("vote" + checkVote.value).src = "../images/contest/vote_check.jpg";
        $("vote" + checkVote.value + "submit").style.display = "block";
        $("overlayvote" + checkVote.value).src = "../images/contest/overlay_vote_checked.jpg";
        $("overlayvote" + checkVote.value + "submit").style.display = "block";
    }
}
  
if (checkAgree != null)
{
    if (checkAgree.value != "")
    {
        $("imgAgree").src = "../images/contest/check_on.gif";
    }
}
*/