﻿// textboxes and textareas
function isEmptyTxt(txt) {
    return (txt.replace(/^\s+|\s+$/g, '').length == 0);
}
function isEmptyBox(txtBoxId) {
    var txtBox = document.getElementById(txtBoxId);
    return isEmptyTxt(txtBox.value);
}
function limitLength(txtAreaId, maxLength, errorMessage) {
    var txtArea = document.getElementById(txtAreaId);
    if (txtArea.value.length > maxLength)
    {
        alert(errorMessage);
        return false;
    } else {
        return true;
    }
}

// hidden inputs
function setHiddenInputValue(hdnInputId, newValue) {
    var hdnInput = document.getElementById(hdnInputId);
    hdnInput.value = newValue;
    __doPostBack(hdnInputId, '');
   return false;
}

// popups
function detailPopup(type, id) {
    var url = '/Career/Popups/DetailPopup.aspx?type=' + type + '&id=' + id;
    window.open(url, '', 'width=400,height=400,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
}
function tellMorePopup(type) {
    var url = '/Career/Popups/TellMorePopup.aspx?type=' + type;
    window.open(url, '', 'width=400,height=400,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
}
function basicSkillPopup(id) {
    var url = '/Career/Popups/BasicSkillPopup.aspx?id=' + id;
    window.open(url, '', 'width=400,height=400,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
}
//function earningsPopup(careerId, stateId) {
//    var url = '/Career/CareerProfile/Popups/WorkforceDevelopmentRegionPopup.aspx?careerId=' + careerId + '&stateId=' + stateId;
//    window.open(url, '', 'width=600,height=500,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
//}
function moviePopup(moviePath) {
    var movieUrl = "http://multimedia.bridges.com/occ/" + moviePath;
	window.open(movieUrl, '', "width=270,height=220,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes");
}
function careerEarningsSourcePopup() {
    var url = '/Career/Popups/CareerEarningsSourcePopup.aspx';
    window.open(url, '', 'width=500,height=500,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
}

function careerEmploymentStatsSourcePopup() {
    var url = '/Career/Popups/careerEmploymentStatsSourcePopup.aspx';
    window.open(url, '', 'width=500,height=500,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
}

function regionMapPopup(type, state) {
    var url = '/Career/Popups/RegionMapPopup.aspx?type=' + type + '&state=' + state;
    window.open(url, '', 'width=500,height=500,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
}

