
function setCookie(name, value, expires, path, domain, secure) {
  document.cookie= name + "=" + escape(value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}

//============================================================================

function check() {
	if(document.new_post.captcha.value==0) {
		alert('Ieraksti taču kodu!');
		document.new_post.captcha.focus();
		return false;
	}
}

//============================================================================

function new_captcha() {
	thesrc = document.getElementById('captcha').src;
	thesrc = thesrc.substring(0,thesrc.lastIndexOf('.')+4);
	document.getElementById('captcha').src = thesrc+'?'+Math.round(Math.random()*100000);
	document.new_post.captcha.focus();
}
