// Подключает скрипт
function include_js($script_src, $script_hash) {
	var script = document.createElement('script');
	script.type = 'text/javascript';
	script.src = script_src + '?hash=' + script_hash;
	//window.script_parent_element.appendChild(script);
	document.getElementsByTagName('head')[0].appendChild(script);  
}

// Подключает css - файл
function include_css(css_src, css_hash) {
	var css = document.createElement('link');
	css.type = 'text/css';
	css.rel = 'stylesheet';
	css.href = css_src + '?hash=' + css_hash;
	//window.script_parent_element.appendChild(css);
	document.getElementsByTagName('head')[0].appendChild(css);
}


function show_info (el, load_container, url) {	
	if($(load_container).is(':visible')){
		hide_info(el, load_container);
	}
	else{
		$(load_container).load(url, '', showNewContent(el, load_container));
	}
}

function hide_info (el, load_container) {
	$(load_container).hide();
	$(el).html('Подробнее...');
}

function showNewContent(el, load_container) {
	$(load_container).show();
	$(el).html('Скрыть подробную информацию');
}

$(document).ready(function(){
	$("a[rel^='prettyPhoto']").prettyPhoto();
	
	$('.click_href').click (function(){
		container = '#'+$(this).attr("id");
		href=$(container).children('.zoom_block').children('.more');
		show_info (href, container+'_load_container', $(href).attr('href')+'#text_content .load_block');
		return false;
	});
});
