﻿var qTipConfig = 
    {
        style:
        {
            name: 'light',
            color: '#777',
            tip: true,
            padding: 10,
            textAlign: 'left',
            border: {width:1, radius:4}
        },
        show: {when: {event:'focus'}},
        hide: {when: {event:'blur'}}
    };

var qTipPosition_default = {corner: {target:'rightMiddle', tooltip:'leftMiddle'}};
var qTipPosition_above = {corner: {target:'topMiddle', tooltip:'bottomMiddle'}};
var qTipPosition_below = {corner: {target:'bottomMiddle', tooltip:'topMiddle'}};

$(document).ready(
    function()
    {
        var positionMesssage = "You can search for contract jobs, permanent jobs or either";
        var sortOrderMesssage = "The search results will be ordered by relevance <strong>or</strong> the date the job was posted";
        var postedWithinMesssage = "<dl><dt>Any time</dt><dd>Finds all matching jobs posted on any date<dd><dt>24 hours</dt><dd>Finds all matching jobs posted within the last 24 hours<dd><dt>3 days</dt><dd>Finds all matching jobs posted within the last 3 days</dd><dt>Last week</dt><dd>Finds all matching jobs posted within the last week</dd><dt>Last month</dt><dd>Finds all matching jobs posted within the last month</dd></dl>";
        var matchTypeMesssage = "Given your search phrase you can choose how the search works :<dl class='type'><dt>Exact match</dt><dd>Finds the exact phrase you enter<dd><dt>Match all words</dt><dd>Finds jobs containing all your words in any order<dd></dl>";
        var searchWithinMesssage = "You can search within job titles or the full job description (or both)";
        var locationMesssage = "You can limit the search results to jobs for a specific country or region";
        var keywordsMessage = "This is your search term or phrase. Enter the job you are looking for";
        var filterMessage = "Press this button to search for jobs that match your chosen filter options";

        var positionTypeQTip = jQuery.extend( {content:positionMesssage, position:qTipPosition_default}, qTipConfig);
        var sortOrderQTip = jQuery.extend( {content:sortOrderMesssage, position:qTipPosition_above}, qTipConfig);
        var postedWithinQTip = jQuery.extend( {content:postedWithinMesssage, position:qTipPosition_below}, qTipConfig);
        var matchTypeQTip = jQuery.extend( {content:matchTypeMesssage, position:qTipPosition_above}, qTipConfig);
        var searchWithinQTip = jQuery.extend( {content:searchWithinMesssage, position:qTipPosition_above}, qTipConfig);
        var locationQTip = jQuery.extend( {content:locationMesssage, position:qTipPosition_default}, qTipConfig);
        var keywordsQTip = jQuery.extend( {content:keywordsMessage, position:qTipPosition_above}, qTipConfig);
        var filterQTip = jQuery.extend( {content:filterMessage, position:qTipPosition_above}, qTipConfig);

        $("#PositionType").qtip( positionTypeQTip);
        // $("#SortOrder").qtip( sortOrderQTip);
        // $("#PostedWithinDate").qtip( postedWithinQTip);
        $("#MatchType").qtip( matchTypeQTip);
        $("#SearchWithinFields").qtip( searchWithinQTip);
        // $("#Location").qtip( locationQTip);
        $("#keywords").qtip( keywordsQTip);
        $("#Filter").qtip( filterQTip);
    });
