var bInClients=false;
var bInPartners=false;
	if (document.getElementById && document.getElementsByTagName) {
	if (window.addEventListener) window.addEventListener('load', initScrollBars, false);
	else if (window.attachEvent) window.attachEvent('onload', initScrollBars);
	}
	function initScrollBars() {
		CSBfleXcroll('mycustomscroll');
		CSBfleXcroll('mycustomscroll2');
		CSBfleXcroll('panel_left');

			//animation
			var oClients = document.getElementById("clients_animation");
			var oClientsContainer = document.getElementById("clients_animation_containter");
				var oPartners = document.getElementById("partners_animation");
				var oPartnersContainer = document.getElementById("partners_animation_containter");

			var iClientsWidth = oClients.offsetWidth;
			var iClientsPos = oClientsContainer.offsetWidth;
				var iPartnersWidth = oPartners.offsetWidth;
				var iPartnersPos = oPartnersContainer.offsetWidth;

			function OnTimer(){
				if(!bInClients){
					oClients.style.left = iClientsPos.toString() + "px";
					if(--iClientsPos < -iClientsWidth){iClientsPos = oClientsContainer.offsetWidth}
				}
				if(!bInPartners){
					oPartners.style.left = iPartnersPos.toString() + "px";
					if(--iPartnersPos < -iPartnersWidth){iPartnersPos = oPartnersContainer.offsetWidth}
				}
			}

			OnTimer();

			window.setInterval(OnTimer, 20);
	}

function SubMenu(id){
	if($('sub_'+id)){
		if($('sub_'+id).style.display=='none'){
			$('sub_'+id).style.display='block';
		} else {
			$('sub_'+id).style.display='none';
		}
	}
CSBfleXcroll('panel_left');

}



function $(id){
	return document.getElementById(id);
}


function showImg(URL,imgPath) {
var content = '<html><head>' +
'\<\style>'+'BODY { overflow: hidden; } img {border: 1px solid #ffffff;}'+'<\/style>'
    +'<script>' +    'function selfResizer(obj) {' +
    'var w = obj.width;iWidth='+self.innerWidth+';' +
    'var h = obj.height;iHeight='+document.body.clientHeight  +';' +
    'var left = (self.opera?iWidth:screen.availWidth)/2 - w/2;' +
    'var top = (self.opera?iHeight:screen.availHeight)/2 - h/2;' +
    '  window.resizeTo(w+60, h+105);' +
    '}' +    '<\/script>' +'</head><BODY SCROLL=NO TEXT=white BGCOLOR=#aaaaaa background="/images/bg_content.jpg" link=white vlink=white alink=white LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0><table width=100% height=100% cellspacing=0 cellpadding=0 border=0><tr><td align=center>' +
'<a href=# onclick=window.close()><img onLoad="selfResizer(this)" alt="Кликните, чтобы закрыть окно" border=1 src="'+imgPath+'"></a>' +
'</td></tr></table></body></html>';

var wnd = window.open(URL, 'preview_window_img', 'width=50,height=50,left=40,top=40,location=0,toolbar=0,directories=0,menubar=0,screenX=0,screenY=0,resizable=1,scrollbar=0,stastusbar=0,fullscreen=0');

    wnd.document.write(content);
    wnd.document.title = "Просмотр увеличенного изображения";
    wnd.document.close();
    if(wnd)wnd.focus();
}

