

function SetWidth()
{
		var CoWidth = jQuery(window).width()+ 2;
		var CoHeight = jQuery(window).height() + 5;

		//jQuery('.container').width(CoWidth);
		jQuery('.container').height(CoHeight);
}


		

function GetContent(url, content_area)
{
	var url ;
	var content_area;
	

	jQuery.ajax({ 
	  type: "GET",   
	  url: "/ajax/?url=" + url,
	  dataType: "html",
	  cache: false,
	  success: function(response)
	  		  {
				Cufon.replace('.replaced');
				jQuery("#" + content_area).html(response);
				
							
	  		  },
	 error: function (XMLHttpRequest, textStatus, errorThrown)
	 					{
							Cufon.replace('.replaced');
							jQuery("#" + content_area).html(XMLHttpRequest.responseText);
						}
	

	});
	return false;	

}

function SendFeedback()
{

if(!$('#feedback_where').hasClass('invalid') && !$('#feedback_name').hasClass('invalid') && !$('#feedback_message').hasClass('invalid'))
{
	var url = 0 ;
	var content_area = 0;
	 var str = $(".feedback_form").serialize();
	
	jQuery.ajax({ 
	  type: "POST",   
	  url: "/ajax_feedback/",
	  dataType: 'html',
	  data: str,
	  cache: false,
	  success: function(response)
	  		  {
				jQuery(".feedback").hide('slow');
				jQuery(".feedback_sent").show('slow');
				jQuery.jGrowl('Спасибо за сообщение! <br>Если вы оставили хоть какие-то контактные данные, то мы с Вами свяжемся.', { 
						 sticky: false,
						 closer: true
	});			
							
	  		  },
	 error: function (XMLHttpRequest, textStatus, errorThrown)
	 					{
				jQuery.jGrowl('Сообщение не было отправлено. Попробуйте позже...', { 
						 sticky: false,
						 closer: true
	});
		
						}
	

	});
	return false;	

}

}


      jQuery(window).bind('resize', function(e) {
   		
			SetWidth();

      });
	  
	  jQuery(document).ready(function(){	
	
	
	/*
	$('#design-content').jScrollPane({showArrows:true});
	$('#web-design-content').jScrollPane({showArrows:true});
	*/

	
									  
					SetWidth();	
					jQuery(window)._scrollable();
					
	jQuery('.sc__').click(function(){
		var url = jQuery(this).attr('href');
		jQuery.scrollTo(url, 600, {axis:'x'});
		return false;
	});
	
		jQuery('#feedback_sent').click(function(){
				jQuery(".feedback").show('slow');
				jQuery(".feedback_sent").hide('slow');
		return false;
	});
		
	
	jQuery('.aj').click(function(){
		var url = jQuery(this).attr('href');
		var content_area = jQuery(this).attr('aj');
		GetContent(url, content_area);
		return false;
	});
	
	jQuery('.feedback_form').submit(
								function()
								  {
		SendFeedback();
		return false;
	});
	
	jQuery("#loading").bind("ajaxSend", function(){
   jQuery(this).show();
 }).bind("ajaxComplete", function(){
   jQuery(this).hide();
 });

					
					
						});
	  
	 
function inspect(obj, maxLevels, level)
{
  var str = '', type, msg;

    // Start Input Validations
    // Don't touch, we start iterating at level zero
    if(level == null)  level = 0;

    // At least you want to show the first level
    if(maxLevels == null) maxLevels = 1;
    if(maxLevels < 1)     
        return '<font color="red">Error: Levels number must be > 0</font>';

    // We start with a non null object
    if(obj == null)
    return '<font color="red">Error: Object <b>NULL</b></font>';
    // End Input Validations

    // Each Iteration must be indented
    str += '<ul>';

    // Start iterations for all objects in obj
    for(property in obj)
    {
      try
      {
          // Show "property" and "type property"
          type =  typeof(obj[property]);
          str += '<li>(' + type + ') ' + property + 
                 ( (obj[property]==null)?(': <b>null</b>'):('')) + '</li>';

          // We keep iterating if this property is an Object, non null
          // and we are inside the required number of levels
          if((type == 'object') && (obj[property] != null) && (level+1 < maxLevels))
          str += inspect(obj[property], maxLevels, level+1);
      }
      catch(err)
      {
        // Is there some properties in obj we can't access? Print it red.
        if(typeof(err) == 'string') msg = err;
        else if(err.message)        msg = err.message;
        else if(err.description)    msg = err.description;
        else                        msg = 'Unknown';

        str += '<li><font color="red">(Error) ' + property + ': ' + msg +'</font></li>';
      }
    }

      // Close indent
      str += '</ul>';

    return str;
}


hs.graphicsDir = 'javascripts/highslide/graphics/';
hs.outlineType = 'drop-shadow';
hs.captionEval = 'this.a.title';

// Russian language strings
hs.lang = {
	cssDirection: 'ltr',
	loadingText: 'Загружается...',
	loadingTitle: 'Нажмите для отмены',
	focusTitle: 'Нажмите чтобы поместить на передний план',
	fullExpandTitle: 'Развернуть до оригинального размера',
	creditsText: '',
	creditsTitle: '',
	previousText: 'Предыдущее',
	nextText: 'Следующее',
	moveText: '',
	closeText: '<img src="/images/close.png">',
	closeTitle: 'Закрыть (esc)',
	resizeTitle: 'Изменить размер',
	playText: 'Слайдшоу',
	playTitle: 'Начать слайдшоу (пробел)',
	pauseText: 'Пауза',
	pauseTitle: 'Приостановить слайдшоу (пробел)',
	previousTitle: 'Предыдущее (стрелка влево)',
	nextTitle: 'Следующее (стрелка вправо)',
	moveTitle: 'Переместить',
	fullExpandText: 'Оригинальный размер',
	number: 'Изображение %1 из %2',
	restoreTitle: 'Нажмите чтобы закрыть изображение, нажмите и перетащите для изменения местоположения. Для просмотра изображений используйте стрелки.'
};

