var Doc ={
    read :function (name,array) {
        var results = document.cookie.match ( '(^|;) ?' + name + '=([^;]*)(;|$)' ); 
        return (results)?   ((!array)? (unescape( results[2] ).split('&')): unescape( results[2] )) :  null;
    },
    save :function (name,value,days) {
        if (days) {
            var date = new Date();
            date.setTime(date.getTime()+(days*24*60*60*1000));
            var expires = "; expires="+date.toGMTString();
        }
        else var expires = "";
        document.cookie = name+"="+value+expires+"; path=/";
    },
    cancel:function(){
        history.back();
    },
    confirm_delete : function (event) {
        if ( !confirm ('Are you sure you want to delete this item?') ) {
            event.preventDefault();
        };
    },
    
    confirm_delete_all : function (event) {
        if ( !confirm ('Are you sure you want to continue?') ) {
              event.preventDefault();   
        }else if ( !confirm ('To confirm your action press Yes!') ) event.preventDefault(); ;
    },
    
    action_confirm : function (event) {
        if ( !confirm (message) ) {
            event.preventDefault();
        };
    },
    linkBox: function (event){
        var url = $('a',this).attr('href');
        if (url)
        window.location = url;
        //console.log($('a',this).attr('href'));
    }
}

$(document).ready(function(){
    $('#banner-info, #banner-no-pay,#banner-top-results').click(Doc.linkBox);
    $('a.action_delete').click(Doc.confirm_delete);
    $('.action_cancel').click(Doc.cancel);
    $('.action_focus').focus()
    $('.action_delete_all').click(Doc.confirm_delete_all);
    $('.buttons input').hover(function(){$(this).addClass('hover');},function(){$(this).removeClass('hover');});
    $('a.action_confirm').click(Doc.action_confirm);
})



