﻿// JScript 파일

// 태그 로그 남기기

function Log_Tag(tag)
{
  var xmlhttp = CreateXmlHttpReq();
  
  if (xmlhttp != null)
  {
    try
    {
      xmlhttp.open("GET", "/Log/Log_Tag.aspx?tag=" + tag, true);
      
      xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
      xmlhttp.onreadystatechange = function()
      {
        if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
        {
          // 할건 없다..
        }
      }

      xmlhttp.send(null);
    }
    catch (e)
    {
      //
    }
  }
}

// 로그인 로그 남기기

function Log_Login(u_id, user_id)
{
  var xmlhttp = CreateXmlHttpReq();
  
  if (xmlhttp != null)
  {
    try
    {
      xmlhttp.open("GET", "/Log/Log_Login.aspx?u_id=" + u_id + "&user_id=" + user_id, true);
      
      xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
      xmlhttp.onreadystatechange = function()
      {
        if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
        {
          // 할건 없다..
        }
      }

      xmlhttp.send(null);
    }
    catch (e)
    {
      //
    }
  }
}

// 미디어 로그 남기기

function Log_Media()
{

}

// RSS 로그 남기기

function Log_RSS()
{

}


// 링크페이지 로그 남기기

function Log_Link(url)
{
  var xmlhttp = CreateXmlHttpReq();
  
  if (xmlhttp != null)
  {
    try
    {
      xmlhttp.open("GET", "/Log/Log_Link.aspx?url=" + url, true);
      
      xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
      xmlhttp.onreadystatechange = function()
      {
        if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
        {
          // 할건 없다..
        }
      }

      xmlhttp.send(null);
    }
    catch (e)
    {
      //
    }
  }
}



function CreateXmlHttpReq()
{
  var xmlhttp = null;
  var is_ie5 = (navigator.userAgent.toLowerCase().indexOf("msie 5") != -1) && document.all;
  
  if (window.XMLHttpRequest)
  {
    xmlhttp = new XMLHttpRequest();
  }
  else
  {
    var control = (is_ie5) ? "Microsoft.XMLHTTP" : "Msxml2.XMLHTTP";
    
    try
    {
      xmlhttp = new ActiveXObject(control);
    }
    catch (e)
    {
      xmlhttp = null;
    }
  }
  
  return xmlhttp;
}
