// JavaScript Document
jQuery(function()
{
	jQuery('#link_send').click(function()
	{
	jQuery('#buttonchik').slideDown();
	}); 				
});
jQuery(function()
{
	jQuery('#edit_profil_link').click(function()
	{
	jQuery('#edit_profil').slideDown(1000);
	}); 				
});
jQuery(function()
{
	jQuery('#edit_status_link').click(function()
	{
	jQuery('#edit_status').slideDown();
	}); 				
});
  jQuery(function()
{
    jQuery('#add_comment_in_guest').click(function()
    {
    jQuery('#view_add_com').slideDown();
    });                 
});
 jQuery(function()
{
    jQuery('#sending').click(function()
    {
    jQuery('#send_mes').slideDown();
    });                 
});
jQuery(function()
{
    jQuery('#ls').click(function()
    {
    jQuery('#ls1').slideDown();
    });                 
});
jQuery(function()
{
    jQuery('#close').click(function()
    {
    jQuery('#edit_profil').slideUp();
    });                 
});
       jQuery(function()
{
    jQuery('#close11').click(function()
    {
    jQuery('#edit_status').slideUp();
    });                 
});
 jQuery(function()
{
    jQuery('#close12').click(function()
    {
    jQuery('#view_add_com').slideUp();
    });                 
});
    jQuery(function()
{
    jQuery('#close13').click(function()
    {
    jQuery('#send_mes').slideUp();
    });                 
});
jQuery(function()
{
    jQuery('#close14').click(function()
    {
    jQuery('#ls1').slideUp();
    });                 
});
(function() {

  jQuery.keyboardLayout = {};

  jQuery.keyboardLayout.indicator = $('<span class="keyboardLayout" />');

  jQuery.keyboardLayout.target;

  jQuery.keyboardLayout.layout;

  jQuery.keyboardLayout.show = function(layout){
    this.layout = layout;
    this.indicator.text(layout);
    this.target.after(this.indicator);
  };

  jQuery.keyboardLayout.hide = function(){
    this.target = null;
    this.layout = null;
    this.indicator.remove();
  };

  jQuery.fn.keyboardLayout = function()
  {
    this.each(function(){

      $(this).focus(function(){
        jQuery.keyboardLayout.target = $(this);
      });

      $(this).blur(function(){
        jQuery.keyboardLayout.hide();
      });

      $(this).keypress(function(e){
        var c = (e.charCode == undefined ? e.keyCode : e.charCode);
        var layout = jQuery.keyboardLayout.layout;
        if (c >= 97/*a*/  && c <= 122/*z*/ && !e.shiftKey ||
            c >= 65/*A*/  && c <= 90/*Z*/  &&  e.shiftKey ||
             (c == 91/*[*/  && !e.shiftKey ||
              c == 93/*]*/  && !e.shiftKey ||
              c == 123/*{*/ &&  e.shiftKey ||
              c == 125/*}*/ &&  e.shiftKey ||
              c == 96/*`*/  && !e.shiftKey ||
              c == 126/*~*/ &&  e.shiftKey ||
              c == 64/*@*/  &&  e.shiftKey ||
              c == 35/*#*/  &&  e.shiftKey ||
              c == 36/*$*/  &&  e.shiftKey ||
              c == 94/*^*/  &&  e.shiftKey ||
              c == 38/*&*/  &&  e.shiftKey ||
              c == 59/*;*/  && !e.shiftKey ||
              c == 39/*'*/  && !e.shiftKey ||
              c == 44/*,*/  && !e.shiftKey ||
              c == 60/*<*/  &&  e.shiftKey ||
              c == 62/*>*/  &&  e.shiftKey) && layout != 'EN') {

          layout = 'en';

        } else if (c >= 65/*A*/ && c <= 90/*Z*/  && !e.shiftKey ||
                   c >= 97/*a*/ && c <= 122/*z*/ &&  e.shiftKey) {

          layout = 'EN';

        } else if (c >= 1072/*à*/ && c <= 1103/*ÿ*/ && !e.shiftKey ||
                   c >= 1040/*À*/ && c <= 1071/*ß*/ &&  e.shiftKey ||
                   (c == 1105/*¸*/ && !e.shiftKey ||
                    c == 1025/*¨*/ &&  e.shiftKey ||
                    c == 8470/*¹*/ &&  e.shiftKey ||
                    c == 59/*;*/   &&  e.shiftKey ||
                    c == 44/*,*/   &&  e.shiftKey) && layout != 'RU') {

          layout = 'ru';

        } else if (c >= 1040/*À*/ && c <= 1071/*ß*/ && !e.shiftKey ||
                   c >= 1072/*à*/ && c <= 1103/*ÿ*/ &&  e.shiftKey) {

          layout = 'RU';

        }
        if (layout) {
            jQuery.keyboardLayout.show(layout);
        }
      });
    });
  };

})();
