﻿function loadfbvote(id)
{
    loadvote(id);
}


function loadvote(id)
{
    new Ajax.Updater('votes', 'http://www.otplan.com/includes/content.aspx', {
        parameters: {type: 'votes', action: 'load', pid: id}
    });
}

function vote(id, vote)
{
    new Ajax.Request('http://www.otplan.com/includes/content.aspx', {
        parameters: {type: 'votes', action: 'vote', pid: id, rating: vote}
    });
    loadvote(id);
}

function CallEmail()
{    
    if ($('emailarea').style.display == 'none') {
        new Effect.BlindDown('emailarea');
        new Effect.ScrollTo('emailarea');
    }
    else 
    {
        new Effect.BlindUp('emailarea');
    }
}

function CallPrint()
{
     var prtContent = $("printarea");
     var WinPrint = window.open('','','letf=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0');
     WinPrint.document.write("<fieldset>");
     WinPrint.document.write("<img width='230px' src='http://www.otplan.com/includes/images/design/OTPlan-Logo-230.png' />");
     WinPrint.document.write(prtContent.innerHTML);
     WinPrint.document.write("<div style='text-align:center; letter-spacing: 1px; font-weight:bold; border-top: solid 1px #ccc; padding-top:3px;'>");
     WinPrint.document.write("Thank you for using OTPlan. Visit http://www.OTPlan.com for more activity ideas.");
     WinPrint.document.write("</div>");
     WinPrint.document.write("<div style='color: #333; text-align:center; padding:5px;'>All rights reserved. OTPlan, Inc.</div>");
     WinPrint.document.write("</fieldset>");
     WinPrint.document.close();
     WinPrint.focus();
     WinPrint.print();
     WinPrint.close();
}