/*function screenSize() {      var w, h;      w = (window.innerWidth ? window.innerWidth : (document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.offsetWidth));      h = (window.innerHeight ? window.innerHeight : (document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.offsetHeight));      return {w:w, h:h};}enablePortfolioScroll = true;current_item = 0;element_width = 811;items = [];sectionItems = [];var sliderSetted = false;var arrow_width = 0;function setupSlider() {	if (sliderSetted) return;	var screenSz = screenSize();	var items = $('#portfolio_slider').find('.imga');	$('#portfolio_slider').find('.s_center').width(815 * items.length);	arrow_width = (screenSz.w - 806 - 10) / 2 - 10;	$('#portfolio_slider').find('.s_center').css('marginLeft', arrow_width + 2);	$('#portfolio_slider').find('.s_left').width(arrow_width + 2);	$('#portfolio_slider').find('.s_right').width(arrow_width + 1);	sliderSetted = true;}*/$(document).ready(function() {	$('#jobList a').click(function() {		if ($(this).parent().hasClass('opened')) return;		var me = this;		$(this).parent().parent().find('.details').slideUp();		$(this).parent().parent().find('li').removeClass('opened');		$(this).parent().addClass('opened');		$(this).next().next().slideDown();	});	$("select").uniform();	/*var screenSz = screenSize();	var arrow_width = (screenSz.w - 806 - 10) / 2 - 10;	setupSlider();	var arrow_anim_speed = 100;	var arrow_anim_width = 40;	var arrows = ['.s_left', '.s_right'];		for (var i = 0; i < arrows.length; i++) {		$('#portfolio_slider').find(arrows[i]).mouseenter(function() {			$(this).animate({				width: '+=' + arrow_anim_width			}, arrow_anim_speed);			$(this).find('.red').show();			$(this).find('.white').show();		});		$('#portfolio_slider').find(arrows[i]).mouseleave(function() {			$(this).animate({				width: '-=' + arrow_anim_width			}, arrow_anim_speed);			$(this).find('.red').hide();			$(this).find('.white').hide();		});	}	//Переход по хешу	if (window.location.hash) {		var hashID = window.location.hash.replace('#', '');		portfolioScrollToID(hashID);		setPortfolioTexts();		loadItem(hashID);	}*/});/*function loadItem(item_id) {	enablePortfolioScroll = false;	$.get('/portfolio/loader/' + item_id + '/', function(data) {		$('#portfolio_item_holder').html(data);		enablePortfolioScroll = true;		//document.title = 'Стилистика :: ' + $('.workarea').find('h1').first().html();	});}var addingSectionFront = 0;var addingSectionEnd = 0;var addedFront = 0;function setPortfolioTexts() {	var container = $('#portfolio_slider').find('.s_center');	if (current_item >= items.length - 2) {		var img = $(sectionItems[addingSectionEnd]).clone(true);		$(img).find('img').attr('src', portfolio_items[addingSectionEnd + addedFront].img);		portfolio_items.push(portfolio_items[addingSectionEnd + addedFront]);		addingSectionEnd++;		if (addingSectionEnd >= sectionItems.length - 1) {			addingSectionEnd = 0;		}		$(container).width($(container).width() + element_width);		$(img).appendTo(container);		items = $(container).find('.imga');	}		if (current_item <= 2) {		var img = $(sectionItems[sectionItems.length - addingSectionFront - 1]).clone(true);		portfolio_items.splice(0, 0, portfolio_items[addedFront + sectionItems.length - addingSectionFront - 1]);		addedFront++;		addingSectionFront++;		if (addingSectionFront == sectionItems.length) {			addingSectionFront = 0;		}		$(container).width($(container).width() + element_width);		$(container).css('marginLeft', $(container).offset().left - element_width);		$(img).appendTo(container);		items = $(container).find('.imga');		current_item++;		for (var x = current_item + 1; x >= 0; x--) {			$(items[x]).find('img').attr('src', portfolio_items[x].img);		}		$('#portfolio_slider').find('.s_left .white').html(portfolio_items[current_item - 1].name);	}		if (current_item < items.length - 1) {		$('#portfolio_slider').find('.s_right .white').html(portfolio_items[current_item + 1].name);	}	//console.log(portfolio_items[current_item - 1].name);	if (current_item > 0) {		$('#portfolio_slider').find('.s_left .white').html(portfolio_items[current_item - 1].name);	}}var scrolled = false;var enabled = false;var runScrollID = null;function portfolioScrollToID(item_id) {	//if (scrolled) return;	if (!enabled) {		runScrollID = item_id;		return;	}	scrolled = true;	setupSlider();	var scrollOffset = 0;	for (var i = 0; i < portfolio_items.length; i++) {		current_item = i;		if (portfolio_items[i].id == item_id) break;		scrollOffset = scrollOffset + element_width;	}	scrollOffset -= 2;	$('.supa_slider').find('.s_center').css('marginLeft', arrow_width - scrollOffset);	$(items[current_item]).find('img').attr('src', portfolio_items[current_item].img);	if (current_item > 0) {		$(items[current_item - 1]).find('img').attr('src', portfolio_items[current_item - 1].img);	}	if (current_item < portfolio_items.length - 1) {		$(items[current_item + 1]).find('img').attr('src', portfolio_items[current_item + 1].img);	}	if (current_item < portfolio_items.length - 2) {		$(items[current_item + 2]).find('img').attr('src', portfolio_items[current_item + 1].img);	}	setPortfolioTexts();}function enablePortfolioSlider() {	items = $('#portfolio_slider').find('.imga');	for (var i = 0; i < items.length; i++) {		sectionItems.push($(items[i]).clone(true));	}	$('#portfolio_slider').find('.s_right .white').html(portfolio_items[current_item + 1].name);	if (current_item > 0) {		$('#portfolio_slider').find('.s_left .white').html(portfolio_items[current_item - 1].name);	}		$('#portfolio_slider').find('.s_right').click(function() {		if (!enablePortfolioScroll) return;		if (current_item < items.length - 1) {			current_item++;			loadItem(portfolio_items[current_item].id);			window.location.hash = portfolio_items[current_item].id;			//Прелоадим картинки			if (current_item < items.length) {				$(items[current_item]).find('img').attr('src', portfolio_items[current_item].img);			}			if (current_item < items.length - 1) {				$(items[current_item + 1]).find('img').attr('src', portfolio_items[current_item + 1].img);			}			setPortfolioTexts();			$('.supa_slider').find('.s_center').animate({				'marginLeft': '-=' + element_width			});		}	});	$('#portfolio_slider').find('.s_left').click(function() {		if (!enablePortfolioScroll) return;		if (current_item > 0) {			current_item--;			loadItem(portfolio_items[current_item].id);			window.location.hash = portfolio_items[current_item].id;			//Прелоадинг			if (current_item >= 0) {				$(items[current_item]).find('img').attr('src', portfolio_items[current_item].img);			}			if (current_item >= 1) {				$(items[current_item - 1]).find('img').attr('src', portfolio_items[current_item - 1].img);			}			setPortfolioTexts();			$('.supa_slider').find('.s_center').animate({				'marginLeft': '+=' + element_width			});		}	});	enabled = true;	if (runScrollID != null) {		portfolioScrollToId(runScrollID);	}	setPortfolioTexts();}*/var curSectPage = 1;var noMoreSectItems = false;function loadPortfolioSection(sectcode) {	if (noMoreSectItems) return;	curSectPage++;	$.get('/portfolio/sectionloader/' + sectcode + '/', {			page: curSectPage		}, function(data) {			$('#portfolio_items_holder').append(data);			var sect_end = $('#portfolio_section_end');			if (sect_end.length > 0) {				noMoreSectItems = true;				$('.look_more').hide();			}		}	);}var curArticlePage = 1;var noMoreArticleItems = false;function loadArticles() {	if (noMoreArticleItems) return;	curArticlePage++;	$.get('/articles/loader.php', {			page: curArticlePage		}, function(data) {			$('.article_list').append(data);			var art_end = $('#articles_end');			if (art_end.length > 0) {				noMoreArticleItems = true;				$('.look_more').hide();			}		}	);}window.sliderPrepared = false;function portfolioScrollToID(id) {	if (!window.sliderPrepared) {		window.scrollToId = id;		window.needToScroll = true;	}}
