dom.prototype.config_events = function (pObj, pEvent, pHandler)
{
if( typeof pObj == 'object')
{
if( pEvent.substring(0, 2) == 'on')
pEvent = pEvent.substring(2, pEvent.length);
if ( pObj.addEventListener )
pObj.addEventListener(pEvent, pHandler, false);
else if( pObj.attachEvent )
pObj.attachEvent('on' + pEvent, pHandler );
}
}
var _beforeunload_ = window.onbeforeunload;
window.onbeforeunload = function()
{
return unloadMess();
}
dom.prototype.unloadMess = function (){
var mess = get_lang("All change you made has not been saved and will be discarted.");
for (var i = 0; i < BordersArray.length; i++) {
var body = Element('body_' + BordersArray[i].sequence);
if (body && body.contentWindow && body.contentWindow.document.designMode.toLowerCase() == 'on') {
return mess;
}
}
}
// Make decimal round, using in size message
dom.prototype.round = function (value, decimal){
var return_value = Math.round( value * Math.pow( 10 , decimal ) ) / Math.pow( 10 , decimal );
return( return_value );
}
dom.prototype.removeAllById = function (id){
do
{
if (typeof(Element(id)) == 'undefined')
break;
Element(id).parentNode.removeChild(Element(id));
}
while(Element(id));
}
// Add Input File Dynamically.
dom.prototype.addFile = function (id_border){
divFiles = document.getElementById("divFiles_"+id_border);
if (! divFiles)
return false;
if (divFiles.lastChild)
var countDivFiles = parseInt(divFiles.lastChild.id.split('_')[2]) + 1;
if (! countDivFiles)
var countDivFiles = 1;
divFile = document.createElement('DIV');
divFile.innerHTML = "";
var linkFile = document.createElement("A");
linkFile.id = "linkFile_"+id_border+"_"+countDivFiles;
linkFile.href='javascript:void(0)';
linkFile.onclick=function () {removeFile(this.id.replace("link","div")); return false;};
linkFile.innerHTML=get_lang("Remove");
//divFile.innerHTML += " ";
divFile.appendChild(linkFile);
divFile.id = "divFile_"+id_border+"_"+countDivFiles;
divFiles.appendChild(divFile);
return document.getElementById("inputFile_"+id_border+"_"+countDivFiles);
}
// Remove Input File Dynamically.
dom.prototype.removeFile = function (id){
var border_id = id.substr(8,1);
var el = Element(id);
el.parentNode.removeChild(el);
}
var denyFileExtensions = new Array('exe','com','reg','chm','cnf','hta','ins',
'jse','job','lnk','pif','src','scf','sct','shb',
'vbe','vbs','wsc','wsf','wsh','cer','its','mau',
'mda','mar','mdz','prf','pst');
dom.prototype.validateFileExtension = function (fileName){
var error_flag = false;
var fileExtension = fileName.split(".");
fileExtension = fileExtension[(fileExtension.length-1)];
for(var i=0; i | ';
old_divStatusBar.style.display = 'none';
msg_div.style.display = '';
// Nao ponha var na frente!! jakjr
handle_write_msg = function(){
try{
if(!old_msg)
clean_msg();
else
write_msg(old_msg, true);
}
catch(e){}
}
if(notimeout)
old_msg = msg;
else
setTimeout_write_msg = setTimeout("handle_write_msg();", 5000);
}
// Funcao usada para apagar mensagem sem timeout
dom.prototype.clean_msg = function (){
old_msg = false;
var msg_div = Element('em_div_write_msg');
var old_divStatusBar = Element("divStatusBar");
if(msg_div)
msg_div.style.display = 'none';
old_divStatusBar.style.display = '';
}
function Element (el) {
return document.getElementById(el);
}
dom.prototype.trim = function (inputString) {
if (typeof inputString != "string")
return inputString;
var retValue = inputString;
var ch = retValue.substring(0, 1);
while (ch == " ") {
retValue = retValue.substring(1, retValue.length);
ch = retValue.substring(0, 1);
}
ch = retValue.substring(retValue.length-1, retValue.length);
while (ch == " ") {
retValue = retValue.substring(0, retValue.length-1);
ch = retValue.substring(retValue.length-1, retValue.length);
}
while (retValue.indexOf(" ") != -1) {
retValue = retValue.substring(0, retValue.indexOf(" ")) + retValue.substring(retValue.indexOf(" ")+1, retValue.length);
}
return retValue;
}
dom.prototype.LTrim = function (value){
var w_space = String.fromCharCode(32);
var strTemp = "";
var iTemp = 0;
var v_length = value ? value.length : 0;
if(v_length < 1)
return "";
while(iTemp < v_length){
if(value && value.charAt(iTemp) != w_space){
strTemp = value.substring(iTemp,v_length);
break;
}
iTemp++;
}
return strTemp;
}
dom.prototype.array_search = function (needle, haystack) {
var n = haystack.length;
for (var i=0; i= 1 && month <= 12 && day >= 1 && day <= 31)
{
if (month == 02 && day <= 29)
{
return true;
}
return true;
}
else
{
return false;
}
}
else
{
return false;
}
}