/**
 * The script shows hidden box with info about difference between unique and no unique prices.
 * Is called when hoverd "?" in "Price (?):" or "Unique Price(?):" strings
 * The script was written in base of "pice_info.js" of "default" by Ujeen.
 *
 * @author andrew
 */

$(document).ready(function() {
    $('.price').hover(
    function(e) {
        
        box_w = $('#priceTitle').width();
        box_h = $('#priceTitle').height();

        x= e.pageX+20;
        y= e.pageY;

        if(!$.browser.opera){
            if((e.clientY+box_h) > $(window).height()){
                y-=(e.clientY+box_h)-$(window).height()+20;
            }
        }
        else{
            if((e.clientY+box_h) > $(window).height()-200){
                y-=(e.clientY+box_h)-$(window).height()+200;
            }
        }
        if((e.clientX+box_w) > $(window).width()){
            x-=box_w+50;
        }
        //alert("x="+x+" y="+y);
        /*y-= ($('#page').offset()).top;
        x-= ($('#page').offset()).left;*/
        $('#priceTitle').css({
            left:(x+"px"),
            top:(y+"px")
        });
        $('#priceTitle').slideDown(1);
    },
    function() {
        $('#priceTitle').slideUp(1);
    });
    $('.price').click(function() {
        return false;
    });
});
