﻿//Ver 1.0,
/* ---------------------------------------------------------------------- *\
  BİRDENBİRE # Ali BİNGÖL 08/07/2011#
\* ---------------------------------------------------------------------- */
function MY_Track(depth){    
    this.Depth=0
    if(depth) this.Depth=depth
    var _xMe=this  

    this.InitHRefs=function()  {
        $('a').click(function(){
            AddTo(this.id,$(this).attr('href'));
        })
    }
          
    this.Add_Url=function(id,url)  {    
        AddTo(id,url)
    }
        
    function AddTo(id,url){
        if(!id) return
        if(id=='') return
        $.ajax({
            type: "POST",async:true, contentType: "application/json; charset=utf-8",dataType: "json",
            url: FindServerRoot() + "ServiceShareB2C.asmx/System_Track_AddSubCode",
            data: "{'argId':'" + id + "','argUrl':'" + url + "'}" ,
            error: function (data) {RiseAlert(data.responseText);return false }
        });                    
    } 
    function FindServerRoot(){    
        var ret=''
        for(var i=0;i<_xMe.Depth;i++) ret +='../'    
        return ret
    }   
}
