document.write('<script src="/js/prototype.js" type="text/javascript"></script>');
document.write('<script type="text/javascript" src="/js/jq.js"></script>');
document.write('<script type="text/javascript" src="/js/jq-ui.js"></script>');
document.write('<script type="text/javascript" src="/js/jFav.js"></script>');

function getElementsByClassName(classname,tag) {
	 if(!tag) tag = "*";
	 var anchs =  document.getElementsByTagName(tag);
	 var total_anchs = anchs.length;
	 var regexp = new RegExp('\\b' + classname + '\\b');
	 var class_items = new Array()
	 
	 for(var i=0;i<total_anchs;i++) {
	  var this_item = anchs[i];
	  if(regexp.test(this_item.className)) {
	   class_items.push(this_item);
	  }
	 }
	 return class_items;
	}
	function toggleEl(elem, anc) {
		var t_el = document.getElementById(elem);
		if (t_el.style.display == 'none') {
		for (var i = 0, j = getElementsByClassName('inner_ul').length; i < j; i++) {
		   getElementsByClassName('inner_ul')[i].style.display = 'none';
		}
		for (var i = 0, j = getElementsByClassName('active').length; i < j; i++) {
		   getElementsByClassName('active')[i].className = '';
		}	
		t_el.style.display = 'block';
		}
		else t_el.style.display = 'none';
		anc.className = anc.className == '' ? 'active' : '';
	}
	function getBrowserWidth(){
		if (window.innerWidth){
			return window.innerWidth;}  
		else if (document.documentElement && document.documentElement.clientWidth != 0){
			return document.documentElement.clientWidth;    }
		else if (document.body){return document.body.clientWidth;}      
			return 0;
	}
	function getBrowserHeight(){
		if (window.innerHeight){
			return window.innerHeight;}  
		else if (document.documentElement && document.documentElement.clientHeight != 0){
			return document.documentElement.clientHeight;    }
		else if (document.body){return document.body.clientHeight;}      
			return 0;
	}
	
	function getBodyScrollTop(){
		return self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop);
	}
	
	function getBodyScrollLeft(){
		return self.pageXOffset || (document.documentElement && document.documentElement.scrollLeft) || (document.body && document.body.scrollLeft);
	}

	
	function getDocumentHeight(){
		return (document.body.scrollHeight > document.body.offsetHeight)?document.body.scrollHeight:document.body.offsetHeight;
	}
	
	//Размер документа по горизонтали
	function getDocumentWidth(){
		return (document.body.scrollWidth > document.body.offsetWidth)?document.body.scrollWidth:document.body.offsetWidth;
	}

	
	function hideBigLayer(divId){
		var div=document.getElementById(divId);
		var dwrap=document.getElementById('bigImgWrap');
		dwrap.style.visibility='hidden';
		div.style.display='none';
	}
	function animWidth(divId, start, finish){
		var div=document.getElementById(divId);
		var currWidth=start+10;
		div.style.width=currWidth+'px';
		if(currWidth<finish){
			setTimeout(function(){animWidth(divId, currWidth, finish);}, 0.5);
		}else{
			return currWidth;
		}
	}
	function animHeight(divId, start, finish){
		var div=document.getElementById(divId);
		var currHeight=start+10;
		div.style.height=currHeight+'px';
		if(currHeight<finish){
			setTimeout(function(){animHeight(divId, currHeight, finish);}, 0.5);
		}else{
			return currHeight;
		}
	}
	function showBigLayer(divId, w, h, bigimg){
		var l=(getBrowserWidth()/2)-(w/2);
		var t=(getBrowserHeight()/2)-(h/2);
		var div=document.getElementById(divId);
		var dwrap=document.getElementById('bigImgWrap');
		dwrap.style.visibility='visible';
		div.style.left=l.toFixed(0)+'px';
		div.style.top=t.toFixed(0)+'px';
		div.style.display='block';
		animWidth(divId, 10, w);
		animHeight(divId, 10, h);
		div.innerHTML='<img class="galleryBigImg" src="'+bigimg+'" onclick="hideBigLayer(\'bigImg\')">';
	}
	
document.write('<script src="/js/JsHttpRequest/lib/JsHttpRequest/JsHttpRequest.js"></script>');
function sendData(f){
	$('answer').innerHTML='<img src="/images/loading.gif">&nbsp; Пожалуйста, подождите, идет отправка данных...';
	var req = new JsHttpRequest();
    req.onreadystatechange = function() {
        if (req.readyState == 4) { 
            if(req.responseJS.answer.length>0)
				var message=req.responseJS.answer;
			document.getElementById("answer").innerHTML=message;
			document.getElementById("answer").innerHTML+=req.responseText;
			message=message+'<h5 style="color:red">'+req.responseText+'</h5>';
			el_dialog('atention', message, 400, 400, ['   OK   ', 'Очистить форму'], 
																	['pg_photocontainershut()', 'pg_photocontainershut(); document.'+f.name+'.reset()']);
        }
    }
    req.open(null, '/modules/forms.php', true);
    req.send( {answer:f} ); 
}

function getNextPrev(id, cat){
 var div=document.getElementById('arrows');
 div.innerHTML = '<img src="/images/loading.gif" style="margin:5px">';
 var req = new JsHttpRequest();
    req.onreadystatechange = function() {
        if (req.readyState == 4) {
            div.innerHTML = req.responseText;
        }
    }
    req.open(null, '/js/nextprev.php', true);
    req.send( { currid: id, currcat: cat } );
}

function reportError(request){
	alert('Ошибка соединения с сервером!\nПроверьте соединение с интернетом или обновите страницу.');
}

function showHideSelect(mode){
	var elems=document.getElementsByTagName('SELECT');
	for(var i=0; i<elems.length; i++){
		elems[i].style.visibility=mode;
	}
}

var pg_ffwrong = "red";
var pg_padding = "5";
var pg_filenamewithjs = "1";
var pg_dhtml_border = "gray";
var pg_openjs_background = "white";
var pg_disableclick = "1";
var pg_use_code = "1";
var pg_show_title_in_dhtml = "1";
var pg_show_description_in_dhtml = "1";
var ponygallery_image = "Фото";
var ponygallery_of = "из";
var ponygallery_close = "Закрыть";
var ponygallery_prev = " Назад";
var ponygallery_next = "Дальше";
var ponygallery_press_esc = "(Esc)";
var resizeJsImage = "1";
function opendhtml(id, cat, imgsource, imgtitle, imgtext, imgwidth, imgheight) {
  imgwidth = parseInt(imgwidth);
  imgheight = parseInt(imgheight);
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}
	var yScroll, xScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
		xScroll = self.pageXOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
		xScroll = document.documentElement.scrollLeft;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
		xScroll = document.body.scrollLeft;
	}
	var fullHeight=(document.body.scrollHeight > document.body.offsetHeight)?document.body.scrollHeight:document.body.offsetHeight;
	//Create wrap layer
	var bodyObj = document.getElementsByTagName('BODY')[0];
  if(!document.getElementById("bigImgWrap")) {
    divObjWrapper = document.createElement("div");
    divObjWrapper.setAttribute("id", "bigImgWrap");
    bodyObj.appendChild(divObjWrapper);
  } else {
    divObjWrapper = document.getElementById("bigImgWrap");
  }
  with(divObjWrapper.style){
	position='absolute'; 
	backgroundColor='#000000'; 
	top='0px'; 
	left='0px'; 
	zIndex='200'; 
	width='100%';
	height=fullHeight+'px'; 
	filter='alpha(opacity=60)'; 
	mozOpacity='0.6';	
	opacity='0.6';
	visibility='visible';
  }

  if(resizeJsImage==1) {
   if((imgwidth+3*pg_padding)>windowWidth) {
     imgheight = (imgheight * (windowWidth-2*pg_padding))/imgwidth;
     imgwidth = windowWidth-2*pg_padding;
   }
   if((imgheight+2*pg_padding+80)>windowHeight) {
     imgwidth = (imgwidth * (windowHeight-2*pg_padding-80))/imgheight;
     imgheight = windowHeight-2*pg_padding-80;
   }
  }
  var postop =(windowHeight/2)-(imgheight/2)+yScroll+document.body.style.padding-10;
  var posleft =(windowWidth/2)-(imgwidth/2)+xScroll+document.body.style.padding;
  if(postop >= 30) { 
   postop = postop-30;
  }
 // var bodyObj = document.getElementsByTagName('BODY')[0];
  if(!document.getElementById("pg_photocontainer")) {
    divObjContainer = document.createElement("div");
    divObjContainer.setAttribute("id", "pg_photocontainer");
    bodyObj.appendChild(divObjContainer);
  } else {
    divObjContainer = document.getElementById("pg_photocontainer");
  }

  var closeimg = new Image();
  closeimg.src = "/images/close.gif";

  var dhtmltext, dhtmltext2="";

  divObjContainer.style.display = "block";
  dhtmltext  = "<div class=\"pg_photocontainer\" style=\"top:"+postop+"px; left:"+posleft+"px; position: absolute; display:block;z-index:99999;\">";
  dhtmltext += "<div class=\"photoborder\" style=\"background-color: "+pg_openjs_background+"; padding: "+pg_padding+"px; border: solid 1px "+pg_dhtml_border+";\">";
  dhtmltext += "<img onclick=\"pg_photocontainershut()\" style=\"cursor:pointer;border: solid 1px #000;width:"+imgwidth+"px;height:"+imgheight+"px;\" src=\""+imgsource+"\" alt=\""+imgtitle+"\" width=\""+imgwidth+"px\" height=\""+imgheight+"px\" class=\"pngfile\" \/>";
  dhtmltext += "<div id='arrows' style='text-align:center'></div><img onclick=\"pg_photocontainershut()\" style=\"cursor:pointer;position:absolute;bottom:"+pg_padding+"px;right:"+pg_padding+"px;width:"+closeimg.width+"px;height:"+closeimg.height+"px;\" src=\""+closeimg.src+"\" title=\"Закрыть\" id=\"dhtml_close\" class=\"pngfile\" />";  
  dhtmltext += "<br /><div id=\"pony_dhtml_imgtext\" style=\"color:#000000; margin-top:"+pg_padding+"px;text-align: justify; width:"+imgwidth+"px;\">&nbsp;<br />&nbsp;</div>";
  //dhtmltext += "<\/div></div>";
  divObjContainer.innerHTML = dhtmltext;
     document.getElementById("pony_dhtml_imgtext").style.width2 = document.getElementById("pony_dhtml_imgtext").style.width-document.getElementById("dhtml_close").style.width;
  if (pg_show_title_in_dhtml==1) {
   dhtmltext2 += "<strong>"+imgtitle+"</strong><br />";
  }
  if (pg_show_description_in_dhtml==1) {
   dhtmltext2 += imgtext;
  }
  dhtmltext2 += "<\/div></div>";
  if (dhtmltext2!="") {
   document.getElementById("pony_dhtml_imgtext").innerHTML = dhtmltext2;
  }

  if (pg_disableclick==1) { 
    divObjContainer.oncontextmenu = function(){return false;}
  }
  getNextPrev(id, cat);
}


// This Script was written by Benjamin Meier, b2m@gmx.de
// The DHTML-function for creating a overlaying div-layer uses parts of the Dynamic Image Mambot, written by Manuel Hirsch
// and Lightbox => core code quirksmode.org
var pg_ffwrong = "red";
var pg_padding = "5";
var pg_filenamewithjs = "1";
var pg_dhtml_border = "#2c81d5";
var pg_openjs_background = "white";
var pg_disableclick = "1";
var pg_use_code = "1";
var pg_show_title_in_dhtml = "1";
var pg_show_description_in_dhtml = "1";
var ponygallery_image = "Фото";
var ponygallery_of = "из";
var ponygallery_close = "Закрыть";
var ponygallery_press_esc = "(Esc)";
var resizeJsImage = "0";

function el_dialog(mode, text, width, height, buttons, actions) {
  imgwidth = parseInt(width);
  imgheight = parseInt(height);
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}
	var fullHeight=(document.body.scrollHeight > document.body.offsetHeight)?document.body.scrollHeight:document.body.offsetHeight;
	//Create wrap layer
	var bodyObj = document.getElementsByTagName('BODY')[0];
  if(!document.getElementById("bigImgWrap")) {
    divObjWrapper = document.createElement("div");
    divObjWrapper.setAttribute("id", "bigImgWrap");
    bodyObj.appendChild(divObjWrapper);
  } else {
    divObjWrapper = document.getElementById("bigImgWrap");
  }
  with(divObjWrapper.style){
	position='absolute'; 
	backgroundColor='#000000'; 
	top='0px'; 
	left='0px'; 
	zIndex=200; 
	width='100%';
	height=(getBrowserHeight()+getBodyScrollTop()+300)+'px'; 
	filter='alpha(opacity=60)'; 
	mozOpacity='0.6';	
	opacity='0.6';
	visibility='visible';
  }
	showHideSelect('hidden');
	
	var yScroll, xScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
		xScroll = self.pageXOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
		xScroll = document.documentElement.scrollLeft;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
		xScroll = document.body.scrollLeft;
	}

 /* if(resizeJsImage==1) {
   if((imgwidth+3*pg_padding)>windowWidth) {
     imgheight = (imgheight * (windowWidth-2*pg_padding))/imgwidth;
     imgwidth = windowWidth-2*pg_padding;
   }
   if((imgheight+2*pg_padding+80)>windowHeight) {
     imgwidth = (imgwidth * (windowHeight-2*pg_padding-80))/imgheight;
     imgheight = windowHeight-2*pg_padding-80;
   }
  }*/
  var postop =(windowHeight/2)-(imgheight/2)+yScroll+document.body.style.padding-10;
  var posleft =(windowWidth/2)-(imgwidth/2)+xScroll+document.body.style.padding;
  if(postop >= 30) { 
   postop = postop-30;
  }
  var bodyObj = document.getElementsByTagName('BODY')[0];
  if(!document.getElementById("pg_photocontainer")) {
    divObjContainer = document.createElement("div");
    divObjContainer.setAttribute("id", "pg_photocontainer");
    bodyObj.appendChild(divObjContainer);
  } else {
    divObjContainer = document.getElementById("pg_photocontainer");
  }

  /*var closeimg = new Image();
  closeimg.src = "/images/close.gif";*/
  var Buttons=new Array();
  Buttons=buttons;
  var Actions=new Array();
  Actions=actions;
  var dhtmltext, dhtmltext2="";
  var buttonsCode="";
  for(var i=0; i<Buttons.length; i++){
	  buttonsCode += '<input type=button id=Submit onclick="'+Actions[i]+'" value="'+Buttons[i]+'">&nbsp;&nbsp;&nbsp;&nbsp;';
  }
  text+='<hr><center>'+buttonsCode+'</center>';
  divObjContainer.style.display = "block";
  dhtmltext  = "<div onclick=\"pg_photocontainershut()\" class=\"pg_photocontainer\" style=\"top:"+postop+"px; left:"+posleft+"px; position: absolute; display:block;z-index:99999;\">";
  dhtmltext += "<div class=\"photoborder\" style=\"background-color: "+pg_openjs_background+"; padding: "+pg_padding+"px; border: solid 2px "+pg_dhtml_border+";\">";
  dhtmltext += "<br /><div align=center id=\"pony_dhtml_imgtext\">"+text+"<hr>"+buttonsCode;
  dhtmltext += "</div>";
  
  divObjContainer.innerHTML = dhtmltext;
  if (pg_show_description_in_dhtml==1) {
   dhtmltext2 += text;
  }
  dhtmltext2 += "<\/div></div>";
  if (dhtmltext2!="") {
   document.getElementById("pony_dhtml_imgtext").innerHTML = dhtmltext2;
  }

  if (pg_disableclick==1) { 
    divObjContainer.oncontextmenu = function(){return false;}
	divObjWrapper.oncontextmenu = function(){return false;}
	//iframe.oncontextmenu = function(){return false;}
  }
}

function pg_photocontainershut() {
  document.getElementById("pg_photocontainer").style.display = "none";
  var dwrap=document.getElementById('bigImgWrap');
		dwrap.style.visibility='hidden';
		showHideSelect('visible');
}

function openWindow(theURL,winName,features, myWidth, myHeight, isCenter) { 
  if(window.screen)if(isCenter)if(isCenter=="true"){
    var myLeft = (screen.width-myWidth)/2;
    var myTop = (screen.height-myHeight)/2;
    features+=(features!='')?',':'';
    features+=',left='+myLeft+',top='+myTop;
  }
  var pw=window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
  pw.print();
}

function checkEmail(form_name,em_fld){
	if(em_fld=="") em_fld="email";
	var email=eval('document.'+form_name+'.'+em_fld);
	var reg = new RegExp("[0-9a-z_]+@[0-9a-z_^.]+\\.[a-z]", 'i');
	return  (!reg.test(email.value))?false:true;
}

function checkNumber(obj){
	valid="1234567890- (),.";
	tmp="";
	for(i=0;(i<obj.value.length);i++)  {
		if (valid.indexOf(obj.value.charAt(i))!=-1){
			tmp=tmp+obj.value.charAt(i);
		};
	};  
	obj.value=tmp.replace(',', '.');	  
}

var totalErr=new Array();
function checkField(obj, type, id){
	var errDiv=document.getElementById('errMess'+id);
	var totalErrDiv=document.getElementById('formMessage');
	var err=0;
	var errMsg='Это поле должно быть заполнено!';
	var button=document.getElementById('Submit');
	switch(type){
		case 'integer':
		case 'phone':
		case 'float': checkNumber(obj); break;
		case 'email': if(!checkEmail(obj.form.name, obj.name)){err++; errMsg='Введенный E-mail неверен!';} break;
	}
	if(obj.value.length==0 || err>0){
		obj.style.backgroundColor='yellow';
		errDiv.style.display='block';
		errDiv.innerHTML='<span style="color:red">'+errMsg+'</span>';
		totalErr[obj.name]=1;
	}else{
		obj.style.backgroundColor='';
		errDiv.style.display='none';
		errDiv.innerHTML='';
		totalErr[obj.name]=0;
	}
	var i=errCount=0;
	for(var key in totalErr){
		if(totalErr[key]==1) errCount++;
	}
	button.disabled=(errCount>0)?true:false;
	if(errCount>0){
		totalErrDiv.style.display='block';
		totalErrDiv.innerHTML='<span style="color:red">Не заполнены обязательные поля</span>';
		//<span style="color:green">Все обязательные поля заполнены. Данные можно отправлять.</span>
		return false;
	}else{
		totalErrDiv.style.display='none';
		return true;
	}
}

function checkForm(f, id, name, type){
	var error=0;
	var errmess="";
	var id1= new Array;
	var name1=new Array;
	var errDiv=document.getElementById('formMessage');
	id1=id;
	name1=name;
	for (var i=0; i<id1.length; i++){ 
		if(!checkField(document.getElementById(id1[i]), type[i], id1[i].replace('field', '')))error++;
	}
	if(error!=0){	
		errDiv.innerHTML='<span style="color:red">Не заполнены обязательные поля!</span>';
		return false;
	}else{
		errDiv.innerHTML='';
		sendData(f);
		return true;
	}
}

function checkLogin(f){
	if(f.user.value!='' && f.user.value!='логин' && f.password.value!='' && f.password.value!='пароль'){
		return true;
	}else{
		f.reset()
		alert('Укажите логин и пароль!');
		return false;
	}
}

function time(){
	var time=document.getElementById("timewrop");
	var vr=new Date();
	hour=(vr.getHours()<10)?'0'+vr.getHours():vr.getHours();
	minute=(vr.getMinutes()<10)?'0'+vr.getMinutes():vr.getMinutes();
	second=(vr.getSeconds()<10)?'0'+vr.getSeconds():vr.getSeconds();
	time.innerText=hour+":"+minute+":"+second; 
	setTimeout("time()",1000)
}

function searchWord(obj, text){
	if(obj.value=='')obj.value='наберите слово для поиска'; 
}

function searchWord1(obj, text){
	if(obj.value=="наберите слово для поиска"){
		obj.value='';
		return false;
	}else{
		obj.value=text;
		return true;
	}
}

function searcSubmit(obj){
	return (obj.value=="наберите слово для поиска")?false:true;
}

function setID(id){
	$('#currid').val(id);
	$.ajaxSetup({cache: false});
	$.get('/linkcode.php', { 'id': id, 'mode':'title' }, function (data){ document.title=data; });
	$('#block_comment').html('<img src="/images/loading.gif" align=left>&nbsp; Идет загрузка...');
	$.get('/modules/comments.php', { 'id': id }, function (data){ $('#block_comment').html(data); });
	$.get('/linkcode.php', { 'id': id, 'mode':'comments' }, function (data){ $('#a_comments').text(data); });
	if($('#showlink').css('display')=='block'){
		$('#showlink').slideUp('normal');
		$('#videocode').text('Получить код');
		$('#videolink').text('Прямая ссылка');
	}
}

function getLink(){
	var videoID=$('#currid').val();
	$('#videolink').blur();
	$.ajaxSetup({cache: false});
	$.get('/linkcode.php', { 'id': videoID, 'mode':'link' }, function (data){ $('#showlink').html(data); });
	$('#showlink').slideToggle('fast', function(){
		var txt=($('#showlink').css('display')=='none')?'Прямая ссылка':'Скрыть';
		$('#videolink').text(txt);
		$('#videocode').text('Получить код');	
	});
}

function getCode(){
	var videoID=$('#currid').val(); 
	$.ajaxSetup({cache: false});
	$.get('/linkcode.php', { 'id': videoID, 'mode':'code' }, function (data){ $('#showlink').html(data); });
	$('#videocode').blur();
	$('#showlink').slideToggle('fast', function(){
		var txt=($('#showlink').css('display')=='none')?'Получить код':'Скрыть';
		$('#videocode').text(txt);
		$('#videolink').text('Прямая ссылка');
	});
}

function sendComment(){ 
	var rnd_no = Math.floor(Math.random());
	var bodyObj = document.getElementById('comments_list');
    divObjContainer = document.createElement("div");
    divObjContainer.setAttribute("id", "last_comment"+rnd_no);
    bodyObj.appendChild(divObjContainer);
	$.ajaxSetup({cache: false});
	$('#alert_area').hide('fast');
	$('#alert_area').html('');
	$.post('/modules/comments.php', {'show_comments':1, 'show_comments_list':1, 'id':document.addcomm.id.value, 'MM_insert':'addcomm', 'text':document.addcomm.text.value, 'rating':$('#rating').val(), 'ip':document.addcomm.ip.value, 'pagepath':document.addcomm.pagepath.value, 'securityCode':document.addcomm.securityCode.value }, function (data){ $('#last_comment'+rnd_no).append(data); $('#last_comment'+rnd_no).effect("pulsate", { times:2 }, 500);});

	document.addcomm.reset();
}

function show_alert(txt){
	$('#alert_area').html(txt);
	$('#alert_area').slideUp('fast');
	$('#alert_area').effect("pulsate", { times:5 }, 200);
	setTimeout("$('#alert_area').fadeOut('slow')", 5000);
}

function editComment(id){
	$.post('/modules/comments.php', {'edit_comment':1, 'show_comments_list':1, 'id':id}, function(data){ $('#commenttext'+id).html(data)});
}

function saveComment(id){
	$('#commenttext'+id).prepend('<img src="/images/loading.gif" align=left>&nbsp; Пожалуйста, подождите...<br>');
	$.post('/modules/comments.php', {'update_comment':1, 'show_comments_list':1, 'id':id, 'text':$('#textcomment'+id).val()}, function(data){ $('#commenttext'+id).html(data)});
}

function unsaveComment(id){
	$.post('/modules/comments.php', {'get_comment':1, 'show_comments_list':1, 'id':id}, function(data){ $('#commenttext'+id).html(data)});
}

function delComment(id){
	$('#alert'+id).html('Уверены, что хотите удалить именно этот комментарий? <input class="button" type=button onclick="deleteComment('+id+')" value="Да"> &nbsp;&nbsp;<input class="button" type=button onclick="undeleteComment('+id+')" value="Нет">');
	$('#alert'+id).slideDown('fast');
}

function deleteComment(id){
	$.post('/modules/comments.php', {'del_comment':1, 'id':id}, function(data){$('#commenttext'+id).html(data)});
	$('#comment'+id).slideUp('fast');
}

function undeleteComment(id){
	$('#alert'+id).slideUp('fast');
}