
function getScroll(){
	var x, y;
	if(document.all !== void 0){ // IE4, IE5, IE6
		x = document.body.scrollLeft;
		y = document.body.scrollTop;
	}else if(document.layers !== void 0 || (navigator.userAgent.indexOf("Opera") != -1 || window.opera !== void 0)){ // NN4, Opera6
		x = window.pageXOffset;
		y = window.pageYOffset;
	}else if(navigator.userAgent.indexOf("Gecko") != -1){ // NS6, Mozilla
		x = window.scrollX;
		y = window.scrollY;
	}else{
		x = y = 0;
	}
	return {x: x, y: y};
}


var SCROLL ;

var divCountScroller = 30 ;


function scroller( x, y, count ){
	
	if( count === void 0 ){
		
		count = 0 ;
		SCROLL = getScroll();
		
	}
	
	if( count++ < divCountScroller ){
		
		var c = count/divCountScroller ;
		
		var nx = SCROLL.x+( x-SCROLL.x )*( c+1/Math.PI*Math.sin( Math.PI*c ) );
		var ny = SCROLL.y+( y-SCROLL.y )*( c+1/Math.PI*Math.sin( Math.PI*c ) );
		
		window.scrollTo( nx, ny );
		
		setTimeout( "scroller("+x+","+y+","+count+");", 10 ); 
		
	}
	
}

function imagePopup( filename , w , h ){
if( w == null) w = 480 ;
if( h == null) h = 480 ;
window.open( filename, "_blank","toolbar=no,location=no,status=no,width=" + w + ",height=" + h  );
return false;


}

function changeImg( m_obj , imgName ){
	m_obj.src =  imgName;
}

function bgClear(elemId ){
	document.getElementById(elemId).style.backgroundImage = 0;
}

function changeCls ( elemId , cls){
	document.getElementById(elemId).className = cls;

}
function rollOverImage( m_obj , overImage){
	downImage = m_obj.src; changeImg(m_obj , overImage);
	m_obj.onmouseover = changeImg(m_obj , overImage);
	m_obj.onmouseout = changeImg(m_obj  , downImage);
}

function changeSrc( OBJ , newSrc ){
	if( OBJ.src){
		OBJ.src = newSrc;
	}else{
		for( i=0; i < OBJ.childNodes.length ; i ++ ){
				changeSrc(  OBJ.childNodes.item(i)  , newSrc );
			
		
		}
		
	}
	   
}


/*
function rollOverImage( elemId , overImage){
	a = new Image; a.src = overImage;
	downImage = document.getElementById(elemId).src;
	document.getElementById(elemId).onmouseover = changeImg(elemId , overImage);
	document.getElementById(elemId).onmousedown = changeImg(elemId , downImage);
}

*/



function menuExpand(iid){
/*
	if(iid){
		//alert(iid);
		menuExpandItem(iid);
		menuCompressBrothers(iid);
	}
*/
}

function menuExpandItem(iid){
/*
	re = RegExp("^([^_]+)_(.*)");
	rslt = re.exec(iid);
	nid = RegExp.$2
	
	if( document.getElementById('mLabel_' + nid  ).className == "menuOpen" ){
		menuItemClose(nid);
	}else{
		menuItemOpen(nid);
	}
*/
}

function menuCompressBrothers(iid){
/*
	re2 = RegExp("^[^_]+_(.*?)([^_]+)$");
	rslt = re2.exec(iid);
	cnum = eval( RegExp.$2);
	clab = RegExp.$1;
	//alert( clab);
	for( i=1 ; i < 64 ; i ++ ){
		if(document.getElementById('mLabel_' + clab + i)){
			if ( i  != cnum && document.getElementById( iid ).className == "menuOpen" ){
				menuItemClose( clab + i);
			} 
		}else{
			//break;
		}
	}
*/
}

function menuItemOpen (iid){
	if(document.getElementById('mLabel_' + iid  ))document.getElementById('mLabel_' + iid  ).className = "menuOpen";
	if(document.getElementById('mItems_' + iid  ))document.getElementById('mItems_' + iid  ).style.display = "block";	
	if(document.getElementById('mPointer_' + iid  ))document.getElementById('mPointer_' + iid  ).src = sdTopPath + "imgs/pointer-down-orange.gif";	
	if(document.getElementById('mBg_' + iid  )){
		if (document.getElementById('mBg_' + iid  ).style.backgroundColor == "rgb(255, 255, 255)"||
		document.getElementById('mBg_' + iid  ).style.backgroundColor == ""){
			document.getElementById('mBg_' + iid  ).style.backgroundColor = "rgb(222, 222, 222)";	
		}
	}
}
function menuItemClose (iid){
	if(document.getElementById('mLabel_' + iid  ))document.getElementById('mLabel_' + iid  ).className = "menuClose";
	if(document.getElementById('mItems_' + iid  ))document.getElementById('mItems_' + iid  ).style.display = "none";	
	if(document.getElementById('mPointer_' + iid  ))document.getElementById('mPointer_' + iid  ).src = sdTopPath + "imgs/pointer-right-gray.gif";	
	if(document.getElementById('mBg_' + iid  )){
		if (document.getElementById('mBg_' + iid  ).style.backgroundColor == "rgb(222, 222, 222)"){
			document.getElementById('mBg_' + iid  ).style.backgroundColor = "#fff";	
		}
	}
}

var ac = [];


