﻿function _ce(p_name) { return document.createElement(p_name); } // create element
function _ge(p_id) { return document.getElementById(p_id); } // get element
function _gev(p_id) { return _ge(p_id).value; } // get element value
function _gevd(p_id) { return new Date(parseInt(_gev(p_id).substring(0,4)),(parseInt(_gev(p_id).substring(5,7)) - 1),parseInt(_gev(p_id).substring(8,10))); } // get element value date
function _gevf(p_id) { return parseFloat(_gev(p_id)); } // get element value float
function _gevi(p_id) { return parseInt(_gev(p_id)); } // get element value int
function _go(p_url) { window.location = p_url; } // redirects to an url
function _he(p_id) { if (_ge(p_id)) return true; return false; } // has element
function _hev(p_id) { if (_he(p_id) && _ge(p_id).value) return true; return false; } // has element value
function _id(p_id) { return /^[0-9]{4}[-](0[1-9]|1[0-2])[-](0[1-9]|[1-2][0-9]|3[0-1])$/i.test(_gev(p_id)); } // is date
function _if(p_id) { if (!isNaN(parseFloat(_gev(p_id)))) return true; return false; } // is float
function _ii(p_id) { if (!isNaN(parseInt(_gev(p_id)))) return true; return false; } // is integer
function _ina(p_arr) { var o = {}; for(var i = 0; i < p_arr.length; i++) { o[p_arr[i]] = ''; } return o; } // in array
function _ltv(p_id,p_val) { if (_gev(p_id) < p_val) return true; return false; } // less than value
function _mtv(p_id,p_val) { if (_gev(p_id) > p_val) return true; return false; } // more than value
function _pf(p_id) { if (!_if(p_id)) return null; else return parseFloat(_gev(p_id)); } // parse float
function _pi(p_id) { if (!_ii(p_id)) return null; else return parseInt(_gev(p_id)); } // parse integer

String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g,""); } // trim
