function setCookie (name, value, path, expires, domain, secure){
   document.cookie = name + "=" + escape(value) +
   ((expires) ? "; expires=" + expires : "") +
   ((path) ? "; path=" + path : "") +
   ((domain) ? "; domain=" + domain : "") +
   ((secure) ? "; secure" : "");
}

function cookieVal(cookieName){
  thisCookie = document.cookie.split("; ")
  for(i = 0; i < thisCookie.length; i++){
      if(cookieName == thisCookie[i].split("=")[0]){
         return thisCookie[i].split("=")[1];
      }
  }
  return 0;
}

function form_submit(name){
  document.getElementById(name).submit();
}

function showCaptcha(){
  var secure = document.getElementById('secure'); 
  secure.innerHTML = '<img src="/kcaptcha/kcaptcha_view.php"/>';
}

function reload(){   
  var rndval = new Date().getTime();
  document.getElementById('capcha').innerHTML = '<img src="/kcaptcha/kcaptcha_view.php?f='+rndval+'" width="120" height="50" border="0" alt="" /><br/><a href="javascript:void();" onclick="reload(); return false;" id="reloadcapcha">обновить</a>';
}
