d=document;
w=window;
b=navigator;
s=screen;

function StrUrlEncode(a_s)
{
  a_s=a_s.replace(/\%/g,"%01%");
  a_s=a_s.replace(/\#/g,"%02%");
  a_s=a_s.replace(/\=/g,"%03%");
  a_s=a_s.replace(/\&/g,"%04%");
  a_s=a_s.replace(/\?/g,"%05%");

  return a_s;
}

g_oDispNewIs=null;

  g_iPlatform=null;
  g_iBrowser=null;

//Process Table/Struct (BEGIN)
var oCP={pid:-1,oRef:null};        //Cp is the current process

var oé;

var _CoreProcessBlock=
{
  pid:-1,
  XmlHttpObj:null,
  pname:"",
  param:"",
  curDir:"",
  aDirs:"",
  LayerObj:null,
  Prev:null,
  Next:null
};

function AP(a,a0) //Active Process
{
 oCP.pid=a;oCP.oRef=a0
}

/*
document.createEvent


*/
// Browser Const
brNone   = 0;
brIE     = 1;
brOpera  = 2;
brFirefox= 3;
brCamino = 4;
brSafari = 5;
brConquerer = 6;

// Os Const
osNone  = 0;
osWin   = 1;
osLinux = 2;
osUnix  = 3;
osReact = 4;

//Process Table/Struct (END)

æ0="hidden";
æ1="auto";
æ2="visible";
æ3="ellipsis";
æ4="hand";
æ5=true;
æ6=false;
æ7="text";
æ8="button";
æ9="auto";
æA="radio";
æB="left"
æC="password"
æD="checkbox"

hx="0123456789ABCDEF";

g_mode=0; // 0=normal seyir modu; 1=sipariş modu;

//-- Cursor Consts (BEGIN)
crHand="pointer";
crDefault="auto";
crCrosshair="crosshair";
crWait="wait";
crText="text";
crHelp="help";
crMove="move";
crResizeN="n-resize";
crResizeNE="ne-resize";
crResizeNW="nw-resize";
crResizeE="e-resize";
crResizeW="w-resize";
crResizeS="s-resize";
crResizeSE="se-resize";
crResizeSw="sw-resize";

//-- Cursor Consts (END)

//-- Event Consts (BEGIN)
evClick="onclick";
evKeyup="onkeyup";
exKeydown="onkeydown";
evKeypress="onkeypress";
evMousedown="onmousedown";
evMouseup="onmouseup";
evMouseout="onmouseout";
evMouseover="onmouseover";
evMousemove="onmousemove";
evDblclick="ondblclick";
evBlur="onblur";
evFocus="onfocus";
evChange="onchange";
evSelect="onselect";
evScroll="onscroll";
evResize="onresize";
evMousewheel="onmousewheel";
evLoad="onload";
evUnload="onunload";
evAbort="onabort";
evError="onerror";
evSubmit="onsubmit";
evReset="onreset";

evDrag="ondrag";
evDrop="ondrop";

evCut="oncut";
evCopy="oncopy";
evPaste="onpaste";

evPropertychange="onpropertychange";
evStatechange="onreadystatechange";

evStart="onstart";
evStop="onstop";
//-- Event Consts (END)

//-- Menu Type Consts (BEGIN)
mtDefault=0;
mtBar=1;
mtPopup=2;
mtContext=3;
//-- Menu Type Consts (END)

var _GUILayerBorder_Node={w:0,style:"solid",color:""};


function StrDecode(a_sStr)
{

}

function StrEncode(a_sStr)
{
  return escape(a_sStr.replace(/\+/g,"&AABBCCDD;"));
  
}


function d2h(d,a_iCharCount)  //arg 2 is hane sayısı karakter tamamlama sayısı
{
 var h=hx.substr(d&15,1);

 while(d>15)
 {
  d>>=4;
  h=hx.substr(d&15,1)+h;
 }

 var l_iLenOfData=h.length;

 if (l_iLenOfData!=a_iCharCount)
 {
   l_sZero="";
  
   while(l_iLenOfData!=a_iCharCount)
   {
     l_sZero=l_sZero+"0";

     l_iLenOfData++;

   }

   h=l_sZero+h;
 }
 return h;
}

function h2d(h)
{
 return parseInt(h,16)
}

function GOB(a)
{
 return d.getElementById(a)
}

function GID(a)
{
 return a.id
}

function GUILayerChildAdd$0(a,a1) // a=obj; a0=parent;
{
 a.appendChild(a1)
}

function GUILayerChildRemove(a,a1) // a=obj; a0=parent;
{
 a.removeChild(a1)
}

function $2(a)
{
 w.open(""+a+"","nw0")
}

function $3(a,a0,a1)
{
 d.title=a;
 d.charset=a0;
 d.body.scroll=a1
}

function $4(a,a0) //setInnerHtml
{
 a.innerHTML+=a0
}

function $5(a) //GetoffstW (Bug ex: $5(d.body) ie=1280; firefox=1264; opera=1274; )
{
 return a.offsetWidth
}

function $6(a) //GetoffstH (Bug ex:$6(d.body) ie=866; firefox=20; opera=885; )
{
 return a.offsetHeight
}

function $7(a,a1) //SetTxtOFlow --------(Not Tested Yet)-----------
{
 a.textOverflow=a1;
}

function $8() //get offsetWidth browser
{
  if (window.offsetWidth)
  {
    return window.offsetWidth;
  }
  else
  {
    return d.body.offsetWidth;
  }
}

function $9()  // get offsetH Browser
{
  if (window.offsetHeight)
  {
    return window.offsetHeight;
  }
  else
  {
    return d.body.offsetHeight;
  }
}

/*
karakter aralığı.
satır aralık mesafesi.
paragraf ayarları

*/

function GUILayerFocusSet(a)
{
 GOB(a).setActive()
}

function GUILayerActiveSet(a)
{
 GOB(a).setActive()
}

function $B(a,a1) //SetTrueNoWrap
{
 a.noWrap=a1;
}

function GUILayerCursorSet(a,a1)
{
 a.style.cursor=a1;
}

function GUILayerCursorGet(a)
{
 return a.style.cursor;
}

function $D(a) //GetOfftW
{
 return a.offsetWidth;
}

//--------- GUI > Layer > Font (BEGIN)

function GUILayerFontColorSet(a,a1)
{
  a.style.color=a1;
}

function GUILayerFontColorGet(a)
{
  return a.style.color=a1;
}

function GUILayerFontTypeSet(a,a0)
{
  a.style.fontFamily=a0;
}

function GUILayerFontTypeGet(a)
{
  return a.style.fontFamily;
}

function GUILayerFontSizeSet(a,a0)
{
  a.style.fontSize=a0;
}

function GUILayerFontSizeGet(a)
{
  return a.style.fontSize;
}

function GUILayerFontStyleSet(a,a0)
{
  a.style.textDecoration=a0;
}

function GUILayerFontStyleGet(a)
{
  return a.style.textDecoration;
}

function GUILayerFontWeightSet(a,a0)
{
  a.style.fontWeight=a0;
}

function GUILayerFontWeightGet(a)
{
  return a.style.fontWeight;
}
//--------- GUI > Layer > Font (END)

function GUILayerTooltipSet(a,a1)
{
 a.title=a1;
}

function GUILayerTooltipGet(a)
{
  return a.title;
}

function GUILayerVisibleSet(a,a0)
{
  var l_sDisplayStr="";
  if (a0==true)
  {
    l_sDisplayStr="inline";
  }
  else
  {
    l_sDisplayStr="none";
  }

  a.style.display=l_sDisplayStr;
}

function GUILayerVisibleGet(a)
{
  var l_sDisplayStr="";

  l_sDisplayStr=a.style.display;

  if (l_sDisplayStr=="inline")
  {
    return true;
  }
  else
  {
    return false;
  }
}

function GUILayerPaddingSet(a,a0)
{
  a.style.padding=a0;
}

function GUILayerPaddingGet(a)
{
  return a.style.padding;
}

//--------- GUI > Layer > Dimensions (BEGIN)

function GUILayerZSet(a,a1) //SetZ
{
 a.style.zIndex=a1;
}

function GUILayerZGet(a) //GetZ
{
 return a.style.zIndex;
}

function GUILayerXSet(a,a1) //SetX
{
  //alert(a.style.pixelLeft);

  if (typeof(a.style.pixelLeft)!="undefined")
  {
    //alert("asd");
    a.style.pixelLeft=a1;
  }
  else
  {
    a.style.left=a1;
  }
}

function GUILayerXGet(a)
{
  if (typeof(a.style.pixelTop)!="undefined")
  {
    return a.style.pixelLeft;
  }
  else
  {
    return a.style.left;
  }
}

function GUILayerWSet(a,a0)
{
  a.style.width=a0;
}

function GUILayerWGet(a)
{
  return a.style.width;
}

function GUILayerYSet(a,a1)
{
  if (typeof(a.style.pixelTop)!="undefined")
  {
    a.style.pixelTop=a1;
  }
  else
  {
    a.style.top=a1;
  }
}

function GUILayerYGet(a)
{
  if (typeof(a.style.pixelTop)!="undefined")
  {
    return a.style.pixelTop;
  }
  else
  {
    return a.style.top;
  }
}

function GUILayerHSet(a,a1)
{
 a.style.height=a1;
}

function GUILayerHGet(a)
{
  return a.style.height;
}
//--------- GUI > Layer > Dimensions (END)


// InsertAdjacentElement on Firefox
//a_Obj.appendChild(parsedNode);



//Inser Adjacent Text on Firefox
//var parsedText = document.createTextNode(txtStr)
//a_Obj.appendChild(parsedText);


function $H(a,a1) //SetInsertHtml
{
  if (a.insertAdjacentHTML!=null) // if browser=ie or opera
  {
    a.insertAdjacentHTML("beforeEnd",a1);
  }
  else // Firefox Gecko engine
  {
    var r=a.ownerDocument.createRange();
    r.setStartBefore(a);
    var parsedHTML=r.createContextualFragment(a1);
    a.appendChild(parsedHTML);
  }
}

function GUILayerParentSet(a,a0)
{


}

function GUILayerParentGet(a)
{


}

function $I(a,a1,a2) //SetHoverEvnt4TxtClr
{
 a.onmouseover=function(){event.srcElement.style.color=a1;};
 a.onmouseout=function(){event.srcElement.style.color=a2;};
}

function $J(a,a0) //setInnerHtmlDAssign
{
 a.innerHTML=a0
}

function $K(a,a0) //setMaxLength
{
 a.maxLength=a0
}

function $L(a,a1,a2) //SetHoverEvnt4TxtClr
{
 a.onfocus=function(){event.srcElement.style.borderColor=a1;event.srcElement.style.backgroundColor="#f8f8f8";};
 a.onblur=function(){event.srcElement.style.borderColor=a2;event.srcElement.style.backgroundColor="#fff";};
}

//--------- GUI > Layer > Background (BEGIN)

function GUILayerBgColorSet(a,a0)
{
  a.style.backgroundColor=a0;
}

function GUILayerBgColorGet(a)
{
  return a.style.backgroundColor;
}

function GUILayerBgImgSet(a,a0)
{
  a.style.backgroundImage=a0;
}

function GUILayerBgImgGet(a)
{
  return a.style.backgroundImage;
}

//--------- GUI > Layer > Background (END)

function $O(a) //hasScrollBar
{
 if(a.scrollHeight<=$6(a)) return æ5;
 return æ6;
}

function $R(a,a1) //SetAlign
{
 a.align=a1;
}

// GetAlign

function GUILayerScSet(a,a1)
{
 a.className=a1;
}

function GUILayerScGet(a)
{
  return a.className;
}


function GUILayerBorderSet(a_Obj,/*IN*/a_GUILayerBorder_Node)
{
  a_Obj.style.borderWidth=a_GUILayerBorder_Node.w;
  a_Obj.style.borderStyle=a_GUILayerBorder_Node.style;
  a_Obj.style.borderColor=a_GUILayerBorder_Node.color;

  return true;
}

function GUILayerBorderGet(a_Obj,/*OUT*/ a_GUILayerBorder_Node)
{
  a_GUILayerBorder_Node.w=a_Obj.style.borderWidth;
  a_GUILayerBorder_Node.style=a_Obj.style.borderStyle;
  a_GUILayerBorder_Node.color=a_Obj.style.borderColor;

  return a_GUILayerBorder_Node;
}

// GUI > LAYER > HELPING OPERATIONS

function GUILayerEventAdd(a_Obj,a_sEventName,a_Code)
{
  if (typeof(a_Obj.attachEvent)!="undefined" || a_Obj.attachEvent!=null)
  {
    a_Obj.attachEvent(a_sEventName,a_Code);
  }
  else
  {
    a_sEventName=a_sEventName.substr(2,a_sEventName.length);
    a_Obj.addEventListener(a_sEventName,a_Code,false);
  }
}

function GUILayerEventRemove(a_Obj,a_sEventName,a_Code) //Warning : UseCapture  false
{
  if (typeof(a_Obj.detachEvent)!="undefined" || a_Obj.detachEvent!=null)
  {
    a_Obj.detachEvent(a_sEventName,a_Code);
  }
  else
  {
    a_sEventName=a_sEventName.substr(2,a_sEventName.length);
    a_Obj.removeEventListener(a_sEventName,a_Code,false);
  }
}

function GUILayerEventFire(a_Obj,a_sEventName) // Half Implemented
{
   // boolean            dispatchEvent(in Event evt)
     //                                   raises(EventException);

  a_Obj.fireEvent(a_sEventName)
}
// Event Functions


function EventMouseX(e)
{
  if (e.pageX)
  {
    return e.pageX
  }
  else if (e.clientX)
  {
    return (e.clientX + document.body.scrollLeft);
  }
  else
  {
    return null;
  }
}

function EventMouseY(e)
{
  if (e.pageY)
  {
    return e.pageY;
  }
  else if (e.clientY)
  {
    return (e.clientY + document.body.scrollTop);
  }
  else
  {
    return null;
  }
}


//-----------------------------------------------
function CXHR(a,a0,rFnc,rFnc1)
{

 var o;
 if(b.appName.indexOf("Microsoft")!=-1)
 {
  try
  {
   o=new ActiveXObject("Msxml2.XMLHTTP");
  }
  catch(e)
  {
   try
   {
    o=new ActiveXObject("Microsoft.XMLHTTP");
   }
   catch(e)
   {
    o=false;
   }
  }
 }
 else
 {
  o=new XMLHttpRequest();
 }

 if(!o) return null;
 var oDate=new Date();

  //""+a0+"&dt="+oDate.toUTCString()+oDate.getMilliseconds()+""
 o.open(a,""+a0+"&dt="+oDate.toUTCString()+oDate.getMilliseconds()+"",true);

 o.onreadystatechange=function()
 {
  if(o.readyState==4)
  {
   if(o.status==200)
   {
     OnLoaded(o,rFnc);
   }
  }
  else if(o.readyState==1)
  {
   OnLoaded(a,rFnc1)
  }
 };

 return o;
}

function OnLoading(a,rFunc)
{
 rFunc()
 {
 
 };
}

function OnLoaded(a,rFunc)
{
 rFunc()
 {

 };
}
//-------------------------------------------
// XML PARSER (COMPATIBLE GECKO-IE-OPERA)
function CXMLParse(a_sXMLText,a_bAsyncIs)
{
  var o;
  if (a_bAsyncIs==null)
  {
    a_bAsyncIs=false;
  }

  if (window.ActiveXObject)
  {
    o=new ActiveXObject("Microsoft.XMLDOM");
    o.async=a_bAsyncIs;
    o.loadXML(a_sXMLText);
  }
  else
  {
    var parser=new DOMParser();
    o=parser.parseFromString(a_sXMLText,"text/xml");
  }

  return o;
}
//-------------------------------------------
function LoadProcess(a0,sCmdParam,f1)
{
 var oXhr=new CXHR("get","b/s.1.asp?mid="+a0+"&p0="+sCmdParam+"",f0,f1);
 
 oXhr.send(null);

 function f0()
 {
  oé.innerHTML="";
  //oé.removeChild(of);
  //of.innerHTML="";
  var l0=oXhr.responseText;

  if(l0=="é4")
  {
   alert("Sistem Hatası\n"+a0+" kimliğine ait işlem bulunamadı.");
  }
  else
  {
   oé.insertAdjacentHTML("afterBegin","&nbsp;<script defer>"+l0+"</script>")
  }
 }
}

function BaseInit()
{
  var l_sPlatformStr;
  l_sPlatformStr=window.navigator.userAgent;

  if (l_sPlatformStr.indexOf("MSIE")!=-1)
  {
    g_iBrowser=brIE;
  }
  else if (l_sPlatformStr.indexOf("Firefox")!=-1)
  {
    g_iBrowser=brFirefox;
  }
  else if (l_sPlatformStr.indexOf("Safari")!=-1)
  {
    g_iBrowser=brSafari;
  }
  else if (l_sPlatformStr.indexOf("Opera")!=-1)
  {
    g_iBrowser=brOpera;
  }
  else if (l_sPlatformStr.indexOf("Camino")!=-1)
  {
    g_iBrowser=brCamino;
  }
  else if (l_sPlatformStr.indexOf("Conquerer")!=-1)
  {
    g_iBrowser=brConquerer;
  }
  else
  {
    g_iBrowser=brNone;
  }

  if (l_sPlatformStr.indexOf("Windows")!=-1)
  {
    g_iPlatform=osWin;
  }
  else if (l_sPlatformStr.indexOf("Linux")!=-1)
  {
    g_iPlatform=0;
  }
  else if (l_sPlatformStr.indexOf("Linux")!=-1)
  {
    g_iPlatform=osLinux;
  }
  else if (l_sPlatformStr.indexOf("Unix")!=-1)
  {
    g_iPlatform=osUnix;
  }
  else if (l_sPlatformStr.indexOf("React")!=-1)
  {
    g_iPlatform=osReact;
  }
  else
  {
    g_iPlatform=osNone;
  }

  

  oé=$H(d.body,"<div id=\"ID_BASE_SYSTEM\" style=\"display:none;\"></div>");
}

function ProcessCreate(a0,sCmdParam,f1)
{
 var oXhr=new CXHR("get","modules/s.1.asp?mid="+a0+"&p0="+sCmdParam+"",f0,f1);
 
 oXhr.send(null);

 function f0()
 {
  if (oé==null || typeof(oé)=="undefined")
  {
    // Hata : Sistem Başlatılmadı; İlk önce BaseInit 'i çalıştırın.
    return;
  }

  oé.innerHTML="";

  var l0=oXhr.responseText;

  if(l0=="é4")
  {
   alert("Sistem Hatası\n"+a0+" kimliğine ait işlem bulunamadı.");
  }
  else
  {
   $H(oé,"&nbsp;<script defer>"+l0+"</script>");
  }
 }
}

//-------------------------------------------
function AProcess(a0,sCmdParam,f1,par,a5) //a5 replace=1; addnEW=0
{
 var oXhr=new CXHR("get","b/s.1.asp?mid="+a0+"&p0="+sCmdParam+"",f0,f1);
 
 oXhr.send(null);

 function f0()
 {
  if(a5==1) par.innerHTML="";
  oé.removeChild(of);
  var l0=oXhr.responseText;

  if(l0=="é4")
  {
   alert("Sistem Hatası\n"+a0+" kimliğine ait işlem bulunamadı.");
  }
  else
  {
   par.insertAdjacentHTML("afterBegin","&nbsp;<script defer>"+l0+"</script>")
  }
 }
}
//-------------------------------------------
function CFlash(id,sFName,quality,x,y,z,w,h,parent)
{
 q="<object id=\""+id+"\" style=\"position:absolute;left:"+x+";top:"+y+";z-Index:"+z+";\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" menu=\"false\" width=\""+w+"\" height=\""+h+"\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\"><param name=\"movie\" value=\""+sFName+"\"><param name=\"quality\" value=\""+quality+"\"><param name=\"menu\" value=\"false\"><param name=\"wmode\" value=\"transparent\"></object>";
 $4(parent,q);
 return GOB(id);
}

function UFlash(o,sFN)
{
 GOB(o).movie=sFN;
}