/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

$(document).ready(function(){

    // Destroy currrent tooltip if present
    if($(this).data("qtip")) $(this).qtip("destroy");

    $('#map div.kavelForSale, #map div.kavelReserved, #map div.kavelSold').click(function(){
        if($(this).attr('rel') != undefined){
            window.location.href = $(this).attr('rel');
        }
    });
    $('#map div.kavelForSale, #map div.kavelReserved, #map div.kavelSold').each(function(){
//            $(this).qtip({
//                content: $(this).children('div.kavelText').html(),
//                show: 'mouseover',
//                hide: 'mouseout',
//                style: {
//                    name: 'dark',
//                    backgroundColor: '#ffffff',
//                    border: {
//                        width: 7,
//                        radius: 2,
//                        color: '#f7921c'
//                    },
//                    color:'#000000',
//                    tip: 'topRight'
//                }
//            });
//


     $(this).qtip({
           content: $(this).children('div.kavelText').html(),
           position: {
              corner: {
                 tooltip: 'bottomLeft', // Use the corner...
                 target: 'topRight' // ...and opposite corner
              }
           },
           show: 'mouseover',
           hide: 'mouseout',
           style: {
              border: {
                 width: 3,
                 radius: 1,
                 color: '#828385'
              },
              padding: 10,
              textAlign: 'center',
              tip: true, // Give it a speech bubble tip with automatic corner detection
              name: 'cream', // Style it according to the preset 'cream' style
              backgroundColor: '#fff',
              color: '#949494'
           }
        });
    });
});