﻿function rate_page(url) {
    open_window(url, "Rate Page", 0, 0, 245, 170, 0);
}

function tip_page(url) {
    open_window(url, "Send tip", 0, 0, 500, 450, 0);
}

function qtip_page(url) {
    alert('qtip_page');
    $(this).qtip(
    {
        content:
        {
            title: {
                text: 'Tips en venn',
                button: 'Lukk'
            },
            url: url
        },
        position: {
            target: $(document.body), // Position it via the document body...
            corner: 'center' // ...at the center of the viewport
        },
        show: {
            when: 'click', // Show it on click
            solo: true // And hide all other tooltips
        },
        hide: false,
        style: {
            width: 500,
            height: 600,
            padding: '14px',
            border: {
                width: 9,
                radius: 9,
                color: '#666666'
            },
            name: 'light'
        }
        //        api: {
        //            beforeShow: function() {
        //                // Fade in the modal "blanket" using the defined show speed
        //                $('#qtip-blanket').fadeIn(this.options.show.effect.length);
        //            },
        //            beforeHide: function() {
        //                // Fade out the modal "blanket" using the defined hide speed
        //                $('#qtip-blanket').fadeOut(this.options.hide.effect.length);
        //            }
        //        }
    })
}




/* qTip tooltip */
//$('a.contentLink').each(function() {

//    $(this).qtip
//        (
//            {
//                content: $(this).find('.hiddenContent:first').html(),
//                show: 'mouseover',
//                hide: 'mouseout',
//                style: {
//                    width: 200,
//                    height: 100,
//                    padding: 5,
//                    border: {
//                        width: 5,
//                        color: '#0085bd'
//                    },
//                    tip: 'topLeft'
//                }
//            }
//        );
//});


function open_window(url, name, left, top, width, height, menubar) {
    // if IE then use modal window (it's a bit quicker)
    var left = (screen.width / 2) - (width / 2);
    var top = (screen.height / 2) - (height / 2);
    rp = window.open(url, "_blank", "top=" + top + ",left=" + left + ",height=" + height + ",width=" + width + ",menubar=" + menubar + ",scrollbars=0,resizable=0,status=0");
    rp.focus();
    return (true);
}
function refreshParent() {
    if (window.opener.location) {
        window.opener.location.reload();
    }
    self.close();
}

function rating(id) {
    rate = parseInt(id.charAt(4));
    document.getElementById("review_rate").value = rate;
    for (i = 1; i <= rate; i++) {
        document.getElementById("rate" + i).className = "scoreSelected";
    }
    for (i = rate + 1; i <= 5; i++) {
        document.getElementById("rate" + i).className = "score";
    }
}                    

