/* String rutinleri */

function str(_s) {
  if (typeof (_s) == "undefined" || typeof (_s) == "null") {
    this.s = "";
  }
  else {
    this.s = _s;
  }
}

str.prototype.trim = function () {
  return this.s.replace(/^\s+|\s+$/g, "");
}

str.prototype.ciftToTekTirnak = function () {
  return this.s.replace(/"/g, "'");
}

str.prototype.tekToAccentGrave = function () {
  return this.s.replace(/'/g, "`");
}

str.prototype.tersSlahToDuzSlash = function () {
  return this.s.replace(/\\/g, "/");
}

str.prototype.doubleTersSlash = function(){
  return this.s.replace(/\\/g, "\\\\");
}
/* String rutinleri */


document.onselectstart = function()  
{ 
  ;
//  return fnotselect();
}

document.oncontextmenu = function()  
{  
  return false;
}

function fnotselect() {
try{
  if(document.activeElement.tagName.toLowerCase() != "input" && document.activeElement.tagName.toLowerCase() != "textarea")
  { return false; } else { return true; }
} catch(e) { return false; }
}

document.onkeydown = function (e) {
  try {
    if (!document.all) { return true; } e = (e) ? e : window.event;
    var k = e.keyCode ? e.keyCode : e.which;
    var vele = (e.target) ? e.target : e.srcElement;
    var vtag = vele.tagName.toLowerCase();
    if ((vtag == "input") || (vtag == "select")) {
      var vtype = vele.getAttribute("type").toLowerCase();
      if ((k == "13") && (vtype != "button") && (vtype != "submit") && (vtype != "hidden")) {
        e.cancelBubble = true;
        e.keyCode = 9;
        e.returnValue = true;
        return true;
      }
    }
  }
  catch (e) { return true; }
};


/* Aracılar */

/*

// Bunu Wz ToolTips için kullan; genellikle tooltips, ama gerekirse her türlü non modal dialog içinde kullanırsın
function fcWZTT(hangiDia) {
  var ob = new Object();
  ob.mthParams = [hangiDia];
  return fcWs("fcObjDia02.getStoredDia", ob);
}

*/

/* Aracılar */

function fcCleargSecili() {
  gSecili.dosya = "";
  gSecili.dizin = "";
  gSecili.idsi = "";
  gSecili.dizinSource = "";
  gSecili.dosyaSource = "";
  $("#spStatusSeciliDirFullPath").text("");
}

/* Main */
var gSWF = "flv/flowplayer-3.2.7.swf";

var gCommon ={d1:"",d2:""}
var gLgn = { useruid:"", sa:"H", eposta:"", rumuz:"", admin:"H" };
var gEposta = { body: "<div><img src='http://tmftp.org/img/logoformail_33Title.jpg' alt='' /></div><table style='width: 597px; height: 30px;' border='0'><tbody><tr><td>&nbsp;</td><td style='text-align: right;'><a href='http://tmftp.org' target='_blank'>http://tmftp.org</a></td></tr></tbody></table><p>&nbsp;</p>", subject: "" };

var tmftpMenu;
var gOnay = { evet: false, data1: "", data2: "" };
var dia1, dia2, dia3;
var gSecili = { dosya: "", dizin: "", idsi: "", dizinSource: "", dosyaSource: "" };
var gBoyut = { WW: 0, WH: 0, trGovdeH: 0 };
var gSQL = "";

/* Main */

/* New */

function fcDoldur(htmAdresi){
  eval(fcAjax("o.clsGovdeDoldur().defGovdeyiVer","'" + htmAdresi + "','divGovde'"));
}

function fcDiaErr(resIdsi, vResizable){
  if (typeof(vResizable) == "undefined"){
    vResizable = "false";
   }
  eval(fcAjax("o.clsDia().defDiaErrVer","'" + resIdsi + "', '" + vResizable + "'"));
}

function fcDia(htmAdresi, vDegiskenler){
  eval(fcAjax("o.clsDia().defDiaVer", "'" + htmAdresi + "'"));
}

function fcDia2(htmAdresi){
  eval(fcAjax("o.clsDia().defDiaVer2","'" + htmAdresi + "'"));
}

function fcRes(vIdsi){
	return fcAjax("o.clsRes().defSelectVeriWhereIdsi", "'" + vIdsi + "'");
}

/* New */

/* Main AJAX CherryPy */ 
function fcAjax(vUrl, jsonArgs){
  var vvMedium, vvGiden, vvReturn;

  vvMedium = {"url": vUrl, "sess": $("#inpSes").val()}
  if(jsonArgs != "undefined"){
    vvMedium.args = jsonArgs;      
  }
  
  vvGiden = JSON.stringify(vvMedium);
  $.ajax({
    async: false,
    type: "POST",
    url: "defAjax",
    timeout: 60000,
    data: vvGiden,
    contentType: "application/x-www-form-urlencoded, charset=utf-8",
    dataType: "text",
    error: function (xhr, msg, thrownError) {
      document.write(xhr.responseText);
      return false;
    },
    success: function (donen) {
      //alert(donen);
	    vvReturn = donen;
    }
  });
  
  return vvReturn;
}
/* Main AJAX CherryPy */ 

