﻿/*!
* Custom jQuerywibble Commands for Green Tourism
*/

// *** Menus ***

$(function () {
    $("#atest").accordion({
        collapsible: true
    });
});

/* Sidebar Accordion Menu */
$(function () {
    $("#sidebaraccordion").accordion({
        animated: 'fade',
        active: false,
        collapsible: true,
        autoHeight: false
    });
});


// *** Popup Windows ***

$('.trainingpopup').popupWindow({
    height: 400,
    width: 450,
    centerScreen: 1,
    menubar: 0,
    location: 0,
    resizable: 0,
    scrollbars: 0,
    toolbar: 0
});

$('.largepopup').popupWindow({
    height: 800,
    width: 600,
    centerScreen: 1,
    menubar: 0,
    location: 0,
    resizable: 0,
    scrollbars: 0,
    toolbar: 0
}); 


// *** Tooltips ***


// For use inside mastheadnav menus.
$('li.mastheadnavtooltip').each(function () {
    $(this).qtip({
        content: $(this).children('.tooltip'),
        show: 'mouseover',
        hide: 'mouseout',
        position: {
            corner: {
                target: 'bottomMiddle',
                tooltip: 'topMiddle'
            }
        },
        style: {
            color: '#ffffff',
            background: '#b6cc96',
            border: {
                color: '#b6cc96',
                width: 2
            },
            classes: {
                title: 'qtipmastheadnav',
                content: 'qtipmastheadnav'
            },
            tip: {
                corner: 'topMiddle',
                color: '#b6cc96',
                size: { x: 10, y: 10 }
            },
            width: 186 // Set the tooltip width
        }
    });
});


// Remove the tooltips once converted
$('.mastheadnavtooltip').remove('.tooltip');




// For use inside sidebar menus.
$('li.sidebartooltip').each(function () {
    $(this).qtip({
    content: $(this).children('.tooltip'),
    show: 'mouseover',
    hide: 'mouseout',
    position: {
        corner: {
            target: 'topRight',
            tooltip: 'topLeft'
        },
        type: 'fixed'
    },
    style: {
        border: {
            width: 0
        },
        classes: {
            content: 'qtipsidebar'
        },
        tip: {
            corner: 'leftMiddle',
            color: '#669933',
            size: { x: 10, y: 20 }             
        },
        width: 398 // Set the tooltip width
    }
});
});


// Remove the tooltips once converted
$('.sidebartooltip').remove('.tooltip');



// For use inside sidebar menus.
$('li.sidebartooltippgcv').each(function () {
    $(this).qtip({
        content: $(this).children('.tooltip'),
        show: 'mouseover',
        hide: 'mouseout',
        position: {
            target: $('li.sidebartooltippgcv:first'), 
            corner: {
                target: 'topRight',
                tooltip: 'topLeft'
            },
            adjust: { x: 12, y: 0 }
        },
        style: {
            background: '#f1f5ec',
            border: {
                width: 0
            },
            classes: {
                content: 'qtipsidebar'
            },
            width: 516, // Set the tooltip width
            height: 346
        }
    });
});


// Remove the tooltips once converted
$('.sidebartooltippgcv').remove('.tooltip');



// Used for inline tooltips within any content
$('.inlinetooltip').qtip({
    content: {
        title: false
    },
    show: 'mouseover',
    hide: 'mouseout',
    position: {
        corner: {
            tooltip: 'bottomLeft',
            target: 'topRight'            
        }
    },
    style: {
        background: '#d9e4ca',
        border: {
            width: 3,
            radius: 4,
            color: '#d9e4ca'
        },
        classes: {
            content: 'qtipinline'
        },
        tip: {
            corner: 'bottomLeft',    
            color: '#d9e4ca'        
         }
    }
});


// Used for the block homepages - tooltip to appear over the target
$('.blockmenutooltip').qtip({
    content: {
        title: false
    },
    show: 'mouseover',
    hide: { when: 'mouseout', fixed: true },
    position: {
        adjust: {
            x: -186,
            y: -186
        }
    },
    style: {
        title: { 'margin': '0px' },
        background: '#e6f6d9',
        border: {
            width: 0,
            radius: 0,
            color: '#d9e4ca'
        },
        classes: {
            content: 'qtiprollover'
        },
        width: 186,
        height: 177
    }
});

// Used for the block homepages - tooltip to appear to the left
$('.blockmenutooltipleft').qtip({
    content: {
        title: false
    },
    show: 'mouseover',
    hide: 'mouseout',
    position: {
        adjust: {
            x: -382,
            y: -186
        },
        type: 'fixed'
    },
    style: {
        title: { 'margin': '0px' },
        background: '#e6f6d9',
        border: {
            width: 1,
            radius: 2,
            color: '#8cc041'
        },
        classes: {
            content: 'qtiprollover'
        },
        tip: {
            corner: 'rightMiddle',
            color: '#8cc041',
            size: {
                x: 12,
                y: 24
            }
        },
        width: 186,
        height: 173
    }
});

$('.blockmenutooltipright').qtip({
    content: {
        title: false
    },
    show: 'mouseover',
    hide: 'mouseout',
    position: {
        adjust: {
            x: 1,
            y: -185
        },
        type: 'fixed'
    },
    style: {
        title: { 'margin': '0px' },
        background: '#e6f6d9',
        border: {
            width: 1,
            radius: 2,
            color: '#8cc041'
        },
        classes: {
            content: 'qtiprollover'
        },
        tip: {
            corner: 'leftMiddle',
            color: '#8cc041',
            size: {
                x: 12,
                y: 24
            }
        },
        width: 186,
        height: 173
    }
});

$('.blockmenutooltipbottom').qtip({
    content: {
        title: false
    },
    show: 'mouseover',
    hide: 'mouseout',
    position: {
        adjust: {
            x: -182,
            y: 2
        },
        type: 'fixed'
    },
    style: {
        title: { 'margin': '0px' },
        background: '#e6f6d9',
        border: {
            width: 1,
            radius: 2,
            color: '#8cc041'
        },
        classes: {
            content: 'qtiprollover'
        },
        tip: {
            corner: 'topMiddle',
            color: '#8cc041',
            size: {
                x: 24,
                y: 12
            }
        },
        width: 186,
        height: 173
    }
});

$('.blockmenutooltiptop').qtip({
    content: {
        title: false
    },
    show: 'mouseover',
    hide: 'mouseout',
    position: {
        adjust: {
            x: -184,
            y: -386
        },
        type: 'fixed'
    },
    style: {
        title: { 'margin': '0px' },
        background: '#e6f6d9',
        border: {
            width: 1,
            radius: 2,
            color: '#8cc041'
        },
        classes: {
            content: 'qtiprollover'
        },
        tip: {
            corner: 'bottomMiddle',
            color: '#8cc041',
            size: {
                x: 24,
                y: 12
            }
        },
        width: 186,
        height: 177
    }
});


// Used inside SPOT Assessment
$('.questiontooltip').qtip({
    content: {
        title: false
    },
    show: 'mouseover',
    hide: 'mouseout',
    position: {
        corner: {
            tooltip: 'bottomLeft',
            target: 'topRight'            
        }
    },
    style: {
        background: '#d9e4ca',
        border: {
            width: 3,
            radius: 4,
            color: '#d9e4ca'
        },
        classes: {
            content: 'qtipinline'
        },
        tip: {
            corner: 'bottomLeft',    
            color: '#d9e4ca'        
         }
    }
});

