userAgent = window.navigator.userAgent;browserVers = parseInt(userAgent.charAt(userAgent.indexOf("/")+1),10);function newImage(arg) {	if (document.images) {		rslt = new Image();		rslt.src = arg;		return rslt;	}}function findElement(n,ly) {	if (browserVers < 4)		return document[n];	var curDoc = ly ? ly.document : document;	var elem = curDoc[n];	if (!elem) {		for (var i=0;i<curDoc.layers.length;i++) {			elem = findElement(n,curDoc.layers[i]);			if (elem) return elem;		}	}	return elem;}function changeimg() {	if (document.images && (preloadFlag == true)) {		var img;		for (var i=0; i<changeimg.arguments.length; i+=2) {			img = null;			if (document.layers) {				img = findElement(changeimg.arguments[i],0);			}			else {				img = document.images[changeimg.arguments[i]];			}			if (img) {				img.src = changeimg.arguments[i+1];			}		}	}}var preloadFlag = false;function preloadimg() {	if (document.images) {		rus_03____ = newImage("img/rus_03-abv.jpg");		eng_05_____ = newImage("img/eng_05-abv.jpg");		search_07_____ = newImage("img/search_07-abv.jpg");		mail_09_____ = newImage("img/mail_09-abv.jpg");		news____ = newImage("img/news-abv.jpg");		home____ = newImage("img/home-abv.jpg");		catalog____ = newImage("img/catalog-abv.jpg");		delivery____ = newImage("img/delivery-abv.jpg");		contacts____ = newImage("img/contacts-abv.jpg");		payments____ = newImage("img/payments-abv.jpg");  fullnews____ = newImage("img/fullnews-abv.gif");  fullitem____ = newImage("img/fullitem-abv.gif");		parser_____  = newImage("img/parser.gif");		null_____    = newImage("img/null.gif");  preloadFlag = true;	}}<!-- Перехват ошибок загрузки изображений -->var Errors = new Array();         Errors[0] = 0;         function badImage(el) {            if (document.readyState != "complete") {               Errors[0]++;               Errors[Errors[0]] = el;            }            else  // Документ загружается. Прямой вывод ошибки.               el.outerHTML = "<img border=0 src='img/parser.gif' >";               el.src = 'img/parser.gif';									}          function reviewErrors() {            for (var i = 1; i <= Errors[0]; i++)               Errors[i].outerHTML =                  "<img border=0 src='img/parser.gif' >";         }           window.onload = reviewErrors;	/*    tabSlideOUt v1.1        By William Paoli: http://wpaoli.building58.com    To use you must have an image ready to go as your tab    Make sure to pass in at minimum the path to the image and its dimensions:        example:            $('.slide-out-div').tabSlideOut({                tabHandle: '.handle',                         //class of the element that will be your tab -doesnt have to be an anchor                pathToTabImage: 'images/contact_tab.gif',     //relative path to the image for the tab *required*                imageHeight: '133px',                         //height of tab image *required*                imageWidth: '44px',                           //width of tab image *required*            });    */(function($){    $.fn.tabSlideOut = function(callerSettings) {        var settings = $.extend({            tabHandle: '.handle',            speed: 300,             action: 'hover',            tabLocation: 'left',            topPos: '200px',            leftPos: '20px',            fixedPosition: false,            positioning: 'absolute',            pathToTabImage: null,            imageHeight: null,            imageWidth: null                               }, callerSettings||{});        settings.tabHandle = $(settings.tabHandle);        var obj = this;        if (settings.fixedPosition === true) {            settings.positioning = 'fixed';        } else {            settings.positioning = 'absolute';        }                //ie6 doesn't do well with the fixed option        if (document.all && !window.opera && !window.XMLHttpRequest) {            settings.positioning = 'absolute';        }                //set initial tabHandle css        settings.tabHandle.css({             'display': 'block',            'width' : settings.imageWidth,            'height': settings.imageHeight,            'textIndent' : '-99999px',            'background' : 'url('+settings.pathToTabImage+') no-repeat',            'outline' : 'none',            'position' : 'absolute'        });                obj.css({            'line-height' : '1',            'position' : settings.positioning        });                var properties = {                    containerWidth: parseInt(obj.outerWidth(), 10) + 'px',                    containerHeight: parseInt(obj.outerHeight(), 10) + 'px',                    tabWidth: parseInt(settings.tabHandle.outerWidth(), 10) + 'px',                    tabHeight: parseInt(settings.tabHandle.outerHeight(), 10) + 'px'                };        //set calculated css        if(settings.tabLocation === 'top' || settings.tabLocation === 'bottom') {            obj.css({'left' : settings.leftPos});            settings.tabHandle.css({'right' : 0});        }                if(settings.tabLocation === 'top') {            obj.css({'top' : '-' + properties.containerHeight});            settings.tabHandle.css({'bottom' : '-' + properties.tabHeight});        }        if(settings.tabLocation === 'bottom') {            obj.css({'bottom' : '-' + properties.containerHeight, 'position' : 'fixed'});            settings.tabHandle.css({'top' : '-' + properties.tabHeight});                    }                if(settings.tabLocation === 'left' || settings.tabLocation === 'right') {            obj.css({                'height' : properties.containerHeight,                'top' : settings.topPos            });                        settings.tabHandle.css({'top' : 0});        }                if(settings.tabLocation === 'left') {            obj.css({ 'left': '-' + properties.containerWidth});            settings.tabHandle.css({'right' : '-' + properties.tabWidth});        }        if(settings.tabLocation === 'right') {            obj.css({ 'right': '-' + properties.containerWidth});            settings.tabHandle.css({'left' : '-' + properties.tabWidth});                        $('html').css('overflow-x', 'hidden');        }        //functions for animation events                settings.tabHandle.click(function(event){            event.preventDefault();        });                var slideIn = function() {                        if (settings.tabLocation === 'top') {                obj.animate({top:'-' + properties.containerHeight}, settings.speed).removeClass('open');            } else if (settings.tabLocation === 'left') {                obj.animate({left: '-' + properties.containerWidth}, settings.speed).removeClass('open');            } else if (settings.tabLocation === 'right') {                obj.animate({right: '-' + properties.containerWidth}, settings.speed).removeClass('open');            } else if (settings.tabLocation === 'bottom') {                obj.animate({bottom: '-' + properties.containerHeight}, settings.speed).removeClass('open');            }                        };                var slideOut = function() {                        if (settings.tabLocation == 'top') {                obj.animate({top:'-3px'},  settings.speed).addClass('open');            } else if (settings.tabLocation == 'left') {                obj.animate({left:'-3px'},  settings.speed).addClass('open');            } else if (settings.tabLocation == 'right') {                obj.animate({right:'-3px'},  settings.speed).addClass('open');            } else if (settings.tabLocation == 'bottom') {                obj.animate({bottom:'-3px'},  settings.speed).addClass('open');            }        };        var clickScreenToClose = function() {            obj.click(function(event){                event.stopPropagation();            });                        $(document).click(function(){                slideIn();            });        };                var clickAction = function(){            settings.tabHandle.click(function(event){                if (obj.hasClass('open')) {                    slideIn();                } else {                    slideOut();                }            });                        clickScreenToClose();        };                var hoverAction = function(){            obj.hover(                function(){                    slideOut();                },                                function(){                    slideIn();                });                                settings.tabHandle.click(function(event){                    if (obj.hasClass('open')) {                        slideIn();                    }                });                clickScreenToClose();                        };                //choose which type of action to bind        if (settings.action === 'click') {            clickAction();        }                if (settings.action === 'hover') {            hoverAction();        }    };})(jQuery);         $(function(){             $('.slide-out-div').tabSlideOut({                 tabHandle: '.handle',                              //class elementa                 pathToTabImage: 'kontakt.gif',          //put k izobraj                 imageHeight: '141px',                               //visota                 imageWidth: '40px',                               //width of tab image *required*                     tabLocation: 'left',                               //side of screen where tab lives, top, right, bottom, or left                 speed: 300,                                        //speed of animation                 action: 'hover',                                   //options: 'click' or 'hover', action to trigger animation                 topPos: '120px',                                   //position from the top                 fixedPosition: true                               //options: true/false makes it stick(fixed position) on scroll             });         });         
