﻿/* FINS.com Javascript for Widgets */
/*global window: false */

var FINSW = FINSW ? FINSW : {};

FINSW.findjobs = function(trackLink, country) {
    var keywordFINSJobs = document.getElementById('FINSW_txtFindFINSJobs').value;
    var locationFINSJobs = document.getElementById('FINSW_txtLocationFINSJobs').value;
    
    var Country = country;
   
    if (keywordFINSJobs == 'keyword') {
        keywordFINSJobs = '';
    }
    if (locationFINSJobs == 'city, state, zip') {
        locationFINSJobs = '';
    }

    if (Country == '')
        window.open('http://www.fins.com/Finance/CandidateJobSearchResults.aspx?reflink=' + trackLink + '&SearchType=Basic&Keywords=' + keywordFINSJobs + '&Location=' + locationFINSJobs + '&Miles=50&widget=y');
    else
        window.open('http://www.fins.com/Finance/CandidateJobSearchResults.aspx?reflink=' + trackLink + '&SearchType=advanced&Source=content&Country=' + Country + '&Keywords=' + keywordFINSJobs + '&cities=' + locationFINSJobs + '&widget=y');

};

FINSW.FINSWatermarkFocus = function(txtElem, strWatermark) {
    if (txtElem.value == strWatermark) { txtElem.value = ''; }
};

FINSW.FINSWatermarkBlur = function(txtElem, strWatermark) {
    if (txtElem.value == '') { txtElem.value = strWatermark; }
};
    