<!--
function replaceAll(str, searchTerm, replaceWith, ignoreCase )   {
   var regex = "/"+searchTerm+"/g";
   if(ignoreCase) regex += "i";
   return str.replace(eval(regex), replaceWith);
}
function getHTTPObject() {
   var xmlhttp;
/*@cc_on
@if (@_jscript_version >= 5)
   try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
   } catch (e) {
      try {
         xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
         xmlhttp = false;
      }
   }
@else
   xmlhttp = false;
@end @*/
   if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
      try {
         xmlhttp = new XMLHttpRequest();
      } catch (e) {
         xmlhttp = false;
      }
   }
   return xmlhttp;
}
function m_curl(url, rpcfunc, rpckey) {
   var http = getHTTPObject();
   http.open("GET", url, true);
   http.setRequestHeader("x-isajax", "1");
   http.onreadystatechange = function() {
      if (http.readyState == 4) {
         if(http.status == 403) {
            document.location = '/customer/Login.sa';
            return;
         }
         if (rpcfunc) {
            if (rpckey) {
               eval(rpcfunc + '("' + escape(http.responseText) + '","' + rpckey + '")');
            } else {
               eval(rpcfunc + '("' + escape(http.responseText) + '")');
            }
         }
      }
   }
   http.send(null);
}

function m_curl_post(url, params, rpcfunc, rpckey) {
   var http = getHTTPObject();
   http.open("POST", url, true);
   http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
   http.setRequestHeader("Content-length", params.length);
   http.setRequestHeader("x-isajax", "1");
   http.onreadystatechange = function() {
      if (http.readyState == 4) {
         if(http.status == 403) {
            document.location = '/customer/Login.sa';
            return;
         }
         if (rpcfunc) {
            if (rpckey) {
               eval(rpcfunc + '("' + escape(http.responseText) + '","' + rpckey + '")');
            } else {
               eval(rpcfunc + '("' + escape(http.responseText) + '")');
            }
         }
      }
   }
   http.send(params);
}

function m_rpc_eval(url,cmd) {
   var http = getHTTPObject();
   http.open("GET",url,true);
   http.onreadystatechange = function() { if(http.readyState == 4) { eval(cmd); } }
   http.send(null);
}
function m_rpc_load(url,layId) {
   if(!document.getElementById(layId)) return;
   var http = getHTTPObject();
   http.open("GET",url,true);
   http.onreadystatechange = function() { if(http.readyState == 4) {document.getElementById(layId).innerHTML=http.responseText; } }
   http.send(null);
}
function m_setc(obj,cln) {
   obj.className = cln;
}
function winHeight() {
   if (parseInt(navigator.appVersion)>3) {
      if (navigator.appName=="Netscape") { return window.innerHeight; }
      if (navigator.appName.indexOf("Microsoft")!=-1) { return document.body.offsetHeight; }
   }
   return 0;
}
function winWidth() {
   if (parseInt(navigator.appVersion)>3) {
      if (navigator.appName=="Netscape") { return window.innerWidth; }
      if (navigator.appName.indexOf("Microsoft")!=-1) { return document.body.offsetWidth; }
   }
   return 0;
}
function URLencode(sStr) {
    return escape(sStr).replace(/\+/g, '%2B').replace(/\"/g,'%22').replace(/\'/g, '%27').replace(/\//g,'%2F');
}
function popup(url,name,w,h,opt,center) {
   if(!w && !h && !opt && !center) {
      win = window.open(url);
   } else {
      if(center) {
         var l = (screen.width/2)-(w/2);
         var t = (screen.height/2)-(h/2);
         opt = opt + ',LEFT='+l+',TOP='+t;
      }
      opt = 'WIDTH='+w+',HEIGHT='+h+','+opt;
      win = window.open(url,name,opt);
   }
   return win;
}
function openWin(url,name,h,w,s,r,center) {
   if(!w) w = 200;
   if(!h) h = 400;
   var opt = '';
   var win;
   if(r) opt = opt + ',RESIZABLE=YES';
   if(s) opt = opt + ',SCROLLBARS=YES';
   if(center) {
      var l = (screen.width/2)-(w/2);
      var t = (screen.height/2)-(h/2);
      opt = opt + ',LEFT='+l+',TOP='+t;
   }
   opt = 'WIDTH='+w+',HEIGHT='+h+','+opt;
   return window.open(url,name,opt);
}
function linkConf(url,msg) {
   if(!msg) { msg = 'Are you sure?'; }
   if(confirm(msg)) { document.location=url; }
}
function contextHelp(id,to,nf,height,width) {
   if(!height) { height = 300; }
   if(!width ) { width  = 200; }
   showUrl('/Help?helpId='+id+'&to='+to+'&nf='+nf,height,width);
}
function showUrl(url,w,h,tit) {
   var l = (screen.width/2)-(w/2);
   var t = (screen.height/2)-(h/2);
   if(!tit) { tit = ''; }
   var w = window.open(url,tit,"SCROLLBARS=1,WIDTH="+w+",HEIGHT="+h+",LEFT="+l+",TOP="+t);
   w.focus();
   return w;
}
function validateTimestamp(date) {
   pat  = /([0-9]{2})-([A-Z]{3})-([0-9]{4}) ([0-9]{2}):([0-9]{2})/;
   day  = date.replace(pat,'$1');
   mon  = date.replace(pat,'$2');
   year = date.replace(pat,'$3');
   hour = date.replace(pat,'$4');
   min  = date.replace(pat,'$5');

   if(!(day  >= 1 && day  <= 31)) { return false; }
   if(!(hour >= 0 && hour <= 24)) { return false; }
   if(!(min  >= 0 && min  <= 59)) { return false; }
   return true;
}
function m_localize(l) {
   if(l == 'JP') document.location = 'http://www.hackersafe.jp/';
   if(l == 'PT') document.location = 'http://www.siteblindado.com.br/';
   if(l == 'EN') document.location = 'http://www.mcafeesecure.com/';
}
function m_tog(imgId,layId) {
   var imgEl = document.getElementById(imgId);
   var layEl = document.getElementById(layId);

   if(imgEl) {
      imgEl.src = '//images.scanalert.com/images/ico_' + (new String(imgEl.src).indexOf('ico_expand') != -1 ? 'colapse' : 'expand') + '.gif';
   }
   if(layEl) {
      layEl.style.display = layEl.style.display == 'none' ? '' : 'none';
   }
}
function m_tog(imgId, layId, dispId, collapseText, expandText) {
   var imgEl = document.getElementById(imgId);
   var layEl = document.getElementById(layId);
   var txtEl = document.getElementById(dispId);
   if (txtEl) {
        txtEl.innerHTML = txtEl.innerHTML == expandText ? collapseText : expandText;
   }
   if(imgEl) {
      imgEl.src = '//images.scanalert.com/images/ico_' + (new String(imgEl.src).indexOf('ico_expand') != -1 ? 'colapse' : 'expand') + '.gif';
   }
   if(layEl) {
      layEl.style.display = layEl.style.display == 'none' ? '' : 'none';
   }
}
function m_img(imgId, imgSrc) {
try {
   var el = document.getElementById(imgId);
   if(el) {
     if(el.src) {
        el.src = imgSrc;
     } else if(el.style) {
        el.style.background = 'url('+imgSrc+')';
     }
   }
   } catch(e) { alert(e); }
}
function m_alertException(er) {
   alert('----- ERROR -----\n\n'+er+'\n\n'
   + 'Description: ' + er.description + "\n"
   + 'File Name: '   + er.fileName + "\n"
   + 'Line Number: ' + er.lineNumber + "\n"
   + 'Message: '     + er.message + "\n"
   + 'Name: '        + er.name + "\n"
   + 'Number: '      + er.number + "\n"
   + 'Prototype: '   + er.prototype + "\n"
   + "");
}
function checkAll(id) {
   var ele = document.getElementById(id);
   if(ele) for(i = 0; i < ele.options.length; i++) { ele.options[i].selected = true; }
}
function moveSelectedOptions(from,to) {
   var eFrom = document.getElementById(from);
   var eTo   = document.getElementById(to);
   for(i = 0; i < eFrom.options.length; i++) {
      if(eFrom.options[i].selected) {
         var len = eTo.options.length;
         eTo.options[len] = new Option(eFrom.options[i].text,eFrom.options[i].value);
         if (eFrom.options[i].title != '') {
            eTo.options[len].title = eFrom.options[i].title;
         }
      }
   }
   for(i = 0; i < eFrom.options.length; i++) {
      if(eFrom.options[i].selected) {
         eFrom.options[i] = null;
         i--;
      }
   }
}
function m_check(selField,ck,formName,fieldName) {
   var fm = eval('document.'+formName);
   if(fm) for(var i = 0; i < fm.elements.length; i++) {
      var ele = fm.elements[i];
      if(ele.name != fieldName) continue;

      if(ck == 0) { ele.checked = false; continue; }
      if(ck == 1) { ele.checked = true; continue; }
      if(ck == 2) { ele.checked = !ele.checked; continue; }

   }
   if(selField) selField.selectedIndex = 0;
}

function m_isPopup() {
   if(!window.opener) return false;
   if(BrowserDetect.browser == 'Explorer' && BrowserDetect.version < 7) return true;
   return false; // This might be a tab
}
function formToStr(fm) {
   var poststr = '';
   for(var i = 0; i < fm.elements.length; i++) {
      var el = fm.elements[i];
      if(el.options) {
         for(var y = 0; y < el.options.length; y++) {
            if(el.options[y].selected) {
               poststr += '&' + escape(el.name) + '=' + escape(el.options[y].value);
            }
         }
      } else {
         poststr += '&' + escape(el.name) + '=' + escape(fm.elements[i].value);
      }
   }
   return poststr;
}
function exportTable(objId) {
   var obj = document.getElementById(objId);
   var table = obj.getElementsByTagName('tbody')[0];
   var rows = table.getElementsByTagName('tr');
   var html = '';

   for(var row = 0; row < rows.length; row++) {
      cols = rows[row].getElementsByTagName('th');
      if(cols.length > 1) {
         for(var col = 0; col < cols.length; col++) {
            if(col != 0) { html += '\t'; }
            html += replaceAll(cols[col].innerHTML,'<.*?>','',true);
         }
         html += '\n'
      }

      cols = rows[row].getElementsByTagName('td');
      if(cols.length > 1) {
         for(var col = 0; col < cols.length; col++) {
            if(col != 0) { html += '\t'; }
            html += replaceAll(cols[col].innerHTML,'<.*?>','',true);
         }
         html += '\n'
      }
   }
   var win = window.open('','','');
   win.document.write('<html><pre>' + html + '</pre></html>');
}



var BrowserDetect = {
   init: function () {
      this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
      this.version = this.searchVersion(navigator.userAgent)
         || this.searchVersion(navigator.appVersion)
         || "an unknown version";
      this.OS = this.searchString(this.dataOS) || "an unknown OS";
   },
   searchString: function (data) {
      for (var i=0;i<data.length;i++)  {
         var dataString = data[i].string;
         var dataProp = data[i].prop;
         this.versionSearchString = data[i].versionSearch || data[i].identity;
         if (dataString) {
            if (dataString.indexOf(data[i].subString) != -1)
               return data[i].identity;
         }
         else if (dataProp)
            return data[i].identity;
      }
   },
   searchVersion: function (dataString) {
      var index = dataString.indexOf(this.versionSearchString);
      if (index == -1) return;
      return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
   },
   dataBrowser: [
      { string: navigator.userAgent, subString: "OmniWeb", versionSearch: "OmniWeb/", identity: "OmniWeb" },
      { string: navigator.vendor, subString: "Apple", identity: "Safari" },
      { prop: window.opera, identity: "Opera" },
      { string: navigator.vendor, subString: "iCab", identity: "iCab" },
      { string: navigator.vendor, subString: "KDE", identity: "Konqueror" },
      { string: navigator.userAgent, subString: "Firefox", identity: "Firefox" },
      { string: navigator.vendor, subString: "Camino", identity: "Camino" },
      { string: navigator.userAgent, subString: "Netscape", identity: "Netscape" },
      { string: navigator.userAgent, subString: "MSIE", identity: "Explorer", versionSearch: "MSIE" },
      { string: navigator.userAgent, subString: "Gecko", identity: "Mozilla", versionSearch: "rv" },
      { string: navigator.userAgent, subString: "Mozilla", identity: "Netscape", versionSearch: "Mozilla" }
   ],
   dataOS : [
      { string: navigator.platform, subString: "Win", identity: "Windows" },
      { string: navigator.platform, subString: "Mac", identity: "Mac" },
      { string: navigator.platform, subString: "Linux", identity: "Linux" }
   ]
};
BrowserDetect.init();
-->
