$(document).ready(function(){
    if ( $('#poll') )
    {
        poll();
    }
    
    if ( $('#contact_form') )
    {
        form();
    }
    
});



function poll()
{
    $('#poll .poll_details ul li').mouseover(function(){
        $(this).css({
            'background-color' : '#3d6ea9',
            'cursor'           : 'pointer'
        })
    });
    
    $('#poll .poll_details ul li').mouseout(function(){
        $(this).css({
            'background-color' : '#295487'
        })
    });
    
    $('#poll .poll_details ul li').click(function(){
       $(this).find(':input').attr('checked', 'checked');
    })      
    
}

function form()
{
    // input
    $('#contact_form input').focus(function(){
        $(this).css({
            "border-color" : "#222"
        });
    })
    
    $('#contact_form input').blur(function(){
        $(this).css({
            "border-color" : "#ccc"
        });
    })    
    
    // select
    $('#contact_form select').focus(function(){
        $(this).css({
            "border-color" : "#222"
        });
    })
    
    $('#contact_form select').blur(function(){
        $(this).css({
            "border-color" : "#ccc"
        });
    })
    
    // text area
    $('#contact_form textarea').focus(function(){
        $(this).css({
            "border-color" : "#222"
        });
    })
    
    $('#contact_form textarea').blur(function(){
        $(this).css({
            "border-color" : "#ccc"
        });
    })          
    
}
