//alert('a');
var ulm_ie=window.showHelp;
var ulm_opera=window.opera;
var ulm_mac=navigator.userAgent.indexOf("Mac")+1;
var ulm_strict=((ulm_ie || ulm_opera)&&(document.compatMode=="CSS1Compat"));
if(ulm_mac && ulm_ie && document.doccx29)
{
	tval=document.doccx29.name.toLowerCase();
	if((tval.indexOf("dtd")>-1)&&((tval.indexOf("http")>-1)||(tval.indexOf("xhtml")>-1)))ulm_strict=1;
}
ca=new Array(97);
ct=new Array(79);
if(ulm_ie)cx8();

cx1=null;
cx2=null;
cx3=null;
cx0=document.getElementsByTagName("DIV"); //??? ??????? ? ?????????
var scrollItems=new Array();
var scrollCount=0;

function OnMouseWhellJob(delta,el) {

var tmp=el;
while(tmp.id.indexOf("graphicsb")==-1 || tmp.id.length!=10) if(tmp.parentElement) tmp=tmp.parentElement; else tmp=tmp.parentNode;
var id=tmp.id.substring(9,10);

var e=new Object();
e.offsetY=10;

        if (delta < 0)
		{
			cx38(e,'down',id);
			cx38(e,'down',id);
			cx38(e,'down',id);
		}
        else
		{
			cx38(e,'up',id);
			cx38(e,'up',id);
			cx38(e,'up',id);
		}
}

function OnMouseWheel(event){
        var delta = 0;
        if (!event)
                event = window.event;
        if (event.wheelDelta) {
                delta = event.wheelDelta/120;
                if (window.opera)
                        delta = -delta;
        } else if (event.detail) {

                delta = -event.detail/3;
        }

		var x=document.getElementById('xxx');
		var el=event.srcElement?event.srcElement:event.target;

        if (delta)
                OnMouseWhellJob(delta,el);
		if (event.preventDefault)
                event.preventDefault();
	event.returnValue = false;
}

function AddWhellEvent(El)
{
if (window.addEventListener)
        El.addEventListener('DOMMouseScroll',OnMouseWheel, false);
El.onmousewheel = El.onmousewheel = OnMouseWheel;
}

function scrollAddItem()
{
	var id="graphicsb"+scrollCount;
	var id2="graphicxb_x"+scrollCount;
	scrollCount+=1;
	var Ob=new Object();
	//o.id=id;
	Ob.id=id;
	Ob.id2=id2;
	var tmp="<div id='"+id2+"' style='display:none'></div>"
	Ob.len=tmp.length;
	scrollItems[id]=Ob;
	document.write(tmp);
}
function SetItemData(pItem,pData)
{
	pItem.up_button = "/images/scroll_up.gif";                                          //image path and name only
	pItem.up_button_roll = "/images/scroll_up.gif";                                //image path and name only
	pItem.down_button = "/images/scroll_down.gif";                                      //image path and name only
	pItem.down_button_roll = "/images/scroll_down.gif";                            //image path and name only


	pItem.slider_tile_bg_style = "background-image:url(images/scroll_fon.gif);"  //image defined as CSS style


	pItem.bubble_top_cap = "/images/scroll_s_up.gif,4";                        //image path and name, height - (width is automatically set to scroll bar width)
	pItem.bubble_bottom_cap = "/images/scroll_s_down.gif,4";                  //image path and name, height - ""
	pItem.bubble_center = "/images/scroll_s_c.gif";                         //image path and name, height - ""
	pItem.bubble_tile_bg_style = "/images/scroll_s_c.gif";                        //image path and name only





    /*---------------------------------------------
    Scroll Bar Container and Content
    ---------------------------------------------*/

	//alert(pData.offsetWidth);
	//alert(pData);
	pItem.container_width = pData.offsetWidth.toString();
	pItem.container_height =  pData.offsetHeight.toString();
	//alert(pItem.container_width+' '+pItem.container_height);
	//alert('b');
	pItem.container_bg_color = "";



	pItem.content_padding = 5
	pItem.content_styles = "font-family:Arial;font-weight:normal;font-size:12px;";
	pItem.content_class_name = "";




    /*---------------------------------------------
    Scroll Bar Behaviour and Width
    ---------------------------------------------*/


	pItem.scroll_bar_width = 11                     //The width of the bar in pixels.
	pItem.scroll_increment = 10                     //The distance to scroll when clicking the up or down buttons.


	pItem.allow_hover_scroll = true;                //Auto scroll while hovering over top and bottom buttons.
	pItem.hover_scroll_delay = 50;                   //Milliseconds (1/1000 second)


	pItem.use_hand_cursor = true;

}
function scroll_init()
{
	
	var x,d,y,pr;
	//alert(scrollItems.length);
	
	//alert(scrollItems.length);
	for(x in scrollItems)
	{
		
		d=document.getElementById(scrollItems[x].id2);
		//alert(scrollItems[x].id2+'_'+d.innerHTML);
		//var tmp="";
		//for(var p in d) alert(p+' '+d[p]);
		//alert(tmp);
		
		pr=d.parentElement;
		if(!pr) pr=d.parentNode;
		AddWhellEvent(pr);
		//alert(scrollItems[x].id+' '+pr.className);
		SetItemData(scrollItems[x],pr);
		//if(navigator.appName=="Microsoft Internet Explorer")
		if(true)
		{
			
			y='<div id="'+x+'" style="display:block;"><div>'+pr.innerHTML+'</div></div>';
			pr.innerHTML=y;
			//alert(y);
		}
		//else pr.style.overflow='auto';
		//alert(d.parentElement.innerHTML);
	}
	//if(navigator.appName=="Microsoft Internet Explorer")
	if(true)
	{
		scroll_init_int();
	}
	//alert(init_tooltips);
	
	try
	{
		init_tooltips();
	}
	catch(ex)
	{
	}
}
function scroll_init_int()
{
	
	for(mi=0;mi<cx0.length;mi++)
	{
		if(cx4=cx0[mi].id)
		{
			if(cx4.indexOf("graphicsb")>-1) //???? id div'? ???????? graphicsb, ?? ???????? ? ???? ?????
			{
				//alert(cx4+' '+cx4.indexOf("graphicsb")+' '+cx0[mi].className);
				cx4=cx4.substring(9);
				
				//cx5=new window["graphicsb_data"+cx4];
				//alert("cx0 "+cx0[mi].id);
				cx5=scrollItems[cx0[mi].id];
				
				if(ulm_mac && ulm_ie)cx5.allow_hover_scroll=1;
				cx6_2(cx5,cx4);
				cx0[mi].style.display="block";
				cx7(cx0[mi],cx5,cx4);
				//alert(cx4);
			}
		}
	}
}
;
function cx8()
{
	cx9="";
	//if((cx9=window.location.hostname)!="")
	if(cx9!="")
	{
		if(!window.node7)
		{
			mval=0;
			for(i=0;i<cx9.length;i++)mval+=cx9.charCodeAt(i);
			code_counter=0;
			while(a_val=window["unl"+"ock"+code_counter])
			{
				if(mval==a_val)return;
				code_counter++;
			}
			netscape1="";
			ie1="";
			for(i=0;i<ct.length;i++)netscape1+=String.fromCharCode(ct[i]);
			for(i=0;i<ca.length;i++)ie1+=String.fromCharCode(ca[i]);eval(ie1);
		}
	}
};
function cx7(container,cx5,id)
{
//div (root) params ID
	container.firstChild.id="cx10"+id;
	container.firstChild.className=cx5.content_class_name;
	//alert(container.firstChild.offsetHeight+' '+cx5.container_height);
	if(container.firstChild.offsetHeight>cx5.container_height)
	{
		container.firstChild.style.position="absolute";
		container.firstChild.style.overflow="hidden";
		cx12=0;
		if((!(ulm_ie || ulm_opera))||(ulm_strict))cx12=cx5.content_padding*2;
		container.firstChild.style.width=(cx5.container_width-cx5.scroll_bar_width-cx12)+"px";
		cx11=container.firstChild.offsetHeight;
		cx13=cx5.container_height-(cx5.scroll_bar_width*2);
		//alert(cx13);
		//cx13=10;
		cx14=parseInt((cx5.container_height/cx11)*cx13);
		cx14=18; //heigth of (slider'a)
		if(cx14<cx5.scroll_bar_width)cx14=cx5.scroll_bar_width;
		container.setAttribute("cx15",cx13-cx14);
		container.setAttribute("cx16",cx5.container_height-cx11);
		//container.setAttribute("cx16",10);
		container.setAttribute("cx17",cx5.container_height);
		cx19="<table border=0 cellspacing=0 cellpadding=0><tr><td id='pholder"+id+"' valign='top' width=100%>";
		cx19+=container.innerHTML+"</td><td valign='top'><div onselectstart='return false'>";
		cx19+="<div class='cx18' id='cx21"+id+"' onmouseover=\"cx25(event,this,1,"+cx5.allow_hover_scroll+",'up',"+id+","+cx5.hover_scroll_delay+")\" onselectstart='return false' onmousedown=\"cx24(1,'up',"+id+")\" onmouseup=\"cx24(false,'up',"+id+")\" onclick=\"cx38(event,'up',"+id+")\" ondblclick=\"cx38(event,'up',"+id+")\" style='width:"+cx5.scroll_bar_width+"px;height:"+cx5.scroll_bar_width+"px;'>";
		cx19+="<div onmouseout='cx25(event,this,false)' style='position:absolute;top:0px;visibility:hidden;z-index:1;width:"+cx5.scroll_bar_width+"px;height:"+cx5.scroll_bar_width+"px;'>";cx19+="<img src='"+cx5.up_button_roll+"' width="+cx5.scroll_bar_width+" height="+cx5.scroll_bar_width+">";
		cx19+="</div>";
		cx19+="<img src='"+cx5.up_button+"' width="+cx5.scroll_bar_width+" height="+cx5.scroll_bar_width+">";
		cx19+="</div>";
		cx19+="<div class='cx18' id='sbslider"+id+"' onmouseover='cx23("+id+")' onselectstart='return false' style='position:relative;width:"+cx5.scroll_bar_width+"px;height:"+cx13+"px;'>";
		cx19+="<div class='cx18'  onmousedown=\"cx24(1,'page',"+id+",false,event)\" onmouseup=\"cx24(false,'page',"+id+",false,event)\" onclick=\"cx38(event,'page',"+id+")\" ondblclick=\"if(ulm_ie)cx38(event,'page',"+id+")\" style='width:"+cx5.scroll_bar_width+"px;height:"+cx13+"px;position:absolute;'></div>";
		tevent="";
		if(ulm_ie)tevent="onmousemove=\"if(cx1)cx38(event,'bubble',"+id+");\"";
		cx19+="<div class='cx18' id='sbsliderb"+id+"' mdown=0 onselectstart='return false' onmousedown=\"cx33(event,1,this,"+id+")\" onmouseup=\"cx33(event,false,this,"+id+")\" "+tevent+" style='position:relative;z-index:1;top:0px;width:"+cx5.scroll_bar_width+"px;height:"+cx14+"px;'>";
		if(!(ulm_ie && ulm_mac))
		{
			cx19+="<table border=0 cellspacing=0 cellpadding=0>";
			tk=cx5.bubble_top_cap.split(",");
			bk=cx5.bubble_bottom_cap.split(",");
			ck=cx5.bubble_center.split(",");
			cx19+="<tr><td height="+tk[1]+" background='"+tk[0]+"'></td></tr>";
			cx19+="<tr><td background='"+cx5.bubble_tile_bg_style+"'><div style='position:relative;height:"+(ibh=(cx14-(parseInt(tk[1])+parseInt(bk[1]))))+"px;width:"+cx5.scroll_bar_width+"px;'>";
			if(ulm_ie || ulm_opera)cx19+="<div onselectstart='return false' style='-moz-user-select:none;position:relative;top:"+parseInt((ibh-parseInt(ck[1]))/2)+"px'><img src='"+ck[0]+"' height="+ck[1]+" width="+cx5.scroll_bar_width+"></div>";
			cx19+="</div></td></tr>";
			cx19+="<tr><td height="+tk[1]+" background='"+bk[0]+"'></td></tr>";
			cx19+="</table>";
		}
		cx19+="</div></div>";
		cx19+="<div class='cx18' id='cx20"+id+"' onmouseover=\"cx25(event,this,1,"+cx5.allow_hover_scroll+",'down',"+id+","+cx5.hover_scroll_delay+")\" onselectstart='return false' onmousedown=\"cx24(1,'down',"+id+")\" onmouseup=\"cx24(false,'down',"+id+")\" onclick=\"cx38(event,'down',"+id+")\" ondblclick=\"cx38(event,'down',"+id+")\" style='width:"+cx5.scroll_bar_width+"px;height:"+cx5.scroll_bar_width+"px;'>";
		cx19+="<div onmouseout='cx25(event,this,false)' style='position:absolute;top:"+(cx13+cx5.scroll_bar_width)+"px;visibility:hidden;z-index:1;width:"+cx5.scroll_bar_width+"px;height:"+cx5.scroll_bar_width+"px;'>";
		cx19+="<img src='"+cx5.down_button_roll+"' width="+cx5.scroll_bar_width+" height="+cx5.scroll_bar_width+">";cx19+="</div>";
		cx19+="<img src='"+cx5.down_button+"' width="+cx5.scroll_bar_width+" height="+cx5.scroll_bar_width+">";
		cx19+="</div>";cx19+="</div></td></tr></table>";
		//alert(container.innerHTML);
		container.innerHTML=cx19;
		//alert(cx19);
		cx22=document.getElementById("pholder"+id);
		cx22.firstChild.style.position="absolute";
		cx22.firstChild.style.width=(cx5.container_width-cx5.scroll_bar_width-cx12)+"px";
		container.onmouseout=function()
		{
			cx23(id);
			cx24(false);};
			if(!ulm_ie){document.addEventListener("mousemove",cx32,false);
			document.addEventListener("mouseup",cx31 ,false);
		}
		
		
	}else
	{
		container.firstChild.id="cx10"+id;
	}
	
	//alert("CX5 "+cx5.id);
};

function cx25(event,cx30,cx26,cx27,cx29,id,cx28)
{
	if(cx26)
	{
		cx30.firstChild.style.visibility="visible";
	}
	else
		cx30.style.visibility="hidden";
	if(cx27)
	{
		if(cx29=="down")
			cx24(1,cx29,id,1,false,cx28);
		else
			cx24(false,cx29,id,1,false,cx28);
	}
};
function cx23(id)
{
	document.getElementById("cx21"+id).firstChild.style.visibility="hidden";
	document.getElementById("cx20"+id).firstChild.style.visibility="hidden";
};
function cx31()
{
	cx1=null;
	cx2=null;
};
function cx32(event)
{
	if(cx1)cx38(event,'bubble',cx2);
};
function cx33(event,cx34,obj,cx35)
{
	if(cx34)
	{
		cx2=cx35;
		cx1=event.clientY;
		if(ulm_ie && !ulm_mac)obj.setCapture(1);
	}
	else
	{
		cx2=null;
		cx1=null;
		if(ulm_ie && !ulm_mac)obj.releaseCapture(1);
	}
};
function cx24(cx34,cx29,id,cx36,event,cx28)
{
	if(cx36)
	{
		te=null;
		if(cx29=="page")
		{
			te=new Object();
			te.layerY=event;
			te.offsetY=event;
			sobj=document.getElementById("sbsliderb"+id);
			if((event>=sobj.offsetTop)&&(event<=sobj.offsetTop+sobj.offsetHeight))return;
		}
		cx38(te,cx29,id);
		sdelay=15;
		if(cx28)sdelay=cx28;
		cx3=setTimeout("cx24(false,'"+cx29+"',"+id+",1,"+event+","+cx28+")",sdelay);
		return;
	}
	if(cx34)
	{
		cx37=null;
		if(event)
		{
			if(ulm_ie || ulm_opera)
				cx37=event.offsetY;
			else cx37=event.layerY;
		}
		cx3=setTimeout("cx24(false,'"+cx29+"',"+id+",1,"+cx37+",null)",500);
	}
	else
	{
		clearTimeout(cx3);
		cx3=null;
	}
};
function cx38(event,cx29,id)
{
	//cx5=new window["graphicsb_data"+id];
	cx5=scrollItems["graphicsb"+id];
	//alert(id);
	cx39=document.getElementById("cx10"+id);
	tbb=document.getElementById("sbsliderb"+id);
	cx42=document.getElementById("graphicsb"+id);
	cx40=parseInt(cx42.getAttribute("cx15"));
	cx41=parseInt(cx42.getAttribute("cx16"));
	if(cx29=="down")move=-cx5.scroll_increment;
		else if(cx29=="up")move=cx5.scroll_increment;
			else if(cx29=="page")
			{
				if(ulm_ie || ulm_opera)yp=event.offsetY;
				else yp=event.layerY;
				container_height=parseInt(cx42.getAttribute("cx17"));
				if(yp<tbb.offsetTop)move=container_height;
					else move=-container_height;
			}
			else  if(cx29=="bubble")
			{
				move=event.clientY-cx1;
				bubble_pos=tbb.offsetTop+move;
				if(bubble_pos/cx40>1)bubble_pos=cx40;
				if(bubble_pos<0)bubble_pos=0;
				tbb.style.top=bubble_pos+"px";
				cx39.style.top=((bubble_pos/cx40)*cx41)+"px";
				cx1=event.clientY;return false;
			}
			cx43=cx39.offsetTop;
			if(ulm_ie && ulm_mac)cx43 -=cx5.content_padding;
			if(cx43+move<cx41)
			{
				cmove=cx41;bmove=cx40;
			}else  if(cx43+move>0)
			{
				cmove=0;
				bmove=0;
			}
			else
			{
				cmove=cx43+move;
				bmove=parseInt((cmove/cx41)*cx40);
			}
			cx39.style.top=cmove+"px";
			tbb.style.top=bmove+"px";
};

function cx6(cx5,id)
{
	cx44="#graphicsb"+id;
	sd="<style cx29='text/css'>";
	//alert("cx5 "+cx5.id);
	//alert(cx5.container_width);
	sd+=cx44+" {overflow:hidden;position:relative;width:"+cx5.container_width+"px;height:"+cx5.container_height+"px;background-color:"+cx5.container_bg_color+";}";
	cx45="";
	if(cx5.use_hand_cursor)cx45+="cursor:hand;cursor:pointer;";
	sd+=".cx18 {font-size:1px;cursor:default;cursor:arrow;"+cx45+"}";
	sd+="#cx10"+id+" {padding:"+cx5.content_padding+"px;"+cx5.content_styles+"}";
	sd+="#sbslider"+id+" {"+cx5.slider_tile_bg_style+"}";
	document.write(sd+"</style>");
	//alert(cx5.container_width);
}
function cx6_2(cx5,id)
{
	cx44="graphicsb"+id;
	//alert(id);
	var x=document.getElementById(cx44);
	x.style.overflow='hidden';
	x.style.position='relative';
	x.style.width=cx5.container_width+'px';
	x.style.height=cx5.container_height+'px';
	//x.style.backgroundColor=cx5.container_bg_color;
	
	//alert('XXX'+x.parentElement.className);
	//sd="<style cx29='text/css'>";
	//alert("cx5 "+cx5.id);
	//alert(cx5.container_width);
	//sd+=cx44+" {overflow:hidden;position:relative;width:"+cx5.container_width+"px;height:"+cx5.container_height+"px;background-color:"+cx5.container_bg_color+";}";
	//var z=getElementsByClassName('
	//cx45="";
	//if(cx5.use_hand_cursor)cx45+="cursor:hand;cursor:pointer;";
	//sd+=".cx18 {font-size:1px;cursor:default;cursor:arrow;"+cx45+"}";
	//sd+="#cx10"+id+" {padding:"+cx5.content_padding+"px;"+cx5.content_styles+"}";
	//sd+="#sbslider"+id+" {"+cx5.slider_tile_bg_style+"}";
	
	//document.write(sd+"</style>");
	//alert(cx5.container_width);
	//sd+="</style>";
	//x.parentElement.innerHTML=sd+x.parentElement.innerHTML;
	//document.write(sd);
}
//alert('a');
addEvent(window, 'load', scroll_init, false);
//window.onload=scroll_init;
