	$(document).ready(function() {
		/*$(".img_hover").hover(
			function(){
				$(this).animate(
					{
						width:'400',
						height:'300'
					},
					130
				);
			},
			function(){
				$(this).animate(
					{
						width:'136',
						height:'102'
					},
					130
				);
			}
		);*/
    });

var get = function(id) { return document.getElementById(id); }

document.onkeydown = function cmsSwitch(event)
{
    if (!document.getElementById) 
      return;
	if (window.event) 
      event = window.event; 
	
	if (event.ctrlKey){ 
		var key = (event.keyCode ? event.keyCode : (event.which ? event.which : null) ); 
		if (!key) 
         return; 

		var link = null; 
		if (key == 37) 
			link = get('next_page'); 
		else if (key == 39) 
			link = get('previous_page'); 
		if (link && link.href) 
			document.location = link.href; 
	}else{
		switch (event.keyCode) {
			case 120: window.open('/'); break;
			case 123: document.location.href = admin_uri; break;
		}
	}
}
function zoom(src, w, h, link) {
	var z_window = window.open(src, z_window, 'left=' + ((screen.width - w)/2) + ',top=' + ((screen.height - h)/2 - 50) + ',width=' + (w+20) + ',height=' + (h+20) + ',scrollbars=1');
	z_window.focus();
}

// Выводим картинку со стрелочками для перелистывания
function zoom2(src, w, h, link, dop_img, prefix) {
	//alert(dop_img);
	var z_window = window.open('about:blank', z_window, 'left=' + ((screen.width - w)/2) + ',top=' + ((screen.height - h)/2 - 50) + ',width=' + (w+20) + ',height=' + (h+20) + ',scrollbars=1');
	var img_array = dop_img.split('<#>');
	var dop_src = new Array();
	var dop_src_num = 0;
	var img_array_nums = img_array.length;
	//alert(img_array_nums);
	for (var i=0; i<img_array_nums; i++) {
		dop_src[i] = prefix+img_array[i];
		//alert('dop_src['+i+']: '+dop_src[i]+' src: '+src);
		if (dop_src[i] == src) {
			//alert(i);
			dop_src_num = i;
		}
	}
	var k = dop_src_num-1;
	var k1 = dop_src_num+1;
	z_window.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Zoom</title><style>a{color: #3B90F1;} a:hover{color: #EF7A0D; text-decoration: none;}</style></head><body style="margin:0px;"');
	z_window.document.write('<table width="100%" height="100%"><tr><td align="center" valign="center"><div>');
	//alert(dop_src_num+' - '+k);
	if (dop_src_num != 0) {
		z_window.document.write('<span onclick="window.close(); alert(\'1\'); window.zoom2(\''+dop_src[k]+'\', 800, 600, \'\', \''+dop_img+'\', \''+prefix+'\'); alert(\'2\');"><img src="/templates/images/bg/paging-larr.gif" border="0"> <a href="#">назад</a></span>');
	}
	if (dop_src_num < img_array_nums-1) {
		//alert(dop_src_num);
		z_window.document.write('<span onclick="var w=window.opener; w.zoom2(\''+dop_src[k1]+'\', 800, 600, \'\', \''+dop_img+'\', \''+prefix+'\');" style="margin-left: 15px;"><a href="#">вперед</a> <img src="/templates/images/bg/paging-rarr.gif" border="0"></span>');
	}
	z_window.document.write('</div><div><img id="loading" src="/templates/images/load.gif" style="margin-top: 200px;"><img src="' + src + '" style="display: none;" onload="this.style.display=\'\'; document.getElementById(\'loading\').style.display=\'none\';"></div>');
	z_window.document.write('</td></tr></table></body></html>');
	z_window.focus();
}

function PopUp(url) {
	var w = 868;
	var h = 800;
	var z_window = window.open(url, z_window, 'left=' + ((screen.width - w)/2) + ',top=' + ((screen.height - h)/2 - 50) + ',width=' + (w+20) + ',height=' + (h+80));
	z_window.focus();
}

//////////////////// это добавил верстальщик
function txt (id) {
	if (img_tag = document.getElementById(id)) {
		img_tag = document.getElementById(id);
		img_tag.value = '';
	} 
}

function psw (id) {
	if (tag = document.getElementById(id)) {
		tag = document.getElementById(id);
		tag.type = 'password';
		tag.value = '';
	} 
}

function ch_icon_on (id) {
	if (tag = document.getElementById(id)) {
		tag = document.getElementById(id);
		tag.src = '/templates/images/disc2.gif';
	}
}

function ch_icon (id) {
	if (tag = document.getElementById(id)) {
		tag = document.getElementById(id);
		tag.src = '/templates/images/disc.gif';
		}
}

function search_page(page) {

//	window.page = page;
	document.getElementById('page').value = page;
	//$('#page').attr('value',page);
	document.getElementById('qwe').submit();

	//window.alert(document.getElementById('page').value);
	//window.alert($('#page').attr('value');

	//window.alert(document.getElementById('qwe').method);
/*
	document.forms['qwe'].submit();
	document.getElementById('qwe').submit();
	document.forms[0].submit();
*/
}
