<!-- #include file="../include/config.asp" -->
<%
dim back_url,old_url,skin,mods
back_url=request.servervariables("http_referer")
old_url=trim(request.querystring("old_url"))
skin=trim(request.querystring("skin"))
mods=trim(request.querystring("mod"))
if var_null(mods)<>"" then mods=cint(mods)
if back_url="" then back_url="../"
if old_url<>"" then back_url=old_url

select case action
case "cookies_clear"
  call cookies_clear()
case else
  if format_mid_num(50)=1 then call skin_type()
end select

call web_clear(0)

response.redirect back_url

sub cookies_clear()
  dim cookies_name
  for each cookies_name in request.cookies(joekoe_cms.web_cookies) 
    response.cookies(joekoe_cms.web_cookies)(cookies_name)=empty
  next
  if login_username<>"" then call joekoe_cms.exec("delete from user_login where l_username='"&login_username&"'",0)
  if session("guest")<>"" then call joekoe_cms.exec("delete from user_login where l_username='"&session("guest")&"'",0)
end sub




sub skin_type()
  sql="select m_dir from jk_skins"
  set rs=joekoe_cms.exec(sql,1)
    do while not rs.eof
      if skin=rs("m_dir") then
        response.cookies(joekoe_cms.web_cookies)("skin_var")=skin
        rs.close
        exit sub
      end if
    rs.movenext
    loop
  rs.close
  
  if format_mid_num(37)=1 then
  sql="select s_id from jk_skin"
  set rs=joekoe_cms.exec(sql,1)
    do while not rs.eof
      if mods=rs("s_id") then
        response.cookies(joekoe_cms.web_cookies)("mod_var")=mods
        rs.close
        exit sub
      end if
    rs.movenext
    loop
  rs.close
  end if
end sub
%>
