$(document).ready(function(){

	$("#content div.dop div.img img.ima").each(function(){
		var height = $(this).height();
		var width = $(this).width();
		if(height != 106){
			$(this).css("height", "106px");
		}
		if(width > 98){
			$(this).css("width", "98px");
		}
	});
	
	$("div#header div.email").html('e-mail<br /><a href="mailto: sales@delvir.ru">sales@delvir.ru</a>');
	
	$("img.img_but").css("visibility", "visible");

    $("div.img_left img.img2next").click(function () {
		var code1 = "#" + $(this).attr("code");
		var code2 = "#" + $(this).attr("code_not");
		$(code2).removeClass("select")
		$(code1).addClass("select")
	});
    $("div.img_right img.img2next").click(function () {
		var code1 = "#" + $(this).attr("code");
		var code2 = "#" + $(this).attr("code_not");
		$(code2).removeClass("select")
		$(code1).addClass("select")
	});
    $("div.img_left img.img2pre").click(function () {
		var code1 = "#" + $(this).attr("code");
		var code2 = "#" + $(this).attr("code_not");
		$(code2).removeClass("select")
		$(code1).addClass("select")
	});
    $("div.img_right img.img2pre").click(function () {
		var code1 = "#" + $(this).attr("code");
		var code2 = "#" + $(this).attr("code_not");
		$(code2).removeClass("select")
		$(code1).addClass("select")
	});

	var params = {
			src:'/system/swf/flash.swf',
			width:'597',
			height:'106'
	};
	$("div#flash").each(function(){
		flashembed(this, params);
	});


/*	
	$('input.login').example(function() {
		return $(this).attr('title'); 
		}
	);
	$('input.pass').example(function() {
		return $(this).attr('title'); 
		}
	);
*/

	$("div#menu2 li[class!='img']").hover(
		function () {
			$(this).addClass("select");
		},
		function () {
			$(this).removeClass("select");
		}
	);

});

function f_clientHeight() {
	return f_filterResults (
		window.innerHeight ? window.innerHeight : 0,
		document.documentElement ? document.documentElement.clientHeight : 0,
		document.body ? document.body.clientHeight : 0
	);
}

function f_filterResults(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}

function scrollDiv() {
 var ScrollTop = document.body.scrollTop;
 if (ScrollTop == 0) {
  if (window.pageYOffset)
   ScrollTop = window.pageYOffset;
  else
   ScrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
 }

 e = document.getElementById('fixed');
 e.style.marginTop = ScrollTop+'px';
 
 if(navigator.userAgent.search(/msie/i)!= -1) {
  e.style.marginLeft = '-13px';
 } 

 if (ScrollTop > 512 && maxHeight*24 > 300 && ScrollTop - maxHeight*24 < 400)
  $(e).show("slow");
 else
  $(e).hide("slow");
  
}

