function validateForm() {
	comment = document.submitcomment.comment;
	if(comment.value == '' || comment.value == 'Ве молиме внесете коментар'){
		comment.value = 'Ве молиме внесете коментар';
		comment.style.border = "1px solid #cb2c2c";
		return false;
	}
	return true;
}

function add_em(em) {
	before = document.submitcomment.comment.value;
	after = before + " " + em;
	document.submitcomment.comment.value = after;
	document.submitcomment.comment.focus();
}

function togglePPL(id, cat){$.post('toggleppl.php?id='+id+'&cat='+ cat,function(resp){$('#allPPl p').hide();$('#allPPl p').html(resp);$('#allPPl p').fadeIn("slow");});}
function checkCaptcha() {
	captcha = document.submitcomment.captcha;
	if(captcha.value == '' || captcha.value == 'Внесете го кодот од сликата'){
		captcha.value = 'Внесете го кодот од сликата';
		captcha.style.border = "1px solid #cb2c2c";
		valid = false;
	} else {
		captcha.style.border = "1px solid #929292";
		valid = true;
	}
	return valid;
}

$(function() {
	$('#fimgs a').hover(function(e) {
		var ttText = $(this).find('img').attr("alt");
		var html = '<div id="ttip"><p>' + ttText + '</p></div>';
						
		$('body').append(html).children('#ttip').hide().fadeIn(400);
		$('#ttip').css('top', e.pageY + -20).css('left', e.pageX);
			
	}, function() {
		$('#ttip').remove();
	});
	
	$('a').mousemove(function(e) {
		$('#ttip').css('top', e.pageY + -20).css('left', e.pageX);
	});
});
// Confirm
$(function(){
	$("a#conf").click(function() {
		$('#cnfrnd').show();
		return false;
	});
	$("#cnfrnd a.yes").click(function() {
		$('#cnfrnd').hide();
		$(this).attr({ href: $("a#conf").attr("href") });
	});
	$("#cnfrnd a.no").click(function() {
		$('#cnfrnd').fadeOut("fast");
		return false;
	});
	
	$("a#conflg").click(function() {
		$('#cnflg').show();
		return false;
	});
	$("#cnflg a.yes").click(function() {
		$('#cnflg').hide();
		$(this).attr({ href: $("a#conflg").attr("href") });
	});
	$("#cnflg a.no").click(function() {
		$('#cnflg').fadeOut("fast");
		return false;
	});
	
	$("#cnfrem a.yes").click(function() {
		$('#cnfrem').hide();
		id = $(this).attr("id");
		$.ajax({
			type: "POST",
			url: "remstat.php",
			data: 'id=' + id,
			error: function(){
				alert('Error');
			},
			success: function(){
				$("#status-"+id).slideUp();
		}});
		return false;
	});
	$("#cnfrem a.no").click(function() {
		$('#cnfrem').fadeOut("fast");
		return false;
	});
	rems = function(id) {
		$("#cnfrem a.yes").attr({id: id});
		$('#cnfrem').show();	
	}
});

// Radio
$(function(){
	$("#r1").click(function(){$("#radio-1").show();$("#radio-2").hide();$("#radio-3").hide();$("#radio-4").hide();$("#radio-5").hide();$("#radio-6").hide();$("#radio-7").hide();return false;});
	$("#r2").click(function(){$("#radio-1").hide();$("#radio-2").show();$("#radio-3").hide();$("#radio-4").hide();$("#radio-5").hide();$("#radio-6").hide();$("#radio-7").hide();return false;});
	$("#r3").click(function(){$("#radio-1").hide();$("#radio-2").hide();$("#radio-3").show();$("#radio-4").hide();$("#radio-5").hide();$("#radio-6").hide();$("#radio-7").hide();return false;});
	$("#r4").click(function(){$("#radio-1").hide();$("#radio-2").hide();$("#radio-3").hide();$("#radio-4").show();$("#radio-5").hide();$("#radio-6").hide();$("#radio-7").hide();return false;});
	$("#r5").click(function(){$("#radio-1").hide();$("#radio-2").hide();$("#radio-3").hide();$("#radio-4").hide();$("#radio-5").show();$("#radio-6").hide();$("#radio-7").hide();return false;});
	$("#r6").click(function(){$("#radio-1").hide();$("#radio-2").hide();$("#radio-3").hide();$("#radio-4").hide();$("#radio-5").hide();$("#radio-6").show();$("#radio-7").hide();return false;});
	$("#r7").click(function(){$("#radio-1").hide();$("#radio-2").hide();$("#radio-3").hide();$("#radio-4").hide();$("#radio-5").hide();$("#radio-6").hide();$("#radio-7").show();return false;});
	$("#nwr").click(function(){ window.open("http://vecerva.com.mk/radio.html","'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=300,height=300,left=200,top=200"); return false; });
});
$(function(){
	$('textarea.phcom').focus(function() {
		$(this).val('');
	});
});

$(function() {
$('#regsubmit').click(function() {
	var emm = $('#email').val();
	$('#email_confirm').val(emm);
	var cps = $('#new_password').val();
	$('#password_confirm').val(cps);
});
$('#clsreg').click(function() {
	$('#reg').hide();
	$('#slshd').show();
	return false;
});
});

// USER STATUS TICKER
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(1($){$.9.D=$.9.g=1(b){b=b||p;i=1(a){j(a);a.4=$("r",a);a.4.q(":o(0)").l().C();a.5=0;h(a)};h=1(a){a.m=t(1(){f(a)},b)};j=1(a){s(a.m)};8=1(a){a.3=7};d=1(a){a.3=c};f=1(a){e(a.3)6;a.3=7;$(a.4[a.5]).n("k",1(){$(2).l();a.5=++a.5%(a.4.B());$(a.4[a.5]).z("k",1(){a.3=c})})};2.y(1(){e(2.x.w()!="A")6;i(2)}).v("g").u(1(){8(2)},1(){d(2)});6 2}})(E);',41,41,'|function|this|pause|items|currentitem|return|true|pauseTicker|fn|||false|resumeTicker|if|doTick|newsticker|startTicker|initTicker|stopTicker|slow|hide|tickfn|fadeOut|eq|5000|not|li|clearInterval|setInterval|hover|addClass|toLowerCase|nodeName|each|fadeIn|ul|size|end|newsTicker|jQuery'.split('|'),0,{}))