d = document;
opera = (navigator.userAgent.indexOf('Opera') >= 0)? true : false;
ie = (document.all && !opera)? true : false;
dom = (document.getElementById && !ie && !opera)? true : false;

var opn;

if (dom || ie)
{
        d.writeln('<STYLE type="text/css">');
        d.writeln('.subcat { display: none; }');
        d.writeln('</STYLE>');
}

function zoom(gal,wid,hei)
{
var n1=parseInt(wid);
var n2=parseInt(hei);
var wid2 = n1+5;
var hei2 = n2+10;
window.open(gal, 'gellery', "scrollbars=0,resizable=no,left=0,top=0,width="+wid2+",height="+hei2);
}

function foto(title, img, width, height, pr) {
	var width=(width ? width : 800);
	var height=(height ? height : 600);
	var win=window.open('', '_blank', 'width='+width+', height='+height+', left='+((screen.width-width)/2)+', top='+((screen.height-height)/2)+', toolbar=no, menubar=no, resizable=yes, status=yes, location=no, alwaysRaised=yes, scrollbars=no');
	win.document.write('<html><head><title>'+title+'</title></head><body marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" rightmargin="0"><table width="100%" cellpadding="0" cellspacing="0" border="0" height="100%"><tr><td width="100%" align="center"><img src="/'+img+'" border="0" style="border:1px solid #bbbbbb;"></td></tr></table></body></html>');
}


function prn() {
var texthtml = document.getElementById("prn").innerHTML;
  myWin= open("", "displayWindow", "width=700,height=500,status=yes,toolbar=yes,scrolling=yes,menubar=yes,scrollbars=yes,resizable=yes");
  myWin.document.open();  
  myWin.document.write("<HTML><HEAD><title>Версия для печати</title><meta http-equiv='Content-Type' content='text/html; charset=windows-1251'>");
  myWin.document.write("<meta name='description' content=''><meta name='keywords' content=''><meta name='robots' content='index, follow'>");
  myWin.document.write("<link rel=stylesheet href='/css/site.css' type='text/css'></HEAD>");
  myWin.document.write("<BODY>"+texthtml);
  myWin.document.write("<script>document.getElementById('lk').style.display = 'none';document.getElementById('model').style.display = 'none';</script>");
  myWin.document.write("</BODY></HTML>");
  myWin.document.close(); 
}

function prndoc() {
var texthtml = document.getElementById("prn").innerHTML;
  myWin= open("", "displayWindow", "width=700,height=500,status=yes,toolbar=yes,scrolling=yes,menubar=yes,scrollbars=yes,resizable=yes");
  myWin.document.open();  
  myWin.document.write("<HTML><HEAD><title>Версия для печати</title><meta http-equiv='Content-Type' content='text/html; charset=windows-1251'>");
  myWin.document.write("<meta name='description' content=''><meta name='keywords' content=''><meta name='robots' content='index, follow'>");
  myWin.document.write("<link rel=stylesheet href='/css/site.css' type='text/css'></HEAD>");
  myWin.document.write("<BODY>"+texthtml);
  myWin.document.write("<script>document.getElementById('lk').style.display = 'none';</script>");
  myWin.document.write("</BODY></HTML>");
  myWin.document.close(); 
}

function vz(id) {
document.getElementById(id).style.display = 'block';
}
function vzn(id) {
document.getElementById(id).style.display = 'none';
}

function sh(id){ 
$("#"+id).slideToggle("fast"); 
}


function viev() {

} 

function getOffsetRect(elem) {
    var box = elem.getBoundingClientRect()
    var body = document.body
    var docElem = document.documentElement
    var scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop
    var scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft
    var clientTop = docElem.clientTop || body.clientTop || 0
    var clientLeft = docElem.clientLeft || body.clientLeft || 0
    var top  = box.top +  scrollTop - clientTop
    var left = box.left + scrollLeft - clientLeft
    return { top: Math.round(top), left: Math.round(left) }
}

function subm(){
$(':checkbox[name=usl]').each(function(){ if (this.checked == true){$('#btn_reg').attr("disabled","");} else {$('#btn_reg').attr("disabled","disabled");} });
}

$(document).ready(function() {

	$('#resume .add-rez').click(function() {
		var table = this.parentNode.parentNode.parentNode.parentNode
		var tr = $("tbody tr:last-child", table).get(0)
		tr.parentNode.insertBefore(tr.cloneNode(true), tr);
		return false
	});


	$('#slider').s3Slider({
	        timeOut: 3000
	});


});

var cop1=0;
function copyr() {
if (!cop1) {window.alert('Использование информации с сайта\n\nтолько при наличии ссылки на www.penza-gorod.ru'); cop1=1; return true;}
}


function printprew() {

var texthtml = $(".content").html();

  myWin= open("", "displayWindow", "width=700,height=500,status=yes,toolbar=yes,scrolling=yes,menubar=yes,scrollbars=yes,resizable=yes");
  myWin.document.open();  
  myWin.document.write("<HTML><HEAD><title>Версия для печати</title><meta http-equiv='Content-Type' content='text/html; charset=windows-1251'>");
  myWin.document.write("<meta name='description' content=''><meta name='keywords' content=''><meta name='robots' content='index, follow'>");
  myWin.document.write("</HEAD>");
  myWin.document.write("<style>");
  myWin.document.write(".brad { display:none; }");
  myWin.document.write(".poll { display:none; }");
  myWin.document.write(".printprew2 { display:none; }");
  myWin.document.write(".submenu1 { display:none; }");
  myWin.document.write("</style>");
  myWin.document.write("<BODY><div class=printprew><div><img src='/images/logoprint2.jpg'></div>"+texthtml+"</div>");
  myWin.document.write("");
  myWin.document.write("</BODY></HTML>");
  myWin.document.close(); 


}


//Carousel

function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });
 
    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });
 
    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};
 
jQuery(document).ready(function() {

    jQuery('#mycarousel').jcarousel({
		visible: 1,
		scroll:1,
        auto: 2,
        wrap: 'last',
        initCallback: mycarousel_initCallback
    });

    	resize_ie6();


});


//Date

	$(function() {
		$("#datepicker").datepicker({
			onSelect: function(date) {
				top.window.location = "/news.html?date="+date+"";
			},
			onChangeMonthYear: function(year, month) {
			}
		});
	});



function resize_ie6()
{

//alert($.browser.version);

	if (($.browser.msie) && (($.browser.version == '6.0') || ($.browser.version == '5.8'))) {
	
	var res = parseInt($('body').width());

//*_width:expression(body.clientWidth>970?(body.clientWidth>1440?"1440":"100%"):"970px");*/ 

	if (res>1440){
	$('#container1').width('1440');
	//alert(1);	
	}else{

		if (res>970){
		$('#container1').width('100%');
		//alert(2);
		}else{
		$('#container1').width('970');
		//alert(3);
		}

	}
	
	}

}

$(window).resize(function() {resize_ie6();});




















