

function registration_go()

{

	// send

	if(verifyPasswordsMatch())

		document.forms.registration_form.submit();

	else

		return false;

	

	

}



function verifyPasswordsMatch()

{



	var pwd = document.getElementById('i_login_pwd');

	var pwd_confirm = document.getElementById('i_login_pwd_confirm');



	if(pwd.value == pwd_confirm.value && pwd.value != '')

		return true;

	else

	{

		alert('Введенные пароли не совпадают');

		return false;

	}

}





function ajaxAddComment(url, text)

{

	if(text=="" || text==null|| text == " ")

	{	

		alert("Текст комменатрия не может быть пустым");

		return;

	}

	$("#comments_block").load(url, {'comment_text': text});

	$("#i_comment_text").val('');

	$("#comments_number").load(url+"&a=shownumber");

}

function ajaxAddBlogComment(url, text)

{

	if(text=="" || text==null|| text == " ")

	{	

		alert("Текст комменатрия не может быть пустым");

		return;

	}

	$("#comments_block").load(url, {'comment_text': text});

	$("#i_comment_text").val('');

	$("#comments_number").load(url+"&a=shownumber");

}

function ajaxShowComments(sid, page)

{

	$("#comments_block").ajaxStart(function(){

	   $(this).hide('slow');

	 });

	$("#comments_block").ajaxComplete(function(){

	   $(this).show('slow');

	 });	

	$("#comments_block").load("/ajax/comments/?sid="+sid+"&page="+page);

}



function ajaxShowBlogComments(id, page)

{

	$("#comments_block").ajaxStart(function(){

	   $(this).hide('slow');

	 });

	$("#comments_block").ajaxComplete(function(){

	   $(this).show('slow');

	 });	

	$("#comments_block").load("/ajax/blog/comments/?id="+id+"&page="+page);

}





function ajaxShowVideoComments(vid, page)

{

	$("#comments_block").ajaxStart(function(){

	   $(this).hide('slow');

	 });

	$("#comments_block").ajaxComplete(function(){

	   $(this).show('slow');

	 });	

	$("#comments_block").load("/ajax/video/comments/?vid="+vid+"&page="+page);

}

function ajaxAddVideoComment(url, text)

{

	if(text=="" || text==null|| text == " ")

	{	

		alert("Текст комменатрия не может быть пустым");

		return;

	}

	$("#comments_block").load(url, {'comment_text': text});

	$("#i_comment_text").val('');

	$("#comments_number").load(url+"&a=shownumber");

}

function makeSubscribe(email)

{

	$.ajax({

		url: "/ajax/subscribe/",

		type: "POST",		

		dataType: "html",

		data:'email='+email,

		beforeSend: function(html) {



		},

		success: function(html){

//			 if(html == '')

	//		 	$("#subscribe_div").html('Некорректный ввод email');

		//	 else

	   			 $("#subscribe_div").html(html);

		}

	 });



	//$("#subscribe_div").load("/ajax/subscribe/?email="+email);

}



function makeTrySubcribe()

{

	 var html='	<div style="margin-left:5px; margin-right:2px"><input id="email" class="input" style="width:220px" value="  -  Ваша электронная почта" onfocus="checkEmailField(this.value)" /></div> <div style="height: 7px"></div><a onclick="makeSubscribe(document.getElementById(\'email\').value);" href="javascript::void(0);" style="color:#000000"><div align="center" style="background-image:url(data/images/button.jpg); background-repeat:repeat-x; width:84px; height: 19px; float:right; font: 8pt Arial; padding-top:2px; margin-right:7px">Подписаться</div></a>';

	 $("#subscribe_div").html(html);

}

function checkSearchField(fvalue)

{

	if(fvalue == '  -  поиск по сайту')

		document.getElementById('search_field').value='';

}



function checkEmailField(fvalue)

{

	if(fvalue == '  -  Ваша эллектронная почта')

		document.getElementById('email').value='';

}



function ajaxDelComment(sid, comment_id)

{

	var url = "/ajax/comment_del/?sid="+sid+"&cid="+comment_id;

	$("#comments_block").load(url);

	$("#i_comment_text").val('');

	$("#comments_number").load(url+"&a=shownumber");

}

function ajaxBlogDelComment(id, comment_id)

{

	var url = "/ajax/blog/comment_del/?id="+id+"&cid="+comment_id;

	$("#comments_block").load(url);

	$("#i_comment_text").val('');

	$("#comments_number").load(url+"&a=shownumber");

}



function ajaxVideoDelComment(vid, comment_id)

{

	var url = "/ajax/video_comment_del/?vid="+vid+"&cid="+comment_id;

	$("#comments_block").load(url);

	$("#i_comment_text").val('');

	$("#comments_number").load(url+"&a=shownumber");

}



function showAnket()

{

	if($('#anket').css('display') == 'none')

		$('#anket_text').html('Закрыть анкету');

	else

		$('#anket_text').html('Заполнить анкету');

	$('#anket').slideToggle();

}



function showAnket2()

{

	if($('#anket').css('display') == 'none')

		$('#anket_text').html('Закрыть анкету');

	else

		$('#anket_text').html('Открыть анкету');

	$('#anket').slideToggle();

}



function selectStar(num)

{

	var count = 1; 

	while(count <= num)

	{

		$("#star_"+count).attr('src', '/data/images/star_active.jpg');

		count++;

	}

	

	while(count <= 5)

	{

		$("#star_"+count).attr('src', '/data/images/star_unactive.jpg');

		count++;

	}

}

function voteKarnaval(id, rate)

{

	$("#vote_div").load("/action/karnaval/vote/?id="+id+"&rate="+rate);

//	$("#vote_div").html('Ваш голос принят!');

}

function voteMalush(id, rate)

{

	$("#vote_div").load("/action/malush/vote/?id="+id+"&rate="+rate);

//	$("#vote_div").html('Ваш голос принят!');

}



function voteDish(id, rate)

{

	$("#vote_div").load("/action/dishes/ajax_vote/?id="+id+"&rate="+rate);

}



function summerShowWindow(pic)

{

	$("#popup_background").show();

	$("#popup_w").html("<img src='/data/images/summer/"+pic+"'>");

}





function summerAjaxVote(id)

{

	$.ajax({

		url: "/action/summer/ajax_vote/?id="+id,

		type: "POST",		

		dataType: "html",

		success: function(html){

				alert(html);

		}

	 });

}



function smileAjaxVote(id)

{	

	

	var code = document.getElementById('code').value;

	

	$.ajax({

		url: "/action/smile/ajax_vote/?id="+id,

		type: "POST",		

		dataType: "html",

		data:"code="+code,

		success: function(html){

			

			$("#fancy_ajax").html(html);

		}

	 });

}



function drawAjaxVote(id)

{	

	

	var code = document.getElementById('code').value;

	

	$.ajax({

		url: "/action/draw/ajax_vote/?id="+id,

		type: "POST",		

		dataType: "html",

		data:"code="+code,

		success: function(html){

			

			$("#fancy_ajax").html(html);

		}

	 });

}