jQuery.noConflict();

// определение типа браузера
// if ($is.IE) {....} или if ($is.IE>6) {....} или if ($is.Opera<9) {....}
(function(){ // check browser type
var ua = navigator.userAgent, av = navigator.appVersion, v, i;
$is={};
$is.Opera = !!(window.opera && opera.buildNumber);
$is.WebKit = /WebKit/.test(ua);
$is.OldWebKit = $is.WebKit && !window.getSelection().getRangeAt;
$is.IE = !$is.WebKit && !$is.Opera && (/MSIE/gi).test(ua) && (/Explorer/gi).test(navigator.appName);
$is.IE6 = $is.IE && /MSIE [56]/.test(ua);
$is.IE5 = $is.IE && /MSIE [5]/.test(ua);
$is.Gecko = !$is.WebKit && /Gecko/.test(ua);
$is.Mac = ua.indexOf('Mac') != -1;
for (i in $is) if (!$is[i]) $is[i]=NaN;
if (!$is.IE5) v = (ua.toLowerCase().match(new RegExp(".+(?:rv|it|ra|ie)[\\/: ]([\\d.]+)"))||[])[1];
switch (true) {
    case ($is.WebKit): v=parseInt(v, 10);$is.WebKit=v=v>599?4:v>499?3:v>399?2:1;break;
    case ($is.Opera): $is.Opera =v=v||9;break;
    case ($is.Gecko): $is.Gecko =v=v.substr(0,3)||1.8;break;
    case ($is.IE): $is.IE =v= window.XMLHttpRequest ? 7 : (/MSIE [5]/.test(av)) ? (/MSIE 5.5/.test(av))?5.5:5 : 6;
    };
$is.verb = v;
$is.ok = !!($is.Opera>=9 || $is.IE>=6 || $is.Gecko || $is.WebKit>2);
$is.debug = /&debug$/.test(location.search);
})();


 function getElementWidth(Elem) {
	/* if (ns4) {
		var elem = getObjNN4(document, Elem);
		return elem.clip.width;
	} else { */
		if(document.getElementById) {
		//if(document.getElementsByClassName) {
			var elem = document.getElementById(Elem);
			//var elem = document.getElementsByClassName(Elem);
		} else if (document.all){
			var elem = document.all[Elem];
		}
	 	//if (op5) {
	 	if ($is.Opera==5) {
			xPos = elem.style.pixelWidth;
		} else {
			xPos = elem.offsetWidth;
		} 
		return xPos;
	//}
}

function getClientWidth()
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
}

function getClientHeight()
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
}


jQuery(document).ready(function () {
// растянем центральную таблицу
var height = getClientHeight();
var table = document.getElementById('main_table');
if (($is.IE) || ($is.Opera))
//if ($is.IE)
{table.style.height = height+200+'px';}
/* else
{table.style.height = height+200+'px';}
 */// для IE
table = document.getElementById('container_table');
if (($is.IE) || ($is.Opera))
//if ($is.IE)
{table.style.height = height+200+'px';}
/* else
{table.style.height = height+200+'px';}
 */
jQuery('.topmenu').autosprites({
		orientation: 'horizontal',
		offset: '67px',
		//activeState: true,
		//activeSprites: true,
		singleSprite: true // режим одиночной картинки для всех элементов меню
		});
		
		
jQuery('.left_menu').autosprites({
		orientation: 'vertical',
		offset: '264px',
		singleSprite: true
		});
		
jQuery('.left_menu2').autosprites({
		orientation: 'vertical',
		offset: '158px',
		singleSprite: true
		});
		
// Expand image JS 
jQuery(function(){
		jQuery('.img').hover(function(){
		jQuery(this).children('img').stop().animate({width:'250px',height:'274px'}, 400);
		}, function(){ jQuery(this).children('img').stop().animate({width:'100px',height:'110px'}, 400); });
});

});
