$(document).ready(function(){
  $('a[id^=comment]').click(function(){
  	$('.edit_form').css('display', 'none');
    $('#quick').load('/files/comment.php');
  });
});
$(document).ready(function(){
  $('a[id^=replay_]').click(function(){
 	$('.edit_form').css('display', 'none');
    $('#q_'+this.id).load('/files/comment.php?replay='+this.id);
  });
});
$(document).ready(function(){
  $('a[id^=edit_comm_]').click(function(){
  	$('.edit_form').css('display', 'none');
    $('#comment_'+this.id).load('/files/comment.php?edit_com='+this.id);
  });
});
$(document).ready(function(){
  $('a[id^=editphoto_comm_]').click(function(){
  	$('.edit_form').css('display', 'none');
    $('#comment_'+this.id).load('/files/comment.php?editphoto_com='+this.id);
  });
});

$(document).ready(function(){
  $('a[id^=editart_comm_]').click(function(){
  	$('.edit_form').css('display', 'none');
    $('#comment_'+this.id).load('/files/comment.php?editart_com='+this.id);
  });
});

$(document).ready(function(){
  $('a[id^=delete_comm_]').click(function(){
  	$('.edit_form').css('display', 'none');
    $('#delete_'+this.id).load('/files/comment.php?delete_com='+this.id);
  });
});
$(document).ready(function(){
  $('a[id^=section]').click(function(){
  	$('#section_block').load('/files/mblock_bottom.php?block=1');
    $('#main_info_block').load('/files/mblock.php?iblock=1');
  });
});
$(document).ready(function(){
  $('a[id^=image]').click(function(){
  	$('#section_block').load('/files/mblock_bottom.php?block=2');
    $('#main_info_block').load('/files/mblock.php?iblock=2');
  });
});
$(document).ready(function(){
  $('select[id^=contry]').change(function(){
  	$('select#sity').load('/files/sity.php?idc='+document.getElementById('contry').value);
  });
});
$(document).ready(function(){
  $('a[id^=smile_up]').click(function(){
  	$('#mnenie').css('display', 'none');
  	$('#smiles').load('/files/ratings_na.php?mod=news&id='+document.getElementById('na_id').value+'&userid='+document.getElementById('uid').value+'&rating=1');
  });
});
$(document).ready(function(){
  $('a[id^=smile_down]').click(function(){
  	$('#mnenie').css('display', 'none');
  	$('#smiles').load('/files/ratings_na.php?mod=news&id='+document.getElementById('na_id').value+'&userid='+document.getElementById('uid').value+'&rating=-1');
  });
});


$(document).ready(function(){
  $('a[id^=smileart_up]').click(function(){
  	$('#mnenie').css('display', 'none');
  	$('#smiles').load('/files/ratings_na.php?mod=art&id='+document.getElementById('na_id').value+'&userid='+document.getElementById('uid').value+'&rating=1');
  });
});
$(document).ready(function(){
  $('a[id^=smileart_down]').click(function(){
  	$('#mnenie').css('display', 'none');
  	$('#smiles').load('/files/ratings_na.php?mod=art&id='+document.getElementById('na_id').value+'&userid='+document.getElementById('uid').value+'&rating=-1');
  });
});


$(document).ready(function(){
  $('a[id^=smileph_up]').click(function(){
  	$('#mnenie').css('display', 'none');
  	$('#smiles').load('/files/ratings_na.php?mod=photo&id='+document.getElementById('na_id').value+'&userid='+document.getElementById('uid').value+'&rating=1');
  });
});
$(document).ready(function(){
  $('a[id^=smileph_down]').click(function(){
  	$('#mnenie').css('display', 'none');
  	$('#smiles').load('/files/ratings_na.php?mod=photo&id='+document.getElementById('na_id').value+'&userid='+document.getElementById('uid').value+'&rating=-1');
  });
});

$(document).ready(function(){
  $('a[id^=cat_]').click(function(){
  	$('#cat').load('/files/change_cat.php?sub='+this.id);
  	$('#sub').load('/files/sub_cat.php?cat='+this.id);
  });
});



$(document).ready(function(){
  $('select[id^=tps]').change(function(){
  	if(document.getElementById('rule').checked == true && document.getElementById('tps').value != '')
  	{
  		$('#typephoto').css('display', 'block');
  		$('#typephoto').load('/files/typeinput.php?type='+document.getElementById('tps').value);
  	}
  	else
  	{
  		$('#typephoto').css('display', 'none');
  	}
  });
});
$(document).ready(function(){
  $('input[id^=rule]').change(function(){
  	if(document.getElementById('rule').checked == true && document.getElementById('tps').value != '')
  	{
  		$('#typephoto').css('display', 'block');
  		$('#typephoto').load('/files/typeinput.php?type='+document.getElementById('tps').value);
  	}
  	else
  	{
  		$('#typephoto').css('display', 'none');
  	}
  });
});



$(document).ready(function(){
  $('select[id^=cat_]').change(function(){
  	$('#sub_'+this.id).load('/files/subcat.php?cat='+document.getElementById(this.id).value+'&photo='+this.id);
  	$('#last_sub'+this.id).css('display', 'none');
  });
});
$(document).ready(function(){
  $('select[id^=subcat_]').change(function(){
  	$('#last_'+this.id).css('display', '');
  	$('#last_'+this.id).load('/files/lastcat.php?sub='+document.getElementById(this.id).value+'&photo='+this.id);
  });
});
$(document).ready(function(){
  $('a[id^=ok_]').click(function(){
  	$('#panel_'+this.id).load('/files/check_panel.php?ok=yes&id='+this.id);
  	$('#message_edit_no_'+this.id).css('display', 'none');
  });
});
$(document).ready(function(){
  $('a[id^=no_ok_]').click(function(){
  	$('#message_edit_'+this.id).load('/files/check_panel.php?ok=no&id='+this.id);
  });
});
$(document).ready(function(){
  $('a[id^=edit_no_ok_]').click(function(){
  	$('#message_'+this.id).load('/files/check_panel.php?ok=noedit&id='+this.id);
  });
});
$(document).ready(function(){
  $('a[id^=del_no_ok_]').click(function(){
  	idd = this.id.substring(4);
  	$('#message_edit_'+idd).load('/files/check_panel.php?ok=nodel&id='+this.id);
  });
});
$(document).ready(function(){
  $('a[id^=mod_no_ok_]').click(function(){
  	idd = this.id.substring(4);
  	$('#message_edit_'+idd).load('/files/check_panel.php?ok=nomod&id='+this.id);
  });
});
$(document).ready(function(){
  $('input[id^=plus_]').click(function(){
  	$('#tagsformtag_'+this.id).load('/files/tags.php?add='+encodeURIComponent(document.getElementById('tag_'+this.id).value)+'&photo='+document.getElementById('photoidtag_'+this.id).value);
  	$('#tag_'+this.id).val('');
  });
});

$(document).ready(function(){
  $('input[id^=tag_plus_]').keypress(function(e){
  	if (e.which == 13){
        $('#tagsform'+this.id).load('/files/tags.php?add='+encodeURIComponent(document.getElementById(this.id).value)+'&photo='+document.getElementById('photoid'+this.id).value);
        $('#'+this.id).val('');
      }
  });
});

$(document).ready(function(){
  $('a[id^=favadd]').click(function(){
  	$('#fav').load('/files/add_fav.php?type='+document.getElementById('type').value+'&id='+document.getElementById('id').value+'&idu='+document.getElementById('idu').value);
  });
});
$(document).ready(function(){
  $('a[id^=deltag_]').click(function(){
  	var tag_str = this.id.split("_");
  	$('#tagsformtag_plus_'+tag_str[1]).load('/files/tags.php?delete='+encodeURIComponent(tag_str[2])+'&photo='+tag_str[1]);
  });
});
