var mainMenu = function(){
    //var ajax = new JsHttpRequest();
    var browserIE = null;
    var viewPics  = 5;
    var iteration;
    var left;
    var width;
    
    return {
	 		// Обработка наведения мышки на левую прокрутку
	 		menuLeftScroll : function (el, over) {
	 		    
	 		    ifram = document.getElementById('scroller').contentWindow;
	 		   
				if (over) {
					el.className = "left_scroll_over";
					//ifram.startScroll(true);
					ifram.fastScroll(true);
				}
				else {
					el.className = "left_scroll";
					
					ifram.stopScroll();
				}
				
			},
			// обработка наведения мышки на правую прокрутку
			menuRightScroll : function (el, over) {
			    ifram = document.getElementById('scroller').contentWindow;
				if (over) {
					el.className = "right_scroll_over";
					//ifram.startScroll(false);
					ifram.fastScroll(false);
				}
				else {
					el.className = "right_scroll";
					ifram.stopScroll();
				}
			}
			// обработка щелчка мыки по кнопке прокрутки
			, clickRightScroll : function () {
			    ifram = document.getElementById('scroller').contentWindow;
			    ifram.fastScroll();
			}
			, init : function () {
					
			    for (iteration in json) {
			        this.iteration = iteration;
			        this.width = json[this.iteration]['width'];
			        
			        dt = json[this.iteration];
			        $('#brends_marker_begin').tplAppend(dt, this.tpl);
			        this.bildToolTips(iteration, '&nbsp;&nbsp;&nbsp;<strong>'+dt['title']+'</strong><br /><br />'+dt['text']+'<br /><br />');
			        
			        MediaData[this.iteration] = new makeData(this.width, 65);
			    }
			    
			    loadVisibleDiv();
			}
			, bildToolTips : function (i, txt) {
			    $('#brandImg'+i).mouseover( function(e){
			        window.parent.mainMenu.showToolTips(i, e, txt);
			        e = null;
			        //
			    });
			    $('#brandImg'+i).mouseout( function(){
			        window.parent.mainMenu.closeTip();
			        //
			    });
			    
			}
			, tpl : function () {

			    if (this.url != "#") {
			        t = [
                        'div', { className: 'brand', id:'divSC'+iteration, style: 'z-index:0; visibility:visible; width:'+this.width+'; position:absolute; left:' + (iteration*this.width - (this.width-1)) +'px;' }, [        
                            'a' , {href: this.url, target: '_blank'}, [
                                'img', {src: this.src, id:'brandImg'+iteration}
                            ]
                        ]
                    ];
			    }
			    else {
			        t = [
                        'div', { className: 'brand', id:'divSC'+iteration, style: 'z-index:0; visibility:visible; width:'+this.width+'; position:absolute; left:' + (iteration*this.width - (this.width-1)) +'px;' }, [        
                            'a' , {onClick: 'javascript:void(0);', target: '_blank'}, [
                                'img', {src: this.src, id:'brandImg'+iteration}
                            ]
                        ]
                    ];    
			    }
                return t;
			}
			, showToolTips : function (i, event, txt) {
			    Tip(txt, BALLOON, true,  WIDTH, 360, TEXTALIGN, 'justify', FIX, this.CalcFixXY(event), BALLOONSTEMWIDTH,1, 
BALLOONSTEMHEIGHT,1, CLICKCLOSE, true );
			    
			}
			, CalcFixXY : function (event) {
			    return [event.pageX , 260];
			},
			closeTip: function (){
				UnTip();
			}
			/*,testIE : function() {
         	if (browserIE != null) {
            	return browserIE;
				}
	         if(navigator.appName.indexOf("Explorer")!=-1) {
   	          browserIE = true;
      	     }
         	 else {
            	 browserIE = false;
	         }
   	         return browserIE;
        	}*/
    }
}();