
function doSomething() {
	var minw = $('.header_title').innerWidth();
	$('.HeaderTitle').css({});
	// alert(minw);
	if(minw > '600') { $('.HeaderTitle').css({'font-size': '90px', 'line-height' : '80px'}); } 
	else { $('.HeaderTitle').css({'font-size': '70px', 'line-height' : '60px'}); }
};
var resizeTimer = null;
$(window).bind('resize', function() {
    if (resizeTimer) clearTimeout(resizeTimer);
    resizeTimer = setTimeout(doSomething, 100);
});

function doOnresizeIE() {
	var myDiv = $('#mainWin');
	
	if($(document).width() <= 980) {
		myDiv.addClass("mainWinMinWidth");
		// .css({'width':'980px', 'border':'solid 3px #0F0'});
		// alert("dddddddd" + $(document).width());
	} else {
		myDiv.removeClass("mainWinMinWidth");
		// myDiv.css({'width':'', 'border':'none'});
	}
	if($(document).width() >= 1440) {
		myDiv.addClass("mainWinMaxWidth");
		// myDiv.css({'width':'1440px'});
	} else {
		myDiv.removeClass("mainWinMaxWidth");
		// myDiv.css({'width':''});
	}

}

$(document).ready(function() {
doSomething();


	var myDiv = $('#mainWin');
	myDiv.minSize({width: 980});
	myDiv.maxSize({width: 1440});
	
	if ( $.browser.msie ) {
		doOnresizeIE();
		
		$(window).resize(function() {
			doOnresizeIE();
		});
	}


});


/* Drop Down Menu */
$(document).ready(function() {
 $(".hmenu").hover(function() {
	 $(this).children('.ddmenu').show();
	 $(this).children('table').children().children().children().children().click(function() { return false; });
 }, function() {
	 $(this).children('.ddmenu').hide();
 });
 // children('tr').children('td').children('a')
 $(this).children('table').css({'background' : '#F3C'}).click(function() { return false; });
});
/* Drop Down Menu End */

/* карусель смены фоток на главной */
var cnt = 7;
var j = 7;
setInterval("photos()", 10000);

function photos() {
  $('#header_block_pic').fadeOut("slow", function() {
	  $(this).css({'background':'#999999 url(images/index_header0' + j + '.jpg) no-repeat right top'}).fadeIn("slow");
  });
  j++;
  if( j > cnt ) { j = 1; }
}


var cnt2 = 4;
var j2 = 1;
setInterval("photos_page2()", 7000);
function photos_page2() {
  $('#pic_inner').fadeOut("slow", function() {
	  $(this).css({'background':'#999999 url(/images/header_innerpage0' + j2 + '.jpg) no-repeat right top'}).fadeIn("slow");
  });
  j2++;
  if( j2 > cnt2 ) { j2 = 1; }
}

